terrascale 0.3.0 → 1.0.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,2330 @@
1
+ {
2
+ "manifestVersion": 2,
3
+ "contractVersion": "terrabase-csharp-v1",
4
+ "contractSource": {
5
+ "registryOrigin": "https://git.terrascale.tech",
6
+ "producer": "TerraScale/terrabase",
7
+ "branch": "main",
8
+ "revision": "0248ad3ac6fb82ac900e38005840a619e5d0beac",
9
+ "version": "0.1.0",
10
+ "release": "ci-0248ad3ac6fb82ac900e38005840a619e5d0beac-run-13267",
11
+ "asset": "terrabase-linux-amd64",
12
+ "sha256": "8abcedaa6b8487f08ecafe4485862f1f9309154e58ac1a74eda2278b78500968",
13
+ "openapiSha256": "84f5f84d592c37a0a8dc72ac57692ef6b5a9a190d1ced6593dc354ae3b69b9aa",
14
+ "inputs": {
15
+ "0004-document-api-v1.md": {
16
+ "sourcePath": "docs/decisions/0004-document-api-v1.md",
17
+ "sha256": "32b91e89c86f91ee26ec9be45837708f14355aa507c0468c40f010268b970907"
18
+ },
19
+ "0005-multi-tenancy.md": {
20
+ "sourcePath": "docs/decisions/0005-multi-tenancy.md",
21
+ "sha256": "14430b2b46bbfae56b1fc5a426481e0c592186c3f36594211e01656f41ed4d3d"
22
+ },
23
+ "shape-reads.md": {
24
+ "sourcePath": "docs/shape-reads.md",
25
+ "sha256": "b0aece7c92e11cd0e63912fa520927f686e9cec9edcf97e1ef798091e5241b75"
26
+ },
27
+ "DocumentRoute.cs": {
28
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/DocumentRoute.cs",
29
+ "sha256": "92df91e5e8cdfd016e4a0a8ef871171f67ebc955d34abd420ca4623a18dffd44"
30
+ },
31
+ "GetShapeEndpoint.cs": {
32
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/GetShapeEndpoint.cs",
33
+ "sha256": "8202d64c4d878d6bed371f145dcd1f40d47db691988975403eabf2320168a30c"
34
+ },
35
+ "IApiKeyStore.cs": {
36
+ "sourcePath": "src/TerraScale.TerraBase/Features/ApiKeys/IApiKeyStore.cs",
37
+ "sha256": "c084cb377c2267abf2cf9aa1565abf95fbc1deeb7176488e3a708ef2798e0a24"
38
+ },
39
+ "GetDocumentEndpoint.cs": {
40
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/GetDocumentEndpoint.cs",
41
+ "sha256": "bcd47ed58009edb8f7c31e2b2edef8109ff28cbe2fc7c9322bee3bc7a702f772"
42
+ },
43
+ "PutDocumentEndpoint.cs": {
44
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/PutDocumentEndpoint.cs",
45
+ "sha256": "5d838cd0556a054794f0da701d46b810815683491fb61572ccfdebb0fee4f98f"
46
+ },
47
+ "CreateDocumentEndpoint.cs": {
48
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/CreateDocumentEndpoint.cs",
49
+ "sha256": "8b99c4222f56cfe74645d687104f0ebae26265c4de3e3df3f4a4f3e88357f364"
50
+ },
51
+ "PatchDocumentEndpoint.cs": {
52
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/PatchDocumentEndpoint.cs",
53
+ "sha256": "c7c8c7d74d048e1d4fedb25e7d7a1a6a6efb475ca999a96d20969cc0a45ae665"
54
+ },
55
+ "DeleteDocumentEndpoint.cs": {
56
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/DeleteDocumentEndpoint.cs",
57
+ "sha256": "cfa0cdafbe9773105b0955401f8b1a8ddabe4b43c04876fd37da465dbebce408"
58
+ },
59
+ "TransactionEndpoint.cs": {
60
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/TransactionEndpoint.cs",
61
+ "sha256": "e923c33de96222d14e134181fc6340964345d664dae024210935ec40e2610064"
62
+ },
63
+ "QueryDocumentsEndpoint.cs": {
64
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/QueryDocumentsEndpoint.cs",
65
+ "sha256": "cb9897891e391d9af7af91cd405268f92538486f8500de7c03e20c99cb6712c5"
66
+ },
67
+ "CreateCollectionEndpoint.cs": {
68
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/CreateCollectionEndpoint.cs",
69
+ "sha256": "87f99316b937f5a1b95d62d456605ece670a1d51096b7a9f50327ea94ccfda86"
70
+ },
71
+ "GetCollectionEndpoint.cs": {
72
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/GetCollectionEndpoint.cs",
73
+ "sha256": "bc754dfd45fd74d5b44d51c5e6e09d015a9c23e2f651ee3fd97f6878c1c3b2fe"
74
+ },
75
+ "ListCollectionsEndpoint.cs": {
76
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/ListCollectionsEndpoint.cs",
77
+ "sha256": "6dd3093c4488fdc1af620c2b09ae290d727aa8981e6f098af3c2cb96b456e885"
78
+ },
79
+ "DropCollectionEndpoint.cs": {
80
+ "sourcePath": "src/TerraScale.TerraBase/Features/Documents/DropCollectionEndpoint.cs",
81
+ "sha256": "e2685ea491ae6d55235376bf2b58c773e30be2bd55f33fec404e820b3a30ae52"
82
+ }
83
+ },
84
+ "openapiBytesSha256": "87d98df69b657f78aa38554634cf449a0796754285de0c07ad8c86c6c9fecd0e",
85
+ "openapiNormalization": "JSON.parse, remove generated servers, JSON.stringify"
86
+ },
87
+ "routeCount": 12,
88
+ "routes": [
89
+ {
90
+ "producer": "terrabase-csharp",
91
+ "client": "TerraBaseV1Client",
92
+ "operation": "getDocument",
93
+ "method": "GET",
94
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/documents/{id}",
95
+ "permission": "documents:read",
96
+ "requestMediaTypes": [],
97
+ "responseMediaType": "application/json",
98
+ "successStatuses": [
99
+ 200
100
+ ],
101
+ "idempotencyKey": "none",
102
+ "replaySafe": true,
103
+ "producerOperation": {
104
+ "tags": [
105
+ "Documents"
106
+ ],
107
+ "summary": "Reads a JSON document",
108
+ "description": "Sends the version as a strong ETag, including a persisted database incarnation so deletion/recreation does not reuse versions. If-None-Match with the current version returns 304. A deleted document returns 404 not_found with its tombstone's ETag, so it can be recreated with If-Match.",
109
+ "operationId": "getDocument",
110
+ "responses": {
111
+ "200": {
112
+ "description": "OK",
113
+ "content": {
114
+ "application/json": {
115
+ "schema": {
116
+ "oneOf": [
117
+ {
118
+ "type": "null"
119
+ },
120
+ {
121
+ "$ref": "#/components/schemas/DocumentBody"
122
+ }
123
+ ]
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "404": {
129
+ "description": "Not Found",
130
+ "content": {
131
+ "application/json": {
132
+ "schema": {
133
+ "oneOf": [
134
+ {
135
+ "type": "null"
136
+ },
137
+ {
138
+ "$ref": "#/components/schemas/ErrorBody"
139
+ }
140
+ ]
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ }
147
+ },
148
+ {
149
+ "producer": "terrabase-csharp",
150
+ "client": "TerraBaseV1Client",
151
+ "operation": "putDocument",
152
+ "method": "PUT",
153
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/documents/{id}",
154
+ "permission": "documents:write",
155
+ "requestMediaTypes": [
156
+ "application/json"
157
+ ],
158
+ "responseMediaType": "application/json",
159
+ "successStatuses": [
160
+ 200,
161
+ 201
162
+ ],
163
+ "idempotencyKey": "none",
164
+ "replaySafe": false,
165
+ "producerOperation": {
166
+ "tags": [
167
+ "Documents"
168
+ ],
169
+ "summary": "Inserts or replaces a JSON document",
170
+ "description": "The body is the complete document: a JSON object of at most 1 MiB, 16 levels and 4096 values. Optional If-Match (current version or *) or If-None-Match: * (absent or deleted). Returns 201 when the document was absent or deleted, 200 otherwise; a failed precondition returns 412 precondition_failed.",
171
+ "operationId": "putDocument",
172
+ "requestBody": {
173
+ "content": {
174
+ "application/json": {
175
+ "schema": {}
176
+ }
177
+ },
178
+ "required": true
179
+ },
180
+ "responses": {
181
+ "200": {
182
+ "description": "OK",
183
+ "content": {
184
+ "application/json": {
185
+ "schema": {
186
+ "oneOf": [
187
+ {
188
+ "type": "null"
189
+ },
190
+ {
191
+ "$ref": "#/components/schemas/WriteBody"
192
+ }
193
+ ]
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "201": {
199
+ "description": "Created",
200
+ "content": {
201
+ "application/json": {
202
+ "schema": {
203
+ "oneOf": [
204
+ {
205
+ "type": "null"
206
+ },
207
+ {
208
+ "$ref": "#/components/schemas/WriteBody"
209
+ }
210
+ ]
211
+ }
212
+ }
213
+ }
214
+ },
215
+ "404": {
216
+ "description": "Not Found",
217
+ "content": {
218
+ "application/json": {
219
+ "schema": {
220
+ "oneOf": [
221
+ {
222
+ "type": "null"
223
+ },
224
+ {
225
+ "$ref": "#/components/schemas/ErrorBody"
226
+ }
227
+ ]
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "412": {
233
+ "description": "Precondition Failed",
234
+ "content": {
235
+ "application/json": {
236
+ "schema": {
237
+ "oneOf": [
238
+ {
239
+ "type": "null"
240
+ },
241
+ {
242
+ "$ref": "#/components/schemas/ErrorBody"
243
+ }
244
+ ]
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "producer": "terrabase-csharp",
254
+ "client": "TerraBaseV1Client",
255
+ "operation": "createDocument",
256
+ "method": "POST",
257
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/documents",
258
+ "permission": "documents:write",
259
+ "requestMediaTypes": [
260
+ "application/json"
261
+ ],
262
+ "responseMediaType": "application/json",
263
+ "successStatuses": [
264
+ 201
265
+ ],
266
+ "idempotencyKey": "none",
267
+ "replaySafe": false,
268
+ "producerOperation": {
269
+ "tags": [
270
+ "Documents"
271
+ ],
272
+ "summary": "Creates a JSON document with a generated id",
273
+ "description": "The body is a JSON object of at most 1 MiB. Conditional headers use the same strict parser as PUT: malformed headers return 400; If-Match fails with 412 for the generated absent id; If-None-Match: * permits creation. Returns 201 with Location and the new id, a lowercase UUIDv7.",
274
+ "operationId": "createDocument",
275
+ "requestBody": {
276
+ "content": {
277
+ "application/json": {
278
+ "schema": {}
279
+ }
280
+ },
281
+ "required": true
282
+ },
283
+ "responses": {
284
+ "201": {
285
+ "description": "Created",
286
+ "content": {
287
+ "application/json": {
288
+ "schema": {
289
+ "oneOf": [
290
+ {
291
+ "type": "null"
292
+ },
293
+ {
294
+ "$ref": "#/components/schemas/WriteBody"
295
+ }
296
+ ]
297
+ }
298
+ }
299
+ }
300
+ },
301
+ "400": {
302
+ "description": "Bad Request",
303
+ "content": {
304
+ "application/json": {
305
+ "schema": {
306
+ "oneOf": [
307
+ {
308
+ "type": "null"
309
+ },
310
+ {
311
+ "$ref": "#/components/schemas/ErrorBody"
312
+ }
313
+ ]
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "404": {
319
+ "description": "Not Found",
320
+ "content": {
321
+ "application/json": {
322
+ "schema": {
323
+ "oneOf": [
324
+ {
325
+ "type": "null"
326
+ },
327
+ {
328
+ "$ref": "#/components/schemas/ErrorBody"
329
+ }
330
+ ]
331
+ }
332
+ }
333
+ }
334
+ },
335
+ "412": {
336
+ "description": "Precondition Failed",
337
+ "content": {
338
+ "application/json": {
339
+ "schema": {
340
+ "oneOf": [
341
+ {
342
+ "type": "null"
343
+ },
344
+ {
345
+ "$ref": "#/components/schemas/ErrorBody"
346
+ }
347
+ ]
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+ }
354
+ },
355
+ {
356
+ "producer": "terrabase-csharp",
357
+ "client": "TerraBaseV1Client",
358
+ "operation": "patchDocument",
359
+ "method": "PATCH",
360
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/documents/{id}",
361
+ "permission": "documents:write",
362
+ "requestMediaTypes": [
363
+ "application/merge-patch+json",
364
+ "application/vnd.terrabase.ops+json"
365
+ ],
366
+ "responseMediaType": "application/json",
367
+ "successStatuses": [
368
+ 200
369
+ ],
370
+ "idempotencyKey": "none",
371
+ "replaySafe": false,
372
+ "producerOperation": {
373
+ "tags": [
374
+ "Documents"
375
+ ],
376
+ "summary": "Patches a JSON document",
377
+ "description": "application/merge-patch+json applies an RFC 7396 merge patch (null removes members). application/vnd.terrabase.ops+json applies {\"ops\":[…]} in order: set (creates missing parents), unset, inc (missing is 0, exact decimal arithmetic) and append (creates a missing array); paths are JSON Pointers to object members, at most 256 ops. A target of the wrong type fails with 409 patch_conflict. Optional If-Match. The document must exist (404 not_found).",
378
+ "operationId": "patchDocument",
379
+ "requestBody": {
380
+ "content": {
381
+ "application/merge-patch+json": {
382
+ "schema": {}
383
+ },
384
+ "application/vnd.terrabase.ops+json": {
385
+ "schema": {
386
+ "required": [
387
+ "ops"
388
+ ],
389
+ "type": "object",
390
+ "properties": {
391
+ "ops": {
392
+ "type": [
393
+ "null",
394
+ "array"
395
+ ],
396
+ "items": {
397
+ "required": [
398
+ "op",
399
+ "path",
400
+ "value",
401
+ "by"
402
+ ],
403
+ "type": "object",
404
+ "properties": {
405
+ "op": {
406
+ "type": [
407
+ "null",
408
+ "string"
409
+ ]
410
+ },
411
+ "path": {
412
+ "type": [
413
+ "null",
414
+ "string"
415
+ ]
416
+ },
417
+ "value": {},
418
+ "by": {}
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+ },
426
+ "required": true
427
+ },
428
+ "responses": {
429
+ "200": {
430
+ "description": "OK",
431
+ "content": {
432
+ "application/json": {
433
+ "schema": {
434
+ "oneOf": [
435
+ {
436
+ "type": "null"
437
+ },
438
+ {
439
+ "$ref": "#/components/schemas/WriteBody"
440
+ }
441
+ ]
442
+ }
443
+ }
444
+ }
445
+ },
446
+ "404": {
447
+ "description": "Not Found",
448
+ "content": {
449
+ "application/json": {
450
+ "schema": {
451
+ "oneOf": [
452
+ {
453
+ "type": "null"
454
+ },
455
+ {
456
+ "$ref": "#/components/schemas/ErrorBody"
457
+ }
458
+ ]
459
+ }
460
+ }
461
+ }
462
+ },
463
+ "409": {
464
+ "description": "Conflict",
465
+ "content": {
466
+ "application/json": {
467
+ "schema": {
468
+ "oneOf": [
469
+ {
470
+ "type": "null"
471
+ },
472
+ {
473
+ "$ref": "#/components/schemas/ErrorBody"
474
+ }
475
+ ]
476
+ }
477
+ }
478
+ }
479
+ },
480
+ "412": {
481
+ "description": "Precondition Failed",
482
+ "content": {
483
+ "application/json": {
484
+ "schema": {
485
+ "oneOf": [
486
+ {
487
+ "type": "null"
488
+ },
489
+ {
490
+ "$ref": "#/components/schemas/ErrorBody"
491
+ }
492
+ ]
493
+ }
494
+ }
495
+ }
496
+ }
497
+ }
498
+ }
499
+ },
500
+ {
501
+ "producer": "terrabase-csharp",
502
+ "client": "TerraBaseV1Client",
503
+ "operation": "deleteDocument",
504
+ "method": "DELETE",
505
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/documents/{id}",
506
+ "permission": "documents:write",
507
+ "requestMediaTypes": [],
508
+ "responseMediaType": "application/json",
509
+ "successStatuses": [
510
+ 200
511
+ ],
512
+ "idempotencyKey": "none",
513
+ "replaySafe": false,
514
+ "producerOperation": {
515
+ "tags": [
516
+ "Documents"
517
+ ],
518
+ "summary": "Deletes a JSON document",
519
+ "description": "Optional If-Match. Returns the tombstone's version; deleting an absent or deleted document returns 404 not_found.",
520
+ "operationId": "deleteDocument",
521
+ "responses": {
522
+ "200": {
523
+ "description": "OK",
524
+ "content": {
525
+ "application/json": {
526
+ "schema": {
527
+ "oneOf": [
528
+ {
529
+ "type": "null"
530
+ },
531
+ {
532
+ "$ref": "#/components/schemas/WriteBody"
533
+ }
534
+ ]
535
+ }
536
+ }
537
+ }
538
+ },
539
+ "404": {
540
+ "description": "Not Found",
541
+ "content": {
542
+ "application/json": {
543
+ "schema": {
544
+ "oneOf": [
545
+ {
546
+ "type": "null"
547
+ },
548
+ {
549
+ "$ref": "#/components/schemas/ErrorBody"
550
+ }
551
+ ]
552
+ }
553
+ }
554
+ }
555
+ },
556
+ "412": {
557
+ "description": "Precondition Failed",
558
+ "content": {
559
+ "application/json": {
560
+ "schema": {
561
+ "oneOf": [
562
+ {
563
+ "type": "null"
564
+ },
565
+ {
566
+ "$ref": "#/components/schemas/ErrorBody"
567
+ }
568
+ ]
569
+ }
570
+ }
571
+ }
572
+ }
573
+ }
574
+ }
575
+ },
576
+ {
577
+ "producer": "terrabase-csharp",
578
+ "client": "TerraBaseV1Client",
579
+ "operation": "commitTransaction",
580
+ "method": "POST",
581
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/transactions",
582
+ "permission": "documents:write",
583
+ "requestMediaTypes": [
584
+ "application/json"
585
+ ],
586
+ "responseMediaType": "application/json",
587
+ "successStatuses": [
588
+ 200
589
+ ],
590
+ "idempotencyKey": "none",
591
+ "replaySafe": false,
592
+ "producerOperation": {
593
+ "tags": [
594
+ "Documents"
595
+ ],
596
+ "summary": "Applies document operations atomically",
597
+ "description": "{\"ops\":[…]} with 1 to 1024 operations across the collections of one database: create (put with if_none_match \"*\"; id is generated as a UUIDv7 when omitted), put (document, optional if_match or if_none_match \"*\"), patch (exactly one of merge or ops, optional if_match), delete (optional if_match), assert (filter: the document exists and matches; or absent: true) and assert_count (filter, gte and/or lte; at most 16 per transaction, at most 10000 documents examined). Assertions see the state before this transaction's writes. Two operations may not target the same document. Every failure names the failing operation in error.op. Assertions also need the documents:read scope. Query assertions and counts are interrupted at SQLite progress callbacks after 5 million VM instructions or a 5-second deadline (400 invalid_query, query too expensive). Existing non-UUID legacy document ids remain addressable; new ids must be lowercase hyphenated UUIDs.",
598
+ "operationId": "transaction",
599
+ "requestBody": {
600
+ "content": {
601
+ "application/json": {
602
+ "schema": {
603
+ "required": [
604
+ "ops"
605
+ ],
606
+ "type": "object",
607
+ "properties": {
608
+ "ops": {
609
+ "type": [
610
+ "null",
611
+ "array"
612
+ ],
613
+ "items": {
614
+ "required": [
615
+ "op",
616
+ "collection",
617
+ "id",
618
+ "document",
619
+ "if_match",
620
+ "if_none_match",
621
+ "merge",
622
+ "ops",
623
+ "filter",
624
+ "absent",
625
+ "gte",
626
+ "lte"
627
+ ],
628
+ "type": "object",
629
+ "properties": {
630
+ "op": {
631
+ "type": [
632
+ "null",
633
+ "string"
634
+ ]
635
+ },
636
+ "collection": {
637
+ "type": [
638
+ "null",
639
+ "string"
640
+ ]
641
+ },
642
+ "id": {
643
+ "type": [
644
+ "null",
645
+ "string"
646
+ ]
647
+ },
648
+ "document": {},
649
+ "if_match": {
650
+ "type": [
651
+ "null",
652
+ "string"
653
+ ]
654
+ },
655
+ "if_none_match": {
656
+ "type": [
657
+ "null",
658
+ "string"
659
+ ]
660
+ },
661
+ "merge": {},
662
+ "ops": {
663
+ "type": [
664
+ "null",
665
+ "array"
666
+ ],
667
+ "items": {
668
+ "required": [
669
+ "op",
670
+ "path",
671
+ "value",
672
+ "by"
673
+ ],
674
+ "type": "object",
675
+ "properties": {
676
+ "op": {
677
+ "type": [
678
+ "null",
679
+ "string"
680
+ ]
681
+ },
682
+ "path": {
683
+ "type": [
684
+ "null",
685
+ "string"
686
+ ]
687
+ },
688
+ "value": {},
689
+ "by": {}
690
+ }
691
+ }
692
+ },
693
+ "filter": {},
694
+ "absent": {
695
+ "type": [
696
+ "null",
697
+ "boolean"
698
+ ]
699
+ },
700
+ "gte": {
701
+ "pattern": "^-?(?:0|[1-9]\\d*)$",
702
+ "type": [
703
+ "null",
704
+ "integer",
705
+ "string"
706
+ ],
707
+ "format": "int64"
708
+ },
709
+ "lte": {
710
+ "pattern": "^-?(?:0|[1-9]\\d*)$",
711
+ "type": [
712
+ "null",
713
+ "integer",
714
+ "string"
715
+ ],
716
+ "format": "int64"
717
+ }
718
+ }
719
+ }
720
+ }
721
+ }
722
+ }
723
+ }
724
+ },
725
+ "required": true
726
+ },
727
+ "responses": {
728
+ "200": {
729
+ "description": "OK",
730
+ "content": {
731
+ "application/json": {
732
+ "schema": {
733
+ "oneOf": [
734
+ {
735
+ "type": "null"
736
+ },
737
+ {
738
+ "$ref": "#/components/schemas/TransactionBody"
739
+ }
740
+ ]
741
+ }
742
+ }
743
+ }
744
+ },
745
+ "400": {
746
+ "description": "Bad Request",
747
+ "content": {
748
+ "application/json": {
749
+ "schema": {
750
+ "oneOf": [
751
+ {
752
+ "type": "null"
753
+ },
754
+ {
755
+ "$ref": "#/components/schemas/ErrorBody"
756
+ }
757
+ ]
758
+ }
759
+ }
760
+ }
761
+ },
762
+ "404": {
763
+ "description": "Not Found",
764
+ "content": {
765
+ "application/json": {
766
+ "schema": {
767
+ "oneOf": [
768
+ {
769
+ "type": "null"
770
+ },
771
+ {
772
+ "$ref": "#/components/schemas/ErrorBody"
773
+ }
774
+ ]
775
+ }
776
+ }
777
+ }
778
+ },
779
+ "409": {
780
+ "description": "Conflict",
781
+ "content": {
782
+ "application/json": {
783
+ "schema": {
784
+ "oneOf": [
785
+ {
786
+ "type": "null"
787
+ },
788
+ {
789
+ "$ref": "#/components/schemas/ErrorBody"
790
+ }
791
+ ]
792
+ }
793
+ }
794
+ }
795
+ },
796
+ "412": {
797
+ "description": "Precondition Failed",
798
+ "content": {
799
+ "application/json": {
800
+ "schema": {
801
+ "oneOf": [
802
+ {
803
+ "type": "null"
804
+ },
805
+ {
806
+ "$ref": "#/components/schemas/ErrorBody"
807
+ }
808
+ ]
809
+ }
810
+ }
811
+ }
812
+ },
813
+ "503": {
814
+ "description": "Service Unavailable",
815
+ "content": {
816
+ "application/json": {
817
+ "schema": {
818
+ "oneOf": [
819
+ {
820
+ "type": "null"
821
+ },
822
+ {
823
+ "$ref": "#/components/schemas/ErrorBody"
824
+ }
825
+ ]
826
+ }
827
+ }
828
+ }
829
+ }
830
+ }
831
+ }
832
+ },
833
+ {
834
+ "producer": "terrabase-csharp",
835
+ "client": "TerraBaseV1Client",
836
+ "operation": "queryDocuments",
837
+ "method": "POST",
838
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/query",
839
+ "permission": "documents:read",
840
+ "requestMediaTypes": [
841
+ "application/json"
842
+ ],
843
+ "responseMediaType": "application/json",
844
+ "successStatuses": [
845
+ 200
846
+ ],
847
+ "idempotencyKey": "none",
848
+ "replaySafe": true,
849
+ "producerOperation": {
850
+ "tags": [
851
+ "Documents"
852
+ ],
853
+ "summary": "Queries JSON documents",
854
+ "description": "Filters ({\"and\"|\"or\":[F…]} with 1 to 64 children, {\"not\":F}, {\"eq\"|\"ne\"|\"lt\"|\"lte\"|\"gt\"|\"gte\":[P,V]}, {\"in\"|\"nin\":[P,[V…]]} with 1 to 256 values, {\"exists\":P}, {\"prefix\":[P,\"str\"]}, {\"contains\":[P,V]}; at most 8 levels and 256 nodes) run inside SQLite. P is a JSON Pointer of object members (nested paths allowed) or \"$id\"; V is a JSON scalar. Ordered comparisons only match values of V's type and reject null; ne and nin also match missing members. sort has at most 4 {path, order} keys, then id; repeated paths retain only their first occurrence, and keys after the unique $id are omitted; encoded cursors are at most 1 MiB and cursor-producing string values are at most 64 KiB UTF-8 each, and the compact query plus continuation must fit the 4 MiB request limit (400 sort_requires_index beyond); values order missing < null < false < true < numbers < strings < arrays/objects. project keeps at most 64 paths with their parents; duplicate decoded paths and descendants covered by selected ancestors are copied only once, with case-sensitive member names. limit is 1 to 1000 (default 50); a page also stops at 8 MiB of JSON. cursor is the previous page's next_cursor and only works with the same filter, sort and project (400 invalid_cursor). count counts matches among at most 100000 documents (exact is false beyond, and value is a lower bound), on requests without a cursor. Queries and counts are interrupted at SQLite progress callbacks after 5 million VM instructions or a 5-second deadline (400 invalid_query, query too expensive). Cancellation also interrupts SQLite. A field sort requires at most 10000 live candidate documents and at most 8 MiB of candidate JSON, otherwise 400 sort_requires_index. lower and explain are not supported yet.",
855
+ "operationId": "queryDocuments",
856
+ "requestBody": {
857
+ "content": {
858
+ "application/json": {
859
+ "schema": {
860
+ "required": [
861
+ "filter",
862
+ "sort",
863
+ "project",
864
+ "limit",
865
+ "cursor",
866
+ "count",
867
+ "explain"
868
+ ],
869
+ "type": "object",
870
+ "properties": {
871
+ "filter": {},
872
+ "sort": {
873
+ "type": [
874
+ "null",
875
+ "array"
876
+ ],
877
+ "items": {
878
+ "required": [
879
+ "path",
880
+ "order"
881
+ ],
882
+ "type": "object",
883
+ "properties": {
884
+ "path": {},
885
+ "order": {
886
+ "type": [
887
+ "null",
888
+ "string"
889
+ ]
890
+ }
891
+ }
892
+ }
893
+ },
894
+ "project": {
895
+ "type": [
896
+ "null",
897
+ "array"
898
+ ]
899
+ },
900
+ "limit": {
901
+ "pattern": "^-?(?:0|[1-9]\\d*)$",
902
+ "type": [
903
+ "null",
904
+ "integer",
905
+ "string"
906
+ ],
907
+ "format": "int32"
908
+ },
909
+ "cursor": {
910
+ "type": [
911
+ "null",
912
+ "string"
913
+ ]
914
+ },
915
+ "count": {
916
+ "type": [
917
+ "null",
918
+ "boolean"
919
+ ]
920
+ },
921
+ "explain": {}
922
+ }
923
+ }
924
+ }
925
+ },
926
+ "required": true
927
+ },
928
+ "responses": {
929
+ "200": {
930
+ "description": "OK",
931
+ "content": {
932
+ "application/json": {
933
+ "schema": {
934
+ "oneOf": [
935
+ {
936
+ "type": "null"
937
+ },
938
+ {
939
+ "$ref": "#/components/schemas/DocumentPageBody"
940
+ }
941
+ ]
942
+ }
943
+ }
944
+ }
945
+ },
946
+ "400": {
947
+ "description": "Bad Request",
948
+ "content": {
949
+ "application/json": {
950
+ "schema": {
951
+ "oneOf": [
952
+ {
953
+ "type": "null"
954
+ },
955
+ {
956
+ "$ref": "#/components/schemas/ErrorBody"
957
+ }
958
+ ]
959
+ }
960
+ }
961
+ }
962
+ },
963
+ "404": {
964
+ "description": "Not Found",
965
+ "content": {
966
+ "application/json": {
967
+ "schema": {
968
+ "oneOf": [
969
+ {
970
+ "type": "null"
971
+ },
972
+ {
973
+ "$ref": "#/components/schemas/ErrorBody"
974
+ }
975
+ ]
976
+ }
977
+ }
978
+ }
979
+ },
980
+ "503": {
981
+ "description": "Service Unavailable",
982
+ "content": {
983
+ "application/json": {
984
+ "schema": {
985
+ "oneOf": [
986
+ {
987
+ "type": "null"
988
+ },
989
+ {
990
+ "$ref": "#/components/schemas/ErrorBody"
991
+ }
992
+ ]
993
+ }
994
+ }
995
+ }
996
+ }
997
+ }
998
+ }
999
+ },
1000
+ {
1001
+ "producer": "terrabase-csharp",
1002
+ "client": "TerraBaseV1Client",
1003
+ "operation": "createCollection",
1004
+ "method": "POST",
1005
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections",
1006
+ "permission": "documents:write",
1007
+ "requestMediaTypes": [
1008
+ "application/json"
1009
+ ],
1010
+ "responseMediaType": "application/json",
1011
+ "successStatuses": [
1012
+ 201
1013
+ ],
1014
+ "idempotencyKey": "none",
1015
+ "replaySafe": false,
1016
+ "producerOperation": {
1017
+ "tags": [
1018
+ "Collections"
1019
+ ],
1020
+ "summary": "Creates a collection",
1021
+ "description": "Body {\"name\":…}; names match ^[a-z][a-z0-9_-]{0,62}$. Collections are schemaless; schema, ttl_path, unique, indexes and advisor are not supported yet and fail as unknown members. An existing name fails with 409 name_taken.",
1022
+ "operationId": "createCollection",
1023
+ "requestBody": {
1024
+ "content": {
1025
+ "application/json": {
1026
+ "schema": {
1027
+ "required": [
1028
+ "name"
1029
+ ],
1030
+ "type": "object",
1031
+ "properties": {
1032
+ "name": {
1033
+ "type": [
1034
+ "null",
1035
+ "string"
1036
+ ]
1037
+ }
1038
+ }
1039
+ }
1040
+ }
1041
+ },
1042
+ "required": true
1043
+ },
1044
+ "responses": {
1045
+ "201": {
1046
+ "description": "Created",
1047
+ "content": {
1048
+ "application/json": {
1049
+ "schema": {
1050
+ "oneOf": [
1051
+ {
1052
+ "type": "null"
1053
+ },
1054
+ {
1055
+ "$ref": "#/components/schemas/CollectionBody"
1056
+ }
1057
+ ]
1058
+ }
1059
+ }
1060
+ }
1061
+ },
1062
+ "404": {
1063
+ "description": "Not Found",
1064
+ "content": {
1065
+ "application/json": {
1066
+ "schema": {
1067
+ "oneOf": [
1068
+ {
1069
+ "type": "null"
1070
+ },
1071
+ {
1072
+ "$ref": "#/components/schemas/ErrorBody"
1073
+ }
1074
+ ]
1075
+ }
1076
+ }
1077
+ }
1078
+ },
1079
+ "409": {
1080
+ "description": "Conflict",
1081
+ "content": {
1082
+ "application/json": {
1083
+ "schema": {
1084
+ "oneOf": [
1085
+ {
1086
+ "type": "null"
1087
+ },
1088
+ {
1089
+ "$ref": "#/components/schemas/ErrorBody"
1090
+ }
1091
+ ]
1092
+ }
1093
+ }
1094
+ }
1095
+ }
1096
+ }
1097
+ }
1098
+ },
1099
+ {
1100
+ "producer": "terrabase-csharp",
1101
+ "client": "TerraBaseV1Client",
1102
+ "operation": "getCollection",
1103
+ "method": "GET",
1104
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}",
1105
+ "permission": "documents:read",
1106
+ "requestMediaTypes": [],
1107
+ "responseMediaType": "application/json",
1108
+ "successStatuses": [
1109
+ 200
1110
+ ],
1111
+ "idempotencyKey": "none",
1112
+ "replaySafe": true,
1113
+ "producerOperation": {
1114
+ "tags": [
1115
+ "Collections"
1116
+ ],
1117
+ "summary": "Reads a collection",
1118
+ "operationId": "getCollection",
1119
+ "responses": {
1120
+ "200": {
1121
+ "description": "OK",
1122
+ "content": {
1123
+ "application/json": {
1124
+ "schema": {
1125
+ "oneOf": [
1126
+ {
1127
+ "type": "null"
1128
+ },
1129
+ {
1130
+ "$ref": "#/components/schemas/CollectionBody"
1131
+ }
1132
+ ]
1133
+ }
1134
+ }
1135
+ }
1136
+ },
1137
+ "404": {
1138
+ "description": "Not Found",
1139
+ "content": {
1140
+ "application/json": {
1141
+ "schema": {
1142
+ "oneOf": [
1143
+ {
1144
+ "type": "null"
1145
+ },
1146
+ {
1147
+ "$ref": "#/components/schemas/ErrorBody"
1148
+ }
1149
+ ]
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+ }
1155
+ }
1156
+ },
1157
+ {
1158
+ "producer": "terrabase-csharp",
1159
+ "client": "TerraBaseV1Client",
1160
+ "operation": "listCollections",
1161
+ "method": "GET",
1162
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections",
1163
+ "permission": "documents:read",
1164
+ "requestMediaTypes": [],
1165
+ "responseMediaType": "application/json",
1166
+ "successStatuses": [
1167
+ 200
1168
+ ],
1169
+ "idempotencyKey": "none",
1170
+ "replaySafe": true,
1171
+ "producerOperation": {
1172
+ "tags": [
1173
+ "Collections"
1174
+ ],
1175
+ "summary": "Lists collections in name order",
1176
+ "description": "Query: limit (1 to 200, default 50) and cursor (next_cursor of the previous page).",
1177
+ "operationId": "listCollections",
1178
+ "responses": {
1179
+ "200": {
1180
+ "description": "OK",
1181
+ "content": {
1182
+ "application/json": {
1183
+ "schema": {
1184
+ "oneOf": [
1185
+ {
1186
+ "type": "null"
1187
+ },
1188
+ {
1189
+ "$ref": "#/components/schemas/CollectionPageBody"
1190
+ }
1191
+ ]
1192
+ }
1193
+ }
1194
+ }
1195
+ },
1196
+ "404": {
1197
+ "description": "Not Found",
1198
+ "content": {
1199
+ "application/json": {
1200
+ "schema": {
1201
+ "oneOf": [
1202
+ {
1203
+ "type": "null"
1204
+ },
1205
+ {
1206
+ "$ref": "#/components/schemas/ErrorBody"
1207
+ }
1208
+ ]
1209
+ }
1210
+ }
1211
+ }
1212
+ }
1213
+ }
1214
+ }
1215
+ },
1216
+ {
1217
+ "producer": "terrabase-csharp",
1218
+ "client": "TerraBaseV1Client",
1219
+ "operation": "dropCollection",
1220
+ "method": "DELETE",
1221
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}",
1222
+ "permission": "documents:write",
1223
+ "requestMediaTypes": [],
1224
+ "responseMediaType": "application/json",
1225
+ "successStatuses": [
1226
+ 200
1227
+ ],
1228
+ "idempotencyKey": "none",
1229
+ "replaySafe": false,
1230
+ "producerOperation": {
1231
+ "tags": [
1232
+ "Collections"
1233
+ ],
1234
+ "summary": "Drops a collection",
1235
+ "description": "Deletes the collection and every document in it in one transaction, and returns the dropped collection.",
1236
+ "operationId": "dropCollection",
1237
+ "responses": {
1238
+ "200": {
1239
+ "description": "OK",
1240
+ "content": {
1241
+ "application/json": {
1242
+ "schema": {
1243
+ "oneOf": [
1244
+ {
1245
+ "type": "null"
1246
+ },
1247
+ {
1248
+ "$ref": "#/components/schemas/CollectionBody"
1249
+ }
1250
+ ]
1251
+ }
1252
+ }
1253
+ }
1254
+ },
1255
+ "404": {
1256
+ "description": "Not Found",
1257
+ "content": {
1258
+ "application/json": {
1259
+ "schema": {
1260
+ "oneOf": [
1261
+ {
1262
+ "type": "null"
1263
+ },
1264
+ {
1265
+ "$ref": "#/components/schemas/ErrorBody"
1266
+ }
1267
+ ]
1268
+ }
1269
+ }
1270
+ }
1271
+ }
1272
+ }
1273
+ }
1274
+ },
1275
+ {
1276
+ "producer": "terrabase-csharp",
1277
+ "client": "TerraBaseV1Client",
1278
+ "operation": "readShape",
1279
+ "method": "GET",
1280
+ "pathTemplate": "/v1/projects/{project}/databases/{database}/collections/{collection}/shape",
1281
+ "permission": "shapes:read",
1282
+ "requestMediaTypes": [],
1283
+ "responseMediaType": "application/json",
1284
+ "successStatuses": [
1285
+ 200,
1286
+ 307
1287
+ ],
1288
+ "idempotencyKey": "none",
1289
+ "replaySafe": true,
1290
+ "producerOperation": {
1291
+ "tags": [
1292
+ "Shapes"
1293
+ ],
1294
+ "summary": "Reads a shape: a snapshot and change log of a collection and filter",
1295
+ "description": "where is a query v1 filter as JSON (optional; every document without it). offset -1 answers 307 to the first snapshot page snap.<S>.0 of head S, with the shape's handle. Snapshot pages hold at most 1000 documents or 1 MiB in id order (one document may exceed 1 MiB with framing, up to 8 MiB); the last one continues at log position S. A log position O returns the commits after O, at most 4096 of them and 1 MiB, grouped by commit offset; a document that is deleted or stops matching is a delete op, and a delete may name a document the client never received. handle is required unless offset is -1; a stale handle or an offset outside the available history answers 409 must_refetch with the current handle: discard the shape and restart at -1. live=true (log positions only) waits up to 20 seconds for a commit when O is the head, then returns no changes; send the TB-Shape-Cursor of the previous response as cursor; each response advances beyond that cursor, even within one time bucket. Snapshot pages and closed chunks have immutable bytes and stable ETags. Origin responses use private, max-age=0, must-revalidate so every reuse checks current authorization; every response varies on Authorization. Shared CDN caching requires authorization before every cache lookup and is not enabled by these headers. TB-Shape-Handle, TB-Shape-Next-Offset and TB-Shape-Up-To-Date mirror the body; If-None-Match with the ETag returns 304. Treat client state as consistent only when up_to_date is true. At capacity, requests return 429 shape_busy; filters whose canonical continuation URL cannot fit an 8 KiB request line return 414 uri_too_long before redirecting.",
1296
+ "operationId": "getShape",
1297
+ "responses": {
1298
+ "200": {
1299
+ "description": "OK",
1300
+ "content": {
1301
+ "application/json": {
1302
+ "schema": {
1303
+ "oneOf": [
1304
+ {
1305
+ "type": "null"
1306
+ },
1307
+ {
1308
+ "$ref": "#/components/schemas/ShapeBody"
1309
+ }
1310
+ ]
1311
+ }
1312
+ }
1313
+ }
1314
+ },
1315
+ "400": {
1316
+ "description": "Bad Request",
1317
+ "content": {
1318
+ "application/json": {
1319
+ "schema": {
1320
+ "oneOf": [
1321
+ {
1322
+ "type": "null"
1323
+ },
1324
+ {
1325
+ "$ref": "#/components/schemas/ErrorBody"
1326
+ }
1327
+ ]
1328
+ }
1329
+ }
1330
+ }
1331
+ },
1332
+ "404": {
1333
+ "description": "Not Found",
1334
+ "content": {
1335
+ "application/json": {
1336
+ "schema": {
1337
+ "oneOf": [
1338
+ {
1339
+ "type": "null"
1340
+ },
1341
+ {
1342
+ "$ref": "#/components/schemas/ErrorBody"
1343
+ }
1344
+ ]
1345
+ }
1346
+ }
1347
+ }
1348
+ },
1349
+ "409": {
1350
+ "description": "Conflict",
1351
+ "content": {
1352
+ "application/json": {
1353
+ "schema": {
1354
+ "oneOf": [
1355
+ {
1356
+ "type": "null"
1357
+ },
1358
+ {
1359
+ "$ref": "#/components/schemas/ErrorBody"
1360
+ }
1361
+ ]
1362
+ }
1363
+ }
1364
+ }
1365
+ },
1366
+ "414": {
1367
+ "description": "URI Too Long",
1368
+ "content": {
1369
+ "application/json": {
1370
+ "schema": {
1371
+ "oneOf": [
1372
+ {
1373
+ "type": "null"
1374
+ },
1375
+ {
1376
+ "$ref": "#/components/schemas/ErrorBody"
1377
+ }
1378
+ ]
1379
+ }
1380
+ }
1381
+ }
1382
+ },
1383
+ "429": {
1384
+ "description": "Too Many Requests",
1385
+ "content": {
1386
+ "application/json": {
1387
+ "schema": {
1388
+ "oneOf": [
1389
+ {
1390
+ "type": "null"
1391
+ },
1392
+ {
1393
+ "$ref": "#/components/schemas/ErrorBody"
1394
+ }
1395
+ ]
1396
+ }
1397
+ }
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+ }
1403
+ ],
1404
+ "schemas": {
1405
+ "AcceptInvitationRequest": {
1406
+ "required": [
1407
+ "token",
1408
+ "email"
1409
+ ],
1410
+ "type": "object",
1411
+ "properties": {
1412
+ "token": {
1413
+ "type": [
1414
+ "null",
1415
+ "string"
1416
+ ]
1417
+ },
1418
+ "email": {
1419
+ "type": [
1420
+ "null",
1421
+ "string"
1422
+ ]
1423
+ }
1424
+ }
1425
+ },
1426
+ "AuditEvent": {
1427
+ "required": [
1428
+ "id",
1429
+ "actor",
1430
+ "action",
1431
+ "target",
1432
+ "detail",
1433
+ "occurredAt"
1434
+ ],
1435
+ "type": "object",
1436
+ "properties": {
1437
+ "id": {
1438
+ "type": "string"
1439
+ },
1440
+ "actor": {
1441
+ "type": "string"
1442
+ },
1443
+ "action": {
1444
+ "type": "string"
1445
+ },
1446
+ "target": {
1447
+ "type": [
1448
+ "null",
1449
+ "string"
1450
+ ]
1451
+ },
1452
+ "detail": {
1453
+ "type": [
1454
+ "null",
1455
+ "string"
1456
+ ]
1457
+ },
1458
+ "occurredAt": {
1459
+ "type": "string",
1460
+ "format": "date-time"
1461
+ }
1462
+ }
1463
+ },
1464
+ "AuditRetention": {
1465
+ "required": [
1466
+ "days"
1467
+ ],
1468
+ "type": "object",
1469
+ "properties": {
1470
+ "days": {
1471
+ "pattern": "^-?(?:0|[1-9]\\d*)$",
1472
+ "type": [
1473
+ "integer",
1474
+ "string"
1475
+ ],
1476
+ "format": "int32"
1477
+ }
1478
+ }
1479
+ },
1480
+ "CollectionBody": {
1481
+ "required": [
1482
+ "name",
1483
+ "created_at"
1484
+ ],
1485
+ "type": "object",
1486
+ "properties": {
1487
+ "name": {
1488
+ "type": "string"
1489
+ },
1490
+ "created_at": {
1491
+ "type": "string"
1492
+ }
1493
+ }
1494
+ },
1495
+ "CollectionPageBody": {
1496
+ "required": [
1497
+ "items",
1498
+ "next_cursor"
1499
+ ],
1500
+ "type": "object",
1501
+ "properties": {
1502
+ "items": {
1503
+ "type": "array",
1504
+ "items": {
1505
+ "$ref": "#/components/schemas/CollectionBody"
1506
+ }
1507
+ },
1508
+ "next_cursor": {
1509
+ "type": [
1510
+ "null",
1511
+ "string"
1512
+ ]
1513
+ }
1514
+ }
1515
+ },
1516
+ "CountBody": {
1517
+ "required": [
1518
+ "value",
1519
+ "exact"
1520
+ ],
1521
+ "type": "object",
1522
+ "properties": {
1523
+ "value": {
1524
+ "type": "string"
1525
+ },
1526
+ "exact": {
1527
+ "type": "boolean"
1528
+ }
1529
+ }
1530
+ },
1531
+ "CreateApiKeyRequest": {
1532
+ "required": [
1533
+ "name",
1534
+ "scopes"
1535
+ ],
1536
+ "type": "object",
1537
+ "properties": {
1538
+ "name": {
1539
+ "type": "string"
1540
+ },
1541
+ "scopes": {
1542
+ "type": "array",
1543
+ "items": {
1544
+ "type": "string"
1545
+ }
1546
+ },
1547
+ "organizationId": {
1548
+ "type": [
1549
+ "null",
1550
+ "string"
1551
+ ]
1552
+ },
1553
+ "projectId": {
1554
+ "type": [
1555
+ "null",
1556
+ "string"
1557
+ ]
1558
+ },
1559
+ "databaseId": {
1560
+ "type": [
1561
+ "null",
1562
+ "string"
1563
+ ]
1564
+ }
1565
+ }
1566
+ },
1567
+ "CreatedApiKeyBody": {
1568
+ "required": [
1569
+ "id",
1570
+ "name",
1571
+ "scopes",
1572
+ "organizationId",
1573
+ "projectId",
1574
+ "databaseId",
1575
+ "secret"
1576
+ ],
1577
+ "type": "object",
1578
+ "properties": {
1579
+ "id": {
1580
+ "type": "string"
1581
+ },
1582
+ "name": {
1583
+ "type": "string"
1584
+ },
1585
+ "scopes": {
1586
+ "type": "array",
1587
+ "items": {
1588
+ "type": "string"
1589
+ }
1590
+ },
1591
+ "organizationId": {
1592
+ "type": "string"
1593
+ },
1594
+ "projectId": {
1595
+ "type": [
1596
+ "null",
1597
+ "string"
1598
+ ]
1599
+ },
1600
+ "databaseId": {
1601
+ "type": [
1602
+ "null",
1603
+ "string"
1604
+ ]
1605
+ },
1606
+ "secret": {
1607
+ "type": "string"
1608
+ }
1609
+ }
1610
+ },
1611
+ "CreatedInvitation": {
1612
+ "required": [
1613
+ "invitation",
1614
+ "token"
1615
+ ],
1616
+ "type": "object",
1617
+ "properties": {
1618
+ "invitation": {
1619
+ "$ref": "#/components/schemas/Invitation"
1620
+ },
1621
+ "token": {
1622
+ "type": "string"
1623
+ }
1624
+ }
1625
+ },
1626
+ "DatabaseBody": {
1627
+ "required": [
1628
+ "id",
1629
+ "projectId",
1630
+ "name"
1631
+ ],
1632
+ "type": "object",
1633
+ "properties": {
1634
+ "id": {
1635
+ "type": "string"
1636
+ },
1637
+ "projectId": {
1638
+ "type": "string"
1639
+ },
1640
+ "name": {
1641
+ "type": "string"
1642
+ }
1643
+ }
1644
+ },
1645
+ "DocumentBody": {
1646
+ "required": [
1647
+ "id",
1648
+ "version",
1649
+ "state",
1650
+ "document"
1651
+ ],
1652
+ "type": "object",
1653
+ "properties": {
1654
+ "id": {
1655
+ "type": "string"
1656
+ },
1657
+ "version": {
1658
+ "type": "string"
1659
+ },
1660
+ "state": {
1661
+ "type": "string"
1662
+ },
1663
+ "document": {
1664
+ "$ref": "#/components/schemas/JsonElement"
1665
+ }
1666
+ }
1667
+ },
1668
+ "DocumentPageBody": {
1669
+ "required": [
1670
+ "items",
1671
+ "next_cursor"
1672
+ ],
1673
+ "type": "object",
1674
+ "properties": {
1675
+ "items": {
1676
+ "type": "array",
1677
+ "items": {
1678
+ "$ref": "#/components/schemas/DocumentBody"
1679
+ }
1680
+ },
1681
+ "next_cursor": {
1682
+ "type": [
1683
+ "null",
1684
+ "string"
1685
+ ]
1686
+ },
1687
+ "count": {
1688
+ "oneOf": [
1689
+ {
1690
+ "type": "null"
1691
+ },
1692
+ {
1693
+ "$ref": "#/components/schemas/CountBody"
1694
+ }
1695
+ ]
1696
+ }
1697
+ }
1698
+ },
1699
+ "ErrorBody": {
1700
+ "required": [
1701
+ "error"
1702
+ ],
1703
+ "type": "object",
1704
+ "properties": {
1705
+ "error": {
1706
+ "$ref": "#/components/schemas/ErrorDetail"
1707
+ }
1708
+ }
1709
+ },
1710
+ "ErrorDetail": {
1711
+ "required": [
1712
+ "code"
1713
+ ],
1714
+ "type": "object",
1715
+ "properties": {
1716
+ "code": {
1717
+ "type": "string"
1718
+ },
1719
+ "message": {
1720
+ "type": [
1721
+ "null",
1722
+ "string"
1723
+ ]
1724
+ },
1725
+ "op": {
1726
+ "pattern": "^-?(?:0|[1-9]\\d*)$",
1727
+ "type": [
1728
+ "null",
1729
+ "integer",
1730
+ "string"
1731
+ ],
1732
+ "format": "int32"
1733
+ },
1734
+ "handle": {
1735
+ "type": [
1736
+ "null",
1737
+ "string"
1738
+ ]
1739
+ }
1740
+ }
1741
+ },
1742
+ "Invitation": {
1743
+ "required": [
1744
+ "id",
1745
+ "email",
1746
+ "role",
1747
+ "invitedBy",
1748
+ "createdAt",
1749
+ "expiresAt"
1750
+ ],
1751
+ "type": "object",
1752
+ "properties": {
1753
+ "id": {
1754
+ "type": "string"
1755
+ },
1756
+ "email": {
1757
+ "type": "string"
1758
+ },
1759
+ "role": {
1760
+ "$ref": "#/components/schemas/OrganizationRole"
1761
+ },
1762
+ "invitedBy": {
1763
+ "type": "string"
1764
+ },
1765
+ "createdAt": {
1766
+ "type": "string",
1767
+ "format": "date-time"
1768
+ },
1769
+ "expiresAt": {
1770
+ "type": "string",
1771
+ "format": "date-time"
1772
+ }
1773
+ }
1774
+ },
1775
+ "InvitationRequest": {
1776
+ "required": [
1777
+ "email",
1778
+ "role"
1779
+ ],
1780
+ "type": "object",
1781
+ "properties": {
1782
+ "email": {
1783
+ "type": [
1784
+ "null",
1785
+ "string"
1786
+ ]
1787
+ },
1788
+ "role": {
1789
+ "oneOf": [
1790
+ {
1791
+ "type": "null"
1792
+ },
1793
+ {
1794
+ "$ref": "#/components/schemas/OrganizationRole"
1795
+ }
1796
+ ]
1797
+ }
1798
+ }
1799
+ },
1800
+ "JsonElement": {},
1801
+ "ManagedDatabase": {
1802
+ "required": [
1803
+ "id",
1804
+ "projectId",
1805
+ "name",
1806
+ "branchedFrom",
1807
+ "createdAt"
1808
+ ],
1809
+ "type": "object",
1810
+ "properties": {
1811
+ "id": {
1812
+ "type": "string"
1813
+ },
1814
+ "projectId": {
1815
+ "type": "string"
1816
+ },
1817
+ "name": {
1818
+ "type": "string"
1819
+ },
1820
+ "branchedFrom": {
1821
+ "type": [
1822
+ "null",
1823
+ "string"
1824
+ ]
1825
+ },
1826
+ "createdAt": {
1827
+ "type": "string",
1828
+ "format": "date-time"
1829
+ }
1830
+ }
1831
+ },
1832
+ "ManagementPageOfAuditEvent": {
1833
+ "required": [
1834
+ "items",
1835
+ "next"
1836
+ ],
1837
+ "type": "object",
1838
+ "properties": {
1839
+ "items": {
1840
+ "type": "array",
1841
+ "items": {
1842
+ "$ref": "#/components/schemas/AuditEvent"
1843
+ }
1844
+ },
1845
+ "next": {
1846
+ "type": [
1847
+ "null",
1848
+ "string"
1849
+ ]
1850
+ }
1851
+ }
1852
+ },
1853
+ "ManagementPageOfInvitation": {
1854
+ "required": [
1855
+ "items",
1856
+ "next"
1857
+ ],
1858
+ "type": "object",
1859
+ "properties": {
1860
+ "items": {
1861
+ "type": "array",
1862
+ "items": {
1863
+ "$ref": "#/components/schemas/Invitation"
1864
+ }
1865
+ },
1866
+ "next": {
1867
+ "type": [
1868
+ "null",
1869
+ "string"
1870
+ ]
1871
+ }
1872
+ }
1873
+ },
1874
+ "ManagementPageOfManagedDatabase": {
1875
+ "required": [
1876
+ "items",
1877
+ "next"
1878
+ ],
1879
+ "type": "object",
1880
+ "properties": {
1881
+ "items": {
1882
+ "type": "array",
1883
+ "items": {
1884
+ "$ref": "#/components/schemas/ManagedDatabase"
1885
+ }
1886
+ },
1887
+ "next": {
1888
+ "type": [
1889
+ "null",
1890
+ "string"
1891
+ ]
1892
+ }
1893
+ }
1894
+ },
1895
+ "ManagementPageOfOrganization": {
1896
+ "required": [
1897
+ "items",
1898
+ "next"
1899
+ ],
1900
+ "type": "object",
1901
+ "properties": {
1902
+ "items": {
1903
+ "type": "array",
1904
+ "items": {
1905
+ "$ref": "#/components/schemas/Organization"
1906
+ }
1907
+ },
1908
+ "next": {
1909
+ "type": [
1910
+ "null",
1911
+ "string"
1912
+ ]
1913
+ }
1914
+ }
1915
+ },
1916
+ "ManagementPageOfOrganizationMember": {
1917
+ "required": [
1918
+ "items",
1919
+ "next"
1920
+ ],
1921
+ "type": "object",
1922
+ "properties": {
1923
+ "items": {
1924
+ "type": "array",
1925
+ "items": {
1926
+ "$ref": "#/components/schemas/OrganizationMember"
1927
+ }
1928
+ },
1929
+ "next": {
1930
+ "type": [
1931
+ "null",
1932
+ "string"
1933
+ ]
1934
+ }
1935
+ }
1936
+ },
1937
+ "ManagementPageOfProject": {
1938
+ "required": [
1939
+ "items",
1940
+ "next"
1941
+ ],
1942
+ "type": "object",
1943
+ "properties": {
1944
+ "items": {
1945
+ "type": "array",
1946
+ "items": {
1947
+ "$ref": "#/components/schemas/Project"
1948
+ }
1949
+ },
1950
+ "next": {
1951
+ "type": [
1952
+ "null",
1953
+ "string"
1954
+ ]
1955
+ }
1956
+ }
1957
+ },
1958
+ "NameRequest": {
1959
+ "required": [
1960
+ "name"
1961
+ ],
1962
+ "type": "object",
1963
+ "properties": {
1964
+ "name": {
1965
+ "type": [
1966
+ "null",
1967
+ "string"
1968
+ ]
1969
+ }
1970
+ }
1971
+ },
1972
+ "Organization": {
1973
+ "required": [
1974
+ "id",
1975
+ "name",
1976
+ "createdBy",
1977
+ "createdAt"
1978
+ ],
1979
+ "type": "object",
1980
+ "properties": {
1981
+ "id": {
1982
+ "type": "string"
1983
+ },
1984
+ "name": {
1985
+ "type": "string"
1986
+ },
1987
+ "createdBy": {
1988
+ "type": "string"
1989
+ },
1990
+ "createdAt": {
1991
+ "type": "string",
1992
+ "format": "date-time"
1993
+ },
1994
+ "plan": {
1995
+ "$ref": "#/components/schemas/PlanTier"
1996
+ }
1997
+ }
1998
+ },
1999
+ "OrganizationMember": {
2000
+ "required": [
2001
+ "userId",
2002
+ "role",
2003
+ "joinedAt"
2004
+ ],
2005
+ "type": "object",
2006
+ "properties": {
2007
+ "userId": {
2008
+ "type": "string"
2009
+ },
2010
+ "role": {
2011
+ "$ref": "#/components/schemas/OrganizationRole"
2012
+ },
2013
+ "joinedAt": {
2014
+ "type": "string",
2015
+ "format": "date-time"
2016
+ }
2017
+ }
2018
+ },
2019
+ "OrganizationRole": {
2020
+ "enum": [
2021
+ "member",
2022
+ "admin",
2023
+ "owner"
2024
+ ]
2025
+ },
2026
+ "OwnershipTransfer": {
2027
+ "required": [
2028
+ "fromUserId",
2029
+ "toUserId",
2030
+ "createdAt",
2031
+ "expiresAt"
2032
+ ],
2033
+ "type": "object",
2034
+ "properties": {
2035
+ "fromUserId": {
2036
+ "type": "string"
2037
+ },
2038
+ "toUserId": {
2039
+ "type": "string"
2040
+ },
2041
+ "createdAt": {
2042
+ "type": "string",
2043
+ "format": "date-time"
2044
+ },
2045
+ "expiresAt": {
2046
+ "type": "string",
2047
+ "format": "date-time"
2048
+ }
2049
+ }
2050
+ },
2051
+ "PlanRequest": {
2052
+ "required": [
2053
+ "plan"
2054
+ ],
2055
+ "type": "object",
2056
+ "properties": {
2057
+ "plan": {
2058
+ "type": [
2059
+ "null",
2060
+ "string"
2061
+ ]
2062
+ }
2063
+ }
2064
+ },
2065
+ "PlanTier": {
2066
+ "enum": [
2067
+ "hobby",
2068
+ "pro",
2069
+ "enterprise"
2070
+ ],
2071
+ "default": "hobby"
2072
+ },
2073
+ "Project": {
2074
+ "required": [
2075
+ "id",
2076
+ "organizationId",
2077
+ "name",
2078
+ "createdAt"
2079
+ ],
2080
+ "type": "object",
2081
+ "properties": {
2082
+ "id": {
2083
+ "type": "string"
2084
+ },
2085
+ "organizationId": {
2086
+ "type": "string"
2087
+ },
2088
+ "name": {
2089
+ "type": "string"
2090
+ },
2091
+ "createdAt": {
2092
+ "type": "string",
2093
+ "format": "date-time"
2094
+ }
2095
+ }
2096
+ },
2097
+ "RoleRequest": {
2098
+ "required": [
2099
+ "role"
2100
+ ],
2101
+ "type": "object",
2102
+ "properties": {
2103
+ "role": {
2104
+ "oneOf": [
2105
+ {
2106
+ "type": "null"
2107
+ },
2108
+ {
2109
+ "$ref": "#/components/schemas/OrganizationRole"
2110
+ }
2111
+ ]
2112
+ }
2113
+ }
2114
+ },
2115
+ "ShapeBody": {
2116
+ "required": [
2117
+ "shape_id",
2118
+ "handle",
2119
+ "offset",
2120
+ "next_offset",
2121
+ "up_to_date",
2122
+ "changes"
2123
+ ],
2124
+ "type": "object",
2125
+ "properties": {
2126
+ "shape_id": {
2127
+ "type": "string"
2128
+ },
2129
+ "handle": {
2130
+ "type": "string"
2131
+ },
2132
+ "offset": {
2133
+ "type": "string"
2134
+ },
2135
+ "next_offset": {
2136
+ "type": "string"
2137
+ },
2138
+ "up_to_date": {
2139
+ "type": "boolean"
2140
+ },
2141
+ "changes": {
2142
+ "type": "array",
2143
+ "items": {
2144
+ "$ref": "#/components/schemas/ShapeChangeBody"
2145
+ }
2146
+ }
2147
+ }
2148
+ },
2149
+ "ShapeChangeBody": {
2150
+ "required": [
2151
+ "offset",
2152
+ "ops"
2153
+ ],
2154
+ "type": "object",
2155
+ "properties": {
2156
+ "offset": {
2157
+ "type": "string"
2158
+ },
2159
+ "ops": {
2160
+ "type": "array",
2161
+ "items": {
2162
+ "$ref": "#/components/schemas/ShapeOpBody"
2163
+ }
2164
+ }
2165
+ }
2166
+ },
2167
+ "ShapeOpBody": {
2168
+ "required": [
2169
+ "op",
2170
+ "id"
2171
+ ],
2172
+ "type": "object",
2173
+ "properties": {
2174
+ "op": {
2175
+ "type": "string"
2176
+ },
2177
+ "id": {
2178
+ "type": "string"
2179
+ },
2180
+ "version": {
2181
+ "type": [
2182
+ "null",
2183
+ "string"
2184
+ ]
2185
+ },
2186
+ "document": {}
2187
+ }
2188
+ },
2189
+ "StatusBody": {
2190
+ "required": [
2191
+ "status",
2192
+ "version"
2193
+ ],
2194
+ "type": "object",
2195
+ "properties": {
2196
+ "status": {
2197
+ "type": "string"
2198
+ },
2199
+ "version": {
2200
+ "type": "string"
2201
+ }
2202
+ }
2203
+ },
2204
+ "SwitchOrganizationRequest": {
2205
+ "required": [
2206
+ "organizationId"
2207
+ ],
2208
+ "type": "object",
2209
+ "properties": {
2210
+ "organizationId": {
2211
+ "type": [
2212
+ "null",
2213
+ "string"
2214
+ ]
2215
+ }
2216
+ }
2217
+ },
2218
+ "TransactionBody": {
2219
+ "required": [
2220
+ "offset",
2221
+ "durability",
2222
+ "results"
2223
+ ],
2224
+ "type": "object",
2225
+ "properties": {
2226
+ "offset": {
2227
+ "type": "string"
2228
+ },
2229
+ "durability": {
2230
+ "type": "string"
2231
+ },
2232
+ "results": {
2233
+ "type": "array",
2234
+ "items": {
2235
+ "$ref": "#/components/schemas/TransactionResultBody"
2236
+ }
2237
+ }
2238
+ }
2239
+ },
2240
+ "TransactionResultBody": {
2241
+ "required": [
2242
+ "id",
2243
+ "version",
2244
+ "asserted",
2245
+ "count"
2246
+ ],
2247
+ "type": "object",
2248
+ "properties": {
2249
+ "id": {
2250
+ "type": [
2251
+ "null",
2252
+ "string"
2253
+ ]
2254
+ },
2255
+ "version": {
2256
+ "type": [
2257
+ "null",
2258
+ "string"
2259
+ ]
2260
+ },
2261
+ "asserted": {
2262
+ "type": [
2263
+ "null",
2264
+ "boolean"
2265
+ ]
2266
+ },
2267
+ "count": {
2268
+ "type": [
2269
+ "null",
2270
+ "string"
2271
+ ]
2272
+ }
2273
+ }
2274
+ },
2275
+ "TransferRequest": {
2276
+ "required": [
2277
+ "userId"
2278
+ ],
2279
+ "type": "object",
2280
+ "properties": {
2281
+ "userId": {
2282
+ "type": [
2283
+ "null",
2284
+ "string"
2285
+ ]
2286
+ }
2287
+ }
2288
+ },
2289
+ "WriteBody": {
2290
+ "required": [
2291
+ "id",
2292
+ "version",
2293
+ "offset",
2294
+ "durability"
2295
+ ],
2296
+ "type": "object",
2297
+ "properties": {
2298
+ "id": {
2299
+ "type": "string"
2300
+ },
2301
+ "version": {
2302
+ "type": "string"
2303
+ },
2304
+ "offset": {
2305
+ "type": "string"
2306
+ },
2307
+ "durability": {
2308
+ "type": "string"
2309
+ }
2310
+ }
2311
+ }
2312
+ },
2313
+ "securityEvidence": [
2314
+ "DocumentRoute.cs",
2315
+ "GetShapeEndpoint.cs",
2316
+ "IApiKeyStore.cs",
2317
+ "GetDocumentEndpoint.cs",
2318
+ "PutDocumentEndpoint.cs",
2319
+ "CreateDocumentEndpoint.cs",
2320
+ "PatchDocumentEndpoint.cs",
2321
+ "DeleteDocumentEndpoint.cs",
2322
+ "TransactionEndpoint.cs",
2323
+ "QueryDocumentsEndpoint.cs",
2324
+ "CreateCollectionEndpoint.cs",
2325
+ "GetCollectionEndpoint.cs",
2326
+ "ListCollectionsEndpoint.cs",
2327
+ "DropCollectionEndpoint.cs"
2328
+ ],
2329
+ "openapiLimitations": "Producer OpenAPI omits security schemes, route/query parameters and some conditional statuses; pinned source and real integration tests supplement it."
2330
+ }