@airnauts/comments-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.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/dist/anchor/decide.d.ts +15 -0
  4. package/dist/anchor/decide.d.ts.map +1 -0
  5. package/dist/anchor/index.d.ts +9 -0
  6. package/dist/anchor/index.d.ts.map +1 -0
  7. package/dist/anchor/locate-quote.d.ts +11 -0
  8. package/dist/anchor/locate-quote.d.ts.map +1 -0
  9. package/dist/anchor/score.d.ts +10 -0
  10. package/dist/anchor/score.d.ts.map +1 -0
  11. package/dist/anchor/weights.d.ts +18 -0
  12. package/dist/anchor/weights.d.ts.map +1 -0
  13. package/dist/contract/errors.d.ts +32 -0
  14. package/dist/contract/errors.d.ts.map +1 -0
  15. package/dist/contract/openapi.d.ts +3 -0
  16. package/dist/contract/openapi.d.ts.map +1 -0
  17. package/dist/contract/operations.d.ts +18 -0
  18. package/dist/contract/operations.d.ts.map +1 -0
  19. package/dist/contract/requests.d.ts +113 -0
  20. package/dist/contract/requests.d.ts.map +1 -0
  21. package/dist/contract/responses.d.ts +65 -0
  22. package/dist/contract/responses.d.ts.map +1 -0
  23. package/dist/contract/wire.d.ts +2 -0
  24. package/dist/contract/wire.d.ts.map +1 -0
  25. package/dist/ids.d.ts +10 -0
  26. package/dist/ids.d.ts.map +1 -0
  27. package/dist/index.d.ts +15 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +576 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/openapi.json +1579 -0
  32. package/dist/pageKey.d.ts +3 -0
  33. package/dist/pageKey.d.ts.map +1 -0
  34. package/dist/schemas/anchor.d.ts +62 -0
  35. package/dist/schemas/anchor.d.ts.map +1 -0
  36. package/dist/schemas/capture.d.ts +15 -0
  37. package/dist/schemas/capture.d.ts.map +1 -0
  38. package/dist/schemas/comment.d.ts +39 -0
  39. package/dist/schemas/comment.d.ts.map +1 -0
  40. package/dist/schemas/common.d.ts +8 -0
  41. package/dist/schemas/common.d.ts.map +1 -0
  42. package/dist/schemas/thread.d.ts +163 -0
  43. package/dist/schemas/thread.d.ts.map +1 -0
  44. package/package.json +55 -0
@@ -0,0 +1,1579 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Comments API",
5
+ "version": "1.0.0"
6
+ },
7
+ "security": [
8
+ {
9
+ "commentsKey": []
10
+ }
11
+ ],
12
+ "paths": {
13
+ "/threads": {
14
+ "post": {
15
+ "operationId": "createThread",
16
+ "summary": "Create a thread with its first comment",
17
+ "requestBody": {
18
+ "content": {
19
+ "application/json": {
20
+ "schema": {
21
+ "$ref": "#/components/schemas/CreateThreadBody"
22
+ }
23
+ }
24
+ }
25
+ },
26
+ "responses": {
27
+ "201": {
28
+ "description": "createThread success",
29
+ "content": {
30
+ "application/json": {
31
+ "schema": {
32
+ "$ref": "#/components/schemas/Thread"
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "400": {
38
+ "description": "VALIDATION_FAILED",
39
+ "content": {
40
+ "application/json": {
41
+ "schema": {
42
+ "$ref": "#/components/schemas/ErrorResponse"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ "401": {
48
+ "description": "AUTH_INVALID_KEY",
49
+ "content": {
50
+ "application/json": {
51
+ "schema": {
52
+ "$ref": "#/components/schemas/ErrorResponse"
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "403": {
58
+ "description": "ORIGIN_NOT_ALLOWED",
59
+ "content": {
60
+ "application/json": {
61
+ "schema": {
62
+ "$ref": "#/components/schemas/ErrorResponse"
63
+ }
64
+ }
65
+ }
66
+ },
67
+ "429": {
68
+ "description": "RATE_LIMITED",
69
+ "content": {
70
+ "application/json": {
71
+ "schema": {
72
+ "$ref": "#/components/schemas/ErrorResponse"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+ },
79
+ "get": {
80
+ "operationId": "listThreads",
81
+ "summary": "List threads on a page (?pageKey=) or across all pages (panel)",
82
+ "parameters": [
83
+ {
84
+ "in": "query",
85
+ "name": "pageKey",
86
+ "schema": {
87
+ "type": "string"
88
+ }
89
+ },
90
+ {
91
+ "in": "query",
92
+ "name": "status",
93
+ "schema": {
94
+ "type": "string",
95
+ "enum": [
96
+ "open",
97
+ "resolved"
98
+ ]
99
+ }
100
+ },
101
+ {
102
+ "in": "query",
103
+ "name": "sort",
104
+ "schema": {
105
+ "type": "string",
106
+ "const": "updatedAt"
107
+ }
108
+ },
109
+ {
110
+ "in": "query",
111
+ "name": "cursor",
112
+ "schema": {
113
+ "type": "string",
114
+ "minLength": 1
115
+ }
116
+ }
117
+ ],
118
+ "responses": {
119
+ "200": {
120
+ "description": "listThreads success",
121
+ "content": {
122
+ "application/json": {
123
+ "schema": {
124
+ "$ref": "#/components/schemas/ThreadListResponse"
125
+ }
126
+ }
127
+ }
128
+ },
129
+ "400": {
130
+ "description": "VALIDATION_FAILED",
131
+ "content": {
132
+ "application/json": {
133
+ "schema": {
134
+ "$ref": "#/components/schemas/ErrorResponse"
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "401": {
140
+ "description": "AUTH_INVALID_KEY",
141
+ "content": {
142
+ "application/json": {
143
+ "schema": {
144
+ "$ref": "#/components/schemas/ErrorResponse"
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "403": {
150
+ "description": "ORIGIN_NOT_ALLOWED",
151
+ "content": {
152
+ "application/json": {
153
+ "schema": {
154
+ "$ref": "#/components/schemas/ErrorResponse"
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "429": {
160
+ "description": "RATE_LIMITED",
161
+ "content": {
162
+ "application/json": {
163
+ "schema": {
164
+ "$ref": "#/components/schemas/ErrorResponse"
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+ },
172
+ "/threads/{id}": {
173
+ "get": {
174
+ "operationId": "getThread",
175
+ "summary": "Get a single thread with its comments",
176
+ "parameters": [
177
+ {
178
+ "in": "path",
179
+ "name": "id",
180
+ "schema": {
181
+ "type": "string",
182
+ "minLength": 1
183
+ },
184
+ "required": true
185
+ }
186
+ ],
187
+ "responses": {
188
+ "200": {
189
+ "description": "getThread success",
190
+ "content": {
191
+ "application/json": {
192
+ "schema": {
193
+ "$ref": "#/components/schemas/Thread"
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "401": {
199
+ "description": "AUTH_INVALID_KEY",
200
+ "content": {
201
+ "application/json": {
202
+ "schema": {
203
+ "$ref": "#/components/schemas/ErrorResponse"
204
+ }
205
+ }
206
+ }
207
+ },
208
+ "403": {
209
+ "description": "ORIGIN_NOT_ALLOWED",
210
+ "content": {
211
+ "application/json": {
212
+ "schema": {
213
+ "$ref": "#/components/schemas/ErrorResponse"
214
+ }
215
+ }
216
+ }
217
+ },
218
+ "404": {
219
+ "description": "NOT_FOUND",
220
+ "content": {
221
+ "application/json": {
222
+ "schema": {
223
+ "$ref": "#/components/schemas/ErrorResponse"
224
+ }
225
+ }
226
+ }
227
+ },
228
+ "429": {
229
+ "description": "RATE_LIMITED",
230
+ "content": {
231
+ "application/json": {
232
+ "schema": {
233
+ "$ref": "#/components/schemas/ErrorResponse"
234
+ }
235
+ }
236
+ }
237
+ }
238
+ }
239
+ },
240
+ "patch": {
241
+ "operationId": "setThreadStatus",
242
+ "summary": "Resolve or reopen a thread",
243
+ "parameters": [
244
+ {
245
+ "in": "path",
246
+ "name": "id",
247
+ "schema": {
248
+ "type": "string",
249
+ "minLength": 1
250
+ },
251
+ "required": true
252
+ }
253
+ ],
254
+ "requestBody": {
255
+ "content": {
256
+ "application/json": {
257
+ "schema": {
258
+ "$ref": "#/components/schemas/SetThreadStatusBody"
259
+ }
260
+ }
261
+ }
262
+ },
263
+ "responses": {
264
+ "200": {
265
+ "description": "setThreadStatus success",
266
+ "content": {
267
+ "application/json": {
268
+ "schema": {
269
+ "$ref": "#/components/schemas/Thread"
270
+ }
271
+ }
272
+ }
273
+ },
274
+ "400": {
275
+ "description": "VALIDATION_FAILED",
276
+ "content": {
277
+ "application/json": {
278
+ "schema": {
279
+ "$ref": "#/components/schemas/ErrorResponse"
280
+ }
281
+ }
282
+ }
283
+ },
284
+ "401": {
285
+ "description": "AUTH_INVALID_KEY",
286
+ "content": {
287
+ "application/json": {
288
+ "schema": {
289
+ "$ref": "#/components/schemas/ErrorResponse"
290
+ }
291
+ }
292
+ }
293
+ },
294
+ "403": {
295
+ "description": "ORIGIN_NOT_ALLOWED",
296
+ "content": {
297
+ "application/json": {
298
+ "schema": {
299
+ "$ref": "#/components/schemas/ErrorResponse"
300
+ }
301
+ }
302
+ }
303
+ },
304
+ "404": {
305
+ "description": "NOT_FOUND",
306
+ "content": {
307
+ "application/json": {
308
+ "schema": {
309
+ "$ref": "#/components/schemas/ErrorResponse"
310
+ }
311
+ }
312
+ }
313
+ },
314
+ "409": {
315
+ "description": "CONFLICT",
316
+ "content": {
317
+ "application/json": {
318
+ "schema": {
319
+ "$ref": "#/components/schemas/ErrorResponse"
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "429": {
325
+ "description": "RATE_LIMITED",
326
+ "content": {
327
+ "application/json": {
328
+ "schema": {
329
+ "$ref": "#/components/schemas/ErrorResponse"
330
+ }
331
+ }
332
+ }
333
+ }
334
+ }
335
+ }
336
+ },
337
+ "/threads/{id}/comments": {
338
+ "post": {
339
+ "operationId": "addComment",
340
+ "summary": "Add a reply to a thread",
341
+ "parameters": [
342
+ {
343
+ "in": "path",
344
+ "name": "id",
345
+ "schema": {
346
+ "type": "string",
347
+ "minLength": 1
348
+ },
349
+ "required": true
350
+ }
351
+ ],
352
+ "requestBody": {
353
+ "content": {
354
+ "application/json": {
355
+ "schema": {
356
+ "$ref": "#/components/schemas/AddCommentBody"
357
+ }
358
+ }
359
+ }
360
+ },
361
+ "responses": {
362
+ "201": {
363
+ "description": "addComment success",
364
+ "content": {
365
+ "application/json": {
366
+ "schema": {
367
+ "$ref": "#/components/schemas/Comment"
368
+ }
369
+ }
370
+ }
371
+ },
372
+ "400": {
373
+ "description": "VALIDATION_FAILED",
374
+ "content": {
375
+ "application/json": {
376
+ "schema": {
377
+ "$ref": "#/components/schemas/ErrorResponse"
378
+ }
379
+ }
380
+ }
381
+ },
382
+ "401": {
383
+ "description": "AUTH_INVALID_KEY",
384
+ "content": {
385
+ "application/json": {
386
+ "schema": {
387
+ "$ref": "#/components/schemas/ErrorResponse"
388
+ }
389
+ }
390
+ }
391
+ },
392
+ "403": {
393
+ "description": "ORIGIN_NOT_ALLOWED",
394
+ "content": {
395
+ "application/json": {
396
+ "schema": {
397
+ "$ref": "#/components/schemas/ErrorResponse"
398
+ }
399
+ }
400
+ }
401
+ },
402
+ "404": {
403
+ "description": "NOT_FOUND",
404
+ "content": {
405
+ "application/json": {
406
+ "schema": {
407
+ "$ref": "#/components/schemas/ErrorResponse"
408
+ }
409
+ }
410
+ }
411
+ },
412
+ "429": {
413
+ "description": "RATE_LIMITED",
414
+ "content": {
415
+ "application/json": {
416
+ "schema": {
417
+ "$ref": "#/components/schemas/ErrorResponse"
418
+ }
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ },
425
+ "/threads/{id}/anchor": {
426
+ "patch": {
427
+ "operationId": "refreshAnchor",
428
+ "summary": "Report a re-match result (self-heal the stored anchor)",
429
+ "parameters": [
430
+ {
431
+ "in": "path",
432
+ "name": "id",
433
+ "schema": {
434
+ "type": "string",
435
+ "minLength": 1
436
+ },
437
+ "required": true
438
+ }
439
+ ],
440
+ "requestBody": {
441
+ "content": {
442
+ "application/json": {
443
+ "schema": {
444
+ "$ref": "#/components/schemas/RefreshAnchorBody"
445
+ }
446
+ }
447
+ }
448
+ },
449
+ "responses": {
450
+ "200": {
451
+ "description": "refreshAnchor success",
452
+ "content": {
453
+ "application/json": {
454
+ "schema": {
455
+ "$ref": "#/components/schemas/ThreadListItem"
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "400": {
461
+ "description": "VALIDATION_FAILED",
462
+ "content": {
463
+ "application/json": {
464
+ "schema": {
465
+ "$ref": "#/components/schemas/ErrorResponse"
466
+ }
467
+ }
468
+ }
469
+ },
470
+ "401": {
471
+ "description": "AUTH_INVALID_KEY",
472
+ "content": {
473
+ "application/json": {
474
+ "schema": {
475
+ "$ref": "#/components/schemas/ErrorResponse"
476
+ }
477
+ }
478
+ }
479
+ },
480
+ "403": {
481
+ "description": "ORIGIN_NOT_ALLOWED",
482
+ "content": {
483
+ "application/json": {
484
+ "schema": {
485
+ "$ref": "#/components/schemas/ErrorResponse"
486
+ }
487
+ }
488
+ }
489
+ },
490
+ "404": {
491
+ "description": "NOT_FOUND",
492
+ "content": {
493
+ "application/json": {
494
+ "schema": {
495
+ "$ref": "#/components/schemas/ErrorResponse"
496
+ }
497
+ }
498
+ }
499
+ },
500
+ "429": {
501
+ "description": "RATE_LIMITED",
502
+ "content": {
503
+ "application/json": {
504
+ "schema": {
505
+ "$ref": "#/components/schemas/ErrorResponse"
506
+ }
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ },
513
+ "/uploads": {
514
+ "post": {
515
+ "operationId": "uploadAttachment",
516
+ "summary": "Upload an image attachment (multipart)",
517
+ "requestBody": {
518
+ "content": {
519
+ "multipart/form-data": {
520
+ "schema": {
521
+ "$ref": "#/components/schemas/UploadForm"
522
+ }
523
+ }
524
+ }
525
+ },
526
+ "responses": {
527
+ "201": {
528
+ "description": "uploadAttachment success",
529
+ "content": {
530
+ "application/json": {
531
+ "schema": {
532
+ "$ref": "#/components/schemas/Attachment"
533
+ }
534
+ }
535
+ }
536
+ },
537
+ "400": {
538
+ "description": "VALIDATION_FAILED",
539
+ "content": {
540
+ "application/json": {
541
+ "schema": {
542
+ "$ref": "#/components/schemas/ErrorResponse"
543
+ }
544
+ }
545
+ }
546
+ },
547
+ "401": {
548
+ "description": "AUTH_INVALID_KEY",
549
+ "content": {
550
+ "application/json": {
551
+ "schema": {
552
+ "$ref": "#/components/schemas/ErrorResponse"
553
+ }
554
+ }
555
+ }
556
+ },
557
+ "403": {
558
+ "description": "ORIGIN_NOT_ALLOWED",
559
+ "content": {
560
+ "application/json": {
561
+ "schema": {
562
+ "$ref": "#/components/schemas/ErrorResponse"
563
+ }
564
+ }
565
+ }
566
+ },
567
+ "413": {
568
+ "description": "UPLOAD_TOO_LARGE",
569
+ "content": {
570
+ "application/json": {
571
+ "schema": {
572
+ "$ref": "#/components/schemas/ErrorResponse"
573
+ }
574
+ }
575
+ }
576
+ },
577
+ "429": {
578
+ "description": "RATE_LIMITED",
579
+ "content": {
580
+ "application/json": {
581
+ "schema": {
582
+ "$ref": "#/components/schemas/ErrorResponse"
583
+ }
584
+ }
585
+ }
586
+ }
587
+ }
588
+ }
589
+ }
590
+ },
591
+ "components": {
592
+ "schemas": {
593
+ "CreateThreadBody": {
594
+ "type": "object",
595
+ "properties": {
596
+ "pageKey": {
597
+ "type": "string"
598
+ },
599
+ "pageUrl": {
600
+ "type": "string",
601
+ "format": "uri"
602
+ },
603
+ "pageTitle": {
604
+ "type": "string"
605
+ },
606
+ "anchor": {
607
+ "$ref": "#/components/schemas/Anchor"
608
+ },
609
+ "comment": {
610
+ "type": "object",
611
+ "properties": {
612
+ "text": {
613
+ "type": "string"
614
+ },
615
+ "attachmentIds": {
616
+ "type": "array",
617
+ "items": {
618
+ "type": "string",
619
+ "minLength": 1
620
+ }
621
+ }
622
+ },
623
+ "required": [
624
+ "text"
625
+ ]
626
+ },
627
+ "author": {
628
+ "$ref": "#/components/schemas/Author"
629
+ },
630
+ "captureContext": {
631
+ "$ref": "#/components/schemas/CaptureContext"
632
+ },
633
+ "provenance": {
634
+ "$ref": "#/components/schemas/Provenance"
635
+ }
636
+ },
637
+ "required": [
638
+ "pageUrl",
639
+ "anchor",
640
+ "comment",
641
+ "author",
642
+ "captureContext"
643
+ ]
644
+ },
645
+ "Anchor": {
646
+ "type": "object",
647
+ "properties": {
648
+ "schemaVersion": {
649
+ "type": "integer",
650
+ "exclusiveMinimum": 0,
651
+ "maximum": 9007199254740991
652
+ },
653
+ "selectors": {
654
+ "type": "array",
655
+ "prefixItems": [
656
+ {
657
+ "type": "string"
658
+ },
659
+ {
660
+ "type": "string"
661
+ }
662
+ ]
663
+ },
664
+ "signals": {
665
+ "$ref": "#/components/schemas/Signals"
666
+ },
667
+ "offset": {
668
+ "type": "object",
669
+ "properties": {
670
+ "fx": {
671
+ "type": "number",
672
+ "minimum": 0,
673
+ "maximum": 1
674
+ },
675
+ "fy": {
676
+ "type": "number",
677
+ "minimum": 0,
678
+ "maximum": 1
679
+ }
680
+ },
681
+ "required": [
682
+ "fx",
683
+ "fy"
684
+ ]
685
+ },
686
+ "selection": {
687
+ "$ref": "#/components/schemas/Selection"
688
+ }
689
+ },
690
+ "required": [
691
+ "schemaVersion",
692
+ "selectors",
693
+ "signals",
694
+ "offset"
695
+ ]
696
+ },
697
+ "Signals": {
698
+ "type": "object",
699
+ "properties": {
700
+ "tag": {
701
+ "type": "string"
702
+ },
703
+ "role": {
704
+ "type": "string"
705
+ },
706
+ "textSnippet": {
707
+ "type": "string",
708
+ "maxLength": 120
709
+ },
710
+ "classes": {
711
+ "type": "array",
712
+ "items": {
713
+ "type": "string"
714
+ }
715
+ },
716
+ "siblingIndex": {
717
+ "type": "integer",
718
+ "minimum": 0,
719
+ "maximum": 9007199254740991
720
+ },
721
+ "ancestorTrail": {
722
+ "type": "array",
723
+ "items": {
724
+ "type": "string"
725
+ }
726
+ },
727
+ "stableAttrs": {
728
+ "type": "object",
729
+ "propertyNames": {
730
+ "type": "string"
731
+ },
732
+ "additionalProperties": {
733
+ "type": "string"
734
+ }
735
+ }
736
+ },
737
+ "required": [
738
+ "tag",
739
+ "classes",
740
+ "siblingIndex",
741
+ "ancestorTrail"
742
+ ]
743
+ },
744
+ "Selection": {
745
+ "type": "object",
746
+ "properties": {
747
+ "start": {
748
+ "type": "object",
749
+ "properties": {
750
+ "selectors": {
751
+ "type": "array",
752
+ "prefixItems": [
753
+ {
754
+ "type": "string"
755
+ },
756
+ {
757
+ "type": "string"
758
+ }
759
+ ]
760
+ },
761
+ "textNodeIndex": {
762
+ "type": "integer",
763
+ "minimum": 0,
764
+ "maximum": 9007199254740991
765
+ },
766
+ "offset": {
767
+ "type": "integer",
768
+ "minimum": 0,
769
+ "maximum": 9007199254740991
770
+ }
771
+ },
772
+ "required": [
773
+ "selectors",
774
+ "textNodeIndex",
775
+ "offset"
776
+ ]
777
+ },
778
+ "end": {
779
+ "type": "object",
780
+ "properties": {
781
+ "selectors": {
782
+ "type": "array",
783
+ "prefixItems": [
784
+ {
785
+ "type": "string"
786
+ },
787
+ {
788
+ "type": "string"
789
+ }
790
+ ]
791
+ },
792
+ "textNodeIndex": {
793
+ "type": "integer",
794
+ "minimum": 0,
795
+ "maximum": 9007199254740991
796
+ },
797
+ "offset": {
798
+ "type": "integer",
799
+ "minimum": 0,
800
+ "maximum": 9007199254740991
801
+ }
802
+ },
803
+ "required": [
804
+ "selectors",
805
+ "textNodeIndex",
806
+ "offset"
807
+ ]
808
+ },
809
+ "quote": {
810
+ "type": "string"
811
+ },
812
+ "prefix": {
813
+ "type": "string"
814
+ },
815
+ "suffix": {
816
+ "type": "string"
817
+ }
818
+ },
819
+ "required": [
820
+ "start",
821
+ "end",
822
+ "quote",
823
+ "prefix",
824
+ "suffix"
825
+ ]
826
+ },
827
+ "Author": {
828
+ "type": "object",
829
+ "properties": {
830
+ "id": {
831
+ "type": "string",
832
+ "minLength": 1
833
+ },
834
+ "email": {
835
+ "$ref": "#/components/schemas/Email"
836
+ },
837
+ "name": {
838
+ "type": "string"
839
+ }
840
+ },
841
+ "required": [
842
+ "email"
843
+ ]
844
+ },
845
+ "Email": {
846
+ "type": "string",
847
+ "format": "email",
848
+ "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
849
+ },
850
+ "CaptureContext": {
851
+ "type": "object",
852
+ "properties": {
853
+ "viewportW": {
854
+ "type": "integer",
855
+ "exclusiveMinimum": 0,
856
+ "maximum": 9007199254740991
857
+ },
858
+ "viewportH": {
859
+ "type": "integer",
860
+ "exclusiveMinimum": 0,
861
+ "maximum": 9007199254740991
862
+ },
863
+ "devicePixelRatio": {
864
+ "type": "number",
865
+ "exclusiveMinimum": 0
866
+ },
867
+ "userAgent": {
868
+ "type": "string"
869
+ }
870
+ },
871
+ "required": [
872
+ "viewportW",
873
+ "viewportH",
874
+ "devicePixelRatio",
875
+ "userAgent"
876
+ ]
877
+ },
878
+ "Provenance": {
879
+ "type": "object",
880
+ "properties": {
881
+ "commitSha": {
882
+ "type": "string"
883
+ },
884
+ "branch": {
885
+ "type": "string"
886
+ },
887
+ "deploymentId": {
888
+ "type": "string"
889
+ }
890
+ }
891
+ },
892
+ "SetThreadStatusBody": {
893
+ "type": "object",
894
+ "properties": {
895
+ "status": {
896
+ "type": "string",
897
+ "enum": [
898
+ "open",
899
+ "resolved"
900
+ ]
901
+ }
902
+ },
903
+ "required": [
904
+ "status"
905
+ ]
906
+ },
907
+ "AddCommentBody": {
908
+ "type": "object",
909
+ "properties": {
910
+ "text": {
911
+ "type": "string"
912
+ },
913
+ "attachmentIds": {
914
+ "type": "array",
915
+ "items": {
916
+ "type": "string",
917
+ "minLength": 1
918
+ }
919
+ },
920
+ "author": {
921
+ "$ref": "#/components/schemas/Author"
922
+ }
923
+ },
924
+ "required": [
925
+ "text",
926
+ "author"
927
+ ]
928
+ },
929
+ "RefreshAnchorBody": {
930
+ "type": "object",
931
+ "properties": {
932
+ "selectors": {
933
+ "type": "array",
934
+ "prefixItems": [
935
+ {
936
+ "type": "string"
937
+ },
938
+ {
939
+ "type": "string"
940
+ }
941
+ ]
942
+ },
943
+ "signals": {
944
+ "$ref": "#/components/schemas/Signals"
945
+ },
946
+ "anchorState": {
947
+ "type": "string",
948
+ "enum": [
949
+ "anchored",
950
+ "orphaned"
951
+ ]
952
+ },
953
+ "selectionLost": {
954
+ "type": "boolean"
955
+ }
956
+ },
957
+ "required": [
958
+ "anchorState"
959
+ ]
960
+ },
961
+ "UploadForm": {
962
+ "type": "object",
963
+ "properties": {
964
+ "file": {
965
+ "type": "string",
966
+ "format": "binary"
967
+ }
968
+ },
969
+ "required": [
970
+ "file"
971
+ ]
972
+ },
973
+ "Thread": {
974
+ "type": "object",
975
+ "properties": {
976
+ "id": {
977
+ "type": "string",
978
+ "minLength": 1
979
+ },
980
+ "scope": {
981
+ "type": "string",
982
+ "const": "page"
983
+ },
984
+ "pageKey": {
985
+ "anyOf": [
986
+ {
987
+ "type": "string"
988
+ },
989
+ {
990
+ "type": "null"
991
+ }
992
+ ]
993
+ },
994
+ "pageUrl": {
995
+ "type": "string",
996
+ "format": "uri"
997
+ },
998
+ "pageTitle": {
999
+ "type": "string"
1000
+ },
1001
+ "anchor": {
1002
+ "$ref": "#/components/schemas/AnchorOutput"
1003
+ },
1004
+ "status": {
1005
+ "type": "string",
1006
+ "enum": [
1007
+ "open",
1008
+ "resolved"
1009
+ ]
1010
+ },
1011
+ "anchorState": {
1012
+ "type": "string",
1013
+ "enum": [
1014
+ "anchored",
1015
+ "orphaned"
1016
+ ]
1017
+ },
1018
+ "selectionLost": {
1019
+ "type": "boolean"
1020
+ },
1021
+ "commentCount": {
1022
+ "type": "integer",
1023
+ "minimum": 0,
1024
+ "maximum": 9007199254740991
1025
+ },
1026
+ "unresolvedCount": {
1027
+ "type": "integer",
1028
+ "minimum": 0,
1029
+ "maximum": 9007199254740991
1030
+ },
1031
+ "createdBy": {
1032
+ "$ref": "#/components/schemas/AuthorOutput"
1033
+ },
1034
+ "createdAt": {
1035
+ "$ref": "#/components/schemas/IsoTimestamp"
1036
+ },
1037
+ "updatedAt": {
1038
+ "$ref": "#/components/schemas/IsoTimestamp"
1039
+ },
1040
+ "lastActivityAt": {
1041
+ "$ref": "#/components/schemas/IsoTimestamp"
1042
+ },
1043
+ "schemaVersion": {
1044
+ "type": "integer",
1045
+ "exclusiveMinimum": 0,
1046
+ "maximum": 9007199254740991
1047
+ },
1048
+ "comments": {
1049
+ "type": "array",
1050
+ "items": {
1051
+ "$ref": "#/components/schemas/Comment"
1052
+ }
1053
+ },
1054
+ "captureContext": {
1055
+ "$ref": "#/components/schemas/CaptureContextOutput"
1056
+ },
1057
+ "provenance": {
1058
+ "$ref": "#/components/schemas/ProvenanceOutput"
1059
+ }
1060
+ },
1061
+ "required": [
1062
+ "id",
1063
+ "scope",
1064
+ "pageKey",
1065
+ "pageUrl",
1066
+ "anchor",
1067
+ "status",
1068
+ "anchorState",
1069
+ "commentCount",
1070
+ "unresolvedCount",
1071
+ "createdBy",
1072
+ "createdAt",
1073
+ "updatedAt",
1074
+ "lastActivityAt",
1075
+ "schemaVersion",
1076
+ "comments",
1077
+ "captureContext"
1078
+ ],
1079
+ "additionalProperties": false
1080
+ },
1081
+ "IsoTimestamp": {
1082
+ "type": "string",
1083
+ "format": "date-time",
1084
+ "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))$"
1085
+ },
1086
+ "Comment": {
1087
+ "type": "object",
1088
+ "properties": {
1089
+ "id": {
1090
+ "type": "string",
1091
+ "minLength": 1
1092
+ },
1093
+ "author": {
1094
+ "$ref": "#/components/schemas/AuthorOutput"
1095
+ },
1096
+ "text": {
1097
+ "type": "string"
1098
+ },
1099
+ "attachments": {
1100
+ "type": "array",
1101
+ "items": {
1102
+ "$ref": "#/components/schemas/Attachment"
1103
+ }
1104
+ },
1105
+ "createdAt": {
1106
+ "$ref": "#/components/schemas/IsoTimestamp"
1107
+ },
1108
+ "editedAt": {
1109
+ "$ref": "#/components/schemas/IsoTimestamp"
1110
+ }
1111
+ },
1112
+ "required": [
1113
+ "id",
1114
+ "author",
1115
+ "text",
1116
+ "attachments",
1117
+ "createdAt"
1118
+ ],
1119
+ "additionalProperties": false
1120
+ },
1121
+ "Attachment": {
1122
+ "type": "object",
1123
+ "properties": {
1124
+ "id": {
1125
+ "type": "string",
1126
+ "minLength": 1
1127
+ },
1128
+ "url": {
1129
+ "type": "string",
1130
+ "format": "uri"
1131
+ },
1132
+ "name": {
1133
+ "type": "string"
1134
+ },
1135
+ "contentType": {
1136
+ "type": "string"
1137
+ },
1138
+ "size": {
1139
+ "type": "integer",
1140
+ "minimum": 0,
1141
+ "maximum": 9007199254740991
1142
+ },
1143
+ "w": {
1144
+ "type": "integer",
1145
+ "exclusiveMinimum": 0,
1146
+ "maximum": 9007199254740991
1147
+ },
1148
+ "h": {
1149
+ "type": "integer",
1150
+ "exclusiveMinimum": 0,
1151
+ "maximum": 9007199254740991
1152
+ }
1153
+ },
1154
+ "required": [
1155
+ "id",
1156
+ "url",
1157
+ "name",
1158
+ "contentType",
1159
+ "size"
1160
+ ],
1161
+ "additionalProperties": false
1162
+ },
1163
+ "ErrorResponse": {
1164
+ "type": "object",
1165
+ "properties": {
1166
+ "error": {
1167
+ "type": "object",
1168
+ "properties": {
1169
+ "code": {
1170
+ "type": "string",
1171
+ "enum": [
1172
+ "VALIDATION_FAILED",
1173
+ "AUTH_INVALID_KEY",
1174
+ "ORIGIN_NOT_ALLOWED",
1175
+ "NOT_FOUND",
1176
+ "CONFLICT",
1177
+ "UPLOAD_TOO_LARGE",
1178
+ "RATE_LIMITED",
1179
+ "INTERNAL"
1180
+ ]
1181
+ },
1182
+ "message": {
1183
+ "type": "string"
1184
+ },
1185
+ "details": {}
1186
+ },
1187
+ "required": [
1188
+ "code",
1189
+ "message"
1190
+ ],
1191
+ "additionalProperties": false
1192
+ }
1193
+ },
1194
+ "required": [
1195
+ "error"
1196
+ ],
1197
+ "additionalProperties": false
1198
+ },
1199
+ "ThreadListResponse": {
1200
+ "type": "object",
1201
+ "properties": {
1202
+ "threads": {
1203
+ "type": "array",
1204
+ "items": {
1205
+ "$ref": "#/components/schemas/ThreadListItem"
1206
+ }
1207
+ },
1208
+ "nextCursor": {
1209
+ "anyOf": [
1210
+ {
1211
+ "type": "string"
1212
+ },
1213
+ {
1214
+ "type": "null"
1215
+ }
1216
+ ]
1217
+ }
1218
+ },
1219
+ "required": [
1220
+ "threads",
1221
+ "nextCursor"
1222
+ ],
1223
+ "additionalProperties": false
1224
+ },
1225
+ "ThreadListItem": {
1226
+ "type": "object",
1227
+ "properties": {
1228
+ "id": {
1229
+ "type": "string",
1230
+ "minLength": 1
1231
+ },
1232
+ "scope": {
1233
+ "type": "string",
1234
+ "const": "page"
1235
+ },
1236
+ "pageKey": {
1237
+ "anyOf": [
1238
+ {
1239
+ "type": "string"
1240
+ },
1241
+ {
1242
+ "type": "null"
1243
+ }
1244
+ ]
1245
+ },
1246
+ "pageUrl": {
1247
+ "type": "string",
1248
+ "format": "uri"
1249
+ },
1250
+ "pageTitle": {
1251
+ "type": "string"
1252
+ },
1253
+ "anchor": {
1254
+ "$ref": "#/components/schemas/AnchorOutput"
1255
+ },
1256
+ "status": {
1257
+ "type": "string",
1258
+ "enum": [
1259
+ "open",
1260
+ "resolved"
1261
+ ]
1262
+ },
1263
+ "anchorState": {
1264
+ "type": "string",
1265
+ "enum": [
1266
+ "anchored",
1267
+ "orphaned"
1268
+ ]
1269
+ },
1270
+ "selectionLost": {
1271
+ "type": "boolean"
1272
+ },
1273
+ "commentCount": {
1274
+ "type": "integer",
1275
+ "minimum": 0,
1276
+ "maximum": 9007199254740991
1277
+ },
1278
+ "unresolvedCount": {
1279
+ "type": "integer",
1280
+ "minimum": 0,
1281
+ "maximum": 9007199254740991
1282
+ },
1283
+ "createdBy": {
1284
+ "$ref": "#/components/schemas/AuthorOutput"
1285
+ },
1286
+ "createdAt": {
1287
+ "$ref": "#/components/schemas/IsoTimestamp"
1288
+ },
1289
+ "updatedAt": {
1290
+ "$ref": "#/components/schemas/IsoTimestamp"
1291
+ },
1292
+ "lastActivityAt": {
1293
+ "$ref": "#/components/schemas/IsoTimestamp"
1294
+ },
1295
+ "schemaVersion": {
1296
+ "type": "integer",
1297
+ "exclusiveMinimum": 0,
1298
+ "maximum": 9007199254740991
1299
+ }
1300
+ },
1301
+ "required": [
1302
+ "id",
1303
+ "scope",
1304
+ "pageKey",
1305
+ "pageUrl",
1306
+ "anchor",
1307
+ "status",
1308
+ "anchorState",
1309
+ "commentCount",
1310
+ "unresolvedCount",
1311
+ "createdBy",
1312
+ "createdAt",
1313
+ "updatedAt",
1314
+ "lastActivityAt",
1315
+ "schemaVersion"
1316
+ ],
1317
+ "additionalProperties": false
1318
+ },
1319
+ "AnchorOutput": {
1320
+ "type": "object",
1321
+ "properties": {
1322
+ "schemaVersion": {
1323
+ "type": "integer",
1324
+ "exclusiveMinimum": 0,
1325
+ "maximum": 9007199254740991
1326
+ },
1327
+ "selectors": {
1328
+ "type": "array",
1329
+ "prefixItems": [
1330
+ {
1331
+ "type": "string"
1332
+ },
1333
+ {
1334
+ "type": "string"
1335
+ }
1336
+ ]
1337
+ },
1338
+ "signals": {
1339
+ "$ref": "#/components/schemas/SignalsOutput"
1340
+ },
1341
+ "offset": {
1342
+ "type": "object",
1343
+ "properties": {
1344
+ "fx": {
1345
+ "type": "number",
1346
+ "minimum": 0,
1347
+ "maximum": 1
1348
+ },
1349
+ "fy": {
1350
+ "type": "number",
1351
+ "minimum": 0,
1352
+ "maximum": 1
1353
+ }
1354
+ },
1355
+ "required": [
1356
+ "fx",
1357
+ "fy"
1358
+ ],
1359
+ "additionalProperties": false
1360
+ },
1361
+ "selection": {
1362
+ "$ref": "#/components/schemas/SelectionOutput"
1363
+ }
1364
+ },
1365
+ "required": [
1366
+ "schemaVersion",
1367
+ "selectors",
1368
+ "signals",
1369
+ "offset"
1370
+ ],
1371
+ "additionalProperties": false
1372
+ },
1373
+ "SignalsOutput": {
1374
+ "type": "object",
1375
+ "properties": {
1376
+ "tag": {
1377
+ "type": "string"
1378
+ },
1379
+ "role": {
1380
+ "type": "string"
1381
+ },
1382
+ "textSnippet": {
1383
+ "type": "string",
1384
+ "maxLength": 120
1385
+ },
1386
+ "classes": {
1387
+ "type": "array",
1388
+ "items": {
1389
+ "type": "string"
1390
+ }
1391
+ },
1392
+ "siblingIndex": {
1393
+ "type": "integer",
1394
+ "minimum": 0,
1395
+ "maximum": 9007199254740991
1396
+ },
1397
+ "ancestorTrail": {
1398
+ "type": "array",
1399
+ "items": {
1400
+ "type": "string"
1401
+ }
1402
+ },
1403
+ "stableAttrs": {
1404
+ "type": "object",
1405
+ "propertyNames": {
1406
+ "type": "string"
1407
+ },
1408
+ "additionalProperties": {
1409
+ "type": "string"
1410
+ }
1411
+ }
1412
+ },
1413
+ "required": [
1414
+ "tag",
1415
+ "classes",
1416
+ "siblingIndex",
1417
+ "ancestorTrail"
1418
+ ],
1419
+ "additionalProperties": false
1420
+ },
1421
+ "SelectionOutput": {
1422
+ "type": "object",
1423
+ "properties": {
1424
+ "start": {
1425
+ "type": "object",
1426
+ "properties": {
1427
+ "selectors": {
1428
+ "type": "array",
1429
+ "prefixItems": [
1430
+ {
1431
+ "type": "string"
1432
+ },
1433
+ {
1434
+ "type": "string"
1435
+ }
1436
+ ]
1437
+ },
1438
+ "textNodeIndex": {
1439
+ "type": "integer",
1440
+ "minimum": 0,
1441
+ "maximum": 9007199254740991
1442
+ },
1443
+ "offset": {
1444
+ "type": "integer",
1445
+ "minimum": 0,
1446
+ "maximum": 9007199254740991
1447
+ }
1448
+ },
1449
+ "required": [
1450
+ "selectors",
1451
+ "textNodeIndex",
1452
+ "offset"
1453
+ ],
1454
+ "additionalProperties": false
1455
+ },
1456
+ "end": {
1457
+ "type": "object",
1458
+ "properties": {
1459
+ "selectors": {
1460
+ "type": "array",
1461
+ "prefixItems": [
1462
+ {
1463
+ "type": "string"
1464
+ },
1465
+ {
1466
+ "type": "string"
1467
+ }
1468
+ ]
1469
+ },
1470
+ "textNodeIndex": {
1471
+ "type": "integer",
1472
+ "minimum": 0,
1473
+ "maximum": 9007199254740991
1474
+ },
1475
+ "offset": {
1476
+ "type": "integer",
1477
+ "minimum": 0,
1478
+ "maximum": 9007199254740991
1479
+ }
1480
+ },
1481
+ "required": [
1482
+ "selectors",
1483
+ "textNodeIndex",
1484
+ "offset"
1485
+ ],
1486
+ "additionalProperties": false
1487
+ },
1488
+ "quote": {
1489
+ "type": "string"
1490
+ },
1491
+ "prefix": {
1492
+ "type": "string"
1493
+ },
1494
+ "suffix": {
1495
+ "type": "string"
1496
+ }
1497
+ },
1498
+ "required": [
1499
+ "start",
1500
+ "end",
1501
+ "quote",
1502
+ "prefix",
1503
+ "suffix"
1504
+ ],
1505
+ "additionalProperties": false
1506
+ },
1507
+ "AuthorOutput": {
1508
+ "type": "object",
1509
+ "properties": {
1510
+ "id": {
1511
+ "type": "string",
1512
+ "minLength": 1
1513
+ },
1514
+ "email": {
1515
+ "$ref": "#/components/schemas/Email"
1516
+ },
1517
+ "name": {
1518
+ "type": "string"
1519
+ }
1520
+ },
1521
+ "required": [
1522
+ "email"
1523
+ ],
1524
+ "additionalProperties": false
1525
+ },
1526
+ "CaptureContextOutput": {
1527
+ "type": "object",
1528
+ "properties": {
1529
+ "viewportW": {
1530
+ "type": "integer",
1531
+ "exclusiveMinimum": 0,
1532
+ "maximum": 9007199254740991
1533
+ },
1534
+ "viewportH": {
1535
+ "type": "integer",
1536
+ "exclusiveMinimum": 0,
1537
+ "maximum": 9007199254740991
1538
+ },
1539
+ "devicePixelRatio": {
1540
+ "type": "number",
1541
+ "exclusiveMinimum": 0
1542
+ },
1543
+ "userAgent": {
1544
+ "type": "string"
1545
+ }
1546
+ },
1547
+ "required": [
1548
+ "viewportW",
1549
+ "viewportH",
1550
+ "devicePixelRatio",
1551
+ "userAgent"
1552
+ ],
1553
+ "additionalProperties": false
1554
+ },
1555
+ "ProvenanceOutput": {
1556
+ "type": "object",
1557
+ "properties": {
1558
+ "commitSha": {
1559
+ "type": "string"
1560
+ },
1561
+ "branch": {
1562
+ "type": "string"
1563
+ },
1564
+ "deploymentId": {
1565
+ "type": "string"
1566
+ }
1567
+ },
1568
+ "additionalProperties": false
1569
+ }
1570
+ },
1571
+ "securitySchemes": {
1572
+ "commentsKey": {
1573
+ "type": "apiKey",
1574
+ "in": "header",
1575
+ "name": "x-comments-key"
1576
+ }
1577
+ }
1578
+ }
1579
+ }