@aloma.io/integration-sdk 3.8.70 → 3.8.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/build/internal/connector/server/on-connect/make-oauth.mjs +27 -6
- package/build/internal/fetcher/fetcher.d.mts +14 -1
- package/build/internal/fetcher/fetcher.mjs +52 -11
- package/build/internal/fetcher/oauth-fetcher.d.mts +15 -2
- package/build/internal/fetcher/oauth-fetcher.mjs +72 -27
- package/build/internal/util/index.d.mts +8 -0
- package/build/internal/util/index.mjs +13 -1
- package/build/internal/util/jwe/index.mjs +3 -1
- package/package.json +8 -3
- package/.prettierrc.cjs +0 -8
- package/FINDINGS-PLAT-47.md +0 -253
- package/MULTI_RESOURCE_GUIDE.md +0 -220
- package/OPENAPI_TO_CONNECTOR.md +0 -349
- package/examples/hello-world/package.json +0 -25
- package/examples/hello-world/src/controller/index.mts +0 -12
- package/examples/hello-world/src/index.mts +0 -6
- package/examples/hello-world/tsconfig.json +0 -27
- package/examples/sample-api.json +0 -325
- package/examples/sample-api.yaml +0 -222
- package/examples/simple-api.json +0 -39
- package/index.js +0 -4
- package/src/builder/index.mts +0 -274
- package/src/builder/runtime-context.mts +0 -129
- package/src/cli.mts +0 -533
- package/src/controller/index.mts +0 -278
- package/src/index.mts +0 -2
- package/src/internal/connector/config.mts +0 -59
- package/src/internal/connector/index.mts +0 -53
- package/src/internal/connector/metrics.mts +0 -34
- package/src/internal/connector/server/index.mts +0 -51
- package/src/internal/connector/server/on-connect/decrypt-config.mts +0 -27
- package/src/internal/connector/server/on-connect/finish-oauth.mts +0 -109
- package/src/internal/connector/server/on-connect/index.mts +0 -162
- package/src/internal/connector/server/on-connect/make-oauth.mts +0 -97
- package/src/internal/connector/server/on-connect/start-oauth.mts +0 -24
- package/src/internal/connector/server/on-message.mts +0 -13
- package/src/internal/dispatcher/index.mts +0 -231
- package/src/internal/fetcher/fetcher.mts +0 -215
- package/src/internal/fetcher/oauth-fetcher.mts +0 -153
- package/src/internal/index.mts +0 -3
- package/src/internal/util/index.mts +0 -52
- package/src/internal/util/jwe/cli.mts +0 -12
- package/src/internal/util/jwe/index.mts +0 -72
- package/src/internal/websocket/config.mjs +0 -109
- package/src/internal/websocket/connection/constants.mjs +0 -25
- package/src/internal/websocket/connection/index.mjs +0 -71
- package/src/internal/websocket/connection/registration.mjs +0 -42
- package/src/internal/websocket/index.mjs +0 -46
- package/src/internal/websocket/transport/durable.mjs +0 -71
- package/src/internal/websocket/transport/index.mjs +0 -194
- package/src/internal/websocket/transport/packet.mjs +0 -54
- package/src/internal/websocket/transport/processor.mjs +0 -66
- package/src/openapi-to-connector.mts +0 -1648
- package/src/testing/fake-aloma.mts +0 -306
- package/src/testing/harness.mts +0 -172
- package/src/testing/index.mts +0 -15
- package/src/testing/keys.mts +0 -19
- package/src/testing/network-guard.mts +0 -57
- package/src/testing/runtime-connector.mts +0 -50
- package/src/testing/vendor-mock.mts +0 -166
- package/src/transform/index.mts +0 -544
- package/test/MUTATION-entry.md +0 -21
- package/test/MUTATION.md +0 -43
- package/test/dispatcher-ctx-forwarding.test.mjs +0 -161
- package/test/fetcher-query-params.test.mjs +0 -294
- package/test/fixtures/transform/basic/expected.json +0 -9
- package/test/fixtures/transform/basic/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/basic/src/controller/index.mts +0 -30
- package/test/fixtures/transform/basic/tsconfig.json +0 -1
- package/test/fixtures/transform/interface-param/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/interface-param/src/controller/index.mts +0 -12
- package/test/fixtures/transform/interface-param/tsconfig.json +0 -1
- package/test/fixtures/transform/overloads/expected.json +0 -6
- package/test/fixtures/transform/overloads/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/overloads/src/controller/index.mts +0 -11
- package/test/fixtures/transform/overloads/tsconfig.json +0 -1
- package/test/fixtures/transform/tdd-stub/expected.json +0 -8
- package/test/fixtures/transform/tdd-stub/src/controller/abstract.mts +0 -6
- package/test/fixtures/transform/tdd-stub/src/controller/index.mts +0 -204
- package/test/fixtures/transform/tdd-stub/tsconfig.json +0 -1
- package/test/fixtures/transform/two-exports/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/two-exports/src/controller/index.mts +0 -9
- package/test/fixtures/transform/two-exports/tsconfig.json +0 -1
- package/test/fixtures/transform/type-error/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/type-error/src/controller/index.mts +0 -7
- package/test/fixtures/transform/type-error/tsconfig.json +0 -1
- package/test/fixtures/transform/typed/expected.json +0 -8
- package/test/fixtures/transform/typed/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/typed/src/controller/index.mts +0 -13
- package/test/fixtures/transform/typed/tsconfig.json +0 -1
- package/test/fixtures/transform/visibility/expected.json +0 -9
- package/test/fixtures/transform/visibility/src/controller/abstract.mts +0 -5
- package/test/fixtures/transform/visibility/src/controller/index.mts +0 -19
- package/test/fixtures/transform/visibility/tsconfig.json +0 -1
- package/test/harness-connector-smoke.test.mjs +0 -72
- package/test/harness.test.mjs +0 -375
- package/test/nested-resolver.test.mjs +0 -184
- package/test/openapi-generator-bugs.test.mjs +0 -248
- package/test/openapi-identifier-sanitise.test.mjs +0 -69
- package/test/openapi-nested-paths.test.mjs +0 -100
- package/test/openapi-to-connector.test.mts +0 -232
- package/test/openapi-ts-compilation.test.mjs +0 -178
- package/test/scenarios/README.md +0 -148
- package/test/scenarios/complex/expected/controller.mts +0 -271
- package/test/scenarios/complex/expected/orders-resource.mts +0 -262
- package/test/scenarios/complex/expected/products-resource.mts +0 -237
- package/test/scenarios/complex/specs/orders.json +0 -362
- package/test/scenarios/complex/specs/products.json +0 -308
- package/test/scenarios/simple/expected-controller.mts +0 -60
- package/test/scenarios/simple/simple-api.json +0 -39
- package/test/scenarios.test.mts +0 -294
- package/test/transform.test.mjs +0 -68
- package/test/verify-scenarios.mjs +0 -298
- package/tools/mutation-run-entry.mjs +0 -52
- package/tools/mutation-run.mjs +0 -138
- package/tools/run-tests.mjs +0 -64
- package/tsconfig.json +0 -27
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.0.0",
|
|
3
|
-
"info": {
|
|
4
|
-
"title": "Orders API",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"description": "A simple orders management API"
|
|
7
|
-
},
|
|
8
|
-
"servers": [
|
|
9
|
-
{
|
|
10
|
-
"url": "https://api.testshop.com",
|
|
11
|
-
"description": "Production server"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"paths": {
|
|
15
|
-
"/orders": {
|
|
16
|
-
"get": {
|
|
17
|
-
"operationId": "getOrders",
|
|
18
|
-
"summary": "List all orders",
|
|
19
|
-
"parameters": [
|
|
20
|
-
{
|
|
21
|
-
"name": "status",
|
|
22
|
-
"in": "query",
|
|
23
|
-
"schema": {
|
|
24
|
-
"type": "string",
|
|
25
|
-
"enum": ["pending", "confirmed", "shipped", "delivered", "cancelled"]
|
|
26
|
-
},
|
|
27
|
-
"description": "Filter by order status"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "customerId",
|
|
31
|
-
"in": "query",
|
|
32
|
-
"schema": {
|
|
33
|
-
"type": "string"
|
|
34
|
-
},
|
|
35
|
-
"description": "Filter by customer ID"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "limit",
|
|
39
|
-
"in": "query",
|
|
40
|
-
"schema": {
|
|
41
|
-
"type": "integer",
|
|
42
|
-
"minimum": 1,
|
|
43
|
-
"maximum": 50
|
|
44
|
-
},
|
|
45
|
-
"description": "Maximum number of orders to return"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"responses": {
|
|
49
|
-
"200": {
|
|
50
|
-
"description": "List of orders",
|
|
51
|
-
"content": {
|
|
52
|
-
"application/json": {
|
|
53
|
-
"schema": {
|
|
54
|
-
"$ref": "#/components/schemas/OrderList"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"post": {
|
|
62
|
-
"operationId": "createOrder",
|
|
63
|
-
"summary": "Create a new order",
|
|
64
|
-
"requestBody": {
|
|
65
|
-
"required": true,
|
|
66
|
-
"content": {
|
|
67
|
-
"application/json": {
|
|
68
|
-
"schema": {
|
|
69
|
-
"$ref": "#/components/schemas/CreateOrderRequest"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"responses": {
|
|
75
|
-
"201": {
|
|
76
|
-
"description": "Order created",
|
|
77
|
-
"content": {
|
|
78
|
-
"application/json": {
|
|
79
|
-
"schema": {
|
|
80
|
-
"$ref": "#/components/schemas/Order"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"/orders/{orderId}": {
|
|
89
|
-
"get": {
|
|
90
|
-
"operationId": "getOrder",
|
|
91
|
-
"summary": "Get a specific order",
|
|
92
|
-
"parameters": [
|
|
93
|
-
{
|
|
94
|
-
"name": "orderId",
|
|
95
|
-
"in": "path",
|
|
96
|
-
"required": true,
|
|
97
|
-
"schema": {
|
|
98
|
-
"type": "string"
|
|
99
|
-
},
|
|
100
|
-
"description": "The order ID"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"responses": {
|
|
104
|
-
"200": {
|
|
105
|
-
"description": "Order details",
|
|
106
|
-
"content": {
|
|
107
|
-
"application/json": {
|
|
108
|
-
"schema": {
|
|
109
|
-
"$ref": "#/components/schemas/Order"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
"patch": {
|
|
117
|
-
"operationId": "updateOrderStatus",
|
|
118
|
-
"summary": "Update order status",
|
|
119
|
-
"parameters": [
|
|
120
|
-
{
|
|
121
|
-
"name": "orderId",
|
|
122
|
-
"in": "path",
|
|
123
|
-
"required": true,
|
|
124
|
-
"schema": {
|
|
125
|
-
"type": "string"
|
|
126
|
-
},
|
|
127
|
-
"description": "The order ID"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"requestBody": {
|
|
131
|
-
"required": true,
|
|
132
|
-
"content": {
|
|
133
|
-
"application/json": {
|
|
134
|
-
"schema": {
|
|
135
|
-
"$ref": "#/components/schemas/UpdateOrderStatusRequest"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"responses": {
|
|
141
|
-
"200": {
|
|
142
|
-
"description": "Order status updated",
|
|
143
|
-
"content": {
|
|
144
|
-
"application/json": {
|
|
145
|
-
"schema": {
|
|
146
|
-
"$ref": "#/components/schemas/Order"
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
"/orders/{orderId}/cancel": {
|
|
155
|
-
"post": {
|
|
156
|
-
"operationId": "cancelOrder",
|
|
157
|
-
"summary": "Cancel an order",
|
|
158
|
-
"parameters": [
|
|
159
|
-
{
|
|
160
|
-
"name": "orderId",
|
|
161
|
-
"in": "path",
|
|
162
|
-
"required": true,
|
|
163
|
-
"schema": {
|
|
164
|
-
"type": "string"
|
|
165
|
-
},
|
|
166
|
-
"description": "The order ID"
|
|
167
|
-
}
|
|
168
|
-
],
|
|
169
|
-
"responses": {
|
|
170
|
-
"200": {
|
|
171
|
-
"description": "Order cancelled",
|
|
172
|
-
"content": {
|
|
173
|
-
"application/json": {
|
|
174
|
-
"schema": {
|
|
175
|
-
"$ref": "#/components/schemas/Order"
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
"components": {
|
|
185
|
-
"schemas": {
|
|
186
|
-
"Order": {
|
|
187
|
-
"type": "object",
|
|
188
|
-
"required": ["id", "customerId", "items", "status", "totalAmount"],
|
|
189
|
-
"properties": {
|
|
190
|
-
"id": {
|
|
191
|
-
"type": "string",
|
|
192
|
-
"description": "Unique order identifier"
|
|
193
|
-
},
|
|
194
|
-
"customerId": {
|
|
195
|
-
"type": "string",
|
|
196
|
-
"description": "Customer who placed the order"
|
|
197
|
-
},
|
|
198
|
-
"items": {
|
|
199
|
-
"type": "array",
|
|
200
|
-
"items": {
|
|
201
|
-
"$ref": "#/components/schemas/OrderItem"
|
|
202
|
-
},
|
|
203
|
-
"description": "Items in the order"
|
|
204
|
-
},
|
|
205
|
-
"status": {
|
|
206
|
-
"type": "string",
|
|
207
|
-
"enum": ["pending", "confirmed", "shipped", "delivered", "cancelled"],
|
|
208
|
-
"description": "Current order status"
|
|
209
|
-
},
|
|
210
|
-
"totalAmount": {
|
|
211
|
-
"type": "number",
|
|
212
|
-
"minimum": 0,
|
|
213
|
-
"description": "Total order amount"
|
|
214
|
-
},
|
|
215
|
-
"shippingAddress": {
|
|
216
|
-
"$ref": "#/components/schemas/Address"
|
|
217
|
-
},
|
|
218
|
-
"billingAddress": {
|
|
219
|
-
"$ref": "#/components/schemas/Address"
|
|
220
|
-
},
|
|
221
|
-
"createdAt": {
|
|
222
|
-
"type": "string",
|
|
223
|
-
"format": "date-time",
|
|
224
|
-
"description": "Order creation timestamp"
|
|
225
|
-
},
|
|
226
|
-
"updatedAt": {
|
|
227
|
-
"type": "string",
|
|
228
|
-
"format": "date-time",
|
|
229
|
-
"description": "Last update timestamp"
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
"OrderItem": {
|
|
234
|
-
"type": "object",
|
|
235
|
-
"required": ["productId", "quantity", "unitPrice"],
|
|
236
|
-
"properties": {
|
|
237
|
-
"productId": {
|
|
238
|
-
"type": "string",
|
|
239
|
-
"description": "Product identifier"
|
|
240
|
-
},
|
|
241
|
-
"productName": {
|
|
242
|
-
"type": "string",
|
|
243
|
-
"description": "Product name"
|
|
244
|
-
},
|
|
245
|
-
"quantity": {
|
|
246
|
-
"type": "integer",
|
|
247
|
-
"minimum": 1,
|
|
248
|
-
"description": "Quantity ordered"
|
|
249
|
-
},
|
|
250
|
-
"unitPrice": {
|
|
251
|
-
"type": "number",
|
|
252
|
-
"minimum": 0,
|
|
253
|
-
"description": "Price per unit"
|
|
254
|
-
},
|
|
255
|
-
"totalPrice": {
|
|
256
|
-
"type": "number",
|
|
257
|
-
"minimum": 0,
|
|
258
|
-
"description": "Total price for this item"
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
"Address": {
|
|
263
|
-
"type": "object",
|
|
264
|
-
"required": ["street", "city", "zipCode", "country"],
|
|
265
|
-
"properties": {
|
|
266
|
-
"street": {
|
|
267
|
-
"type": "string",
|
|
268
|
-
"description": "Street address"
|
|
269
|
-
},
|
|
270
|
-
"city": {
|
|
271
|
-
"type": "string",
|
|
272
|
-
"description": "City"
|
|
273
|
-
},
|
|
274
|
-
"state": {
|
|
275
|
-
"type": "string",
|
|
276
|
-
"description": "State or province"
|
|
277
|
-
},
|
|
278
|
-
"zipCode": {
|
|
279
|
-
"type": "string",
|
|
280
|
-
"description": "ZIP or postal code"
|
|
281
|
-
},
|
|
282
|
-
"country": {
|
|
283
|
-
"type": "string",
|
|
284
|
-
"description": "Country"
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
"OrderList": {
|
|
289
|
-
"type": "object",
|
|
290
|
-
"properties": {
|
|
291
|
-
"orders": {
|
|
292
|
-
"type": "array",
|
|
293
|
-
"items": {
|
|
294
|
-
"$ref": "#/components/schemas/Order"
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
"total": {
|
|
298
|
-
"type": "integer",
|
|
299
|
-
"description": "Total number of orders"
|
|
300
|
-
},
|
|
301
|
-
"hasMore": {
|
|
302
|
-
"type": "boolean",
|
|
303
|
-
"description": "Whether there are more orders available"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
"CreateOrderRequest": {
|
|
308
|
-
"type": "object",
|
|
309
|
-
"required": ["customerId", "items"],
|
|
310
|
-
"properties": {
|
|
311
|
-
"customerId": {
|
|
312
|
-
"type": "string",
|
|
313
|
-
"description": "Customer who is placing the order"
|
|
314
|
-
},
|
|
315
|
-
"items": {
|
|
316
|
-
"type": "array",
|
|
317
|
-
"items": {
|
|
318
|
-
"$ref": "#/components/schemas/OrderItemRequest"
|
|
319
|
-
},
|
|
320
|
-
"description": "Items to order"
|
|
321
|
-
},
|
|
322
|
-
"shippingAddress": {
|
|
323
|
-
"$ref": "#/components/schemas/Address"
|
|
324
|
-
},
|
|
325
|
-
"billingAddress": {
|
|
326
|
-
"$ref": "#/components/schemas/Address"
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
"OrderItemRequest": {
|
|
331
|
-
"type": "object",
|
|
332
|
-
"required": ["productId", "quantity"],
|
|
333
|
-
"properties": {
|
|
334
|
-
"productId": {
|
|
335
|
-
"type": "string",
|
|
336
|
-
"description": "Product to order"
|
|
337
|
-
},
|
|
338
|
-
"quantity": {
|
|
339
|
-
"type": "integer",
|
|
340
|
-
"minimum": 1,
|
|
341
|
-
"description": "Quantity to order"
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
"UpdateOrderStatusRequest": {
|
|
346
|
-
"type": "object",
|
|
347
|
-
"required": ["status"],
|
|
348
|
-
"properties": {
|
|
349
|
-
"status": {
|
|
350
|
-
"type": "string",
|
|
351
|
-
"enum": ["confirmed", "shipped", "delivered"],
|
|
352
|
-
"description": "New order status"
|
|
353
|
-
},
|
|
354
|
-
"trackingNumber": {
|
|
355
|
-
"type": "string",
|
|
356
|
-
"description": "Tracking number (for shipped status)"
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.0.0",
|
|
3
|
-
"info": {
|
|
4
|
-
"title": "Products API",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"description": "A simple products management API"
|
|
7
|
-
},
|
|
8
|
-
"servers": [
|
|
9
|
-
{
|
|
10
|
-
"url": "https://api.testshop.com",
|
|
11
|
-
"description": "Production server"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"paths": {
|
|
15
|
-
"/products": {
|
|
16
|
-
"get": {
|
|
17
|
-
"operationId": "getProducts",
|
|
18
|
-
"summary": "List all products",
|
|
19
|
-
"parameters": [
|
|
20
|
-
{
|
|
21
|
-
"name": "limit",
|
|
22
|
-
"in": "query",
|
|
23
|
-
"schema": {
|
|
24
|
-
"type": "integer",
|
|
25
|
-
"minimum": 1,
|
|
26
|
-
"maximum": 100
|
|
27
|
-
},
|
|
28
|
-
"description": "Maximum number of products to return"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "category",
|
|
32
|
-
"in": "query",
|
|
33
|
-
"schema": {
|
|
34
|
-
"type": "string"
|
|
35
|
-
},
|
|
36
|
-
"description": "Filter by category"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "archived",
|
|
40
|
-
"in": "query",
|
|
41
|
-
"schema": {
|
|
42
|
-
"type": "boolean"
|
|
43
|
-
},
|
|
44
|
-
"description": "Include archived products"
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"responses": {
|
|
48
|
-
"200": {
|
|
49
|
-
"description": "List of products",
|
|
50
|
-
"content": {
|
|
51
|
-
"application/json": {
|
|
52
|
-
"schema": {
|
|
53
|
-
"$ref": "#/components/schemas/ProductList"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"post": {
|
|
61
|
-
"operationId": "createProduct",
|
|
62
|
-
"summary": "Create a new product",
|
|
63
|
-
"requestBody": {
|
|
64
|
-
"required": true,
|
|
65
|
-
"content": {
|
|
66
|
-
"application/json": {
|
|
67
|
-
"schema": {
|
|
68
|
-
"$ref": "#/components/schemas/CreateProductRequest"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"responses": {
|
|
74
|
-
"201": {
|
|
75
|
-
"description": "Product created",
|
|
76
|
-
"content": {
|
|
77
|
-
"application/json": {
|
|
78
|
-
"schema": {
|
|
79
|
-
"$ref": "#/components/schemas/Product"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"/products/{productId}": {
|
|
88
|
-
"get": {
|
|
89
|
-
"operationId": "getProduct",
|
|
90
|
-
"summary": "Get a specific product",
|
|
91
|
-
"parameters": [
|
|
92
|
-
{
|
|
93
|
-
"name": "productId",
|
|
94
|
-
"in": "path",
|
|
95
|
-
"required": true,
|
|
96
|
-
"schema": {
|
|
97
|
-
"type": "string"
|
|
98
|
-
},
|
|
99
|
-
"description": "The product ID"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"responses": {
|
|
103
|
-
"200": {
|
|
104
|
-
"description": "Product details",
|
|
105
|
-
"content": {
|
|
106
|
-
"application/json": {
|
|
107
|
-
"schema": {
|
|
108
|
-
"$ref": "#/components/schemas/Product"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"put": {
|
|
116
|
-
"operationId": "updateProduct",
|
|
117
|
-
"summary": "Update a product",
|
|
118
|
-
"parameters": [
|
|
119
|
-
{
|
|
120
|
-
"name": "productId",
|
|
121
|
-
"in": "path",
|
|
122
|
-
"required": true,
|
|
123
|
-
"schema": {
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
"description": "The product ID"
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
"requestBody": {
|
|
130
|
-
"required": true,
|
|
131
|
-
"content": {
|
|
132
|
-
"application/json": {
|
|
133
|
-
"schema": {
|
|
134
|
-
"$ref": "#/components/schemas/UpdateProductRequest"
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"responses": {
|
|
140
|
-
"200": {
|
|
141
|
-
"description": "Product updated",
|
|
142
|
-
"content": {
|
|
143
|
-
"application/json": {
|
|
144
|
-
"schema": {
|
|
145
|
-
"$ref": "#/components/schemas/Product"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
"delete": {
|
|
153
|
-
"operationId": "deleteProduct",
|
|
154
|
-
"summary": "Delete a product",
|
|
155
|
-
"parameters": [
|
|
156
|
-
{
|
|
157
|
-
"name": "productId",
|
|
158
|
-
"in": "path",
|
|
159
|
-
"required": true,
|
|
160
|
-
"schema": {
|
|
161
|
-
"type": "string"
|
|
162
|
-
},
|
|
163
|
-
"description": "The product ID"
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
"responses": {
|
|
167
|
-
"204": {
|
|
168
|
-
"description": "Product deleted"
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
"components": {
|
|
175
|
-
"schemas": {
|
|
176
|
-
"Product": {
|
|
177
|
-
"type": "object",
|
|
178
|
-
"required": ["id", "name", "price"],
|
|
179
|
-
"properties": {
|
|
180
|
-
"id": {
|
|
181
|
-
"type": "string",
|
|
182
|
-
"description": "Unique product identifier"
|
|
183
|
-
},
|
|
184
|
-
"name": {
|
|
185
|
-
"type": "string",
|
|
186
|
-
"description": "Product name"
|
|
187
|
-
},
|
|
188
|
-
"description": {
|
|
189
|
-
"type": "string",
|
|
190
|
-
"description": "Product description"
|
|
191
|
-
},
|
|
192
|
-
"price": {
|
|
193
|
-
"type": "number",
|
|
194
|
-
"minimum": 0,
|
|
195
|
-
"description": "Product price"
|
|
196
|
-
},
|
|
197
|
-
"category": {
|
|
198
|
-
"type": "string",
|
|
199
|
-
"description": "Product category"
|
|
200
|
-
},
|
|
201
|
-
"inStock": {
|
|
202
|
-
"type": "boolean",
|
|
203
|
-
"description": "Whether product is in stock"
|
|
204
|
-
},
|
|
205
|
-
"tags": {
|
|
206
|
-
"type": "array",
|
|
207
|
-
"items": {
|
|
208
|
-
"type": "string"
|
|
209
|
-
},
|
|
210
|
-
"description": "Product tags"
|
|
211
|
-
},
|
|
212
|
-
"createdAt": {
|
|
213
|
-
"type": "string",
|
|
214
|
-
"format": "date-time",
|
|
215
|
-
"description": "Creation timestamp"
|
|
216
|
-
},
|
|
217
|
-
"updatedAt": {
|
|
218
|
-
"type": "string",
|
|
219
|
-
"format": "date-time",
|
|
220
|
-
"description": "Last update timestamp"
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
"ProductList": {
|
|
225
|
-
"type": "object",
|
|
226
|
-
"properties": {
|
|
227
|
-
"products": {
|
|
228
|
-
"type": "array",
|
|
229
|
-
"items": {
|
|
230
|
-
"$ref": "#/components/schemas/Product"
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
"total": {
|
|
234
|
-
"type": "integer",
|
|
235
|
-
"description": "Total number of products"
|
|
236
|
-
},
|
|
237
|
-
"hasMore": {
|
|
238
|
-
"type": "boolean",
|
|
239
|
-
"description": "Whether there are more products available"
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
"CreateProductRequest": {
|
|
244
|
-
"type": "object",
|
|
245
|
-
"required": ["name", "price"],
|
|
246
|
-
"properties": {
|
|
247
|
-
"name": {
|
|
248
|
-
"type": "string",
|
|
249
|
-
"description": "Product name"
|
|
250
|
-
},
|
|
251
|
-
"description": {
|
|
252
|
-
"type": "string",
|
|
253
|
-
"description": "Product description"
|
|
254
|
-
},
|
|
255
|
-
"price": {
|
|
256
|
-
"type": "number",
|
|
257
|
-
"minimum": 0,
|
|
258
|
-
"description": "Product price"
|
|
259
|
-
},
|
|
260
|
-
"category": {
|
|
261
|
-
"type": "string",
|
|
262
|
-
"description": "Product category"
|
|
263
|
-
},
|
|
264
|
-
"tags": {
|
|
265
|
-
"type": "array",
|
|
266
|
-
"items": {
|
|
267
|
-
"type": "string"
|
|
268
|
-
},
|
|
269
|
-
"description": "Product tags"
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
"UpdateProductRequest": {
|
|
274
|
-
"type": "object",
|
|
275
|
-
"properties": {
|
|
276
|
-
"name": {
|
|
277
|
-
"type": "string",
|
|
278
|
-
"description": "Product name"
|
|
279
|
-
},
|
|
280
|
-
"description": {
|
|
281
|
-
"type": "string",
|
|
282
|
-
"description": "Product description"
|
|
283
|
-
},
|
|
284
|
-
"price": {
|
|
285
|
-
"type": "number",
|
|
286
|
-
"minimum": 0,
|
|
287
|
-
"description": "Product price"
|
|
288
|
-
},
|
|
289
|
-
"category": {
|
|
290
|
-
"type": "string",
|
|
291
|
-
"description": "Product category"
|
|
292
|
-
},
|
|
293
|
-
"inStock": {
|
|
294
|
-
"type": "boolean",
|
|
295
|
-
"description": "Whether product is in stock"
|
|
296
|
-
},
|
|
297
|
-
"tags": {
|
|
298
|
-
"type": "array",
|
|
299
|
-
"items": {
|
|
300
|
-
"type": "string"
|
|
301
|
-
},
|
|
302
|
-
"description": "Product tags"
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|