@vuoma/sdk 0.1.1 → 0.2.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,1343 @@
1
+ // Generated from reviewed API contracts. Run npm run api:generate; do not edit.
2
+ function freeze_contract(value) {
3
+ if (value && typeof value === 'object' && !Object.isFrozen(value)) {
4
+ for (const child of Object.values(value)) freeze_contract(child)
5
+ Object.freeze(value)
6
+ }
7
+ return value
8
+ }
9
+ export const organizationReadContracts = freeze_contract([
10
+ {
11
+ "id": "organization.read",
12
+ "method": "GET",
13
+ "path_template": "/api/v1/o/{organization_slug}",
14
+ "summary": "Read the current organization",
15
+ "authorization": {
16
+ "kind": "organization_member",
17
+ "permission_scope": "organization",
18
+ "any_permissions": []
19
+ },
20
+ "credential_kinds": [
21
+ "session",
22
+ "api_token",
23
+ "remote_agent"
24
+ ],
25
+ "query_schema": {
26
+ "type": "object",
27
+ "properties": {},
28
+ "additionalProperties": false,
29
+ "required": []
30
+ },
31
+ "response_schema": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": [
35
+ "api_version",
36
+ "data"
37
+ ],
38
+ "properties": {
39
+ "api_version": {
40
+ "type": "integer",
41
+ "const": 1
42
+ },
43
+ "data": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": [
47
+ "organization",
48
+ "access"
49
+ ],
50
+ "properties": {
51
+ "organization": {
52
+ "type": "object",
53
+ "additionalProperties": true,
54
+ "required": [
55
+ "id",
56
+ "slug",
57
+ "name",
58
+ "timezone",
59
+ "currency_code"
60
+ ],
61
+ "properties": {
62
+ "id": {
63
+ "type": "string",
64
+ "format": "uuid"
65
+ },
66
+ "slug": {
67
+ "type": "string"
68
+ },
69
+ "name": {
70
+ "type": "string"
71
+ },
72
+ "timezone": {
73
+ "type": "string"
74
+ },
75
+ "currency_code": {
76
+ "type": "string"
77
+ },
78
+ "brand_name": {
79
+ "anyOf": [
80
+ {
81
+ "type": "string"
82
+ },
83
+ {
84
+ "type": "null"
85
+ }
86
+ ]
87
+ }
88
+ }
89
+ },
90
+ "access": {
91
+ "type": "object",
92
+ "additionalProperties": true
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ },
99
+ {
100
+ "id": "locations.read",
101
+ "method": "GET",
102
+ "path_template": "/api/v1/o/{organization_slug}/locations",
103
+ "summary": "List organization locations",
104
+ "authorization": {
105
+ "kind": "organization_member",
106
+ "permission_scope": "organization",
107
+ "any_permissions": []
108
+ },
109
+ "credential_kinds": [
110
+ "session",
111
+ "api_token",
112
+ "remote_agent"
113
+ ],
114
+ "query_schema": {
115
+ "type": "object",
116
+ "properties": {},
117
+ "additionalProperties": false,
118
+ "required": []
119
+ },
120
+ "response_schema": {
121
+ "type": "object",
122
+ "additionalProperties": false,
123
+ "required": [
124
+ "api_version",
125
+ "data"
126
+ ],
127
+ "properties": {
128
+ "api_version": {
129
+ "type": "integer",
130
+ "const": 1
131
+ },
132
+ "data": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": [
136
+ "locations"
137
+ ],
138
+ "properties": {
139
+ "locations": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "object",
143
+ "additionalProperties": true,
144
+ "required": [
145
+ "id",
146
+ "name",
147
+ "timezone",
148
+ "status"
149
+ ],
150
+ "properties": {
151
+ "id": {
152
+ "type": "string",
153
+ "format": "uuid"
154
+ },
155
+ "name": {
156
+ "type": "string"
157
+ },
158
+ "timezone": {
159
+ "type": "string"
160
+ },
161
+ "status": {
162
+ "type": "string"
163
+ },
164
+ "formatted_address": {
165
+ "anyOf": [
166
+ {
167
+ "type": "string"
168
+ },
169
+ {
170
+ "type": "null"
171
+ }
172
+ ]
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ },
182
+ {
183
+ "id": "services.read",
184
+ "method": "GET",
185
+ "path_template": "/api/v1/o/{organization_slug}/services",
186
+ "summary": "List organization services",
187
+ "authorization": {
188
+ "kind": "organization_member",
189
+ "permission_scope": "organization",
190
+ "any_permissions": []
191
+ },
192
+ "credential_kinds": [
193
+ "session",
194
+ "api_token",
195
+ "remote_agent"
196
+ ],
197
+ "query_schema": {
198
+ "type": "object",
199
+ "properties": {},
200
+ "additionalProperties": false,
201
+ "required": []
202
+ },
203
+ "response_schema": {
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "api_version",
208
+ "data"
209
+ ],
210
+ "properties": {
211
+ "api_version": {
212
+ "type": "integer",
213
+ "const": 1
214
+ },
215
+ "data": {
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": [
219
+ "services",
220
+ "past_session_variations"
221
+ ],
222
+ "properties": {
223
+ "services": {
224
+ "type": "array",
225
+ "items": {
226
+ "type": "object",
227
+ "additionalProperties": true,
228
+ "required": [
229
+ "id",
230
+ "name",
231
+ "duration_minutes",
232
+ "status"
233
+ ],
234
+ "properties": {
235
+ "id": {
236
+ "type": "string",
237
+ "format": "uuid"
238
+ },
239
+ "name": {
240
+ "type": "string"
241
+ },
242
+ "description": {
243
+ "anyOf": [
244
+ {
245
+ "type": "string"
246
+ },
247
+ {
248
+ "type": "null"
249
+ }
250
+ ]
251
+ },
252
+ "duration_minutes": {
253
+ "type": "integer",
254
+ "minimum": 5,
255
+ "maximum": 1440
256
+ },
257
+ "default_capacity": {
258
+ "anyOf": [
259
+ {
260
+ "type": "integer",
261
+ "minimum": 1,
262
+ "maximum": 10000
263
+ },
264
+ {
265
+ "type": "null"
266
+ }
267
+ ]
268
+ },
269
+ "status": {
270
+ "type": "string",
271
+ "enum": [
272
+ "active",
273
+ "inactive"
274
+ ]
275
+ }
276
+ }
277
+ }
278
+ },
279
+ "past_session_variations": {
280
+ "type": "array",
281
+ "items": {
282
+ "type": "object",
283
+ "additionalProperties": true
284
+ }
285
+ }
286
+ }
287
+ }
288
+ }
289
+ }
290
+ },
291
+ {
292
+ "id": "schedule.read",
293
+ "method": "GET",
294
+ "path_template": "/api/v1/o/{organization_slug}/schedule",
295
+ "summary": "Read a schedule week and calendar month",
296
+ "authorization": {
297
+ "kind": "organization_member",
298
+ "permission_scope": "organization_or_location",
299
+ "any_permissions": [
300
+ "schedule.read",
301
+ "schedule.manage",
302
+ "schedule.work",
303
+ "frontdesk.check_in"
304
+ ]
305
+ },
306
+ "credential_kinds": [
307
+ "session",
308
+ "api_token",
309
+ "remote_agent"
310
+ ],
311
+ "query_schema": {
312
+ "type": "object",
313
+ "properties": {
314
+ "week": {
315
+ "type": "string",
316
+ "format": "date",
317
+ "description": "A date within the requested organization-local week (YYYY-MM-DD)."
318
+ },
319
+ "month": {
320
+ "type": "string",
321
+ "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])$",
322
+ "description": "The requested calendar month (YYYY-MM)."
323
+ }
324
+ },
325
+ "additionalProperties": false,
326
+ "required": []
327
+ },
328
+ "response_schema": {
329
+ "type": "object",
330
+ "additionalProperties": false,
331
+ "required": [
332
+ "api_version",
333
+ "data"
334
+ ],
335
+ "properties": {
336
+ "api_version": {
337
+ "type": "integer",
338
+ "const": 1
339
+ },
340
+ "data": {
341
+ "type": "object",
342
+ "additionalProperties": false,
343
+ "required": [
344
+ "week_start",
345
+ "sessions",
346
+ "staffing_windows",
347
+ "staffing_load_error",
348
+ "calendar"
349
+ ],
350
+ "properties": {
351
+ "week_start": {
352
+ "type": "string",
353
+ "format": "date"
354
+ },
355
+ "sessions": {
356
+ "type": "array",
357
+ "items": {
358
+ "type": "object",
359
+ "additionalProperties": true
360
+ }
361
+ },
362
+ "staffing_windows": {
363
+ "type": "array",
364
+ "items": {
365
+ "type": "object",
366
+ "additionalProperties": true
367
+ }
368
+ },
369
+ "staffing_load_error": {
370
+ "anyOf": [
371
+ {
372
+ "type": "string"
373
+ },
374
+ {
375
+ "type": "null"
376
+ }
377
+ ]
378
+ },
379
+ "calendar": {
380
+ "type": "object",
381
+ "additionalProperties": true,
382
+ "required": [
383
+ "month",
384
+ "days"
385
+ ],
386
+ "properties": {
387
+ "month": {
388
+ "type": "string"
389
+ },
390
+ "days": {
391
+ "type": "array",
392
+ "items": {
393
+ "type": "object"
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+ }
401
+ }
402
+ },
403
+ {
404
+ "id": "users.directory.read",
405
+ "method": "GET",
406
+ "path_template": "/api/v1/o/{organization_slug}/users/directory",
407
+ "summary": "Read the user directory",
408
+ "authorization": {
409
+ "kind": "organization_member",
410
+ "permission_scope": "organization",
411
+ "any_permissions": [
412
+ "customers.read",
413
+ "customers.manage"
414
+ ]
415
+ },
416
+ "credential_kinds": [
417
+ "session",
418
+ "api_token",
419
+ "remote_agent"
420
+ ],
421
+ "query_schema": {
422
+ "type": "object",
423
+ "properties": {
424
+ "q": {
425
+ "type": "string",
426
+ "maxLength": 100,
427
+ "pattern": "^[^\\u0000-\\u001f\\u007f]*$",
428
+ "description": "Case-insensitive name, email, or phone search (maximum 100 characters)."
429
+ },
430
+ "limit": {
431
+ "type": "integer",
432
+ "minimum": 1,
433
+ "maximum": 100,
434
+ "default": 50
435
+ },
436
+ "offset": {
437
+ "type": "integer",
438
+ "minimum": 0,
439
+ "maximum": 100000,
440
+ "default": 0
441
+ },
442
+ "facet": {
443
+ "type": "string",
444
+ "enum": [
445
+ "all",
446
+ "customers"
447
+ ],
448
+ "default": "all",
449
+ "description": "Choose only customer records, or the permitted people directory."
450
+ },
451
+ "customer_status": {
452
+ "type": "string",
453
+ "enum": [
454
+ "active",
455
+ "inactive",
456
+ "archived"
457
+ ],
458
+ "description": "Requires facet=customers. This is customer record status, not a paid membership or login status."
459
+ }
460
+ },
461
+ "additionalProperties": false,
462
+ "required": [],
463
+ "allOf": [
464
+ {
465
+ "if": {
466
+ "required": [
467
+ "customer_status"
468
+ ]
469
+ },
470
+ "then": {
471
+ "required": [
472
+ "facet"
473
+ ],
474
+ "properties": {
475
+ "facet": {
476
+ "const": "customers"
477
+ }
478
+ }
479
+ }
480
+ }
481
+ ]
482
+ },
483
+ "response_schema": {
484
+ "type": "object",
485
+ "additionalProperties": false,
486
+ "required": [
487
+ "api_version",
488
+ "data"
489
+ ],
490
+ "properties": {
491
+ "api_version": {
492
+ "type": "integer",
493
+ "const": 1
494
+ },
495
+ "data": {
496
+ "type": "object",
497
+ "additionalProperties": false,
498
+ "required": [
499
+ "users",
500
+ "pagination",
501
+ "filters"
502
+ ],
503
+ "properties": {
504
+ "users": {
505
+ "type": "array",
506
+ "maxItems": 100,
507
+ "items": {
508
+ "type": "object",
509
+ "additionalProperties": false,
510
+ "required": [
511
+ "id",
512
+ "display_name"
513
+ ],
514
+ "properties": {
515
+ "id": {
516
+ "type": "string",
517
+ "format": "uuid"
518
+ },
519
+ "display_name": {
520
+ "anyOf": [
521
+ {
522
+ "type": "string"
523
+ },
524
+ {
525
+ "type": "null"
526
+ }
527
+ ]
528
+ },
529
+ "email": {
530
+ "anyOf": [
531
+ {
532
+ "type": "string"
533
+ },
534
+ {
535
+ "type": "null"
536
+ }
537
+ ]
538
+ },
539
+ "phone_e164": {
540
+ "anyOf": [
541
+ {
542
+ "type": "string"
543
+ },
544
+ {
545
+ "type": "null"
546
+ }
547
+ ]
548
+ },
549
+ "is_customer": {
550
+ "type": "boolean"
551
+ },
552
+ "is_staff": {
553
+ "type": "boolean"
554
+ },
555
+ "has_workspace_access": {
556
+ "type": "boolean"
557
+ },
558
+ "person_status": {
559
+ "type": "string",
560
+ "enum": [
561
+ "active",
562
+ "archived"
563
+ ]
564
+ },
565
+ "customer_status": {
566
+ "anyOf": [
567
+ {
568
+ "type": "string",
569
+ "enum": [
570
+ "active",
571
+ "inactive",
572
+ "archived"
573
+ ]
574
+ },
575
+ {
576
+ "type": "null"
577
+ }
578
+ ]
579
+ }
580
+ }
581
+ }
582
+ },
583
+ "filters": {
584
+ "type": "object",
585
+ "additionalProperties": false,
586
+ "required": [
587
+ "facet",
588
+ "customer_status"
589
+ ],
590
+ "properties": {
591
+ "facet": {
592
+ "type": "string",
593
+ "enum": [
594
+ "all",
595
+ "customers"
596
+ ]
597
+ },
598
+ "customer_status": {
599
+ "anyOf": [
600
+ {
601
+ "type": "string",
602
+ "enum": [
603
+ "active",
604
+ "inactive",
605
+ "archived"
606
+ ]
607
+ },
608
+ {
609
+ "type": "null"
610
+ }
611
+ ]
612
+ }
613
+ }
614
+ },
615
+ "pagination": {
616
+ "type": "object",
617
+ "additionalProperties": false,
618
+ "required": [
619
+ "total",
620
+ "limit",
621
+ "offset",
622
+ "has_more",
623
+ "query"
624
+ ],
625
+ "properties": {
626
+ "total": {
627
+ "type": "integer",
628
+ "minimum": 0
629
+ },
630
+ "limit": {
631
+ "type": "integer"
632
+ },
633
+ "offset": {
634
+ "type": "integer"
635
+ },
636
+ "has_more": {
637
+ "type": "boolean"
638
+ },
639
+ "query": {
640
+ "type": "string"
641
+ }
642
+ }
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ },
649
+ {
650
+ "id": "task_lists.read",
651
+ "method": "GET",
652
+ "path_template": "/api/v1/o/{organization_slug}/task-lists",
653
+ "summary": "List manageable service task lists",
654
+ "authorization": {
655
+ "kind": "organization_member",
656
+ "permission_scope": "organization_or_location",
657
+ "any_permissions": [
658
+ "schedule.manage"
659
+ ]
660
+ },
661
+ "credential_kinds": [
662
+ "session",
663
+ "api_token",
664
+ "remote_agent"
665
+ ],
666
+ "query_schema": {
667
+ "type": "object",
668
+ "properties": {},
669
+ "additionalProperties": false,
670
+ "required": []
671
+ },
672
+ "response_schema": {
673
+ "type": "object",
674
+ "additionalProperties": false,
675
+ "required": [
676
+ "api_version",
677
+ "data"
678
+ ],
679
+ "properties": {
680
+ "api_version": {
681
+ "type": "integer",
682
+ "const": 1
683
+ },
684
+ "data": {
685
+ "type": "object",
686
+ "additionalProperties": true,
687
+ "required": [
688
+ "task_lists",
689
+ "locations",
690
+ "can_manage_organization"
691
+ ],
692
+ "properties": {
693
+ "task_lists": {
694
+ "type": "array",
695
+ "items": {
696
+ "type": "object",
697
+ "additionalProperties": true
698
+ }
699
+ },
700
+ "locations": {
701
+ "type": "array",
702
+ "items": {
703
+ "type": "object",
704
+ "additionalProperties": true
705
+ }
706
+ },
707
+ "can_manage_organization": {
708
+ "type": "boolean"
709
+ }
710
+ }
711
+ }
712
+ }
713
+ }
714
+ },
715
+ {
716
+ "id": "inventory.read",
717
+ "method": "GET",
718
+ "path_template": "/api/v1/o/{organization_slug}/inventory",
719
+ "summary": "Read the inventory workspace",
720
+ "authorization": {
721
+ "kind": "organization_member",
722
+ "permission_scope": "organization_or_location",
723
+ "any_permissions": [
724
+ "inventory.read",
725
+ "inventory.work",
726
+ "inventory.manage"
727
+ ]
728
+ },
729
+ "credential_kinds": [
730
+ "session",
731
+ "api_token",
732
+ "remote_agent"
733
+ ],
734
+ "query_schema": {
735
+ "type": "object",
736
+ "properties": {},
737
+ "additionalProperties": false,
738
+ "required": []
739
+ },
740
+ "response_schema": {
741
+ "type": "object",
742
+ "additionalProperties": false,
743
+ "required": [
744
+ "api_version",
745
+ "data"
746
+ ],
747
+ "properties": {
748
+ "api_version": {
749
+ "type": "integer",
750
+ "const": 1
751
+ },
752
+ "data": {
753
+ "type": "object",
754
+ "additionalProperties": false,
755
+ "required": [
756
+ "inventory"
757
+ ],
758
+ "properties": {
759
+ "inventory": {
760
+ "type": "object",
761
+ "additionalProperties": true,
762
+ "required": [
763
+ "locations",
764
+ "stocks",
765
+ "alerts",
766
+ "movements",
767
+ "currency_code"
768
+ ],
769
+ "properties": {
770
+ "locations": {
771
+ "type": "array",
772
+ "items": {
773
+ "type": "object"
774
+ }
775
+ },
776
+ "stocks": {
777
+ "type": "array",
778
+ "items": {
779
+ "type": "object"
780
+ }
781
+ },
782
+ "alerts": {
783
+ "type": "array",
784
+ "items": {
785
+ "type": "object"
786
+ }
787
+ },
788
+ "movements": {
789
+ "type": "array",
790
+ "items": {
791
+ "type": "object"
792
+ }
793
+ },
794
+ "currency_code": {
795
+ "type": "string"
796
+ }
797
+ }
798
+ }
799
+ }
800
+ }
801
+ }
802
+ }
803
+ }
804
+ ])
805
+ export const organizationWriteContracts = freeze_contract([
806
+ {
807
+ "id": "messages.send",
808
+ "method": "POST",
809
+ "path_template": "/api/v1/o/{organization_slug}/messages",
810
+ "summary": "Send an organization message",
811
+ "authorization": {
812
+ "kind": "organization_member",
813
+ "permission_scope": "organization",
814
+ "any_permissions": [
815
+ "messages.send",
816
+ "messages.manage"
817
+ ]
818
+ },
819
+ "credential_kinds": [
820
+ "session",
821
+ "remote_agent",
822
+ "api_token"
823
+ ],
824
+ "request_schema": {
825
+ "type": "object",
826
+ "additionalProperties": false,
827
+ "required": [
828
+ "body"
829
+ ],
830
+ "properties": {
831
+ "path": {
832
+ "type": "object",
833
+ "additionalProperties": false,
834
+ "required": [],
835
+ "properties": {}
836
+ },
837
+ "body": {
838
+ "type": "object",
839
+ "additionalProperties": false,
840
+ "required": [
841
+ "channel_id",
842
+ "body"
843
+ ],
844
+ "properties": {
845
+ "channel_id": {
846
+ "type": "string",
847
+ "format": "uuid",
848
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
849
+ },
850
+ "body": {
851
+ "type": "string",
852
+ "minLength": 1,
853
+ "maxLength": 4000
854
+ },
855
+ "attachment_ids": {
856
+ "type": "array",
857
+ "items": {
858
+ "type": "string",
859
+ "format": "uuid",
860
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
861
+ },
862
+ "maxItems": 3,
863
+ "uniqueItems": true
864
+ },
865
+ "title": {
866
+ "type": "string",
867
+ "minLength": 1,
868
+ "maxLength": 120
869
+ },
870
+ "preview": {
871
+ "type": [
872
+ "string",
873
+ "null"
874
+ ],
875
+ "maxLength": 200
876
+ },
877
+ "action": {
878
+ "type": [
879
+ "object",
880
+ "null"
881
+ ],
882
+ "additionalProperties": false,
883
+ "required": [
884
+ "label",
885
+ "url"
886
+ ],
887
+ "properties": {
888
+ "label": {
889
+ "type": "string",
890
+ "minLength": 1,
891
+ "maxLength": 60
892
+ },
893
+ "url": {
894
+ "type": "string",
895
+ "minLength": 1,
896
+ "maxLength": 2048,
897
+ "format": "uri",
898
+ "pattern": "^https://"
899
+ }
900
+ }
901
+ }
902
+ }
903
+ }
904
+ }
905
+ },
906
+ "response_schema": {
907
+ "$schema": "http://json-schema.org/draft-07/schema#",
908
+ "type": "object",
909
+ "properties": {
910
+ "api_version": {
911
+ "type": "number",
912
+ "const": 1
913
+ },
914
+ "message": {
915
+ "type": "object",
916
+ "properties": {
917
+ "attachments": {
918
+ "maxItems": 3,
919
+ "type": "array",
920
+ "items": {
921
+ "type": "object",
922
+ "properties": {
923
+ "file_name": {
924
+ "type": "string",
925
+ "minLength": 1,
926
+ "maxLength": 180
927
+ },
928
+ "content_type": {
929
+ "type": "string",
930
+ "enum": [
931
+ "image/jpeg",
932
+ "image/png",
933
+ "image/webp",
934
+ "image/gif",
935
+ "image/heic",
936
+ "application/pdf",
937
+ "text/plain",
938
+ "text/csv",
939
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
940
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
941
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation"
942
+ ]
943
+ },
944
+ "byte_size": {
945
+ "type": "integer",
946
+ "minimum": 1,
947
+ "maximum": 10485760
948
+ },
949
+ "id": {
950
+ "type": "string",
951
+ "format": "uuid",
952
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
953
+ }
954
+ },
955
+ "required": [
956
+ "file_name",
957
+ "content_type",
958
+ "byte_size",
959
+ "id"
960
+ ],
961
+ "additionalProperties": false
962
+ }
963
+ },
964
+ "id": {
965
+ "type": "string",
966
+ "format": "uuid",
967
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
968
+ },
969
+ "body": {
970
+ "type": "string",
971
+ "minLength": 1,
972
+ "maxLength": 4000
973
+ },
974
+ "kind": {
975
+ "type": "string",
976
+ "enum": [
977
+ "announcement",
978
+ "deleted",
979
+ "notification"
980
+ ]
981
+ },
982
+ "notification": {
983
+ "default": null,
984
+ "anyOf": [
985
+ {
986
+ "type": "object",
987
+ "properties": {
988
+ "source_kind": {
989
+ "type": "string",
990
+ "enum": [
991
+ "service_session_work_slot",
992
+ "service_session_provider",
993
+ "staffing_window_assignment",
994
+ "staffing_window"
995
+ ]
996
+ },
997
+ "source_id": {
998
+ "type": "string",
999
+ "format": "uuid",
1000
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1001
+ },
1002
+ "session_id": {
1003
+ "anyOf": [
1004
+ {
1005
+ "type": "string",
1006
+ "format": "uuid",
1007
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1008
+ },
1009
+ {
1010
+ "type": "null"
1011
+ }
1012
+ ]
1013
+ },
1014
+ "session_starts_at": {
1015
+ "default": null,
1016
+ "anyOf": [
1017
+ {
1018
+ "type": "string",
1019
+ "format": "date-time",
1020
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
1021
+ },
1022
+ {
1023
+ "type": "null"
1024
+ }
1025
+ ]
1026
+ },
1027
+ "staffing_window_id": {
1028
+ "anyOf": [
1029
+ {
1030
+ "type": "string",
1031
+ "format": "uuid",
1032
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1033
+ },
1034
+ {
1035
+ "type": "null"
1036
+ }
1037
+ ]
1038
+ },
1039
+ "starts_at": {
1040
+ "type": "string",
1041
+ "format": "date-time",
1042
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
1043
+ },
1044
+ "time_zone": {
1045
+ "type": "string",
1046
+ "minLength": 1,
1047
+ "maxLength": 100
1048
+ },
1049
+ "status": {
1050
+ "type": "string",
1051
+ "enum": [
1052
+ "open",
1053
+ "claimed",
1054
+ "withdrawn",
1055
+ "cancelled"
1056
+ ]
1057
+ },
1058
+ "label": {
1059
+ "type": "string",
1060
+ "minLength": 1,
1061
+ "maxLength": 240
1062
+ }
1063
+ },
1064
+ "required": [
1065
+ "source_kind",
1066
+ "source_id",
1067
+ "session_id",
1068
+ "session_starts_at",
1069
+ "staffing_window_id",
1070
+ "starts_at",
1071
+ "time_zone",
1072
+ "status",
1073
+ "label"
1074
+ ],
1075
+ "additionalProperties": false
1076
+ },
1077
+ {
1078
+ "type": "null"
1079
+ }
1080
+ ]
1081
+ },
1082
+ "author_name": {
1083
+ "type": "string",
1084
+ "minLength": 1,
1085
+ "maxLength": 320
1086
+ },
1087
+ "is_mine": {
1088
+ "type": "boolean"
1089
+ },
1090
+ "created_at": {
1091
+ "type": "string",
1092
+ "format": "date-time",
1093
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
1094
+ },
1095
+ "edited_at": {
1096
+ "anyOf": [
1097
+ {
1098
+ "type": "string",
1099
+ "format": "date-time",
1100
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
1101
+ },
1102
+ {
1103
+ "type": "null"
1104
+ }
1105
+ ]
1106
+ },
1107
+ "deleted_at": {
1108
+ "anyOf": [
1109
+ {
1110
+ "type": "string",
1111
+ "format": "date-time",
1112
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
1113
+ },
1114
+ {
1115
+ "type": "null"
1116
+ }
1117
+ ]
1118
+ }
1119
+ },
1120
+ "required": [
1121
+ "id",
1122
+ "body",
1123
+ "kind",
1124
+ "notification",
1125
+ "author_name",
1126
+ "is_mine",
1127
+ "created_at",
1128
+ "edited_at",
1129
+ "deleted_at"
1130
+ ],
1131
+ "additionalProperties": false
1132
+ }
1133
+ },
1134
+ "required": [
1135
+ "api_version",
1136
+ "message"
1137
+ ],
1138
+ "additionalProperties": false
1139
+ },
1140
+ "maximum_body_bytes": 16384,
1141
+ "idempotency": {
1142
+ "class": "non_idempotent",
1143
+ "retry": "never_automatically"
1144
+ }
1145
+ },
1146
+ {
1147
+ "id": "messages.read_state.update",
1148
+ "method": "POST",
1149
+ "path_template": "/api/v1/o/{organization_slug}/messages/channels/{channel_id}/read",
1150
+ "summary": "Advance a channel's read state",
1151
+ "authorization": {
1152
+ "kind": "organization_member",
1153
+ "permission_scope": "organization_or_location",
1154
+ "any_permissions": [
1155
+ "messages.read",
1156
+ "messages.send",
1157
+ "messages.manage",
1158
+ "schedule.work"
1159
+ ]
1160
+ },
1161
+ "credential_kinds": [
1162
+ "session",
1163
+ "remote_agent",
1164
+ "api_token"
1165
+ ],
1166
+ "request_schema": {
1167
+ "type": "object",
1168
+ "additionalProperties": false,
1169
+ "required": [
1170
+ "body",
1171
+ "path"
1172
+ ],
1173
+ "properties": {
1174
+ "path": {
1175
+ "type": "object",
1176
+ "additionalProperties": false,
1177
+ "required": [
1178
+ "channel_id"
1179
+ ],
1180
+ "properties": {
1181
+ "channel_id": {
1182
+ "type": "string",
1183
+ "format": "uuid"
1184
+ }
1185
+ }
1186
+ },
1187
+ "body": {
1188
+ "type": "object",
1189
+ "additionalProperties": false,
1190
+ "required": [
1191
+ "message_id"
1192
+ ],
1193
+ "properties": {
1194
+ "message_id": {
1195
+ "type": "string",
1196
+ "format": "uuid"
1197
+ }
1198
+ }
1199
+ }
1200
+ }
1201
+ },
1202
+ "response_schema": {
1203
+ "$schema": "http://json-schema.org/draft-07/schema#",
1204
+ "type": "object",
1205
+ "properties": {
1206
+ "api_version": {
1207
+ "type": "number",
1208
+ "const": 1
1209
+ },
1210
+ "state": {
1211
+ "type": "object",
1212
+ "properties": {
1213
+ "channel_id": {
1214
+ "type": "string",
1215
+ "format": "uuid",
1216
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1217
+ },
1218
+ "message_id": {
1219
+ "type": "string",
1220
+ "format": "uuid",
1221
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1222
+ },
1223
+ "read_at": {
1224
+ "type": "string",
1225
+ "format": "date-time",
1226
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
1227
+ }
1228
+ },
1229
+ "required": [
1230
+ "channel_id",
1231
+ "message_id",
1232
+ "read_at"
1233
+ ],
1234
+ "additionalProperties": false
1235
+ }
1236
+ },
1237
+ "required": [
1238
+ "api_version",
1239
+ "state"
1240
+ ],
1241
+ "additionalProperties": false
1242
+ },
1243
+ "maximum_body_bytes": 16384,
1244
+ "idempotency": {
1245
+ "class": "idempotent",
1246
+ "retry": "automatic"
1247
+ }
1248
+ },
1249
+ {
1250
+ "id": "messages.mute.update",
1251
+ "method": "PATCH",
1252
+ "path_template": "/api/v1/o/{organization_slug}/messages/channels/{channel_id}/mute",
1253
+ "summary": "Set a channel's mute preference",
1254
+ "authorization": {
1255
+ "kind": "organization_member",
1256
+ "permission_scope": "organization_or_location",
1257
+ "any_permissions": [
1258
+ "messages.read",
1259
+ "messages.send",
1260
+ "messages.manage",
1261
+ "schedule.work"
1262
+ ]
1263
+ },
1264
+ "credential_kinds": [
1265
+ "session",
1266
+ "remote_agent",
1267
+ "api_token"
1268
+ ],
1269
+ "request_schema": {
1270
+ "type": "object",
1271
+ "additionalProperties": false,
1272
+ "required": [
1273
+ "body",
1274
+ "path"
1275
+ ],
1276
+ "properties": {
1277
+ "path": {
1278
+ "type": "object",
1279
+ "additionalProperties": false,
1280
+ "required": [
1281
+ "channel_id"
1282
+ ],
1283
+ "properties": {
1284
+ "channel_id": {
1285
+ "type": "string",
1286
+ "format": "uuid"
1287
+ }
1288
+ }
1289
+ },
1290
+ "body": {
1291
+ "type": "object",
1292
+ "additionalProperties": false,
1293
+ "required": [
1294
+ "is_muted"
1295
+ ],
1296
+ "properties": {
1297
+ "is_muted": {
1298
+ "type": "boolean"
1299
+ }
1300
+ }
1301
+ }
1302
+ }
1303
+ },
1304
+ "response_schema": {
1305
+ "$schema": "http://json-schema.org/draft-07/schema#",
1306
+ "type": "object",
1307
+ "properties": {
1308
+ "api_version": {
1309
+ "type": "number",
1310
+ "const": 1
1311
+ },
1312
+ "state": {
1313
+ "type": "object",
1314
+ "properties": {
1315
+ "channel_id": {
1316
+ "type": "string",
1317
+ "format": "uuid",
1318
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1319
+ },
1320
+ "is_muted": {
1321
+ "type": "boolean"
1322
+ }
1323
+ },
1324
+ "required": [
1325
+ "channel_id",
1326
+ "is_muted"
1327
+ ],
1328
+ "additionalProperties": false
1329
+ }
1330
+ },
1331
+ "required": [
1332
+ "api_version",
1333
+ "state"
1334
+ ],
1335
+ "additionalProperties": false
1336
+ },
1337
+ "maximum_body_bytes": 16384,
1338
+ "idempotency": {
1339
+ "class": "idempotent",
1340
+ "retry": "automatic"
1341
+ }
1342
+ }
1343
+ ])