@mitralab.io/sdk-core 0.1.0

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.
@@ -0,0 +1,787 @@
1
+ {
2
+ "contract": "SDK-PARITY-001",
3
+ "version": "0.1.0",
4
+ "description": "Canonical semantic and HTTP contract fixtures for the Mitra runtime SDKs.",
5
+ "sources": {
6
+ "mcp": {
7
+ "repository": "mitralab-dev/mitra-mcp-server",
8
+ "commit": "12f33cceb94eaf6ed69f9ed9127f6a5260a7c2e9",
9
+ "paths": [
10
+ "src/main/java/io/mitralab/mcp/tools/datamanager/DataManagerRecordTools.java",
11
+ "src/main/java/io/mitralab/mcp/tools/datamanager/DataManagerCustomQueryTools.java",
12
+ "src/main/java/io/mitralab/mcp/tools/functions/FunctionTools.java",
13
+ "src/main/java/io/mitralab/mcp/tools/iam/IamTools.java",
14
+ "src/main/java/io/mitralab/mcp/tools/integration/IntegrationProxyTools.java",
15
+ "src/main/java/io/mitralab/mcp/tools/integration/IntegrationResourceTools.java"
16
+ ]
17
+ },
18
+ "dataManagerMain": {
19
+ "repository": "mitralab-dev/mitra-data-manager",
20
+ "commit": "4ec85ceac720da5d056cc85fecd6b27104e13396",
21
+ "request": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/dto/CustomQueryExecuteRequest.java",
22
+ "controller": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/CustomQueryController.java",
23
+ "response": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/dto/QueryExecuteResponse.java"
24
+ },
25
+ "dataManagerAlpha": {
26
+ "repository": "mitralab-dev/mitra-data-manager",
27
+ "commit": "ee49949c362f87ac9a8dbb38117236cee842f2ed",
28
+ "request": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/dto/CustomQueryExecuteRequest.java",
29
+ "controller": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/CustomQueryController.java",
30
+ "response": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/dto/QueryExecuteResponse.java",
31
+ "errorHandler": "api/src/main/java/io/mitralab/datamanager/infrastructure/api/exception/GlobalExceptionHandler.java",
32
+ "controllerTest": "api/src/test/java/io/mitralab/datamanager/api/CustomQueryControllerTest.java"
33
+ }
34
+ },
35
+ "matrix": [
36
+ {
37
+ "operation": "auth.me",
38
+ "mcpTool": "getMe",
39
+ "javascript": "auth.me()",
40
+ "python": "auth.me()",
41
+ "endpoint": "GET /iam/api/v1/auth/me",
42
+ "mcpTransportParity": "exact"
43
+ },
44
+ {
45
+ "operation": "entities.list",
46
+ "mcpTool": "listRecords",
47
+ "javascript": "entities.getTable(table).list(options)",
48
+ "python": "entities.table(table).list(**options)",
49
+ "endpoint": "GET /data-manager/api/v1/tables/{table}/records",
50
+ "mcpTransportParity": "semantic-only"
51
+ },
52
+ {
53
+ "operation": "entities.filter",
54
+ "mcpTool": "listRecords",
55
+ "javascript": "entities.getTable(table).filter(query, sort, limit, skip, fields)",
56
+ "python": "entities.table(table).filter(query, sort=sort, limit=limit, skip=skip, fields=fields)",
57
+ "endpoint": "GET /data-manager/api/v1/tables/{table}/records",
58
+ "mcpTransportParity": "semantic-only"
59
+ },
60
+ {
61
+ "operation": "entities.get",
62
+ "mcpTool": "getRecord",
63
+ "javascript": "entities.getTable(table).get(id)",
64
+ "python": "entities.table(table).get(id)",
65
+ "endpoint": "GET /data-manager/api/v1/tables/{table}/records/{id}",
66
+ "mcpTransportParity": "semantic-only"
67
+ },
68
+ {
69
+ "operation": "entities.create",
70
+ "mcpTool": "createRecord",
71
+ "javascript": "entities.getTable(table).create(data)",
72
+ "python": "entities.table(table).create(data)",
73
+ "endpoint": "POST /data-manager/api/v1/tables/{table}/records",
74
+ "mcpTransportParity": "semantic-only"
75
+ },
76
+ {
77
+ "operation": "entities.bulkCreate",
78
+ "mcpTool": "bulkCreateRecords",
79
+ "javascript": "entities.getTable(table).bulkCreate(data)",
80
+ "python": "entities.table(table).bulk_create(data)",
81
+ "endpoint": "POST /data-manager/api/v1/tables/{table}/records/bulk",
82
+ "mcpTransportParity": "semantic-only"
83
+ },
84
+ {
85
+ "operation": "entities.update",
86
+ "mcpTool": "updateRecord",
87
+ "javascript": "entities.getTable(table).update(id, data)",
88
+ "python": "entities.table(table).update(id, data)",
89
+ "endpoint": "PUT /data-manager/api/v1/tables/{table}/records/{id}",
90
+ "mcpTransportParity": "semantic-only"
91
+ },
92
+ {
93
+ "operation": "entities.delete",
94
+ "mcpTool": "deleteRecord",
95
+ "javascript": "entities.getTable(table).delete(id)",
96
+ "python": "entities.table(table).delete(id)",
97
+ "endpoint": "DELETE /data-manager/api/v1/tables/{table}/records/{id}",
98
+ "mcpTransportParity": "semantic-only"
99
+ },
100
+ {
101
+ "operation": "entities.deleteMany",
102
+ "mcpTool": "deleteManyRecords",
103
+ "javascript": "entities.getTable(table).deleteMany(query)",
104
+ "python": "entities.table(table).delete_many(query)",
105
+ "endpoint": "DELETE /data-manager/api/v1/tables/{table}/records",
106
+ "mcpTransportParity": "semantic-only"
107
+ },
108
+ {
109
+ "operation": "queries.execute",
110
+ "mcpTool": "executeCustomQuery",
111
+ "javascript": "queries.execute(id, parameters)",
112
+ "python": "queries.execute(id, parameters)",
113
+ "endpoint": "POST /data-manager/api/v1/custom-queries/{id}/execute",
114
+ "mcpTransportParity": "main-request-compatible"
115
+ },
116
+ {
117
+ "operation": "functions.execute",
118
+ "mcpTool": "executeFunction",
119
+ "javascript": "functions.execute(id, input)",
120
+ "python": "functions.execute(id, input)",
121
+ "endpoint": "POST /functions/api/v1/functions/{id}/execute",
122
+ "mcpTransportParity": "exact"
123
+ },
124
+ {
125
+ "operation": "functions.executeAsync",
126
+ "mcpTool": null,
127
+ "javascript": "functions.executeAsync(id, input)",
128
+ "python": "functions.execute_async(id, input)",
129
+ "endpoint": "POST /functions/api/v1/functions/{id}/execute",
130
+ "mcpTransportParity": "sdk-only"
131
+ },
132
+ {
133
+ "operation": "functions.getExecution",
134
+ "mcpTool": "getExecution",
135
+ "javascript": "functions.getExecution(id)",
136
+ "python": "functions.get_execution(id)",
137
+ "endpoint": "GET /functions/api/v1/executions/{id}",
138
+ "mcpTransportParity": "semantic-only"
139
+ },
140
+ {
141
+ "operation": "functions.cancelExecution",
142
+ "mcpTool": null,
143
+ "javascript": "functions.cancelExecution(id)",
144
+ "python": "functions.cancel_execution(id)",
145
+ "endpoint": "POST /functions/api/v1/executions/{id}/cancel",
146
+ "mcpTransportParity": "sdk-only"
147
+ },
148
+ {
149
+ "operation": "integration.execute",
150
+ "mcpTool": "executeIntegrationTemplateConfig",
151
+ "javascript": "integration.execute(configId, request)",
152
+ "python": "integration.execute(config_id, request)",
153
+ "endpoint": "POST /integration/api/v1/proxy/template-configs/{id}/execute",
154
+ "mcpTransportParity": "semantic-only"
155
+ },
156
+ {
157
+ "operation": "integration.executeResource",
158
+ "mcpTool": "executeIntegrationResource",
159
+ "javascript": "integration.executeResource(resourceId, parameters)",
160
+ "python": "integration.execute_resource(resource_id, parameters)",
161
+ "endpoint": "POST /integration/api/v1/proxy/resources/{id}/execute",
162
+ "mcpTransportParity": "exact"
163
+ }
164
+ ],
165
+ "customQueryTransition": {
166
+ "currentSdkTarget": "main",
167
+ "sharedRequestBody": {
168
+ "dataSourceId": "00000000-0000-4000-8000-000000000001",
169
+ "parameters": { "status": "active" }
170
+ },
171
+ "main": {
172
+ "acceptsSharedRequestBody": true,
173
+ "dataSourceIdTransportBehavior": "consumed",
174
+ "dataSourceResolution": "request-body"
175
+ },
176
+ "alpha": {
177
+ "acceptsSharedRequestBody": true,
178
+ "dataSourceIdTransportBehavior": "ignored",
179
+ "dataSourceResolution": "authenticated-app",
180
+ "semanticCompatibility": "The request is accepted, but alpha resolves the data source from the authenticated app rather than dataSourceId."
181
+ },
182
+ "singlePayloadTransportCompatibility": true,
183
+ "automaticFallbackAllowed": false,
184
+ "automaticFallbackReason": "The main request is already accepted by both recorded contracts, and retrying a POST could execute a query twice.",
185
+ "removeDataSourceIdGate": [
186
+ "The parameters-only request is present on Data Manager main.",
187
+ "A Data Manager integration test proves authenticated app and data source resolution on main.",
188
+ "The canonical fixture version is bumped and both SDK suites pass the parameters-only request.",
189
+ "MITRA_DATA_SOURCE_ID and init-time data source resolution are deprecated before removal."
190
+ ]
191
+ },
192
+ "consumerRequirements": {
193
+ "@mitralab.io/sdk-core": { "successCases": "all", "responseValidationCases": "all" },
194
+ "@mitralab.io/functions-sdk": { "httpAdapterCases": "all" },
195
+ "mitra-functions-sdk": {
196
+ "successCases": "all",
197
+ "responseValidationCases": "all",
198
+ "httpAdapterCases": "all"
199
+ }
200
+ },
201
+ "cases": [
202
+ {
203
+ "id": "auth.me.success",
204
+ "kind": "success",
205
+ "operation": "auth.me",
206
+ "input": {},
207
+ "request": { "service": "auth", "method": "GET", "path": "/api/v1/auth/me" },
208
+ "response": {
209
+ "status": 200,
210
+ "body": {
211
+ "id": "user-1",
212
+ "tenant": {
213
+ "id": "tenant-1",
214
+ "shortId": "AAAAAAAAAAAAAAAAAAAAEA",
215
+ "legacyId": null,
216
+ "slug": "tenant-one",
217
+ "plan": { "id": "plan-1", "name": "Free" },
218
+ "name": "Tenant One",
219
+ "description": null,
220
+ "hexColor": null,
221
+ "icon": null,
222
+ "infraStatus": "ACTIVE",
223
+ "active": true
224
+ },
225
+ "name": "Test User",
226
+ "email": "user@example.com",
227
+ "imageUrl": null,
228
+ "onboardingCompleted": false
229
+ }
230
+ },
231
+ "expectedResult": {
232
+ "id": "user-1",
233
+ "tenant": {
234
+ "id": "tenant-1",
235
+ "shortId": "AAAAAAAAAAAAAAAAAAAAEA",
236
+ "legacyId": null,
237
+ "slug": "tenant-one",
238
+ "plan": { "id": "plan-1", "name": "Free" },
239
+ "name": "Tenant One",
240
+ "description": null,
241
+ "hexColor": null,
242
+ "icon": null,
243
+ "infraStatus": "ACTIVE",
244
+ "active": true
245
+ },
246
+ "name": "Test User",
247
+ "email": "user@example.com",
248
+ "imageUrl": null,
249
+ "onboardingCompleted": false
250
+ }
251
+ },
252
+ {
253
+ "id": "entities.list.success",
254
+ "kind": "success",
255
+ "operation": "entities.list",
256
+ "input": {
257
+ "table": "Order items",
258
+ "options": { "sort": "-created_at", "limit": 2, "skip": 4, "fields": ["id", "status"] }
259
+ },
260
+ "request": {
261
+ "service": "dataManager",
262
+ "method": "GET",
263
+ "path": "/api/v1/tables/Order%20items/records",
264
+ "params": { "sort": "-created_at", "limit": 2, "skip": 4, "fields": "id,status" }
265
+ },
266
+ "response": {
267
+ "status": 200,
268
+ "body": {
269
+ "data": [
270
+ { "id": "order-5", "status": "active" },
271
+ { "id": "order-6", "status": "pending" }
272
+ ],
273
+ "limit": 2,
274
+ "skip": 4,
275
+ "total": 8,
276
+ "hasMore": true
277
+ }
278
+ },
279
+ "expectedResult": [
280
+ { "id": "order-5", "status": "active" },
281
+ { "id": "order-6", "status": "pending" }
282
+ ]
283
+ },
284
+ {
285
+ "id": "entities.filter.success",
286
+ "kind": "success",
287
+ "operation": "entities.filter",
288
+ "input": {
289
+ "table": "Orders",
290
+ "query": { "status": "active" },
291
+ "sort": "name",
292
+ "limit": 5,
293
+ "skip": 0,
294
+ "fields": ["id", "status"]
295
+ },
296
+ "request": {
297
+ "service": "dataManager",
298
+ "method": "GET",
299
+ "path": "/api/v1/tables/Orders/records",
300
+ "params": {
301
+ "q": "{\"status\":\"active\"}",
302
+ "sort": "name",
303
+ "limit": 5,
304
+ "skip": 0,
305
+ "fields": "id,status"
306
+ }
307
+ },
308
+ "response": {
309
+ "status": 200,
310
+ "body": {
311
+ "data": [{ "id": "order-1", "status": "active" }],
312
+ "limit": 5,
313
+ "skip": 0,
314
+ "total": 1,
315
+ "hasMore": false
316
+ }
317
+ },
318
+ "expectedResult": [{ "id": "order-1", "status": "active" }]
319
+ },
320
+ {
321
+ "id": "entities.get.success",
322
+ "kind": "success",
323
+ "operation": "entities.get",
324
+ "input": { "table": "Orders", "id": "order/1" },
325
+ "request": {
326
+ "service": "dataManager",
327
+ "method": "GET",
328
+ "path": "/api/v1/tables/Orders/records/order%2F1"
329
+ },
330
+ "response": { "status": 200, "body": { "id": "order/1", "status": "active" } },
331
+ "expectedResult": { "id": "order/1", "status": "active" }
332
+ },
333
+ {
334
+ "id": "entities.create.success",
335
+ "kind": "success",
336
+ "operation": "entities.create",
337
+ "input": { "table": "Orders", "data": { "status": "draft" } },
338
+ "request": {
339
+ "service": "dataManager",
340
+ "method": "POST",
341
+ "path": "/api/v1/tables/Orders/records",
342
+ "body": { "status": "draft" }
343
+ },
344
+ "response": { "status": 201, "body": { "id": "order-2", "status": "draft" } },
345
+ "expectedResult": { "id": "order-2", "status": "draft" }
346
+ },
347
+ {
348
+ "id": "entities.bulk-create.success",
349
+ "kind": "success",
350
+ "operation": "entities.bulkCreate",
351
+ "input": { "table": "Orders", "data": [{ "status": "draft" }, { "status": "active" }] },
352
+ "request": {
353
+ "service": "dataManager",
354
+ "method": "POST",
355
+ "path": "/api/v1/tables/Orders/records/bulk",
356
+ "body": [{ "status": "draft" }, { "status": "active" }]
357
+ },
358
+ "response": {
359
+ "status": 201,
360
+ "body": [
361
+ { "id": "order-3", "status": "draft" },
362
+ { "id": "order-4", "status": "active" }
363
+ ]
364
+ },
365
+ "expectedResult": [
366
+ { "id": "order-3", "status": "draft" },
367
+ { "id": "order-4", "status": "active" }
368
+ ]
369
+ },
370
+ {
371
+ "id": "entities.update.success",
372
+ "kind": "success",
373
+ "operation": "entities.update",
374
+ "input": { "table": "Orders", "id": "order-2", "data": { "status": "active" } },
375
+ "request": {
376
+ "service": "dataManager",
377
+ "method": "PUT",
378
+ "path": "/api/v1/tables/Orders/records/order-2",
379
+ "body": { "status": "active" }
380
+ },
381
+ "response": { "status": 200, "body": { "id": "order-2", "status": "active" } },
382
+ "expectedResult": { "id": "order-2", "status": "active" }
383
+ },
384
+ {
385
+ "id": "entities.delete.success",
386
+ "kind": "success",
387
+ "operation": "entities.delete",
388
+ "input": { "table": "Orders", "id": "order-2" },
389
+ "request": {
390
+ "service": "dataManager",
391
+ "method": "DELETE",
392
+ "path": "/api/v1/tables/Orders/records/order-2"
393
+ },
394
+ "response": { "status": 204, "empty": true }
395
+ },
396
+ {
397
+ "id": "entities.delete-many.success",
398
+ "kind": "success",
399
+ "operation": "entities.deleteMany",
400
+ "input": { "table": "Orders", "query": { "status": "archived" } },
401
+ "request": {
402
+ "service": "dataManager",
403
+ "method": "DELETE",
404
+ "path": "/api/v1/tables/Orders/records",
405
+ "params": { "q": "{\"status\":\"archived\"}" }
406
+ },
407
+ "response": { "status": 200, "body": { "deleted": 2 } },
408
+ "expectedResult": { "deleted": 2 }
409
+ },
410
+ {
411
+ "id": "queries.execute.success",
412
+ "kind": "success",
413
+ "operation": "queries.execute",
414
+ "input": {
415
+ "id": "00000000-0000-4000-8000-000000000101",
416
+ "dataSourceId": "00000000-0000-4000-8000-000000000001",
417
+ "parameters": { "status": "active" }
418
+ },
419
+ "request": {
420
+ "service": "dataManager",
421
+ "method": "POST",
422
+ "path": "/api/v1/custom-queries/00000000-0000-4000-8000-000000000101/execute",
423
+ "body": {
424
+ "dataSourceId": "00000000-0000-4000-8000-000000000001",
425
+ "parameters": { "status": "active" }
426
+ }
427
+ },
428
+ "response": { "status": 200, "body": { "rows": [{ "total": 2 }], "durationMs": 7 } },
429
+ "expectedResult": { "rows": [{ "total": 2 }], "durationMs": 7 }
430
+ },
431
+ {
432
+ "id": "functions.execute.success",
433
+ "kind": "success",
434
+ "operation": "functions.execute",
435
+ "input": { "id": "00000000-0000-4000-8000-000000000201", "body": { "orderId": "order-1" } },
436
+ "request": {
437
+ "service": "functions",
438
+ "method": "POST",
439
+ "path": "/api/v1/functions/00000000-0000-4000-8000-000000000201/execute",
440
+ "headers": { "X-Invocation-Type": "sync" },
441
+ "body": { "input": { "orderId": "order-1" } }
442
+ },
443
+ "response": {
444
+ "status": 200,
445
+ "body": {
446
+ "id": "00000000-0000-4000-8000-000000000301",
447
+ "functionId": "00000000-0000-4000-8000-000000000201",
448
+ "functionVersionId": "00000000-0000-4000-8000-000000000211",
449
+ "status": "SUCCESS",
450
+ "input": { "orderId": "order-1" },
451
+ "output": { "ok": true },
452
+ "errorMessage": null,
453
+ "logs": null,
454
+ "durationMs": 10,
455
+ "startedAt": "2026-08-14T20:00:00Z",
456
+ "finishedAt": "2026-08-14T20:00:01Z",
457
+ "createdAt": "2026-08-14T20:00:00Z"
458
+ }
459
+ },
460
+ "expectedResult": {
461
+ "id": "00000000-0000-4000-8000-000000000301",
462
+ "functionId": "00000000-0000-4000-8000-000000000201",
463
+ "functionVersionId": "00000000-0000-4000-8000-000000000211",
464
+ "status": "SUCCESS",
465
+ "input": { "orderId": "order-1" },
466
+ "output": { "ok": true },
467
+ "errorMessage": null,
468
+ "logs": null,
469
+ "durationMs": 10,
470
+ "startedAt": "2026-08-14T20:00:00Z",
471
+ "finishedAt": "2026-08-14T20:00:01Z",
472
+ "createdAt": "2026-08-14T20:00:00Z"
473
+ }
474
+ },
475
+ {
476
+ "id": "functions.execute-async.success",
477
+ "kind": "success",
478
+ "operation": "functions.executeAsync",
479
+ "input": { "id": "00000000-0000-4000-8000-000000000201", "body": { "orderId": "order-2" } },
480
+ "request": {
481
+ "service": "functions",
482
+ "method": "POST",
483
+ "path": "/api/v1/functions/00000000-0000-4000-8000-000000000201/execute",
484
+ "headers": { "X-Invocation-Type": "async" },
485
+ "body": { "input": { "orderId": "order-2" } }
486
+ },
487
+ "response": {
488
+ "status": 202,
489
+ "body": {
490
+ "id": "00000000-0000-4000-8000-000000000302",
491
+ "functionId": "00000000-0000-4000-8000-000000000201",
492
+ "functionVersionId": "00000000-0000-4000-8000-000000000211",
493
+ "status": "PENDING",
494
+ "input": { "orderId": "order-2" },
495
+ "output": null,
496
+ "errorMessage": null,
497
+ "logs": null,
498
+ "durationMs": null,
499
+ "startedAt": null,
500
+ "finishedAt": null,
501
+ "createdAt": "2026-08-14T20:01:00Z"
502
+ }
503
+ },
504
+ "expectedResult": {
505
+ "id": "00000000-0000-4000-8000-000000000302",
506
+ "functionId": "00000000-0000-4000-8000-000000000201",
507
+ "functionVersionId": "00000000-0000-4000-8000-000000000211",
508
+ "status": "PENDING",
509
+ "input": { "orderId": "order-2" },
510
+ "output": null,
511
+ "errorMessage": null,
512
+ "logs": null,
513
+ "durationMs": null,
514
+ "startedAt": null,
515
+ "finishedAt": null,
516
+ "createdAt": "2026-08-14T20:01:00Z"
517
+ }
518
+ },
519
+ {
520
+ "id": "functions.get-execution.success",
521
+ "kind": "success",
522
+ "operation": "functions.getExecution",
523
+ "input": { "id": "00000000-0000-4000-8000-000000000302" },
524
+ "request": {
525
+ "service": "functions",
526
+ "method": "GET",
527
+ "path": "/api/v1/executions/00000000-0000-4000-8000-000000000302"
528
+ },
529
+ "response": {
530
+ "status": 200,
531
+ "body": {
532
+ "id": "00000000-0000-4000-8000-000000000302",
533
+ "functionId": "00000000-0000-4000-8000-000000000201",
534
+ "functionVersionId": "00000000-0000-4000-8000-000000000211",
535
+ "status": "SUCCESS",
536
+ "input": { "orderId": "order-2" },
537
+ "output": { "ok": true },
538
+ "errorMessage": null,
539
+ "logs": "done",
540
+ "durationMs": 12,
541
+ "startedAt": "2026-08-14T20:01:00Z",
542
+ "finishedAt": "2026-08-14T20:01:01Z",
543
+ "createdAt": "2026-08-14T20:01:00Z"
544
+ }
545
+ },
546
+ "expectedResult": {
547
+ "id": "00000000-0000-4000-8000-000000000302",
548
+ "functionId": "00000000-0000-4000-8000-000000000201",
549
+ "functionVersionId": "00000000-0000-4000-8000-000000000211",
550
+ "status": "SUCCESS",
551
+ "input": { "orderId": "order-2" },
552
+ "output": { "ok": true },
553
+ "errorMessage": null,
554
+ "logs": "done",
555
+ "durationMs": 12,
556
+ "startedAt": "2026-08-14T20:01:00Z",
557
+ "finishedAt": "2026-08-14T20:01:01Z",
558
+ "createdAt": "2026-08-14T20:01:00Z"
559
+ }
560
+ },
561
+ {
562
+ "id": "functions.cancel-execution.success",
563
+ "kind": "success",
564
+ "operation": "functions.cancelExecution",
565
+ "input": { "id": "00000000-0000-4000-8000-000000000302" },
566
+ "request": {
567
+ "service": "functions",
568
+ "method": "POST",
569
+ "path": "/api/v1/executions/00000000-0000-4000-8000-000000000302/cancel"
570
+ },
571
+ "response": { "status": 204, "empty": true }
572
+ },
573
+ {
574
+ "id": "integration.execute.success",
575
+ "kind": "success",
576
+ "operation": "integration.execute",
577
+ "input": {
578
+ "id": "00000000-0000-4000-8000-000000000401",
579
+ "proxyRequest": {
580
+ "method": "POST",
581
+ "endpoint": "/orders",
582
+ "headers": { "x-client": "sdk" },
583
+ "body": { "id": "order-1" },
584
+ "queryParams": { "dryRun": true }
585
+ }
586
+ },
587
+ "request": {
588
+ "service": "integration",
589
+ "method": "POST",
590
+ "path": "/api/v1/proxy/template-configs/00000000-0000-4000-8000-000000000401/execute",
591
+ "body": {
592
+ "method": "POST",
593
+ "endpoint": "/orders",
594
+ "headers": { "x-client": "sdk" },
595
+ "body": { "id": "order-1" },
596
+ "queryParams": { "dryRun": true },
597
+ "source": "SDK"
598
+ }
599
+ },
600
+ "response": {
601
+ "status": 200,
602
+ "body": {
603
+ "status": 201,
604
+ "headers": { "content-type": "application/json" },
605
+ "body": { "id": "remote-order-1" },
606
+ "durationMs": 18,
607
+ "executionId": "integration-execution-1"
608
+ }
609
+ },
610
+ "expectedResult": {
611
+ "status": 201,
612
+ "headers": { "content-type": "application/json" },
613
+ "body": { "id": "remote-order-1" },
614
+ "durationMs": 18,
615
+ "executionId": "integration-execution-1"
616
+ }
617
+ },
618
+ {
619
+ "id": "integration.execute-resource.success",
620
+ "kind": "success",
621
+ "operation": "integration.executeResource",
622
+ "input": { "id": "00000000-0000-4000-8000-000000000402", "parameters": { "limit": 10 } },
623
+ "request": {
624
+ "service": "integration",
625
+ "method": "POST",
626
+ "path": "/api/v1/proxy/resources/00000000-0000-4000-8000-000000000402/execute",
627
+ "body": { "params": { "limit": 10 } }
628
+ },
629
+ "response": {
630
+ "status": 200,
631
+ "body": {
632
+ "status": 200,
633
+ "headers": { "content-type": "application/json" },
634
+ "body": { "ok": true },
635
+ "durationMs": 20,
636
+ "executionId": "integration-execution-2"
637
+ }
638
+ },
639
+ "expectedResult": {
640
+ "status": 200,
641
+ "headers": { "content-type": "application/json" },
642
+ "body": { "ok": true },
643
+ "durationMs": 20,
644
+ "executionId": "integration-execution-2"
645
+ }
646
+ }
647
+ ],
648
+ "responseValidationCases": [
649
+ {
650
+ "id": "queries.execute.invalid-payload",
651
+ "kind": "invalid-payload",
652
+ "operation": "queries.execute",
653
+ "input": {
654
+ "id": "00000000-0000-4000-8000-000000000101",
655
+ "dataSourceId": "00000000-0000-4000-8000-000000000001",
656
+ "parameters": {}
657
+ },
658
+ "request": {
659
+ "service": "dataManager",
660
+ "method": "POST",
661
+ "path": "/api/v1/custom-queries/00000000-0000-4000-8000-000000000101/execute",
662
+ "body": { "dataSourceId": "00000000-0000-4000-8000-000000000001", "parameters": {} }
663
+ },
664
+ "response": { "status": 200, "body": { "rows": [{ "total": 2 }], "durationMs": "7" } },
665
+ "expectedError": {
666
+ "type": "response",
667
+ "status": 200,
668
+ "code": "INVALID_RESPONSE",
669
+ "message": "Query execution response has an invalid durationMs field",
670
+ "details": null,
671
+ "requestId": null,
672
+ "retryable": false
673
+ }
674
+ }
675
+ ],
676
+ "httpAdapterCases": [
677
+ {
678
+ "id": "queries.execute.data-source-not-found",
679
+ "kind": "api-4xx",
680
+ "operation": "queries.execute",
681
+ "input": {
682
+ "id": "00000000-0000-4000-8000-000000000103",
683
+ "dataSourceId": "00000000-0000-4000-8000-000000000001",
684
+ "parameters": {}
685
+ },
686
+ "verification": {
687
+ "owner": "concrete-sdk-http-adapter",
688
+ "coreExecutable": false,
689
+ "requiredConsumers": ["@mitralab.io/functions-sdk", "mitra-functions-sdk"]
690
+ },
691
+ "source": {
692
+ "service": "mitra-data-manager",
693
+ "commit": "ee49949c362f87ac9a8dbb38117236cee842f2ed",
694
+ "handler": "GlobalExceptionHandler.handleNotFound",
695
+ "useCase": "ExecuteSqlUseCase.execute",
696
+ "integrationTest": "CustomQueryControllerTest.Execute.execute_withDataSourceAssociatedToAnotherApp_shouldFailClosed"
697
+ },
698
+ "request": {
699
+ "service": "dataManager",
700
+ "method": "POST",
701
+ "path": "/api/v1/custom-queries/00000000-0000-4000-8000-000000000103/execute",
702
+ "body": { "dataSourceId": "00000000-0000-4000-8000-000000000001", "parameters": {} }
703
+ },
704
+ "response": {
705
+ "status": 404,
706
+ "body": {
707
+ "error_code": "NOT_FOUND",
708
+ "message": "The Custom Query data source was not found for the authenticated app"
709
+ }
710
+ },
711
+ "expectedError": {
712
+ "type": "api",
713
+ "status": 404,
714
+ "code": "NOT_FOUND",
715
+ "message": "The Custom Query data source was not found for the authenticated app",
716
+ "details": null,
717
+ "requestId": null,
718
+ "retryable": false
719
+ }
720
+ },
721
+ {
722
+ "id": "queries.execute.database-unavailable",
723
+ "kind": "api-5xx",
724
+ "operation": "queries.execute",
725
+ "input": {
726
+ "id": "00000000-0000-4000-8000-000000000101",
727
+ "dataSourceId": "00000000-0000-4000-8000-000000000001",
728
+ "parameters": {}
729
+ },
730
+ "verification": {
731
+ "owner": "concrete-sdk-http-adapter",
732
+ "coreExecutable": false,
733
+ "requiredConsumers": ["@mitralab.io/functions-sdk", "mitra-functions-sdk"]
734
+ },
735
+ "source": {
736
+ "service": "mitra-data-manager",
737
+ "commit": "ee49949c362f87ac9a8dbb38117236cee842f2ed",
738
+ "handler": "GlobalExceptionHandler.handleDatabaseException"
739
+ },
740
+ "request": {
741
+ "service": "dataManager",
742
+ "method": "POST",
743
+ "path": "/api/v1/custom-queries/00000000-0000-4000-8000-000000000101/execute",
744
+ "body": { "dataSourceId": "00000000-0000-4000-8000-000000000001", "parameters": {} }
745
+ },
746
+ "response": {
747
+ "status": 503,
748
+ "body": {
749
+ "error_code": "DATABASE_ERROR",
750
+ "message": "Failed to connect to database. Please check your connection settings.",
751
+ "details": "Connection refused"
752
+ }
753
+ },
754
+ "expectedError": {
755
+ "type": "api",
756
+ "status": 503,
757
+ "code": "DATABASE_ERROR",
758
+ "message": "Failed to connect to database. Please check your connection settings.",
759
+ "details": "Connection refused",
760
+ "requestId": null,
761
+ "retryable": true
762
+ }
763
+ },
764
+ {
765
+ "id": "auth.me.timeout",
766
+ "kind": "timeout",
767
+ "operation": "auth.me",
768
+ "input": {},
769
+ "verification": {
770
+ "owner": "concrete-sdk-http-adapter",
771
+ "coreExecutable": false,
772
+ "requiredConsumers": ["@mitralab.io/functions-sdk", "mitra-functions-sdk"]
773
+ },
774
+ "request": { "service": "auth", "method": "GET", "path": "/api/v1/auth/me" },
775
+ "failure": { "type": "timeout" },
776
+ "expectedError": {
777
+ "type": "network",
778
+ "status": 0,
779
+ "code": "REQUEST_TIMEOUT",
780
+ "message": "Mitra request timed out",
781
+ "details": null,
782
+ "requestId": null,
783
+ "retryable": true
784
+ }
785
+ }
786
+ ]
787
+ }