haystack-contracts 1.0.1 → 1.0.4
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 +76 -8
- package/dist/index.d.mts +366 -103
- package/dist/index.d.ts +366 -103
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/openapi.json +313 -34
- package/package.json +2 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/openapi.json
CHANGED
|
@@ -51,8 +51,13 @@
|
|
|
51
51
|
"example": {
|
|
52
52
|
"success": false,
|
|
53
53
|
"statusCode": 400,
|
|
54
|
-
"
|
|
55
|
-
"
|
|
54
|
+
"data": null,
|
|
55
|
+
"error": {
|
|
56
|
+
"message": "email must be an email",
|
|
57
|
+
"error": "Bad Request"
|
|
58
|
+
},
|
|
59
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
60
|
+
"path": "/api/v1/resource"
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
}
|
|
@@ -64,8 +69,12 @@
|
|
|
64
69
|
"example": {
|
|
65
70
|
"success": false,
|
|
66
71
|
"statusCode": 401,
|
|
67
|
-
"
|
|
68
|
-
"
|
|
72
|
+
"data": null,
|
|
73
|
+
"error": {
|
|
74
|
+
"message": "Unauthorized"
|
|
75
|
+
},
|
|
76
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
77
|
+
"path": "/api/v1/resource"
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
80
|
}
|
|
@@ -118,8 +127,12 @@
|
|
|
118
127
|
"example": {
|
|
119
128
|
"success": false,
|
|
120
129
|
"statusCode": 401,
|
|
121
|
-
"
|
|
122
|
-
"
|
|
130
|
+
"data": null,
|
|
131
|
+
"error": {
|
|
132
|
+
"message": "Unauthorized"
|
|
133
|
+
},
|
|
134
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
135
|
+
"path": "/api/v1/resource"
|
|
123
136
|
}
|
|
124
137
|
}
|
|
125
138
|
}
|
|
@@ -181,8 +194,13 @@
|
|
|
181
194
|
"example": {
|
|
182
195
|
"success": false,
|
|
183
196
|
"statusCode": 400,
|
|
184
|
-
"
|
|
185
|
-
"
|
|
197
|
+
"data": null,
|
|
198
|
+
"error": {
|
|
199
|
+
"message": "email must be an email",
|
|
200
|
+
"error": "Bad Request"
|
|
201
|
+
},
|
|
202
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
203
|
+
"path": "/api/v1/resource"
|
|
186
204
|
}
|
|
187
205
|
}
|
|
188
206
|
}
|
|
@@ -194,8 +212,12 @@
|
|
|
194
212
|
"example": {
|
|
195
213
|
"success": false,
|
|
196
214
|
"statusCode": 401,
|
|
197
|
-
"
|
|
198
|
-
"
|
|
215
|
+
"data": null,
|
|
216
|
+
"error": {
|
|
217
|
+
"message": "Unauthorized"
|
|
218
|
+
},
|
|
219
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
220
|
+
"path": "/api/v1/resource"
|
|
199
221
|
}
|
|
200
222
|
}
|
|
201
223
|
}
|
|
@@ -207,8 +229,13 @@
|
|
|
207
229
|
"example": {
|
|
208
230
|
"success": false,
|
|
209
231
|
"statusCode": 404,
|
|
210
|
-
"
|
|
211
|
-
"
|
|
232
|
+
"data": null,
|
|
233
|
+
"error": {
|
|
234
|
+
"message": "Robot not found",
|
|
235
|
+
"error": "Not Found"
|
|
236
|
+
},
|
|
237
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
238
|
+
"path": "/api/v1/resource"
|
|
212
239
|
}
|
|
213
240
|
}
|
|
214
241
|
}
|
|
@@ -218,6 +245,137 @@
|
|
|
218
245
|
"tags": ["robots"]
|
|
219
246
|
}
|
|
220
247
|
},
|
|
248
|
+
"/robots/{id}/assign": {
|
|
249
|
+
"patch": {
|
|
250
|
+
"description": "Updates the robot tenant and optional fleet assignment. Use fleetId null to leave the robot unassigned.",
|
|
251
|
+
"parameters": [
|
|
252
|
+
{
|
|
253
|
+
"name": "id",
|
|
254
|
+
"required": true,
|
|
255
|
+
"in": "path",
|
|
256
|
+
"description": "UUID of the robot to assign.",
|
|
257
|
+
"schema": {
|
|
258
|
+
"example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
259
|
+
"type": "string"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"requestBody": {
|
|
264
|
+
"required": true,
|
|
265
|
+
"content": {
|
|
266
|
+
"application/json": {
|
|
267
|
+
"schema": {
|
|
268
|
+
"$ref": "#/components/schemas/AssignRobotDto"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"responses": {
|
|
274
|
+
"200": {
|
|
275
|
+
"description": "Robot assignment updated.",
|
|
276
|
+
"content": {
|
|
277
|
+
"application/json": {
|
|
278
|
+
"schema": {
|
|
279
|
+
"type": "object",
|
|
280
|
+
"required": ["success", "statusCode", "data", "timestamp"],
|
|
281
|
+
"properties": {
|
|
282
|
+
"success": {
|
|
283
|
+
"type": "boolean",
|
|
284
|
+
"example": true
|
|
285
|
+
},
|
|
286
|
+
"statusCode": {
|
|
287
|
+
"type": "integer",
|
|
288
|
+
"example": 200
|
|
289
|
+
},
|
|
290
|
+
"timestamp": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"format": "date-time",
|
|
293
|
+
"example": "2026-05-29T12:00:00.000Z"
|
|
294
|
+
},
|
|
295
|
+
"data": {
|
|
296
|
+
"$ref": "#/components/schemas/RobotListItemDto"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"400": {
|
|
304
|
+
"description": "Validation failed. Check that all required fields are present and correctly typed.",
|
|
305
|
+
"content": {
|
|
306
|
+
"application/json": {
|
|
307
|
+
"example": {
|
|
308
|
+
"success": false,
|
|
309
|
+
"statusCode": 400,
|
|
310
|
+
"data": null,
|
|
311
|
+
"error": {
|
|
312
|
+
"message": "email must be an email",
|
|
313
|
+
"error": "Bad Request"
|
|
314
|
+
},
|
|
315
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
316
|
+
"path": "/api/v1/resource"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"401": {
|
|
322
|
+
"description": "Authentication required. Provide a valid bearer token.",
|
|
323
|
+
"content": {
|
|
324
|
+
"application/json": {
|
|
325
|
+
"example": {
|
|
326
|
+
"success": false,
|
|
327
|
+
"statusCode": 401,
|
|
328
|
+
"data": null,
|
|
329
|
+
"error": {
|
|
330
|
+
"message": "Unauthorized"
|
|
331
|
+
},
|
|
332
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
333
|
+
"path": "/api/v1/resource"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"403": {
|
|
339
|
+
"description": "Requires the `robots.manage` permission.",
|
|
340
|
+
"content": {
|
|
341
|
+
"application/json": {
|
|
342
|
+
"example": {
|
|
343
|
+
"success": false,
|
|
344
|
+
"statusCode": 403,
|
|
345
|
+
"data": null,
|
|
346
|
+
"error": {
|
|
347
|
+
"message": "Insufficient permissions",
|
|
348
|
+
"error": "Forbidden"
|
|
349
|
+
},
|
|
350
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
351
|
+
"path": "/api/v1/resource"
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"404": {
|
|
357
|
+
"description": "Robot, tenant, or fleet not found in the current tenant.",
|
|
358
|
+
"content": {
|
|
359
|
+
"application/json": {
|
|
360
|
+
"example": {
|
|
361
|
+
"success": false,
|
|
362
|
+
"statusCode": 404,
|
|
363
|
+
"data": null,
|
|
364
|
+
"error": {
|
|
365
|
+
"message": "Robot, tenant, or fleet not found",
|
|
366
|
+
"error": "Not Found"
|
|
367
|
+
},
|
|
368
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
369
|
+
"path": "/api/v1/resource"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"summary": "Assign a robot to a tenant and fleet",
|
|
376
|
+
"tags": ["robots"]
|
|
377
|
+
}
|
|
378
|
+
},
|
|
221
379
|
"/metrics/types": {
|
|
222
380
|
"get": {
|
|
223
381
|
"description": "Returns the full registry of metric types from the analytics store. Each entry includes an integer id, a human-readable name, and a description. Any authenticated user can access this endpoint.",
|
|
@@ -261,8 +419,12 @@
|
|
|
261
419
|
"example": {
|
|
262
420
|
"success": false,
|
|
263
421
|
"statusCode": 401,
|
|
264
|
-
"
|
|
265
|
-
"
|
|
422
|
+
"data": null,
|
|
423
|
+
"error": {
|
|
424
|
+
"message": "Unauthorized"
|
|
425
|
+
},
|
|
426
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
427
|
+
"path": "/api/v1/resource"
|
|
266
428
|
}
|
|
267
429
|
}
|
|
268
430
|
}
|
|
@@ -337,8 +499,13 @@
|
|
|
337
499
|
"example": {
|
|
338
500
|
"success": false,
|
|
339
501
|
"statusCode": 400,
|
|
340
|
-
"
|
|
341
|
-
"
|
|
502
|
+
"data": null,
|
|
503
|
+
"error": {
|
|
504
|
+
"message": "email must be an email",
|
|
505
|
+
"error": "Bad Request"
|
|
506
|
+
},
|
|
507
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
508
|
+
"path": "/api/v1/resource"
|
|
342
509
|
}
|
|
343
510
|
}
|
|
344
511
|
}
|
|
@@ -350,8 +517,12 @@
|
|
|
350
517
|
"example": {
|
|
351
518
|
"success": false,
|
|
352
519
|
"statusCode": 401,
|
|
353
|
-
"
|
|
354
|
-
"
|
|
520
|
+
"data": null,
|
|
521
|
+
"error": {
|
|
522
|
+
"message": "Unauthorized"
|
|
523
|
+
},
|
|
524
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
525
|
+
"path": "/api/v1/resource"
|
|
355
526
|
}
|
|
356
527
|
}
|
|
357
528
|
}
|
|
@@ -404,8 +575,12 @@
|
|
|
404
575
|
"example": {
|
|
405
576
|
"success": false,
|
|
406
577
|
"statusCode": 401,
|
|
407
|
-
"
|
|
408
|
-
"
|
|
578
|
+
"data": null,
|
|
579
|
+
"error": {
|
|
580
|
+
"message": "Unauthorized"
|
|
581
|
+
},
|
|
582
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
583
|
+
"path": "/api/v1/resource"
|
|
409
584
|
}
|
|
410
585
|
}
|
|
411
586
|
}
|
|
@@ -458,8 +633,12 @@
|
|
|
458
633
|
"example": {
|
|
459
634
|
"success": false,
|
|
460
635
|
"statusCode": 401,
|
|
461
|
-
"
|
|
462
|
-
"
|
|
636
|
+
"data": null,
|
|
637
|
+
"error": {
|
|
638
|
+
"message": "Unauthorized"
|
|
639
|
+
},
|
|
640
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
641
|
+
"path": "/api/v1/resource"
|
|
463
642
|
}
|
|
464
643
|
}
|
|
465
644
|
}
|
|
@@ -533,8 +712,13 @@
|
|
|
533
712
|
"example": {
|
|
534
713
|
"success": false,
|
|
535
714
|
"statusCode": 400,
|
|
536
|
-
"
|
|
537
|
-
"
|
|
715
|
+
"data": null,
|
|
716
|
+
"error": {
|
|
717
|
+
"message": "email must be an email",
|
|
718
|
+
"error": "Bad Request"
|
|
719
|
+
},
|
|
720
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
721
|
+
"path": "/api/v1/resource"
|
|
538
722
|
}
|
|
539
723
|
}
|
|
540
724
|
}
|
|
@@ -546,8 +730,12 @@
|
|
|
546
730
|
"example": {
|
|
547
731
|
"success": false,
|
|
548
732
|
"statusCode": 401,
|
|
549
|
-
"
|
|
550
|
-
"
|
|
733
|
+
"data": null,
|
|
734
|
+
"error": {
|
|
735
|
+
"message": "Unauthorized"
|
|
736
|
+
},
|
|
737
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
738
|
+
"path": "/api/v1/resource"
|
|
551
739
|
}
|
|
552
740
|
}
|
|
553
741
|
}
|
|
@@ -597,8 +785,12 @@
|
|
|
597
785
|
"example": {
|
|
598
786
|
"success": false,
|
|
599
787
|
"statusCode": 401,
|
|
600
|
-
"
|
|
601
|
-
"
|
|
788
|
+
"data": null,
|
|
789
|
+
"error": {
|
|
790
|
+
"message": "Unauthorized"
|
|
791
|
+
},
|
|
792
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
793
|
+
"path": "/api/v1/resource"
|
|
602
794
|
}
|
|
603
795
|
}
|
|
604
796
|
}
|
|
@@ -648,8 +840,12 @@
|
|
|
648
840
|
"example": {
|
|
649
841
|
"success": false,
|
|
650
842
|
"statusCode": 401,
|
|
651
|
-
"
|
|
652
|
-
"
|
|
843
|
+
"data": null,
|
|
844
|
+
"error": {
|
|
845
|
+
"message": "Unauthorized"
|
|
846
|
+
},
|
|
847
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
848
|
+
"path": "/api/v1/resource"
|
|
653
849
|
}
|
|
654
850
|
}
|
|
655
851
|
}
|
|
@@ -699,8 +895,12 @@
|
|
|
699
895
|
"example": {
|
|
700
896
|
"success": false,
|
|
701
897
|
"statusCode": 401,
|
|
702
|
-
"
|
|
703
|
-
"
|
|
898
|
+
"data": null,
|
|
899
|
+
"error": {
|
|
900
|
+
"message": "Unauthorized"
|
|
901
|
+
},
|
|
902
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
903
|
+
"path": "/api/v1/resource"
|
|
704
904
|
}
|
|
705
905
|
}
|
|
706
906
|
}
|
|
@@ -750,8 +950,12 @@
|
|
|
750
950
|
"example": {
|
|
751
951
|
"success": false,
|
|
752
952
|
"statusCode": 401,
|
|
753
|
-
"
|
|
754
|
-
"
|
|
953
|
+
"data": null,
|
|
954
|
+
"error": {
|
|
955
|
+
"message": "Unauthorized"
|
|
956
|
+
},
|
|
957
|
+
"timestamp": "2026-05-29T12:00:00.000Z",
|
|
958
|
+
"path": "/api/v1/resource"
|
|
755
959
|
}
|
|
756
960
|
}
|
|
757
961
|
}
|
|
@@ -802,6 +1006,35 @@
|
|
|
802
1006
|
],
|
|
803
1007
|
"components": {
|
|
804
1008
|
"schemas": {
|
|
1009
|
+
"AssignRobotDto": {
|
|
1010
|
+
"type": "object",
|
|
1011
|
+
"properties": {
|
|
1012
|
+
"workspaceId": {
|
|
1013
|
+
"type": "string",
|
|
1014
|
+
"nullable": true,
|
|
1015
|
+
"description": "Workspace UUID. Tenant admin may set any workspace; workspace admin may only set their own workspace(s). Lower roles must omit this field."
|
|
1016
|
+
},
|
|
1017
|
+
"facilityId": {
|
|
1018
|
+
"type": "string",
|
|
1019
|
+
"nullable": true,
|
|
1020
|
+
"description": "Facility UUID. Null unassigns from facility (UNASSIGNED)."
|
|
1021
|
+
},
|
|
1022
|
+
"fleetId": {
|
|
1023
|
+
"type": "string",
|
|
1024
|
+
"nullable": true,
|
|
1025
|
+
"description": "Fleet UUID. Null unassigns from fleet."
|
|
1026
|
+
},
|
|
1027
|
+
"isSubscribed": {
|
|
1028
|
+
"type": "boolean"
|
|
1029
|
+
},
|
|
1030
|
+
"changedBy": {
|
|
1031
|
+
"type": "string"
|
|
1032
|
+
},
|
|
1033
|
+
"changeReason": {
|
|
1034
|
+
"type": "string"
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
805
1038
|
"AuthResponseDto": {
|
|
806
1039
|
"type": "object",
|
|
807
1040
|
"properties": {
|
|
@@ -1112,6 +1345,16 @@
|
|
|
1112
1345
|
"type": "string",
|
|
1113
1346
|
"nullable": true
|
|
1114
1347
|
},
|
|
1348
|
+
"createdBy": {
|
|
1349
|
+
"type": "string",
|
|
1350
|
+
"nullable": true,
|
|
1351
|
+
"description": "UUID of user who created this record."
|
|
1352
|
+
},
|
|
1353
|
+
"updatedBy": {
|
|
1354
|
+
"type": "string",
|
|
1355
|
+
"nullable": true,
|
|
1356
|
+
"description": "UUID of user who last updated this record."
|
|
1357
|
+
},
|
|
1115
1358
|
"createdAt": {
|
|
1116
1359
|
"format": "date-time",
|
|
1117
1360
|
"type": "string",
|
|
@@ -1206,6 +1449,30 @@
|
|
|
1206
1449
|
"description": "Human-readable display name for the robot.",
|
|
1207
1450
|
"example": "Warehouse Bot Alpha"
|
|
1208
1451
|
},
|
|
1452
|
+
"workspaceId": {
|
|
1453
|
+
"type": "string",
|
|
1454
|
+
"description": "UUID of the workspace this robot is assigned to.",
|
|
1455
|
+
"example": "b2000000-0000-4000-8000-000000000002",
|
|
1456
|
+
"nullable": true
|
|
1457
|
+
},
|
|
1458
|
+
"workspaceName": {
|
|
1459
|
+
"type": "string",
|
|
1460
|
+
"description": "Name of the workspace this robot is assigned to.",
|
|
1461
|
+
"example": "North Hospital Cluster",
|
|
1462
|
+
"nullable": true
|
|
1463
|
+
},
|
|
1464
|
+
"facilityId": {
|
|
1465
|
+
"type": "string",
|
|
1466
|
+
"description": "UUID of the facility this robot is assigned to.",
|
|
1467
|
+
"example": "c3000000-0000-4000-8000-000000000003",
|
|
1468
|
+
"nullable": true
|
|
1469
|
+
},
|
|
1470
|
+
"facilityName": {
|
|
1471
|
+
"type": "string",
|
|
1472
|
+
"description": "Name of the facility this robot is assigned to.",
|
|
1473
|
+
"example": "City General Hospital",
|
|
1474
|
+
"nullable": true
|
|
1475
|
+
},
|
|
1209
1476
|
"fleetId": {
|
|
1210
1477
|
"type": "string",
|
|
1211
1478
|
"description": "UUID of the fleet this robot is assigned to.",
|
|
@@ -1295,6 +1562,18 @@
|
|
|
1295
1562
|
"description": "ISO-8601 timestamp of the last received status stream update, or null.",
|
|
1296
1563
|
"example": "2026-05-20T10:00:00.000Z",
|
|
1297
1564
|
"nullable": true
|
|
1565
|
+
},
|
|
1566
|
+
"botVersion": {
|
|
1567
|
+
"type": "string",
|
|
1568
|
+
"description": "Software version currently running on the robot, or null if not yet received.",
|
|
1569
|
+
"example": "2.0.84",
|
|
1570
|
+
"nullable": true
|
|
1571
|
+
},
|
|
1572
|
+
"botModel": {
|
|
1573
|
+
"type": "string",
|
|
1574
|
+
"description": "Hardware model of the robot, or null if not yet identified.",
|
|
1575
|
+
"example": "Violet Gen 4 AI",
|
|
1576
|
+
"nullable": true
|
|
1298
1577
|
}
|
|
1299
1578
|
},
|
|
1300
1579
|
"required": ["id", "tenantId", "name", "isSubscribed"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haystack-contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Haystack public API — TypeScript types, path constants, and OpenAPI spec for frontend integrations",
|
|
5
5
|
"author": "Haystack Robotics",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@haystack/typescript-config": "workspace:*",
|
|
48
48
|
"openapi-typescript": "^7.8.0",
|
|
49
|
+
"prettier": "catalog:",
|
|
49
50
|
"ts-node": "catalog:",
|
|
50
51
|
"tsup": "catalog:",
|
|
51
52
|
"typescript": "catalog:"
|