-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.html
More file actions
221 lines (213 loc) · 8.92 KB
/
Copy pathcommands.html
File metadata and controls
221 lines (213 loc) · 8.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Commands - Circuit Auction API</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" rel="stylesheet" />
<style>
body { padding-top: 70px; background-color: #f8f9fa; }
.navbar-brand { font-weight: bold; }
.main-content { padding: 2rem; }
pre { background: #f4f4f4; padding: 1rem; border-radius: 0.375rem; position: relative; }
.copy-btn { position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.8rem; }
.endpoint { font-family: 'Courier New', monospace; background: #e9ecef; padding: 0.2rem 0.4rem; border-radius: 0.25rem; }
.badge-method { font-size: 0.7em; padding: 0.3em 0.6em; }
.param-table th { background-color: #f8f9fa; }
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">Circuit Auction API v1.0</a>
</div>
</nav>
<div class="container main-content">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">API</a></li>
<li class="breadcrumb-item active">Commands</li>
</ol>
</nav>
<h1>Commands</h1>
<p class="lead">Action-oriented endpoints for invoking server functions, bulk operations, and print/export utilities.</p>
<div class="alert alert-warning">
These endpoints trigger server-side operations. Most are not discoverable via the API index. All require authentication unless noted.
</div>
<!-- Invoke Function -->
<div class="card mb-4">
<div class="card-header">
<span class="badge bg-primary badge-method">POST</span>
<code class="endpoint">/api/v1.0/invoke-function</code>
</div>
<div class="card-body">
<p>Invokes a named server-side function. The available functions depend on server configuration. The response format is a raw passthrough of the function's return value and will vary by function.</p>
<h5>Request Body</h5>
<table class="table table-sm param-table">
<thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>function</code></td><td>string (required)</td><td>Machine name of the function to invoke</td></tr>
<tr><td><code>args</code></td><td>object (optional)</td><td>Key-value arguments passed to the function</td></tr>
</tbody>
</table>
<h5 class="mt-3">Example Request</h5>
<pre><code class="language-bash">POST /api/v1.0/invoke-function</code></pre>
<pre><code class="language-json">{
"function": "recalculate_sale_totals",
"args": {
"sale_id": "45"
}
}</code></pre>
<h5 class="mt-3">Response</h5>
<pre><code class="language-json">{
"data": {
"status": "ok",
"message": "Sale totals recalculated for sale 45."
}
}</code></pre>
</div>
</div>
<!-- Invoke Function Public -->
<div class="card mb-4">
<div class="card-header">
<span class="badge bg-primary badge-method">POST</span>
<code class="endpoint">/api/v1.0/invoke-function-public</code>
</div>
<div class="card-body">
<p>Same as <code>invoke-function</code> but accessible without a Bearer token. Permission checks are performed inside the function itself — the function is responsible for validating whether the caller is authorized to execute it.</p>
<h5>Request Body</h5>
<table class="table table-sm param-table">
<thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>function</code></td><td>string (required)</td><td>Machine name of the function to invoke</td></tr>
<tr><td><code>args</code></td><td>object (optional)</td><td>Key-value arguments passed to the function</td></tr>
</tbody>
</table>
<h5 class="mt-3">Example Request</h5>
<pre><code class="language-bash">POST /api/v1.0/invoke-function-public</code></pre>
<pre><code class="language-json">{
"function": "get_public_sale_summary",
"args": {
"sale_id": "12"
}
}</code></pre>
<h5 class="mt-3">Response</h5>
<pre><code class="language-json">{
"data": {
"sale_id": "12",
"total_lots": 385,
"status": "upcoming"
}
}</code></pre>
</div>
</div>
<!-- Bulk Dispatcher -->
<div class="card mb-4">
<div class="card-header">
<span class="badge bg-primary badge-method">POST</span>
<code class="endpoint">/api/v1.0/bulk-dispatcher</code>
</div>
<div class="card-body">
<p>Generic endpoint for dispatching bulk operations across multiple entities. See the dedicated <a href="bulk/dispatcher.html">Bulk Dispatcher</a> page for a full list of supported operations and their parameters.</p>
<h5>Request Body</h5>
<table class="table table-sm param-table">
<thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>operation</code></td><td>string (required)</td><td>Machine name of the bulk operation to run</td></tr>
<tr><td><code>ids</code></td><td>array (required)</td><td>Array of entity node IDs to operate on</td></tr>
<tr><td><code>params</code></td><td>object (optional)</td><td>Additional operation-specific parameters</td></tr>
</tbody>
</table>
<h5 class="mt-3">Example Request</h5>
<pre><code class="language-bash">POST /api/v1.0/bulk-dispatcher</code></pre>
<pre><code class="language-json">{
"operation": "mark_items_sold",
"ids": ["100", "101", "102"],
"params": {
"sale_id": "45"
}
}</code></pre>
<h5 class="mt-3">Response</h5>
<pre><code class="language-json">{
"data": {
"processed": 3,
"errors": []
}
}</code></pre>
</div>
</div>
<!-- Generate Cheque -->
<div class="card mb-4">
<div class="card-header">
<span class="badge bg-primary badge-method">POST</span>
<code class="endpoint">/api/v1.0/generate-cheque</code>
</div>
<div class="card-body">
<p>Generates a cheque document for a given transaction. Returns a URL to the generated PDF.</p>
<h5>Request Body</h5>
<table class="table table-sm param-table">
<thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>transaction_id</code></td><td>string (required)</td><td>Node ID of the transaction for which to generate the cheque</td></tr>
</tbody>
</table>
<h5 class="mt-3">Example Request</h5>
<pre><code class="language-bash">POST /api/v1.0/generate-cheque</code></pre>
<pre><code class="language-json">{
"transaction_id": "456"
}</code></pre>
<h5 class="mt-3">Response</h5>
<pre><code class="language-json">{
"data": {
"cheque_url": "/files/cheque_456.pdf"
}
}</code></pre>
</div>
</div>
<!-- Reset Statement Charges -->
<div class="card mb-4">
<div class="card-header">
<span class="badge bg-warning text-dark badge-method">PATCH</span>
<code class="endpoint">/api/v1.0/reset-statement-charges/{id}</code>
</div>
<div class="card-body">
<p>Removes all current charges from the specified consignment statement and re-assigns all unassigned charges to it. The <code>id</code> path parameter is the numeric consignment statement node ID.</p>
<h5>Parameters</h5>
<table class="table table-sm param-table">
<thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>id</code></td><td>integer (path)</td><td>Consignment statement node ID</td></tr>
</tbody>
</table>
<h5 class="mt-3">Example Request</h5>
<pre><code class="language-bash">PATCH /api/v1.0/reset-statement-charges/789</code></pre>
<h5 class="mt-3">Response</h5>
<pre><code class="language-json">{
"data": {
"id": "789",
"status": "charges_reset"
}
}</code></pre>
</div>
</div>
</div>
<script src="assets/js/sidebar.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script>
document.querySelectorAll('pre code').forEach(block => {
const button = document.createElement('button');
button.className = 'btn btn-sm btn-outline-secondary copy-btn';
button.textContent = 'Copy';
button.onclick = () => {
navigator.clipboard.writeText(block.textContent);
button.textContent = 'Copied!';
setTimeout(() => button.textContent = 'Copy', 2000);
};
block.parentElement.appendChild(button);
});
</script>
</body>
</html>