@loams/client 0.1.0 → 0.1.1

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 (45) hide show
  1. package/README.md +78 -2
  2. package/dist/app.d.ts +149 -0
  3. package/dist/app.js +317 -0
  4. package/dist/builders/filter.d.ts +96 -0
  5. package/dist/builders/filter.js +190 -0
  6. package/dist/builders/schema.d.ts +50 -0
  7. package/dist/builders/schema.js +92 -0
  8. package/dist/builders/search.d.ts +159 -0
  9. package/dist/builders/search.js +307 -0
  10. package/dist/gen/facade.d.ts +267 -2
  11. package/dist/gen/facade.js +194 -0
  12. package/dist/handle.d.ts +67 -0
  13. package/dist/handle.js +107 -0
  14. package/dist/index.d.ts +12 -5
  15. package/dist/index.js +12 -3
  16. package/dist/loams.d.ts +77 -2
  17. package/dist/loams.js +84 -6
  18. package/dist/runtime/batch.d.ts +29 -0
  19. package/dist/runtime/batch.js +95 -0
  20. package/dist/runtime/call.d.ts +63 -9
  21. package/dist/runtime/call.js +243 -41
  22. package/dist/runtime/consistency.d.ts +65 -11
  23. package/dist/runtime/consistency.js +212 -46
  24. package/dist/runtime/errors.d.ts +29 -2
  25. package/dist/runtime/errors.js +26 -0
  26. package/dist/runtime/pagination.js +8 -2
  27. package/dist/runtime/subscribe.d.ts +37 -0
  28. package/dist/runtime/subscribe.js +128 -0
  29. package/dist/vendor/proto/collection-v1.d.ts +3 -0
  30. package/dist/vendor/proto/collection-v1.js +7 -0
  31. package/dist/vendor/proto/gen/loams/collection/v1/collection_pb.d.ts +1610 -0
  32. package/dist/vendor/proto/gen/loams/collection/v1/collection_pb.js +399 -0
  33. package/dist/vendor/proto/gen/loams/collection/v1/document_pb.d.ts +1054 -0
  34. package/dist/vendor/proto/gen/loams/collection/v1/document_pb.js +327 -0
  35. package/dist/vendor/proto/gen/loams/collection/v1/query_pb.d.ts +2101 -0
  36. package/dist/vendor/proto/gen/loams/collection/v1/query_pb.js +608 -0
  37. package/dist/vendor/proto/gen/loams/graph/v1/graph_pb.d.ts +2299 -0
  38. package/dist/vendor/proto/gen/loams/graph/v1/graph_pb.js +596 -0
  39. package/dist/vendor/proto/gen/loams/operations/v1/operations_pb.d.ts +399 -0
  40. package/dist/vendor/proto/gen/loams/operations/v1/operations_pb.js +118 -0
  41. package/dist/vendor/proto/gen/loams/sql/v1/sql_pb.d.ts +182 -0
  42. package/dist/vendor/proto/gen/loams/sql/v1/sql_pb.js +72 -0
  43. package/dist/vendor/proto/gen/loams/stream/v1/stream_pb.d.ts +688 -0
  44. package/dist/vendor/proto/gen/loams/stream/v1/stream_pb.js +180 -0
  45. package/package.json +2 -2
@@ -0,0 +1,1054 @@
1
+ import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Value } from "@bufbuild/protobuf/wkt";
3
+ import type { JsonObject, Message } from "@bufbuild/protobuf";
4
+ /**
5
+ * Describes the file loams/collection/v1/document.proto.
6
+ */
7
+ export declare const file_loams_collection_v1_document: GenFile;
8
+ /**
9
+ * @generated from message loams.collection.v1.WriteDocumentsRequest
10
+ */
11
+ export type WriteDocumentsRequest = Message<"loams.collection.v1.WriteDocumentsRequest"> & {
12
+ /**
13
+ * @generated from field: string namespace = 1;
14
+ */
15
+ namespace: string;
16
+ /**
17
+ * A collection name or an alias.
18
+ *
19
+ * @generated from field: string collection = 2;
20
+ */
21
+ collection: string;
22
+ /**
23
+ * Applied in order, and all of them or none of them.
24
+ *
25
+ * @generated from field: repeated loams.collection.v1.WriteOp ops = 3;
26
+ */
27
+ ops: WriteOp[];
28
+ /**
29
+ * Whether `results` reports what each op did to an existing document
30
+ * (`created`, `updated`, `deleted`, `not_found`, `noop`) rather than
31
+ * `accepted`. Absent is `false`, which is the cheaper answer.
32
+ *
33
+ * @generated from field: bool report_existence = 4;
34
+ */
35
+ reportExistence: boolean;
36
+ /**
37
+ * The key that makes a retry a replay (D610). Absent means the caller is not
38
+ * retrying and every call is a new write.
39
+ *
40
+ * @generated from field: string idempotency_key = 5;
41
+ */
42
+ idempotencyKey: string;
43
+ };
44
+ /**
45
+ * Describes the message loams.collection.v1.WriteDocumentsRequest.
46
+ * Use `create(WriteDocumentsRequestSchema)` to create a new message.
47
+ */
48
+ export declare const WriteDocumentsRequestSchema: GenMessage<WriteDocumentsRequest>;
49
+ /**
50
+ * @generated from message loams.collection.v1.WriteDocumentsResponse
51
+ */
52
+ export type WriteDocumentsResponse = Message<"loams.collection.v1.WriteDocumentsResponse"> & {
53
+ /**
54
+ * The writes' consistency token: at least these writes are acknowledged.
55
+ * The same value is the `loams-consistency-token` response header.
56
+ *
57
+ * @generated from field: string token = 1;
58
+ */
59
+ token: string;
60
+ /**
61
+ * One per op, in request order.
62
+ *
63
+ * @generated from field: repeated loams.collection.v1.OpResult results = 2;
64
+ */
65
+ results: OpResult[];
66
+ /**
67
+ * One per op: where it was appended. An op that was not placed answers an
68
+ * entry with no fields, which is how a `noop` reports itself.
69
+ *
70
+ * @generated from field: repeated loams.collection.v1.OpPosition positions = 3;
71
+ */
72
+ positions: OpPosition[];
73
+ /**
74
+ * The unapplied-data backlog measured at admission, before this write's own
75
+ * records. Also the `loams-unapplied-records` / `loams-unapplied-bytes`
76
+ * response headers, which is where a non-Connect reader reads them.
77
+ *
78
+ * @generated from field: optional uint64 unapplied_records = 4;
79
+ */
80
+ unappliedRecords?: bigint | undefined;
81
+ /**
82
+ * @generated from field: optional uint64 unapplied_bytes = 5;
83
+ */
84
+ unappliedBytes?: bigint | undefined;
85
+ };
86
+ /**
87
+ * Describes the message loams.collection.v1.WriteDocumentsResponse.
88
+ * Use `create(WriteDocumentsResponseSchema)` to create a new message.
89
+ */
90
+ export declare const WriteDocumentsResponseSchema: GenMessage<WriteDocumentsResponse>;
91
+ /**
92
+ * One document change. A proto oneof, so the JSON is the REST route's
93
+ * `{"upsert": {…}}` / `{"delete": {…}}` / `{"patch": {…}}` unchanged, and an
94
+ * op that is none of the three is `invalid_argument`.
95
+ *
96
+ * @generated from message loams.collection.v1.WriteOp
97
+ */
98
+ export type WriteOp = Message<"loams.collection.v1.WriteOp"> & {
99
+ /**
100
+ * @generated from oneof loams.collection.v1.WriteOp.op
101
+ */
102
+ op: {
103
+ /**
104
+ * Writes the document under its id, replacing it if it is there.
105
+ *
106
+ * @generated from field: loams.collection.v1.WriteDocument upsert = 1;
107
+ */
108
+ value: WriteDocument;
109
+ case: "upsert";
110
+ } | {
111
+ /**
112
+ * Removes the document. Removing one that is not there is a `not_found`,
113
+ * which is only reported with `report_existence`.
114
+ *
115
+ * @generated from field: loams.collection.v1.DeleteDocument delete = 2;
116
+ */
117
+ value: DeleteDocument;
118
+ case: "delete";
119
+ } | {
120
+ /**
121
+ * Changes part of a document, and may create one (see `Patch.upsert`).
122
+ *
123
+ * @generated from field: loams.collection.v1.Patch patch = 3;
124
+ */
125
+ value: Patch;
126
+ case: "patch";
127
+ } | {
128
+ case: undefined;
129
+ value?: undefined;
130
+ };
131
+ };
132
+ /**
133
+ * Describes the message loams.collection.v1.WriteOp.
134
+ * Use `create(WriteOpSchema)` to create a new message.
135
+ */
136
+ export declare const WriteOpSchema: GenMessage<WriteOp>;
137
+ /**
138
+ * @generated from message loams.collection.v1.WriteDocument
139
+ */
140
+ export type WriteDocument = Message<"loams.collection.v1.WriteDocument"> & {
141
+ /**
142
+ * @generated from field: loams.collection.v1.DocumentId id = 1;
143
+ */
144
+ id?: DocumentId | undefined;
145
+ /**
146
+ * The document's payload, as the native REST route's `_source` JSON. Absent
147
+ * is an empty document.
148
+ *
149
+ * @generated from field: google.protobuf.Struct source = 2;
150
+ */
151
+ source?: JsonObject | undefined;
152
+ /**
153
+ * Dense vectors by name, as the REST route's JSON (`[1.0, 0.0, 0.0]`).
154
+ *
155
+ * @generated from field: map<string, google.protobuf.Value> vectors = 3;
156
+ */
157
+ vectors: {
158
+ [key: string]: Value;
159
+ };
160
+ /**
161
+ * Sparse vectors by name, as the REST route's JSON (`{"indices": [1],
162
+ * "values": [1.0]}`).
163
+ *
164
+ * @generated from field: map<string, google.protobuf.Struct> sparse_vectors = 4;
165
+ */
166
+ sparseVectors: {
167
+ [key: string]: JsonObject;
168
+ };
169
+ };
170
+ /**
171
+ * Describes the message loams.collection.v1.WriteDocument.
172
+ * Use `create(WriteDocumentSchema)` to create a new message.
173
+ */
174
+ export declare const WriteDocumentSchema: GenMessage<WriteDocument>;
175
+ /**
176
+ * @generated from message loams.collection.v1.DeleteDocument
177
+ */
178
+ export type DeleteDocument = Message<"loams.collection.v1.DeleteDocument"> & {
179
+ /**
180
+ * @generated from field: loams.collection.v1.DocumentId id = 1;
181
+ */
182
+ id?: DocumentId | undefined;
183
+ };
184
+ /**
185
+ * Describes the message loams.collection.v1.DeleteDocument.
186
+ * Use `create(DeleteDocumentSchema)` to create a new message.
187
+ */
188
+ export declare const DeleteDocumentSchema: GenMessage<DeleteDocument>;
189
+ /**
190
+ * One document's change. `mode` and every other spelling here are the REST
191
+ * route's, because a reader switches on them verbatim (the same call
192
+ * `loams.collection.v1` made for `ScanColumn.role`).
193
+ *
194
+ * @generated from message loams.collection.v1.Patch
195
+ */
196
+ export type Patch = Message<"loams.collection.v1.Patch"> & {
197
+ /**
198
+ * @generated from field: loams.collection.v1.DocumentId id = 1;
199
+ */
200
+ id?: DocumentId | undefined;
201
+ /**
202
+ * `merge_deep` (the default), `merge_top` or `replace`. A string rather than
203
+ * an enum so the REST spelling survives verbatim; any other value is
204
+ * `invalid_argument`.
205
+ *
206
+ * @generated from field: string mode = 2;
207
+ */
208
+ mode: string;
209
+ /**
210
+ * The keys to merge. `merge_deep` merges nested objects, `merge_top`
211
+ * replaces them and `replace` replaces the document.
212
+ *
213
+ * @generated from field: google.protobuf.Struct source = 3;
214
+ */
215
+ source?: JsonObject | undefined;
216
+ /**
217
+ * The top-level source keys to remove.
218
+ *
219
+ * @generated from field: repeated string delete_keys = 4;
220
+ */
221
+ deleteKeys: string[];
222
+ /**
223
+ * Vectors to set, by name. A `null` value **removes** the vector, which is
224
+ * why the value is a `Value` and not a `ListValue` (see the header).
225
+ *
226
+ * @generated from field: map<string, google.protobuf.Value> vectors = 5;
227
+ */
228
+ vectors: {
229
+ [key: string]: Value;
230
+ };
231
+ /**
232
+ * Sparse vectors to set, by name; a `null` value removes one.
233
+ *
234
+ * @generated from field: map<string, google.protobuf.Struct> sparse_vectors = 6;
235
+ */
236
+ sparseVectors: {
237
+ [key: string]: JsonObject;
238
+ };
239
+ /**
240
+ * The document to write when the patched document is not there. Absent
241
+ * leaves a missing document missing, which is what a `patch_by_filter`
242
+ * never does (it patches what the filter matched).
243
+ *
244
+ * @generated from field: loams.collection.v1.WriteDocument upsert = 7;
245
+ */
246
+ upsert?: WriteDocument | undefined;
247
+ };
248
+ /**
249
+ * Describes the message loams.collection.v1.Patch.
250
+ * Use `create(PatchSchema)` to create a new message.
251
+ */
252
+ export declare const PatchSchema: GenMessage<Patch>;
253
+ /**
254
+ * One document's id, as the three `PrimaryKey` variants (see the header).
255
+ *
256
+ * @generated from message loams.collection.v1.DocumentId
257
+ */
258
+ export type DocumentId = Message<"loams.collection.v1.DocumentId"> & {
259
+ /**
260
+ * @generated from oneof loams.collection.v1.DocumentId.id
261
+ */
262
+ id: {
263
+ /**
264
+ * An id in `0..=2^64−1`, as a decimal string in JSON.
265
+ *
266
+ * @generated from field: uint64 uint = 1;
267
+ */
268
+ value: bigint;
269
+ case: "uint";
270
+ } | {
271
+ /**
272
+ * @generated from field: string string = 2;
273
+ */
274
+ value: string;
275
+ case: "string";
276
+ } | {
277
+ /**
278
+ * The REST spelling, `8-4-4-4-12` in any case.
279
+ *
280
+ * @generated from field: string uuid = 3;
281
+ */
282
+ value: string;
283
+ case: "uuid";
284
+ } | {
285
+ case: undefined;
286
+ value?: undefined;
287
+ };
288
+ };
289
+ /**
290
+ * Describes the message loams.collection.v1.DocumentId.
291
+ * Use `create(DocumentIdSchema)` to create a new message.
292
+ */
293
+ export declare const DocumentIdSchema: GenMessage<DocumentId>;
294
+ /**
295
+ * Where one op was appended.
296
+ *
297
+ * An op that was not placed answers an entry with **no `seqNo` at all**, which
298
+ * is why `seq_no` is `optional` and not a plain `uint64`: offset 0 is the
299
+ * first record of a partition and a real answer, and proto3 JSON omitting a
300
+ * zero would make it indistinguishable from "this op was not placed".
301
+ *
302
+ * @generated from message loams.collection.v1.OpPosition
303
+ */
304
+ export type OpPosition = Message<"loams.collection.v1.OpPosition"> & {
305
+ /**
306
+ * @generated from field: uint32 partition = 1;
307
+ */
308
+ partition: number;
309
+ /**
310
+ * @generated from field: optional uint64 seq_no = 2;
311
+ */
312
+ seqNo?: bigint | undefined;
313
+ };
314
+ /**
315
+ * Describes the message loams.collection.v1.OpPosition.
316
+ * Use `create(OpPositionSchema)` to create a new message.
317
+ */
318
+ export declare const OpPositionSchema: GenMessage<OpPosition>;
319
+ /**
320
+ * @generated from message loams.collection.v1.GetDocumentsRequest
321
+ */
322
+ export type GetDocumentsRequest = Message<"loams.collection.v1.GetDocumentsRequest"> & {
323
+ /**
324
+ * @generated from field: string namespace = 1;
325
+ */
326
+ namespace: string;
327
+ /**
328
+ * A collection name or an alias.
329
+ *
330
+ * @generated from field: string collection = 2;
331
+ */
332
+ collection: string;
333
+ /**
334
+ * The documents to get. The answer has one entry per id, in this order.
335
+ *
336
+ * @generated from field: repeated loams.collection.v1.DocumentId ids = 3;
337
+ */
338
+ ids: DocumentId[];
339
+ /**
340
+ * What to return of each document, as the REST route's projection JSON
341
+ * (`{"source": "all" | "none" | {"include": [], "exclude": []},
342
+ * "vectors": [], "fields": []}`). Absent is everything.
343
+ *
344
+ * @generated from field: google.protobuf.Struct select = 4;
345
+ */
346
+ select?: JsonObject | undefined;
347
+ /**
348
+ * @generated from field: loams.collection.v1.Consistency consistency = 5;
349
+ */
350
+ consistency?: Consistency | undefined;
351
+ };
352
+ /**
353
+ * Describes the message loams.collection.v1.GetDocumentsRequest.
354
+ * Use `create(GetDocumentsRequestSchema)` to create a new message.
355
+ */
356
+ export declare const GetDocumentsRequestSchema: GenMessage<GetDocumentsRequest>;
357
+ /**
358
+ * @generated from message loams.collection.v1.GetDocumentsResponse
359
+ */
360
+ export type GetDocumentsResponse = Message<"loams.collection.v1.GetDocumentsResponse"> & {
361
+ /**
362
+ * One per requested id, in request order. An entry with no fields is a
363
+ * document that is not there.
364
+ *
365
+ * @generated from field: repeated loams.collection.v1.Document documents = 1;
366
+ */
367
+ documents: Document[];
368
+ /**
369
+ * The state the documents were read at, and a `consistency.at_least` that
370
+ * reads this state again. The same value is the
371
+ * `loams-consistency-token` response header.
372
+ *
373
+ * @generated from field: string read_token = 2;
374
+ */
375
+ readToken: string;
376
+ };
377
+ /**
378
+ * Describes the message loams.collection.v1.GetDocumentsResponse.
379
+ * Use `create(GetDocumentsResponseSchema)` to create a new message.
380
+ */
381
+ export declare const GetDocumentsResponseSchema: GenMessage<GetDocumentsResponse>;
382
+ /**
383
+ * @generated from message loams.collection.v1.ScrollDocumentsRequest
384
+ */
385
+ export type ScrollDocumentsRequest = Message<"loams.collection.v1.ScrollDocumentsRequest"> & {
386
+ /**
387
+ * @generated from field: string namespace = 1;
388
+ */
389
+ namespace: string;
390
+ /**
391
+ * A collection name or an alias.
392
+ *
393
+ * @generated from field: string collection = 2;
394
+ */
395
+ collection: string;
396
+ /**
397
+ * The native query JSON, as the REST route takes it. Absent is every
398
+ * document. This stays a `Value` while `query.proto` types the filter IR for
399
+ * `QueryService/Search`: the tests that shipped this RPC send the bare string
400
+ * `"match_all"`, which a typed oneof cannot spell, and `SearchRequest.filter`
401
+ * is where a typed filter lands (API1 Task 4).
402
+ *
403
+ * @generated from field: google.protobuf.Value filter = 3;
404
+ */
405
+ filter?: Value | undefined;
406
+ /**
407
+ * The last document of the previous page; absent starts at the first.
408
+ *
409
+ * @generated from field: loams.collection.v1.DocumentId after = 4;
410
+ */
411
+ after?: DocumentId | undefined;
412
+ /**
413
+ * The page size; absent or `0` is the server's default.
414
+ *
415
+ * @generated from field: optional uint32 limit = 5;
416
+ */
417
+ limit?: number | undefined;
418
+ /**
419
+ * @generated from field: google.protobuf.Struct select = 6;
420
+ */
421
+ select?: JsonObject | undefined;
422
+ /**
423
+ * @generated from field: loams.collection.v1.Consistency consistency = 7;
424
+ */
425
+ consistency?: Consistency | undefined;
426
+ /**
427
+ * The AIP-158 spelling of `after`, and the **same cursor**: a `DocumentId`,
428
+ * encoded exactly as `after` and `ScrollDocumentsResponse.next` encode it, so
429
+ * there is one cursor on the wire and the two fields are interchangeable —
430
+ * a `next` handed straight back as a `page_token` reads the same page. A
431
+ * request that sets both names different cursors is `invalid_argument`.
432
+ *
433
+ * It is an addition rather than a change of shape: plan ruling 2 offers
434
+ * `page_token` as an alternative to server-streaming `ScrollDocuments`, and
435
+ * Q614 — which of the two the method is — is unanswered, so the shipped
436
+ * unary RPC keeps its shape rather than breaking for an open question. True
437
+ * server-streaming, if Q614 says so, is a separate additive RPC.
438
+ *
439
+ * @generated from field: loams.collection.v1.DocumentId page_token = 8;
440
+ */
441
+ pageToken?: DocumentId | undefined;
442
+ /**
443
+ * The filter as a typed `loams.collection.v1.Query`, in its proto3 JSON
444
+ * (`{"term": {"field": "tags", "value": "policy"}}`, `{"matchAll": {}}`):
445
+ * the shape the SDKs' `Filter` builder writes and `SearchRequest.filter`
446
+ * takes. A `Struct` and not a `Query` because `query.proto` imports this
447
+ * file, so this file cannot import it back (SDKP ruling P0a-1). Setting both
448
+ * this and `filter` is `invalid_argument` with reason `filter_conflict`.
449
+ *
450
+ * @generated from field: google.protobuf.Struct where = 9;
451
+ */
452
+ where?: JsonObject | undefined;
453
+ };
454
+ /**
455
+ * Describes the message loams.collection.v1.ScrollDocumentsRequest.
456
+ * Use `create(ScrollDocumentsRequestSchema)` to create a new message.
457
+ */
458
+ export declare const ScrollDocumentsRequestSchema: GenMessage<ScrollDocumentsRequest>;
459
+ /**
460
+ * @generated from message loams.collection.v1.ScrollDocumentsResponse
461
+ */
462
+ export type ScrollDocumentsResponse = Message<"loams.collection.v1.ScrollDocumentsResponse"> & {
463
+ /**
464
+ * In primary-key order.
465
+ *
466
+ * @generated from field: repeated loams.collection.v1.Document documents = 1;
467
+ */
468
+ documents: Document[];
469
+ /**
470
+ * The id to continue after; absent on the last page.
471
+ *
472
+ * @generated from field: loams.collection.v1.DocumentId next = 2;
473
+ */
474
+ next?: DocumentId | undefined;
475
+ /**
476
+ * @generated from field: string read_token = 3;
477
+ */
478
+ readToken: string;
479
+ };
480
+ /**
481
+ * Describes the message loams.collection.v1.ScrollDocumentsResponse.
482
+ * Use `create(ScrollDocumentsResponseSchema)` to create a new message.
483
+ */
484
+ export declare const ScrollDocumentsResponseSchema: GenMessage<ScrollDocumentsResponse>;
485
+ /**
486
+ * @generated from message loams.collection.v1.CountDocumentsRequest
487
+ */
488
+ export type CountDocumentsRequest = Message<"loams.collection.v1.CountDocumentsRequest"> & {
489
+ /**
490
+ * @generated from field: string namespace = 1;
491
+ */
492
+ namespace: string;
493
+ /**
494
+ * A collection name or an alias.
495
+ *
496
+ * @generated from field: string collection = 2;
497
+ */
498
+ collection: string;
499
+ /**
500
+ * @generated from field: google.protobuf.Value filter = 3;
501
+ */
502
+ filter?: Value | undefined;
503
+ /**
504
+ * @generated from field: loams.collection.v1.Consistency consistency = 4;
505
+ */
506
+ consistency?: Consistency | undefined;
507
+ /**
508
+ * The filter as a typed `loams.collection.v1.Query`, in its proto3 JSON
509
+ * (`{"term": {"field": "tags", "value": "policy"}}`, `{"matchAll": {}}`):
510
+ * the shape the SDKs' `Filter` builder writes and `SearchRequest.filter`
511
+ * takes. A `Struct` and not a `Query` because `query.proto` imports this
512
+ * file, so this file cannot import it back (SDKP ruling P0a-1). Setting both
513
+ * this and `filter` is `invalid_argument` with reason `filter_conflict`.
514
+ *
515
+ * @generated from field: google.protobuf.Struct where = 5;
516
+ */
517
+ where?: JsonObject | undefined;
518
+ };
519
+ /**
520
+ * Describes the message loams.collection.v1.CountDocumentsRequest.
521
+ * Use `create(CountDocumentsRequestSchema)` to create a new message.
522
+ */
523
+ export declare const CountDocumentsRequestSchema: GenMessage<CountDocumentsRequest>;
524
+ /**
525
+ * @generated from message loams.collection.v1.CountDocumentsResponse
526
+ */
527
+ export type CountDocumentsResponse = Message<"loams.collection.v1.CountDocumentsResponse"> & {
528
+ /**
529
+ * How many documents matched, as a decimal string in JSON. `optional` and
530
+ * always set: "nothing matched" is a count, not an absent field, and proto3
531
+ * JSON omitting a zero would make an empty result read as "unanswered".
532
+ *
533
+ * @generated from field: optional uint64 count = 1;
534
+ */
535
+ count?: bigint | undefined;
536
+ /**
537
+ * @generated from field: string read_token = 2;
538
+ */
539
+ readToken: string;
540
+ };
541
+ /**
542
+ * Describes the message loams.collection.v1.CountDocumentsResponse.
543
+ * Use `create(CountDocumentsResponseSchema)` to create a new message.
544
+ */
545
+ export declare const CountDocumentsResponseSchema: GenMessage<CountDocumentsResponse>;
546
+ /**
547
+ * @generated from message loams.collection.v1.DeleteByFilterRequest
548
+ */
549
+ export type DeleteByFilterRequest = Message<"loams.collection.v1.DeleteByFilterRequest"> & {
550
+ /**
551
+ * @generated from field: string namespace = 1;
552
+ */
553
+ namespace: string;
554
+ /**
555
+ * A collection name or an alias.
556
+ *
557
+ * @generated from field: string collection = 2;
558
+ */
559
+ collection: string;
560
+ /**
561
+ * The native query JSON, as the REST route takes it. Required: there is no
562
+ * "delete everything" spelling, and `match_all` is the caller's to write.
563
+ *
564
+ * @generated from field: google.protobuf.Value filter = 3;
565
+ */
566
+ filter?: Value | undefined;
567
+ /**
568
+ * The most rows this call may write. Absent is the kind's ceiling; `0` is
569
+ * `invalid_argument`, because a call that may write nothing is a mistake
570
+ * rather than a no-op.
571
+ *
572
+ * @generated from field: optional uint64 max_rows = 4;
573
+ */
574
+ maxRows?: bigint | undefined;
575
+ /**
576
+ * Whether a call matching more than `max_rows` writes what fits and answers a
577
+ * cursor instead of failing. Absent is `false`: a call over its limit fails
578
+ * before writing anything.
579
+ *
580
+ * @generated from field: bool allow_partial = 5;
581
+ */
582
+ allowPartial: boolean;
583
+ /**
584
+ * The `cursor` of the previous partial call, which resumes at the same pin.
585
+ *
586
+ * @generated from field: loams.collection.v1.FilterWriteCursor cursor = 6;
587
+ */
588
+ cursor?: FilterWriteCursor | undefined;
589
+ /**
590
+ * @generated from field: loams.collection.v1.Consistency consistency = 7;
591
+ */
592
+ consistency?: Consistency | undefined;
593
+ /**
594
+ * The filter as a typed `loams.collection.v1.Query`, in its proto3 JSON
595
+ * (`{"term": {"field": "tags", "value": "policy"}}`, `{"matchAll": {}}`):
596
+ * the shape the SDKs' `Filter` builder writes and `SearchRequest.filter`
597
+ * takes. A `Struct` and not a `Query` because `query.proto` imports this
598
+ * file, so this file cannot import it back (SDKP ruling P0a-1). Setting both
599
+ * this and `filter` is `invalid_argument` with reason `filter_conflict`.
600
+ *
601
+ * @generated from field: google.protobuf.Struct where = 8;
602
+ */
603
+ where?: JsonObject | undefined;
604
+ };
605
+ /**
606
+ * Describes the message loams.collection.v1.DeleteByFilterRequest.
607
+ * Use `create(DeleteByFilterRequestSchema)` to create a new message.
608
+ */
609
+ export declare const DeleteByFilterRequestSchema: GenMessage<DeleteByFilterRequest>;
610
+ /**
611
+ * @generated from message loams.collection.v1.PatchByFilterRequest
612
+ */
613
+ export type PatchByFilterRequest = Message<"loams.collection.v1.PatchByFilterRequest"> & {
614
+ /**
615
+ * @generated from field: string namespace = 1;
616
+ */
617
+ namespace: string;
618
+ /**
619
+ * A collection name or an alias.
620
+ *
621
+ * @generated from field: string collection = 2;
622
+ */
623
+ collection: string;
624
+ /**
625
+ * @generated from field: google.protobuf.Value filter = 3;
626
+ */
627
+ filter?: Value | undefined;
628
+ /**
629
+ * What to change on each match, in the REST route's form. `id` and `upsert`
630
+ * are refused: a filter write patches what the filter matched and never
631
+ * creates a document.
632
+ *
633
+ * @generated from field: loams.collection.v1.Patch patch = 4;
634
+ */
635
+ patch?: Patch | undefined;
636
+ /**
637
+ * @generated from field: optional uint64 max_rows = 5;
638
+ */
639
+ maxRows?: bigint | undefined;
640
+ /**
641
+ * @generated from field: bool allow_partial = 6;
642
+ */
643
+ allowPartial: boolean;
644
+ /**
645
+ * @generated from field: loams.collection.v1.FilterWriteCursor cursor = 7;
646
+ */
647
+ cursor?: FilterWriteCursor | undefined;
648
+ /**
649
+ * @generated from field: loams.collection.v1.Consistency consistency = 8;
650
+ */
651
+ consistency?: Consistency | undefined;
652
+ /**
653
+ * The filter as a typed `loams.collection.v1.Query`, in its proto3 JSON
654
+ * (`{"term": {"field": "tags", "value": "policy"}}`, `{"matchAll": {}}`):
655
+ * the shape the SDKs' `Filter` builder writes and `SearchRequest.filter`
656
+ * takes. A `Struct` and not a `Query` because `query.proto` imports this
657
+ * file, so this file cannot import it back (SDKP ruling P0a-1). Setting both
658
+ * this and `filter` is `invalid_argument` with reason `filter_conflict`.
659
+ *
660
+ * @generated from field: google.protobuf.Struct where = 9;
661
+ */
662
+ where?: JsonObject | undefined;
663
+ };
664
+ /**
665
+ * Describes the message loams.collection.v1.PatchByFilterRequest.
666
+ * Use `create(PatchByFilterRequestSchema)` to create a new message.
667
+ */
668
+ export declare const PatchByFilterRequestSchema: GenMessage<PatchByFilterRequest>;
669
+ /**
670
+ * The answer to one filter write. Both filter writes answer this, because
671
+ * every number in it is the same question either way: how much the filter
672
+ * matched, how much this call wrote, and the state it wrote at.
673
+ *
674
+ * @generated from message loams.collection.v1.FilterWriteResponse
675
+ */
676
+ export type FilterWriteResponse = Message<"loams.collection.v1.FilterWriteResponse"> & {
677
+ /**
678
+ * Documents matching `filter` at the pin. The four counters are `optional`
679
+ * and always set, for the reason `CountDocumentsResponse.count` gives: a
680
+ * count of zero is a count, and proto3 JSON omitting it would read as
681
+ * "unanswered".
682
+ *
683
+ * @generated from field: optional uint64 matched = 1;
684
+ */
685
+ matched?: bigint | undefined;
686
+ /**
687
+ * Documents this call deleted or patched.
688
+ *
689
+ * @generated from field: optional uint64 affected = 2;
690
+ */
691
+ affected?: bigint | undefined;
692
+ /**
693
+ * Keys this call's batches wrote: `affected`, and the keys found deleted
694
+ * since the pin or (for a patch) already patched. It is what a caller's own
695
+ * row budget counts.
696
+ *
697
+ * @generated from field: optional uint64 written = 3;
698
+ */
699
+ written?: bigint | undefined;
700
+ /**
701
+ * How many batches this call wrote.
702
+ *
703
+ * @generated from field: optional uint64 batches = 4;
704
+ */
705
+ batches?: bigint | undefined;
706
+ /**
707
+ * Whether the filter still matches rows this call did not reach.
708
+ *
709
+ * @generated from field: bool rows_remaining = 5;
710
+ */
711
+ rowsRemaining: boolean;
712
+ /**
713
+ * The cursor that finishes the write at the same pin. Present exactly when
714
+ * `rows_remaining`.
715
+ *
716
+ * @generated from field: loams.collection.v1.FilterWriteCursor cursor = 6;
717
+ */
718
+ cursor?: FilterWriteCursor | undefined;
719
+ /**
720
+ * Covers the pin and every batch of this call, so a read at it sees this
721
+ * write. The same value is the `loams-consistency-token` response header.
722
+ *
723
+ * @generated from field: string token = 7;
724
+ */
725
+ token: string;
726
+ /**
727
+ * The snapshot the filter was evaluated at, which the `cursor` resumes at.
728
+ *
729
+ * @generated from field: loams.collection.v1.Pin pin = 8;
730
+ */
731
+ pin?: Pin | undefined;
732
+ /**
733
+ * How long to wait, when the call stopped at its deadline on a batch refused
734
+ * for backpressure. Absent when the call finished. The same number is the
735
+ * `Retry-After` header of the call that carries it.
736
+ *
737
+ * @generated from field: optional uint64 retry_after_ms = 9;
738
+ */
739
+ retryAfterMs?: bigint | undefined;
740
+ };
741
+ /**
742
+ * Describes the message loams.collection.v1.FilterWriteResponse.
743
+ * Use `create(FilterWriteResponseSchema)` to create a new message.
744
+ */
745
+ export declare const FilterWriteResponseSchema: GenMessage<FilterWriteResponse>;
746
+ /**
747
+ * @generated from message loams.collection.v1.FilterWriteCursor
748
+ */
749
+ export type FilterWriteCursor = Message<"loams.collection.v1.FilterWriteCursor"> & {
750
+ /**
751
+ * The last key written; the next call starts after it.
752
+ *
753
+ * @generated from field: loams.collection.v1.DocumentId after = 1;
754
+ */
755
+ after?: DocumentId | undefined;
756
+ /**
757
+ * The snapshot the first call pinned, so the next call evaluates the same
758
+ * filter against the same state.
759
+ *
760
+ * @generated from field: uint64 manifest_version = 2;
761
+ */
762
+ manifestVersion: bigint;
763
+ /**
764
+ * @generated from field: string token = 3;
765
+ */
766
+ token: string;
767
+ };
768
+ /**
769
+ * Describes the message loams.collection.v1.FilterWriteCursor.
770
+ * Use `create(FilterWriteCursorSchema)` to create a new message.
771
+ */
772
+ export declare const FilterWriteCursorSchema: GenMessage<FilterWriteCursor>;
773
+ /**
774
+ * One document, as a get or a scroll answers it.
775
+ *
776
+ * @generated from message loams.collection.v1.Document
777
+ */
778
+ export type Document = Message<"loams.collection.v1.Document"> & {
779
+ /**
780
+ * Absent only on the entry of an id that is not there.
781
+ *
782
+ * @generated from field: loams.collection.v1.DocumentId id = 1;
783
+ */
784
+ id?: DocumentId | undefined;
785
+ /**
786
+ * Absent when the projection leaves the source out, rather than an empty
787
+ * object: "no source" and "an empty source" are different answers.
788
+ *
789
+ * @generated from field: google.protobuf.Struct source = 2;
790
+ */
791
+ source?: JsonObject | undefined;
792
+ /**
793
+ * Dense vectors by name, `map<string, google.protobuf.Value>` for the same
794
+ * reason a `WriteDocument`'s are.
795
+ *
796
+ * @generated from field: map<string, google.protobuf.Value> vectors = 3;
797
+ */
798
+ vectors: {
799
+ [key: string]: Value;
800
+ };
801
+ /**
802
+ * @generated from field: map<string, google.protobuf.Struct> sparse_vectors = 4;
803
+ */
804
+ sparseVectors: {
805
+ [key: string]: JsonObject;
806
+ };
807
+ /**
808
+ * The typed field values by name, as the REST route's JSON (see the header).
809
+ *
810
+ * @generated from field: map<string, google.protobuf.Value> fields = 5;
811
+ */
812
+ fields: {
813
+ [key: string]: Value;
814
+ };
815
+ /**
816
+ * Where the document's last write was appended. `optional` and always set
817
+ * for the same reason as `OpPosition.seq_no`: the first write to a partition
818
+ * is at 0, and "0" must not read as "no position".
819
+ *
820
+ * @generated from field: optional uint64 seq_no = 6;
821
+ */
822
+ seqNo?: bigint | undefined;
823
+ /**
824
+ * @generated from field: uint32 partition = 7;
825
+ */
826
+ partition: number;
827
+ };
828
+ /**
829
+ * Describes the message loams.collection.v1.Document.
830
+ * Use `create(DocumentSchema)` to create a new message.
831
+ */
832
+ export declare const DocumentSchema: GenMessage<Document>;
833
+ /**
834
+ * How much of a read's freshness the caller asks for (rule 1).
835
+ *
836
+ * @generated from message loams.collection.v1.Consistency
837
+ */
838
+ export type Consistency = Message<"loams.collection.v1.Consistency"> & {
839
+ /**
840
+ * Absent is `FRESHNESS_STRONG`: every write acknowledged before the read
841
+ * began is visible. `FRESHNESS_EVENTUAL` is whatever the tail holds.
842
+ *
843
+ * @generated from field: loams.collection.v1.Freshness freshness = 1;
844
+ */
845
+ freshness: Freshness;
846
+ /**
847
+ * At least the writes this token names: the read **waits** for them and then
848
+ * reads exactly the state up to them, which is what makes this a wait and
849
+ * not a hint. A token this server cannot read is `invalid_argument`.
850
+ *
851
+ * @generated from field: string at_least = 2;
852
+ */
853
+ atLeast: string;
854
+ /**
855
+ * Exactly one retained manifest plus the token's writes after it, which is
856
+ * what a filter write pins. A pinned read is not a free one.
857
+ *
858
+ * @generated from field: loams.collection.v1.Pin pin = 3;
859
+ */
860
+ pin?: Pin | undefined;
861
+ };
862
+ /**
863
+ * Describes the message loams.collection.v1.Consistency.
864
+ * Use `create(ConsistencySchema)` to create a new message.
865
+ */
866
+ export declare const ConsistencySchema: GenMessage<Consistency>;
867
+ /**
868
+ * One pinned state of a collection: a manifest version and the token that
869
+ * covers it. `Consistency.pin` names the state to read and
870
+ * `FilterWriteResponse.pin` reports the one a filter write read.
871
+ *
872
+ * @generated from message loams.collection.v1.Pin
873
+ */
874
+ export type Pin = Message<"loams.collection.v1.Pin"> & {
875
+ /**
876
+ * @generated from field: uint64 manifest_version = 1;
877
+ */
878
+ manifestVersion: bigint;
879
+ /**
880
+ * A `consistency.at_least` that reads this state again.
881
+ *
882
+ * @generated from field: string token = 2;
883
+ */
884
+ token: string;
885
+ };
886
+ /**
887
+ * Describes the message loams.collection.v1.Pin.
888
+ * Use `create(PinSchema)` to create a new message.
889
+ */
890
+ export declare const PinSchema: GenMessage<Pin>;
891
+ /**
892
+ * The outcome of one op (Ruling 10).
893
+ *
894
+ * @generated from enum loams.collection.v1.OpResult
895
+ */
896
+ export declare enum OpResult {
897
+ /**
898
+ * @generated from enum value: OP_RESULT_UNSPECIFIED = 0;
899
+ */
900
+ UNSPECIFIED = 0,
901
+ /**
902
+ * The document was not there and now is.
903
+ *
904
+ * @generated from enum value: OP_RESULT_CREATED = 1;
905
+ */
906
+ CREATED = 1,
907
+ /**
908
+ * The document was there and now holds this write.
909
+ *
910
+ * @generated from enum value: OP_RESULT_UPDATED = 2;
911
+ */
912
+ UPDATED = 2,
913
+ /**
914
+ * The document was there and now is not.
915
+ *
916
+ * @generated from enum value: OP_RESULT_DELETED = 3;
917
+ */
918
+ DELETED = 3,
919
+ /**
920
+ * There was no such document (only reported with `report_existence`).
921
+ *
922
+ * @generated from enum value: OP_RESULT_NOT_FOUND = 4;
923
+ */
924
+ NOT_FOUND = 4,
925
+ /**
926
+ * A patch whose result equals the document that is already there.
927
+ *
928
+ * @generated from enum value: OP_RESULT_NOOP = 5;
929
+ */
930
+ NOOP = 5,
931
+ /**
932
+ * Written, without existence reporting.
933
+ *
934
+ * @generated from enum value: OP_RESULT_ACCEPTED = 6;
935
+ */
936
+ ACCEPTED = 6
937
+ }
938
+ /**
939
+ * Describes the enum loams.collection.v1.OpResult.
940
+ */
941
+ export declare const OpResultSchema: GenEnum<OpResult>;
942
+ /**
943
+ * @generated from enum loams.collection.v1.Freshness
944
+ */
945
+ export declare enum Freshness {
946
+ /**
947
+ * @generated from enum value: FRESHNESS_UNSPECIFIED = 0;
948
+ */
949
+ UNSPECIFIED = 0,
950
+ /**
951
+ * Every write acknowledged before the read began.
952
+ *
953
+ * @generated from enum value: FRESHNESS_STRONG = 1;
954
+ */
955
+ STRONG = 1,
956
+ /**
957
+ * Whatever the tail holds right now.
958
+ *
959
+ * @generated from enum value: FRESHNESS_EVENTUAL = 2;
960
+ */
961
+ EVENTUAL = 2
962
+ }
963
+ /**
964
+ * Describes the enum loams.collection.v1.Freshness.
965
+ */
966
+ export declare const FreshnessSchema: GenEnum<Freshness>;
967
+ /**
968
+ * @generated from service loams.collection.v1.DocumentService
969
+ */
970
+ export declare const DocumentService: GenService<{
971
+ /**
972
+ * An atomic write: every op of a request is applied or none is (Ruling 16).
973
+ *
974
+ * This is the one RPC here that is not naturally idempotent, so it carries
975
+ * `idempotency_key`; a repeat of a keyed write replays the first answer
976
+ * instead of writing again. The write is refused with `resource_exhausted`
977
+ * when it would take the collection's unapplied-data budget over its
978
+ * ceiling, and every answer to an admitted *or* a refused write carries the
979
+ * backlog headers.
980
+ *
981
+ * @generated from rpc loams.collection.v1.DocumentService.WriteDocuments
982
+ */
983
+ writeDocuments: {
984
+ methodKind: "unary";
985
+ input: typeof WriteDocumentsRequestSchema;
986
+ output: typeof WriteDocumentsResponseSchema;
987
+ };
988
+ /**
989
+ * The documents of `ids`, in request order.
990
+ *
991
+ * A document that is not there is an **entry with no fields**, which sits at
992
+ * the requested id's position: proto3 JSON has no `null` for an element of a
993
+ * `repeated` field of messages, and an empty entry is the same information
994
+ * — the entry is there and it is empty.
995
+ *
996
+ * @generated from rpc loams.collection.v1.DocumentService.GetDocuments
997
+ */
998
+ getDocuments: {
999
+ methodKind: "unary";
1000
+ input: typeof GetDocumentsRequestSchema;
1001
+ output: typeof GetDocumentsResponseSchema;
1002
+ };
1003
+ /**
1004
+ * One page of the collection's documents in primary-key order, and the id to
1005
+ * continue after. `next` is absent on the last page.
1006
+ *
1007
+ * @generated from rpc loams.collection.v1.DocumentService.ScrollDocuments
1008
+ */
1009
+ scrollDocuments: {
1010
+ methodKind: "unary";
1011
+ input: typeof ScrollDocumentsRequestSchema;
1012
+ output: typeof ScrollDocumentsResponseSchema;
1013
+ };
1014
+ /**
1015
+ * How many documents match, which is a read and not a free one.
1016
+ *
1017
+ * @generated from rpc loams.collection.v1.DocumentService.CountDocuments
1018
+ */
1019
+ countDocuments: {
1020
+ methodKind: "unary";
1021
+ input: typeof CountDocumentsRequestSchema;
1022
+ output: typeof CountDocumentsResponseSchema;
1023
+ };
1024
+ /**
1025
+ * Deletes every document matching `filter`, in batches, at one pinned
1026
+ * snapshot (M1.5 Task 9a, D87).
1027
+ *
1028
+ * A call matching more than `max_rows` fails with `invalid_argument` and
1029
+ * deletes nothing unless `allow_partial`, in which case it writes what fits
1030
+ * and answers the `cursor` that finishes it at the same pin. The pin travels
1031
+ * in `consistency` too: an `at_least` token makes the pin at least as new as
1032
+ * the token.
1033
+ *
1034
+ * @generated from rpc loams.collection.v1.DocumentService.DeleteByFilter
1035
+ */
1036
+ deleteByFilter: {
1037
+ methodKind: "unary";
1038
+ input: typeof DeleteByFilterRequestSchema;
1039
+ output: typeof FilterWriteResponseSchema;
1040
+ };
1041
+ /**
1042
+ * The same as `DeleteByFilter` with a `patch` applied to each match.
1043
+ *
1044
+ * A filter write patches the documents the filter matched and never creates
1045
+ * one, so `patch.upsert` is refused.
1046
+ *
1047
+ * @generated from rpc loams.collection.v1.DocumentService.PatchByFilter
1048
+ */
1049
+ patchByFilter: {
1050
+ methodKind: "unary";
1051
+ input: typeof PatchByFilterRequestSchema;
1052
+ output: typeof FilterWriteResponseSchema;
1053
+ };
1054
+ }>;