@sylphx/sdk 0.31.0 → 0.32.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 (120) hide show
  1. package/README.md +131 -4
  2. package/dist/access.d.ts +146 -17
  3. package/dist/access.js +114 -8
  4. package/dist/access.js.map +1 -1
  5. package/dist/agents.d.ts +1564 -0
  6. package/dist/agents.js +1096 -0
  7. package/dist/agents.js.map +1 -0
  8. package/dist/ai.d.ts +1 -2
  9. package/dist/ai.js +2 -3
  10. package/dist/ai.js.map +1 -1
  11. package/dist/artifacts.d.ts +1 -1
  12. package/dist/artifacts.js +2 -2
  13. package/dist/assets.d.ts +447 -0
  14. package/dist/assets.js +266 -0
  15. package/dist/assets.js.map +1 -0
  16. package/dist/auth/client.d.ts +239 -0
  17. package/dist/auth/client.js +337 -0
  18. package/dist/auth/client.js.map +1 -0
  19. package/dist/auth/end-user-keys-mock.d.ts +83 -0
  20. package/dist/auth/end-user-keys-mock.js +427 -0
  21. package/dist/auth/end-user-keys-mock.js.map +1 -0
  22. package/dist/auth/end-user-keys.d.ts +219 -0
  23. package/dist/auth/end-user-keys.js +240 -0
  24. package/dist/auth/end-user-keys.js.map +1 -0
  25. package/dist/auth/verify.d.ts +38 -3
  26. package/dist/auth/verify.js +58 -8
  27. package/dist/auth/verify.js.map +1 -1
  28. package/dist/auth.d.ts +656 -9
  29. package/dist/auth.js +563 -6
  30. package/dist/auth.js.map +1 -1
  31. package/dist/billing.d.ts +99 -21
  32. package/dist/billing.js +43 -5
  33. package/dist/billing.js.map +1 -1
  34. package/dist/broker.d.ts +5 -4
  35. package/dist/broker.js +3 -3
  36. package/dist/broker.js.map +1 -1
  37. package/dist/build.d.ts +362 -29
  38. package/dist/build.js +302 -10
  39. package/dist/build.js.map +1 -1
  40. package/dist/common.d.ts +1 -1
  41. package/dist/common.js +1 -1
  42. package/dist/config/flags.d.ts +140 -0
  43. package/dist/config/flags.js +462 -0
  44. package/dist/config/flags.js.map +1 -0
  45. package/dist/config.d.ts +380 -15
  46. package/dist/config.js +283 -5
  47. package/dist/config.js.map +1 -1
  48. package/dist/connections.d.ts +6 -6
  49. package/dist/connections.js +3 -3
  50. package/dist/data.d.ts +612 -7
  51. package/dist/data.js +566 -4
  52. package/dist/data.js.map +1 -1
  53. package/dist/entitlement.d.ts +10 -8
  54. package/dist/entitlement.js +3 -4
  55. package/dist/entitlement.js.map +1 -1
  56. package/dist/events/realtime.d.ts +69 -0
  57. package/dist/events/realtime.js +107 -0
  58. package/dist/events/realtime.js.map +1 -0
  59. package/dist/events/webhooks.d.ts +40 -0
  60. package/dist/events/webhooks.js +110 -0
  61. package/dist/events/webhooks.js.map +1 -0
  62. package/dist/events.d.ts +369 -22
  63. package/dist/events.js +311 -8
  64. package/dist/events.js.map +1 -1
  65. package/dist/flags.d.ts +18 -0
  66. package/dist/flags.js +44 -0
  67. package/dist/flags.js.map +1 -0
  68. package/dist/hosting.d.ts +13 -14
  69. package/dist/hosting.js +3 -4
  70. package/dist/hosting.js.map +1 -1
  71. package/dist/ids.d.ts +987 -0
  72. package/dist/ids.js +317 -0
  73. package/dist/ids.js.map +1 -0
  74. package/dist/index.d.ts +25 -1
  75. package/dist/index.js +34 -2
  76. package/dist/index.js.map +1 -1
  77. package/dist/keys.d.ts +2 -2
  78. package/dist/keys.js +3 -3
  79. package/dist/knowledge.d.ts +1192 -0
  80. package/dist/knowledge.js +1002 -0
  81. package/dist/knowledge.js.map +1 -0
  82. package/dist/localization.d.ts +663 -0
  83. package/dist/localization.js +491 -0
  84. package/dist/localization.js.map +1 -0
  85. package/dist/methods.js +3251 -133
  86. package/dist/methods.js.map +1 -1
  87. package/dist/money.d.ts +3086 -0
  88. package/dist/money.js +2358 -0
  89. package/dist/money.js.map +1 -0
  90. package/dist/network.d.ts +4 -5
  91. package/dist/network.js +3 -4
  92. package/dist/network.js.map +1 -1
  93. package/dist/notify.d.ts +667 -125
  94. package/dist/notify.js +471 -73
  95. package/dist/notify.js.map +1 -1
  96. package/dist/observability.d.ts +322 -7
  97. package/dist/observability.js +244 -8
  98. package/dist/observability.js.map +1 -1
  99. package/dist/realtime.d.ts +404 -0
  100. package/dist/realtime.js +312 -0
  101. package/dist/realtime.js.map +1 -0
  102. package/dist/release.d.ts +14 -15
  103. package/dist/release.js +3 -4
  104. package/dist/release.js.map +1 -1
  105. package/dist/runners.d.ts +2 -3
  106. package/dist/runners.js +3 -4
  107. package/dist/runners.js.map +1 -1
  108. package/dist/runtime.d.ts +5 -1
  109. package/dist/runtime.js +7 -3
  110. package/dist/runtime.js.map +1 -1
  111. package/dist/sandboxes.d.ts +64 -20
  112. package/dist/sandboxes.js +9 -4
  113. package/dist/sandboxes.js.map +1 -1
  114. package/dist/secrets.d.ts +342 -6
  115. package/dist/secrets.js +271 -4
  116. package/dist/secrets.js.map +1 -1
  117. package/dist/workflows.d.ts +969 -15
  118. package/dist/workflows.js +815 -6
  119. package/dist/workflows.js.map +1 -1
  120. package/package.json +2 -2
package/dist/data.js CHANGED
@@ -1,4 +1,4 @@
1
- // @generated by sylphx-gen 0.1.0 from contracts@446ceb843d4ff88057b0db68e2e54e4aea52d8143b72d66016122995b878de20. Do not edit.
1
+ // @generated by sylphx-gen 0.1.0 from contracts@c8a7361c53e572321b0ec9fb014fd1e8279b007b62562423038e0d0e5b9d767a. Do not edit.
2
2
  // `sylphx.data.v1`.
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
@@ -82,6 +82,12 @@ runtime.registerSchemas({
82
82
  ['allowMissing', 'allow_missing'],
83
83
  ['validateOnly', 'validate_only'],
84
84
  ],
85
+ 'sylphx.data.v1.DeleteDocumentRequest': [
86
+ ['indexId', 'index_id'],
87
+ ['documentId', 'document_id'],
88
+ ['expectedVersion', 'expected_version'],
89
+ ],
90
+ 'sylphx.data.v1.DeleteDocumentResponse': [],
85
91
  'sylphx.data.v1.DeleteKvNamespaceRequest': [
86
92
  ['allowMissing', 'allow_missing'],
87
93
  ['validateOnly', 'validate_only'],
@@ -102,8 +108,28 @@ runtime.registerSchemas({
102
108
  ['expectedVersion', 'expected_version'],
103
109
  ],
104
110
  'sylphx.data.v1.DeleteValueResponse': [],
111
+ 'sylphx.data.v1.DocumentRecord': [
112
+ ['indexId', 'index_id'],
113
+ ['documentId', 'document_id'],
114
+ ['documentJson', 'document_json'],
115
+ ['updatedAtUnixMs', 'updated_at_unix_ms'],
116
+ ],
117
+ 'sylphx.data.v1.ExpireValueRequest': [
118
+ ['namespaceId', 'namespace_id'],
119
+ ['ttlSeconds', 'ttl_seconds'],
120
+ ],
121
+ 'sylphx.data.v1.ExpireValueResponse': [
122
+ ['expiresAtUnixMs', 'expires_at_unix_ms'],
123
+ ],
105
124
  'sylphx.data.v1.GetBucketRequest': [],
106
125
  'sylphx.data.v1.GetDatabaseRequest': [],
126
+ 'sylphx.data.v1.GetDocumentRequest': [
127
+ ['indexId', 'index_id'],
128
+ ['documentId', 'document_id'],
129
+ ],
130
+ 'sylphx.data.v1.GetDocumentResponse': [
131
+ ['document', 'document', 'sylphx.data.v1.DocumentRecord'],
132
+ ],
107
133
  'sylphx.data.v1.GetKvNamespaceRequest': [],
108
134
  'sylphx.data.v1.GetObjectRequest': [
109
135
  ['bucketId', 'bucket_id'],
@@ -118,6 +144,34 @@ runtime.registerSchemas({
118
144
  'sylphx.data.v1.GetValueResponse': [
119
145
  ['value', 'value', 'sylphx.data.v1.ValueRecord'],
120
146
  ],
147
+ 'sylphx.data.v1.GetValuesRequest': [
148
+ ['namespaceId', 'namespace_id'],
149
+ ],
150
+ 'sylphx.data.v1.GetValuesResponse': [
151
+ ['values', 'values', 'sylphx.data.v1.ValueRecord'],
152
+ ],
153
+ 'sylphx.data.v1.HashField': [],
154
+ 'sylphx.data.v1.HashGetAllRequest': [
155
+ ['namespaceId', 'namespace_id'],
156
+ ],
157
+ 'sylphx.data.v1.HashGetAllResponse': [
158
+ ['fields', 'fields', 'sylphx.data.v1.HashField'],
159
+ ],
160
+ 'sylphx.data.v1.HashGetFieldsRequest': [
161
+ ['namespaceId', 'namespace_id'],
162
+ ],
163
+ 'sylphx.data.v1.HashGetFieldsResponse': [
164
+ ['fields', 'fields', 'sylphx.data.v1.HashField'],
165
+ ],
166
+ 'sylphx.data.v1.HashGetValueRequest': [
167
+ ['namespaceId', 'namespace_id'],
168
+ ],
169
+ 'sylphx.data.v1.HashGetValueResponse': [],
170
+ 'sylphx.data.v1.HashSetValueRequest': [
171
+ ['namespaceId', 'namespace_id'],
172
+ ['fields', 'fields', 'sylphx.data.v1.HashField'],
173
+ ],
174
+ 'sylphx.data.v1.HashSetValueResponse': [],
121
175
  'sylphx.data.v1.IncrementValueRequest': [
122
176
  ['namespaceId', 'namespace_id'],
123
177
  ],
@@ -165,6 +219,10 @@ runtime.registerSchemas({
165
219
  ['kvNamespaces', 'kv_namespaces', 'sylphx.data.v1.KvNamespace'],
166
220
  ['nextPageToken', 'next_page_token'],
167
221
  ],
222
+ 'sylphx.data.v1.ListLenValueRequest': [
223
+ ['namespaceId', 'namespace_id'],
224
+ ],
225
+ 'sylphx.data.v1.ListLenValueResponse': [],
168
226
  'sylphx.data.v1.ListObjectsRequest': [
169
227
  ['bucketId', 'bucket_id'],
170
228
  ['pageSize', 'page_size'],
@@ -174,6 +232,18 @@ runtime.registerSchemas({
174
232
  ['objects', 'objects', 'sylphx.data.v1.ObjectRecord'],
175
233
  ['nextPageToken', 'next_page_token'],
176
234
  ],
235
+ 'sylphx.data.v1.ListPopValueRequest': [
236
+ ['namespaceId', 'namespace_id'],
237
+ ],
238
+ 'sylphx.data.v1.ListPopValueResponse': [],
239
+ 'sylphx.data.v1.ListPushValueRequest': [
240
+ ['namespaceId', 'namespace_id'],
241
+ ],
242
+ 'sylphx.data.v1.ListPushValueResponse': [],
243
+ 'sylphx.data.v1.ListRangeValueRequest': [
244
+ ['namespaceId', 'namespace_id'],
245
+ ],
246
+ 'sylphx.data.v1.ListRangeValueResponse': [],
177
247
  'sylphx.data.v1.ListSearchIndexesRequest': [
178
248
  ['pageSize', 'page_size'],
179
249
  ['pageToken', 'page_token'],
@@ -192,12 +262,37 @@ runtime.registerSchemas({
192
262
  ['values', 'values', 'sylphx.data.v1.ValueRecord'],
193
263
  ['nextPageToken', 'next_page_token'],
194
264
  ],
265
+ 'sylphx.data.v1.MultiSearchRequest': [
266
+ ['indexId', 'index_id'],
267
+ ['searches', 'searches', 'sylphx.data.v1.SearchRequest'],
268
+ ],
269
+ 'sylphx.data.v1.MultiSearchResponse': [
270
+ ['results', 'results', 'sylphx.data.v1.SearchResponse'],
271
+ ],
195
272
  'sylphx.data.v1.ObjectRecord': [
196
273
  ['bucketId', 'bucket_id'],
197
274
  ['contentType', 'content_type'],
198
275
  ['updatedAtUnixMs', 'updated_at_unix_ms'],
199
276
  ['deleteMarker', 'delete_marker'],
200
277
  ],
278
+ 'sylphx.data.v1.PatchDocumentRequest': [
279
+ ['indexId', 'index_id'],
280
+ ['documentId', 'document_id'],
281
+ ['patchJson', 'patch_json'],
282
+ ['expectedVersion', 'expected_version'],
283
+ ],
284
+ 'sylphx.data.v1.PatchDocumentResponse': [
285
+ ['document', 'document', 'sylphx.data.v1.DocumentRecord'],
286
+ ],
287
+ 'sylphx.data.v1.PutDocumentRequest': [
288
+ ['indexId', 'index_id'],
289
+ ['documentId', 'document_id'],
290
+ ['documentJson', 'document_json'],
291
+ ['expectedVersion', 'expected_version'],
292
+ ],
293
+ 'sylphx.data.v1.PutDocumentResponse': [
294
+ ['document', 'document', 'sylphx.data.v1.DocumentRecord'],
295
+ ],
201
296
  'sylphx.data.v1.PutObjectRequest': [
202
297
  ['bucketId', 'bucket_id'],
203
298
  ['contentType', 'content_type'],
@@ -230,6 +325,18 @@ runtime.registerSchemas({
230
325
  'sylphx.data.v1.RotateSearchIndexCredentialsRequest': [
231
326
  ['validateOnly', 'validate_only'],
232
327
  ],
328
+ 'sylphx.data.v1.ScanValuesRequest': [
329
+ ['namespaceId', 'namespace_id'],
330
+ ],
331
+ 'sylphx.data.v1.ScanValuesResponse': [],
332
+ 'sylphx.data.v1.SearchFilter': [
333
+ ['valueJson', 'value_json'],
334
+ ],
335
+ 'sylphx.data.v1.SearchHit': [
336
+ ['document', 'document', 'sylphx.data.v1.DocumentRecord'],
337
+ ['textScore', 'text_score'],
338
+ ['vectorScore', 'vector_score'],
339
+ ],
233
340
  'sylphx.data.v1.SearchIndex': [
234
341
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
235
342
  ['spec', 'spec', 'sylphx.data.v1.SearchIndexSpec'],
@@ -245,6 +352,14 @@ runtime.registerSchemas({
245
352
  ['storageBytes', 'storage_bytes'],
246
353
  ['documentCount', 'document_count'],
247
354
  ],
355
+ 'sylphx.data.v1.SearchRequest': [
356
+ ['indexId', 'index_id'],
357
+ ['filters', 'filters', 'sylphx.data.v1.SearchFilter'],
358
+ ['vectorWeight', 'vector_weight'],
359
+ ],
360
+ 'sylphx.data.v1.SearchResponse': [
361
+ ['hits', 'hits', 'sylphx.data.v1.SearchHit'],
362
+ ],
248
363
  'sylphx.data.v1.UpdateBucketRequest': [
249
364
  ['bucket', 'bucket', 'sylphx.data.v1.Bucket'],
250
365
  ['updateMask', 'update_mask'],
@@ -274,16 +389,39 @@ runtime.registerSchemas({
274
389
  ['expiresAtUnixMs', 'expires_at_unix_ms'],
275
390
  ['updatedAtUnixMs', 'updated_at_unix_ms'],
276
391
  ],
392
+ 'sylphx.data.v1.ZSetAddValueRequest': [
393
+ ['namespaceId', 'namespace_id'],
394
+ ['members', 'members', 'sylphx.data.v1.ZSetMember'],
395
+ ],
396
+ 'sylphx.data.v1.ZSetAddValueResponse': [],
397
+ 'sylphx.data.v1.ZSetLenValueRequest': [
398
+ ['namespaceId', 'namespace_id'],
399
+ ],
400
+ 'sylphx.data.v1.ZSetLenValueResponse': [],
401
+ 'sylphx.data.v1.ZSetMember': [],
402
+ 'sylphx.data.v1.ZSetRangeValueRequest': [
403
+ ['namespaceId', 'namespace_id'],
404
+ ['withScores', 'with_scores'],
405
+ ],
406
+ 'sylphx.data.v1.ZSetRangeValueResponse': [
407
+ ['members', 'members', 'sylphx.data.v1.ZSetMember'],
408
+ ],
409
+ 'sylphx.data.v1.ZSetScoreValueRequest': [
410
+ ['namespaceId', 'namespace_id'],
411
+ ],
412
+ 'sylphx.data.v1.ZSetScoreValueResponse': [],
277
413
  });
278
414
  /**
279
- * DataPlaneService is the data plane of Sylphx Data: object bytes and
280
- * key-value entries in an environment's buckets and KV namespaces. It is
415
+ * DataPlaneService is the data plane of Sylphx Data: object bytes, key-value
416
+ * entries (strings, counters, hashes, lists, and sorted sets), and search
417
+ * documents in an environment's buckets, KV namespaces, and search indexes. It is
281
418
  * served by Data itself at its origin, not by the Resource API, and is called
282
419
  * with the environment's secret key (`SYLPHX_API_KEY`); the key's org,
283
420
  * project, and environment are the tenant. Every call carries a new
284
421
  * `Sylphx-Effect-Id`, which the SDK sends and reuses on retries.
285
422
  *
286
- * The buckets and namespaces themselves are Resources of DataService. The
423
+ * The buckets, namespaces, and indexes themselves are Resources of
424
+ * DataService. The
287
425
  * messages here are Data's wire format
288
426
  * (`services/data/proto/sylphx/data/v1/data.proto`), field for field; Data
289
427
  * answers ProtoJSON (camelCase names, 64-bit integers and bytes as strings).
@@ -295,6 +433,10 @@ export class DataApi {
295
433
  objects;
296
434
  /** The `kv` collection. */
297
435
  kv;
436
+ /** The `documents` collection. */
437
+ documents;
438
+ /** The `search` collection. */
439
+ search;
298
440
  /** The `databases` collection. */
299
441
  databases;
300
442
  /** The `kv_namespaces` collection. */
@@ -306,6 +448,8 @@ export class DataApi {
306
448
  constructor(client) {
307
449
  this.objects = new ObjectsCollection(client);
308
450
  this.kv = new KvCollection(client);
451
+ this.documents = new DocumentsCollection(client);
452
+ this.search = new SearchCollection(client);
309
453
  this.databases = new DatabasesCollection(client);
310
454
  this.kvNamespaces = new KvNamespacesCollection(client);
311
455
  this.buckets = new BucketsCollection(client);
@@ -491,6 +635,424 @@ export class KvCollection {
491
635
  mutation: true,
492
636
  });
493
637
  }
638
+ /**
639
+ * Reads up to 1000 keys at once (MGET). Answers one entry per key, in
640
+ * order; an absent or expired key keeps its key and has no `value`.
641
+ *
642
+ * `POST /v1/kv-mget` · permission `data:read` · effect `read`
643
+ *
644
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
645
+ */
646
+ async getMany(request) {
647
+ return this.client.call({
648
+ method: 'POST',
649
+ path: `/v1/kv-mget`,
650
+ body: runtime.omit(request, []),
651
+ bodyType: 'sylphx.data.v1.GetValuesRequest',
652
+ responseType: 'sylphx.data.v1.GetValuesResponse',
653
+ origin: 'https://api.data.sylphx.com',
654
+ effectIds: true,
655
+ mutation: true,
656
+ });
657
+ }
658
+ /**
659
+ * Sets fields of a hash (HSET), creating it.
660
+ *
661
+ * `POST /v1/kv-hashes` · permission `data:write` · effect `write`
662
+ *
663
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
664
+ */
665
+ async hashSet(request) {
666
+ return this.client.call({
667
+ method: 'POST',
668
+ path: `/v1/kv-hashes`,
669
+ body: runtime.omit(request, []),
670
+ bodyType: 'sylphx.data.v1.HashSetValueRequest',
671
+ responseType: 'sylphx.data.v1.HashSetValueResponse',
672
+ origin: 'https://api.data.sylphx.com',
673
+ effectIds: true,
674
+ mutation: true,
675
+ });
676
+ }
677
+ /**
678
+ * Reads one field of a hash (HGET); an absent field has no `value`.
679
+ *
680
+ * `POST /v1/kv-hash-gets` · permission `data:read` · effect `read`
681
+ *
682
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
683
+ */
684
+ async hashGet(request) {
685
+ return this.client.call({
686
+ method: 'POST',
687
+ path: `/v1/kv-hash-gets`,
688
+ body: runtime.omit(request, []),
689
+ bodyType: 'sylphx.data.v1.HashGetValueRequest',
690
+ responseType: 'sylphx.data.v1.HashGetValueResponse',
691
+ origin: 'https://api.data.sylphx.com',
692
+ effectIds: true,
693
+ mutation: true,
694
+ });
695
+ }
696
+ /**
697
+ * Reads every field of a hash (HGETALL).
698
+ *
699
+ * `POST /v1/kv-hash-getall` · permission `data:read` · effect `read`
700
+ *
701
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
702
+ */
703
+ async hashGetAll(request) {
704
+ return this.client.call({
705
+ method: 'POST',
706
+ path: `/v1/kv-hash-getall`,
707
+ body: runtime.omit(request, []),
708
+ bodyType: 'sylphx.data.v1.HashGetAllRequest',
709
+ responseType: 'sylphx.data.v1.HashGetAllResponse',
710
+ origin: 'https://api.data.sylphx.com',
711
+ effectIds: true,
712
+ mutation: true,
713
+ });
714
+ }
715
+ /**
716
+ * Reads several fields of a hash (HMGET), one per field, in order; an
717
+ * absent field has no `value`.
718
+ *
719
+ * `POST /v1/kv-hash-mget` · permission `data:read` · effect `read`
720
+ *
721
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
722
+ */
723
+ async hashGetMany(request) {
724
+ return this.client.call({
725
+ method: 'POST',
726
+ path: `/v1/kv-hash-mget`,
727
+ body: runtime.omit(request, []),
728
+ bodyType: 'sylphx.data.v1.HashGetFieldsRequest',
729
+ responseType: 'sylphx.data.v1.HashGetFieldsResponse',
730
+ origin: 'https://api.data.sylphx.com',
731
+ effectIds: true,
732
+ mutation: true,
733
+ });
734
+ }
735
+ /**
736
+ * Pushes values onto the head of a list (LPUSH), creating it.
737
+ *
738
+ * `POST /v1/kv-list-pushes` · permission `data:write` · effect `write`
739
+ *
740
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
741
+ */
742
+ async listPush(request) {
743
+ return this.client.call({
744
+ method: 'POST',
745
+ path: `/v1/kv-list-pushes`,
746
+ body: runtime.omit(request, []),
747
+ bodyType: 'sylphx.data.v1.ListPushValueRequest',
748
+ responseType: 'sylphx.data.v1.ListPushValueResponse',
749
+ origin: 'https://api.data.sylphx.com',
750
+ effectIds: true,
751
+ mutation: true,
752
+ });
753
+ }
754
+ /**
755
+ * Reads a range of a list (LRANGE); negative indexes count from the end.
756
+ *
757
+ * `POST /v1/kv-list-ranges` · permission `data:read` · effect `read`
758
+ *
759
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
760
+ */
761
+ async listRange(request) {
762
+ return this.client.call({
763
+ method: 'POST',
764
+ path: `/v1/kv-list-ranges`,
765
+ body: runtime.omit(request, []),
766
+ bodyType: 'sylphx.data.v1.ListRangeValueRequest',
767
+ responseType: 'sylphx.data.v1.ListRangeValueResponse',
768
+ origin: 'https://api.data.sylphx.com',
769
+ effectIds: true,
770
+ mutation: true,
771
+ });
772
+ }
773
+ /**
774
+ * Pops values from the head of a list (LPOP); an emptied list is removed.
775
+ *
776
+ * `POST /v1/kv-list-pops` · permission `data:write` · effect `write`
777
+ *
778
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
779
+ */
780
+ async listPop(request) {
781
+ return this.client.call({
782
+ method: 'POST',
783
+ path: `/v1/kv-list-pops`,
784
+ body: runtime.omit(request, []),
785
+ bodyType: 'sylphx.data.v1.ListPopValueRequest',
786
+ responseType: 'sylphx.data.v1.ListPopValueResponse',
787
+ origin: 'https://api.data.sylphx.com',
788
+ effectIds: true,
789
+ mutation: true,
790
+ });
791
+ }
792
+ /**
793
+ * Reads the length of a list (LLEN); an absent key has length zero.
794
+ *
795
+ * `POST /v1/kv-list-lens` · permission `data:read` · effect `read`
796
+ *
797
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
798
+ */
799
+ async listLength(request) {
800
+ return this.client.call({
801
+ method: 'POST',
802
+ path: `/v1/kv-list-lens`,
803
+ body: runtime.omit(request, []),
804
+ bodyType: 'sylphx.data.v1.ListLenValueRequest',
805
+ responseType: 'sylphx.data.v1.ListLenValueResponse',
806
+ origin: 'https://api.data.sylphx.com',
807
+ effectIds: true,
808
+ mutation: true,
809
+ });
810
+ }
811
+ /**
812
+ * Adds members to a sorted set or updates their scores (ZADD), creating it.
813
+ *
814
+ * `POST /v1/kv-zsets` · permission `data:write` · effect `write`
815
+ *
816
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
817
+ */
818
+ async zsetAdd(request) {
819
+ return this.client.call({
820
+ method: 'POST',
821
+ path: `/v1/kv-zsets`,
822
+ body: runtime.omit(request, []),
823
+ bodyType: 'sylphx.data.v1.ZSetAddValueRequest',
824
+ responseType: 'sylphx.data.v1.ZSetAddValueResponse',
825
+ origin: 'https://api.data.sylphx.com',
826
+ effectIds: true,
827
+ mutation: true,
828
+ });
829
+ }
830
+ /**
831
+ * Reads a range of a sorted set by rank, lowest score first (ZRANGE);
832
+ * negative indexes count from the end.
833
+ *
834
+ * `POST /v1/kv-zset-ranges` · permission `data:read` · effect `read`
835
+ *
836
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
837
+ */
838
+ async zsetRange(request) {
839
+ return this.client.call({
840
+ method: 'POST',
841
+ path: `/v1/kv-zset-ranges`,
842
+ body: runtime.omit(request, []),
843
+ bodyType: 'sylphx.data.v1.ZSetRangeValueRequest',
844
+ responseType: 'sylphx.data.v1.ZSetRangeValueResponse',
845
+ origin: 'https://api.data.sylphx.com',
846
+ effectIds: true,
847
+ mutation: true,
848
+ });
849
+ }
850
+ /**
851
+ * Reads a member's score (ZSCORE); an absent member has no `score`.
852
+ *
853
+ * `POST /v1/kv-zset-scores` · permission `data:read` · effect `read`
854
+ *
855
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
856
+ */
857
+ async zsetScore(request) {
858
+ return this.client.call({
859
+ method: 'POST',
860
+ path: `/v1/kv-zset-scores`,
861
+ body: runtime.omit(request, []),
862
+ bodyType: 'sylphx.data.v1.ZSetScoreValueRequest',
863
+ responseType: 'sylphx.data.v1.ZSetScoreValueResponse',
864
+ origin: 'https://api.data.sylphx.com',
865
+ effectIds: true,
866
+ mutation: true,
867
+ });
868
+ }
869
+ /**
870
+ * Reads the size of a sorted set (ZCARD); an absent key has size zero.
871
+ *
872
+ * `POST /v1/kv-zset-lens` · permission `data:read` · effect `read`
873
+ *
874
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
875
+ */
876
+ async zsetLength(request) {
877
+ return this.client.call({
878
+ method: 'POST',
879
+ path: `/v1/kv-zset-lens`,
880
+ body: runtime.omit(request, []),
881
+ bodyType: 'sylphx.data.v1.ZSetLenValueRequest',
882
+ responseType: 'sylphx.data.v1.ZSetLenValueResponse',
883
+ origin: 'https://api.data.sylphx.com',
884
+ effectIds: true,
885
+ mutation: true,
886
+ });
887
+ }
888
+ /**
889
+ * Walks a namespace's keys that match a glob (SCAN). Call again with the
890
+ * returned `cursor` until it is empty.
891
+ *
892
+ * `POST /v1/kv-scans` · permission `data:read` · effect `read`
893
+ *
894
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
895
+ */
896
+ async scan(request) {
897
+ return this.client.call({
898
+ method: 'POST',
899
+ path: `/v1/kv-scans`,
900
+ body: runtime.omit(request, []),
901
+ bodyType: 'sylphx.data.v1.ScanValuesRequest',
902
+ responseType: 'sylphx.data.v1.ScanValuesResponse',
903
+ origin: 'https://api.data.sylphx.com',
904
+ effectIds: true,
905
+ mutation: true,
906
+ });
907
+ }
908
+ /**
909
+ * Sets a key's time to live (EXPIRE) without rewriting its value; zero
910
+ * makes it persistent.
911
+ *
912
+ * `POST /v1/kv-expiries` · permission `data:write` · effect `write`
913
+ *
914
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
915
+ */
916
+ async expire(request) {
917
+ return this.client.call({
918
+ method: 'POST',
919
+ path: `/v1/kv-expiries`,
920
+ body: runtime.omit(request, []),
921
+ bodyType: 'sylphx.data.v1.ExpireValueRequest',
922
+ responseType: 'sylphx.data.v1.ExpireValueResponse',
923
+ origin: 'https://api.data.sylphx.com',
924
+ effectIds: true,
925
+ mutation: true,
926
+ });
927
+ }
928
+ }
929
+ /** `documents` of Sylphx Data: served at `https://api.data.sylphx.com`. */
930
+ export class DocumentsCollection {
931
+ client;
932
+ constructor(client) {
933
+ this.client = client;
934
+ }
935
+ /**
936
+ * Writes a document to a search index, replacing the current version.
937
+ *
938
+ * `PUT /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `write`
939
+ *
940
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
941
+ */
942
+ async put(request) {
943
+ return this.client.call({
944
+ method: 'PUT',
945
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
946
+ body: runtime.omit(request, ['documentId', 'indexId']),
947
+ bodyType: 'sylphx.data.v1.PutDocumentRequest',
948
+ responseType: 'sylphx.data.v1.PutDocumentResponse',
949
+ origin: 'https://api.data.sylphx.com',
950
+ effectIds: true,
951
+ mutation: true,
952
+ });
953
+ }
954
+ /**
955
+ * Changes some fields of a document and keeps the rest: a JSON merge patch
956
+ * (RFC 7396). The version goes up by one.
957
+ *
958
+ * `PATCH /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `write`
959
+ *
960
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
961
+ */
962
+ async patch(request) {
963
+ return this.client.call({
964
+ method: 'PATCH',
965
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
966
+ body: runtime.omit(request, ['documentId', 'indexId']),
967
+ bodyType: 'sylphx.data.v1.PatchDocumentRequest',
968
+ responseType: 'sylphx.data.v1.PatchDocumentResponse',
969
+ origin: 'https://api.data.sylphx.com',
970
+ effectIds: true,
971
+ mutation: true,
972
+ });
973
+ }
974
+ /**
975
+ * Reads a document.
976
+ *
977
+ * `GET /v1/documents/{index_id}/{document_id}` · permission `data:read` · effect `read`
978
+ *
979
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
980
+ */
981
+ async get(request) {
982
+ return this.client.call({
983
+ method: 'GET',
984
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
985
+ responseType: 'sylphx.data.v1.GetDocumentResponse',
986
+ origin: 'https://api.data.sylphx.com',
987
+ effectIds: true,
988
+ mutation: false,
989
+ });
990
+ }
991
+ /**
992
+ * Deletes a document.
993
+ *
994
+ * `DELETE /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `destructive`
995
+ *
996
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
997
+ */
998
+ async delete(request) {
999
+ return this.client.call({
1000
+ method: 'DELETE',
1001
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
1002
+ query: { expected_version: request.expectedVersion },
1003
+ responseType: 'sylphx.data.v1.DeleteDocumentResponse',
1004
+ origin: 'https://api.data.sylphx.com',
1005
+ effectIds: true,
1006
+ mutation: true,
1007
+ });
1008
+ }
1009
+ }
1010
+ /** `search` of Sylphx Data: served at `https://api.data.sylphx.com`. */
1011
+ export class SearchCollection {
1012
+ client;
1013
+ constructor(client) {
1014
+ this.client = client;
1015
+ }
1016
+ /**
1017
+ * Searches an index by text, by vector, or both, best match first, with
1018
+ * filters and paging.
1019
+ *
1020
+ * `POST /v1/search/{index_id}` · permission `data:read` · effect `read`
1021
+ *
1022
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1023
+ */
1024
+ async query(request) {
1025
+ return this.client.call({
1026
+ method: 'POST',
1027
+ path: `/v1/search/${runtime.protocolParam(request.indexId, false, 'index_id')}`,
1028
+ body: runtime.omit(request, ['indexId']),
1029
+ bodyType: 'sylphx.data.v1.SearchRequest',
1030
+ responseType: 'sylphx.data.v1.SearchResponse',
1031
+ origin: 'https://api.data.sylphx.com',
1032
+ effectIds: true,
1033
+ mutation: true,
1034
+ });
1035
+ }
1036
+ /**
1037
+ * Runs several searches of one index in one request, 1 to 10, and answers
1038
+ * each in request order.
1039
+ *
1040
+ * `POST /v1/multi-search/{index_id}` · permission `data:read` · effect `read`
1041
+ *
1042
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1043
+ */
1044
+ async multi(request) {
1045
+ return this.client.call({
1046
+ method: 'POST',
1047
+ path: `/v1/multi-search/${runtime.protocolParam(request.indexId, false, 'index_id')}`,
1048
+ body: runtime.omit(request, ['indexId']),
1049
+ bodyType: 'sylphx.data.v1.MultiSearchRequest',
1050
+ responseType: 'sylphx.data.v1.MultiSearchResponse',
1051
+ origin: 'https://api.data.sylphx.com',
1052
+ effectIds: true,
1053
+ mutation: true,
1054
+ });
1055
+ }
494
1056
  }
495
1057
  /** `databases` of Sylphx Data: Resource type `data.sylphx.com/Database`. */
496
1058
  export class DatabasesCollection {