@sylphx/sdk 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +123 -0
  2. package/dist/access.d.ts +126 -20
  3. package/dist/access.js +111 -15
  4. package/dist/access.js.map +1 -1
  5. package/dist/ai.d.ts +1 -2
  6. package/dist/ai.js +2 -3
  7. package/dist/ai.js.map +1 -1
  8. package/dist/artifacts.d.ts +1 -1
  9. package/dist/artifacts.js +2 -2
  10. package/dist/assets.d.ts +447 -0
  11. package/dist/assets.js +266 -0
  12. package/dist/assets.js.map +1 -0
  13. package/dist/auth/client.d.ts +239 -0
  14. package/dist/auth/client.js +337 -0
  15. package/dist/auth/client.js.map +1 -0
  16. package/dist/auth/verify.d.ts +92 -0
  17. package/dist/auth/verify.js +207 -0
  18. package/dist/auth/verify.js.map +1 -0
  19. package/dist/auth.d.ts +455 -7
  20. package/dist/auth.js +416 -5
  21. package/dist/auth.js.map +1 -1
  22. package/dist/billing.d.ts +113 -17
  23. package/dist/billing.js +45 -5
  24. package/dist/billing.js.map +1 -1
  25. package/dist/broker.d.ts +5 -4
  26. package/dist/broker.js +3 -3
  27. package/dist/broker.js.map +1 -1
  28. package/dist/build.d.ts +4 -4
  29. package/dist/build.js +3 -3
  30. package/dist/common.d.ts +1 -1
  31. package/dist/common.js +1 -1
  32. package/dist/config/flags.d.ts +140 -0
  33. package/dist/config/flags.js +462 -0
  34. package/dist/config/flags.js.map +1 -0
  35. package/dist/config.d.ts +380 -15
  36. package/dist/config.js +283 -5
  37. package/dist/config.js.map +1 -1
  38. package/dist/connections.d.ts +6 -6
  39. package/dist/connections.js +3 -3
  40. package/dist/data.d.ts +844 -8
  41. package/dist/data.js +779 -5
  42. package/dist/data.js.map +1 -1
  43. package/dist/entitlement.d.ts +18 -9
  44. package/dist/entitlement.js +4 -4
  45. package/dist/entitlement.js.map +1 -1
  46. package/dist/events/realtime.d.ts +69 -0
  47. package/dist/events/realtime.js +107 -0
  48. package/dist/events/realtime.js.map +1 -0
  49. package/dist/events/webhooks.d.ts +40 -0
  50. package/dist/events/webhooks.js +110 -0
  51. package/dist/events/webhooks.js.map +1 -0
  52. package/dist/events.d.ts +369 -22
  53. package/dist/events.js +311 -8
  54. package/dist/events.js.map +1 -1
  55. package/dist/hosting.d.ts +13 -14
  56. package/dist/hosting.js +3 -4
  57. package/dist/hosting.js.map +1 -1
  58. package/dist/ids.d.ts +837 -0
  59. package/dist/ids.js +287 -0
  60. package/dist/ids.js.map +1 -0
  61. package/dist/index.d.ts +12 -1
  62. package/dist/index.js +16 -2
  63. package/dist/index.js.map +1 -1
  64. package/dist/keys.d.ts +2 -2
  65. package/dist/keys.js +3 -3
  66. package/dist/localization.d.ts +663 -0
  67. package/dist/localization.js +491 -0
  68. package/dist/localization.js.map +1 -0
  69. package/dist/methods.js +1933 -133
  70. package/dist/methods.js.map +1 -1
  71. package/dist/money.d.ts +1406 -0
  72. package/dist/money.js +1090 -0
  73. package/dist/money.js.map +1 -0
  74. package/dist/network.d.ts +4 -5
  75. package/dist/network.js +3 -4
  76. package/dist/network.js.map +1 -1
  77. package/dist/notify.d.ts +718 -127
  78. package/dist/notify.js +493 -74
  79. package/dist/notify.js.map +1 -1
  80. package/dist/observability.d.ts +184 -7
  81. package/dist/observability.js +156 -8
  82. package/dist/observability.js.map +1 -1
  83. package/dist/release.d.ts +14 -15
  84. package/dist/release.js +3 -4
  85. package/dist/release.js.map +1 -1
  86. package/dist/runners.d.ts +2 -3
  87. package/dist/runners.js +3 -4
  88. package/dist/runners.js.map +1 -1
  89. package/dist/runtime.d.ts +42 -5
  90. package/dist/runtime.js +101 -18
  91. package/dist/runtime.js.map +1 -1
  92. package/dist/sandboxes.d.ts +64 -20
  93. package/dist/sandboxes.js +9 -4
  94. package/dist/sandboxes.js.map +1 -1
  95. package/dist/secrets.d.ts +6 -6
  96. package/dist/secrets.js +4 -4
  97. package/dist/workflows.d.ts +850 -12
  98. package/dist/workflows.js +672 -3
  99. package/dist/workflows.js.map +1 -1
  100. package/package.json +4 -4
package/dist/data.js CHANGED
@@ -1,4 +1,4 @@
1
- // @generated by sylphx-gen 0.1.0 from contracts@cdf6473b36ca648759a7f4b1fc21554541d52a947477e6e9d1d7a6a9a79bdaa0. Do not edit.
1
+ // @generated by sylphx-gen 0.1.0 from contracts@c8aac0afaf7591d0d5efa1ba6a8540d723d41a97ce7ad5d68601380ef3ab4783. Do not edit.
2
2
  // `sylphx.data.v1`.
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
@@ -82,18 +82,102 @@ 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'],
88
94
  ],
95
+ 'sylphx.data.v1.DeleteObjectRequest': [
96
+ ['bucketId', 'bucket_id'],
97
+ ['expectedVersion', 'expected_version'],
98
+ ],
99
+ 'sylphx.data.v1.DeleteObjectResponse': [
100
+ ['object', 'object', 'sylphx.data.v1.ObjectRecord'],
101
+ ],
89
102
  'sylphx.data.v1.DeleteSearchIndexRequest': [
90
103
  ['allowMissing', 'allow_missing'],
91
104
  ['validateOnly', 'validate_only'],
92
105
  ],
106
+ 'sylphx.data.v1.DeleteValueRequest': [
107
+ ['namespaceId', 'namespace_id'],
108
+ ['expectedVersion', 'expected_version'],
109
+ ],
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
+ ],
93
124
  'sylphx.data.v1.GetBucketRequest': [],
94
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
+ ],
95
133
  'sylphx.data.v1.GetKvNamespaceRequest': [],
134
+ 'sylphx.data.v1.GetObjectRequest': [
135
+ ['bucketId', 'bucket_id'],
136
+ ],
137
+ 'sylphx.data.v1.GetObjectResponse': [
138
+ ['object', 'object', 'sylphx.data.v1.ObjectRecord'],
139
+ ],
96
140
  'sylphx.data.v1.GetSearchIndexRequest': [],
141
+ 'sylphx.data.v1.GetValueRequest': [
142
+ ['namespaceId', 'namespace_id'],
143
+ ],
144
+ 'sylphx.data.v1.GetValueResponse': [
145
+ ['value', 'value', 'sylphx.data.v1.ValueRecord'],
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': [],
175
+ 'sylphx.data.v1.IncrementValueRequest': [
176
+ ['namespaceId', 'namespace_id'],
177
+ ],
178
+ 'sylphx.data.v1.IncrementValueResponse': [
179
+ ['value', 'value', 'sylphx.data.v1.ValueRecord'],
180
+ ],
97
181
  'sylphx.data.v1.KvNamespace': [
98
182
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
99
183
  ['spec', 'spec', 'sylphx.data.v1.KvNamespaceSpec'],
@@ -135,6 +219,31 @@ runtime.registerSchemas({
135
219
  ['kvNamespaces', 'kv_namespaces', 'sylphx.data.v1.KvNamespace'],
136
220
  ['nextPageToken', 'next_page_token'],
137
221
  ],
222
+ 'sylphx.data.v1.ListLenValueRequest': [
223
+ ['namespaceId', 'namespace_id'],
224
+ ],
225
+ 'sylphx.data.v1.ListLenValueResponse': [],
226
+ 'sylphx.data.v1.ListObjectsRequest': [
227
+ ['bucketId', 'bucket_id'],
228
+ ['pageSize', 'page_size'],
229
+ ['pageToken', 'page_token'],
230
+ ],
231
+ 'sylphx.data.v1.ListObjectsResponse': [
232
+ ['objects', 'objects', 'sylphx.data.v1.ObjectRecord'],
233
+ ['nextPageToken', 'next_page_token'],
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': [],
138
247
  'sylphx.data.v1.ListSearchIndexesRequest': [
139
248
  ['pageSize', 'page_size'],
140
249
  ['pageToken', 'page_token'],
@@ -144,6 +253,46 @@ runtime.registerSchemas({
144
253
  ['searchIndexes', 'search_indexes', 'sylphx.data.v1.SearchIndex'],
145
254
  ['nextPageToken', 'next_page_token'],
146
255
  ],
256
+ 'sylphx.data.v1.ListValuesRequest': [
257
+ ['namespaceId', 'namespace_id'],
258
+ ['pageSize', 'page_size'],
259
+ ['pageToken', 'page_token'],
260
+ ],
261
+ 'sylphx.data.v1.ListValuesResponse': [
262
+ ['values', 'values', 'sylphx.data.v1.ValueRecord'],
263
+ ['nextPageToken', 'next_page_token'],
264
+ ],
265
+ 'sylphx.data.v1.ObjectRecord': [
266
+ ['bucketId', 'bucket_id'],
267
+ ['contentType', 'content_type'],
268
+ ['updatedAtUnixMs', 'updated_at_unix_ms'],
269
+ ['deleteMarker', 'delete_marker'],
270
+ ],
271
+ 'sylphx.data.v1.PutDocumentRequest': [
272
+ ['indexId', 'index_id'],
273
+ ['documentId', 'document_id'],
274
+ ['documentJson', 'document_json'],
275
+ ['expectedVersion', 'expected_version'],
276
+ ],
277
+ 'sylphx.data.v1.PutDocumentResponse': [
278
+ ['document', 'document', 'sylphx.data.v1.DocumentRecord'],
279
+ ],
280
+ 'sylphx.data.v1.PutObjectRequest': [
281
+ ['bucketId', 'bucket_id'],
282
+ ['contentType', 'content_type'],
283
+ ['expectedVersion', 'expected_version'],
284
+ ],
285
+ 'sylphx.data.v1.PutObjectResponse': [
286
+ ['object', 'object', 'sylphx.data.v1.ObjectRecord'],
287
+ ],
288
+ 'sylphx.data.v1.PutValueRequest': [
289
+ ['namespaceId', 'namespace_id'],
290
+ ['ttlSeconds', 'ttl_seconds'],
291
+ ['expectedVersion', 'expected_version'],
292
+ ],
293
+ 'sylphx.data.v1.PutValueResponse': [
294
+ ['value', 'value', 'sylphx.data.v1.ValueRecord'],
295
+ ],
147
296
  'sylphx.data.v1.RestoreDatabaseRequest': [
148
297
  ['restoreTime', 'restore_time'],
149
298
  ['validateOnly', 'validate_only'],
@@ -160,6 +309,18 @@ runtime.registerSchemas({
160
309
  'sylphx.data.v1.RotateSearchIndexCredentialsRequest': [
161
310
  ['validateOnly', 'validate_only'],
162
311
  ],
312
+ 'sylphx.data.v1.ScanValuesRequest': [
313
+ ['namespaceId', 'namespace_id'],
314
+ ],
315
+ 'sylphx.data.v1.ScanValuesResponse': [],
316
+ 'sylphx.data.v1.SearchFilter': [
317
+ ['valueJson', 'value_json'],
318
+ ],
319
+ 'sylphx.data.v1.SearchHit': [
320
+ ['document', 'document', 'sylphx.data.v1.DocumentRecord'],
321
+ ['textScore', 'text_score'],
322
+ ['vectorScore', 'vector_score'],
323
+ ],
163
324
  'sylphx.data.v1.SearchIndex': [
164
325
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
165
326
  ['spec', 'spec', 'sylphx.data.v1.SearchIndexSpec'],
@@ -175,6 +336,14 @@ runtime.registerSchemas({
175
336
  ['storageBytes', 'storage_bytes'],
176
337
  ['documentCount', 'document_count'],
177
338
  ],
339
+ 'sylphx.data.v1.SearchRequest': [
340
+ ['indexId', 'index_id'],
341
+ ['filters', 'filters', 'sylphx.data.v1.SearchFilter'],
342
+ ['vectorWeight', 'vector_weight'],
343
+ ],
344
+ 'sylphx.data.v1.SearchResponse': [
345
+ ['hits', 'hits', 'sylphx.data.v1.SearchHit'],
346
+ ],
178
347
  'sylphx.data.v1.UpdateBucketRequest': [
179
348
  ['bucket', 'bucket', 'sylphx.data.v1.Bucket'],
180
349
  ['updateMask', 'update_mask'],
@@ -199,16 +368,59 @@ runtime.registerSchemas({
199
368
  ['allowMissing', 'allow_missing'],
200
369
  ['validateOnly', 'validate_only'],
201
370
  ],
371
+ 'sylphx.data.v1.ValueRecord': [
372
+ ['namespaceId', 'namespace_id'],
373
+ ['expiresAtUnixMs', 'expires_at_unix_ms'],
374
+ ['updatedAtUnixMs', 'updated_at_unix_ms'],
375
+ ],
376
+ 'sylphx.data.v1.ZSetAddValueRequest': [
377
+ ['namespaceId', 'namespace_id'],
378
+ ['members', 'members', 'sylphx.data.v1.ZSetMember'],
379
+ ],
380
+ 'sylphx.data.v1.ZSetAddValueResponse': [],
381
+ 'sylphx.data.v1.ZSetLenValueRequest': [
382
+ ['namespaceId', 'namespace_id'],
383
+ ],
384
+ 'sylphx.data.v1.ZSetLenValueResponse': [],
385
+ 'sylphx.data.v1.ZSetMember': [],
386
+ 'sylphx.data.v1.ZSetRangeValueRequest': [
387
+ ['namespaceId', 'namespace_id'],
388
+ ['withScores', 'with_scores'],
389
+ ],
390
+ 'sylphx.data.v1.ZSetRangeValueResponse': [
391
+ ['members', 'members', 'sylphx.data.v1.ZSetMember'],
392
+ ],
393
+ 'sylphx.data.v1.ZSetScoreValueRequest': [
394
+ ['namespaceId', 'namespace_id'],
395
+ ],
396
+ 'sylphx.data.v1.ZSetScoreValueResponse': [],
202
397
  });
203
398
  /**
204
- * DataService is Sylphx Data's control plane: the four customer datastores and
205
- * how to connect to them (docs/services/data/vision.md). Each datastore is its
206
- * own silo; its engine credentials are not API keys, and every endpoint is
207
- * `{ref}[-direct].sylphx.net` served by Data Edge from the Cell Snapshot.
399
+ * DataPlaneService is the data plane of Sylphx Data: object bytes, key-value
400
+ * entries (strings, counters, hashes, lists, and sorted sets), and search
401
+ * documents in an environment's buckets, KV namespaces, and search indexes. It is
402
+ * served by Data itself at its origin, not by the Resource API, and is called
403
+ * with the environment's secret key (`SYLPHX_API_KEY`); the key's org,
404
+ * project, and environment are the tenant. Every call carries a new
405
+ * `Sylphx-Effect-Id`, which the SDK sends and reuses on retries.
406
+ *
407
+ * The buckets, namespaces, and indexes themselves are Resources of
408
+ * DataService. The
409
+ * messages here are Data's wire format
410
+ * (`services/data/proto/sylphx/data/v1/data.proto`), field for field; Data
411
+ * answers ProtoJSON (camelCase names, 64-bit integers and bytes as strings).
208
412
  *
209
413
  * Namespace of Sylphx Data on `Sylphx`.
210
414
  */
211
415
  export class DataApi {
416
+ /** The `objects` collection. */
417
+ objects;
418
+ /** The `kv` collection. */
419
+ kv;
420
+ /** The `documents` collection. */
421
+ documents;
422
+ /** The `search` collection. */
423
+ search;
212
424
  /** The `databases` collection. */
213
425
  databases;
214
426
  /** The `kv_namespaces` collection. */
@@ -218,12 +430,574 @@ export class DataApi {
218
430
  /** The `search_indexes` collection. */
219
431
  searchIndexes;
220
432
  constructor(client) {
433
+ this.objects = new ObjectsCollection(client);
434
+ this.kv = new KvCollection(client);
435
+ this.documents = new DocumentsCollection(client);
436
+ this.search = new SearchCollection(client);
221
437
  this.databases = new DatabasesCollection(client);
222
438
  this.kvNamespaces = new KvNamespacesCollection(client);
223
439
  this.buckets = new BucketsCollection(client);
224
440
  this.searchIndexes = new SearchIndexesCollection(client);
225
441
  }
226
442
  }
443
+ /** `objects` of Sylphx Data: served at `https://api.data.sylphx.com`. */
444
+ export class ObjectsCollection {
445
+ client;
446
+ constructor(client) {
447
+ this.client = client;
448
+ }
449
+ /**
450
+ * Writes an object's bytes, replacing the current version. `body` is the
451
+ * base64 of the bytes.
452
+ *
453
+ * `PUT /v1/objects/{bucket_id}/{key=**}` · permission `data:write` · effect `write`
454
+ *
455
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
456
+ */
457
+ async put(request) {
458
+ return this.client.call({
459
+ method: 'PUT',
460
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
461
+ body: runtime.omit(request, ['bucketId', 'key']),
462
+ bodyType: 'sylphx.data.v1.PutObjectRequest',
463
+ responseType: 'sylphx.data.v1.PutObjectResponse',
464
+ origin: 'https://api.data.sylphx.com',
465
+ effectIds: true,
466
+ mutation: true,
467
+ });
468
+ }
469
+ /**
470
+ * Reads an object and its bytes (`body`, base64).
471
+ *
472
+ * `GET /v1/objects/{bucket_id}/{key=**}` · permission `data:read` · effect `read`
473
+ *
474
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
475
+ */
476
+ async get(request) {
477
+ return this.client.call({
478
+ method: 'GET',
479
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
480
+ query: { version: request.version },
481
+ responseType: 'sylphx.data.v1.GetObjectResponse',
482
+ origin: 'https://api.data.sylphx.com',
483
+ effectIds: true,
484
+ mutation: false,
485
+ });
486
+ }
487
+ /**
488
+ * Lists a bucket's objects in key order.
489
+ *
490
+ * `GET /v1/objects/{bucket_id}` · permission `data:read` · effect `read`
491
+ *
492
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
493
+ */
494
+ async list(request) {
495
+ return this.client.call({
496
+ method: 'GET',
497
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}`,
498
+ query: { prefix: request.prefix, page_size: request.pageSize, page_token: request.pageToken },
499
+ responseType: 'sylphx.data.v1.ListObjectsResponse',
500
+ origin: 'https://api.data.sylphx.com',
501
+ effectIds: true,
502
+ mutation: false,
503
+ });
504
+ }
505
+ /**
506
+ * Deletes an object's current version (history is kept).
507
+ *
508
+ * `DELETE /v1/objects/{bucket_id}/{key=**}` · permission `data:write` · effect `destructive`
509
+ *
510
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
511
+ */
512
+ async delete(request) {
513
+ return this.client.call({
514
+ method: 'DELETE',
515
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
516
+ query: { expected_version: request.expectedVersion },
517
+ responseType: 'sylphx.data.v1.DeleteObjectResponse',
518
+ origin: 'https://api.data.sylphx.com',
519
+ effectIds: true,
520
+ mutation: true,
521
+ });
522
+ }
523
+ }
524
+ /** `kv` of Sylphx Data: served at `https://api.data.sylphx.com`. */
525
+ export class KvCollection {
526
+ client;
527
+ constructor(client) {
528
+ this.client = client;
529
+ }
530
+ /**
531
+ * Writes a value. Without `ttl_seconds` the namespace default applies; zero
532
+ * means no expiry.
533
+ *
534
+ * `PUT /v1/kv/{namespace_id}/{key=**}` · permission `data:write` · effect `write`
535
+ *
536
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
537
+ */
538
+ async put(request) {
539
+ return this.client.call({
540
+ method: 'PUT',
541
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
542
+ body: runtime.omit(request, ['key', 'namespaceId']),
543
+ bodyType: 'sylphx.data.v1.PutValueRequest',
544
+ responseType: 'sylphx.data.v1.PutValueResponse',
545
+ origin: 'https://api.data.sylphx.com',
546
+ effectIds: true,
547
+ mutation: true,
548
+ });
549
+ }
550
+ /**
551
+ * Reads a value.
552
+ *
553
+ * `GET /v1/kv/{namespace_id}/{key=**}` · permission `data:read` · effect `read`
554
+ *
555
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
556
+ */
557
+ async get(request) {
558
+ return this.client.call({
559
+ method: 'GET',
560
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
561
+ responseType: 'sylphx.data.v1.GetValueResponse',
562
+ origin: 'https://api.data.sylphx.com',
563
+ effectIds: true,
564
+ mutation: false,
565
+ });
566
+ }
567
+ /**
568
+ * Lists a namespace's values in key order.
569
+ *
570
+ * `GET /v1/kv/{namespace_id}` · permission `data:read` · effect `read`
571
+ *
572
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
573
+ */
574
+ async list(request) {
575
+ return this.client.call({
576
+ method: 'GET',
577
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}`,
578
+ query: { prefix: request.prefix, page_size: request.pageSize, page_token: request.pageToken },
579
+ responseType: 'sylphx.data.v1.ListValuesResponse',
580
+ origin: 'https://api.data.sylphx.com',
581
+ effectIds: true,
582
+ mutation: false,
583
+ });
584
+ }
585
+ /**
586
+ * Deletes a value.
587
+ *
588
+ * `DELETE /v1/kv/{namespace_id}/{key=**}` · permission `data:write` · effect `destructive`
589
+ *
590
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
591
+ */
592
+ async delete(request) {
593
+ return this.client.call({
594
+ method: 'DELETE',
595
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
596
+ query: { expected_version: request.expectedVersion },
597
+ responseType: 'sylphx.data.v1.DeleteValueResponse',
598
+ origin: 'https://api.data.sylphx.com',
599
+ effectIds: true,
600
+ mutation: true,
601
+ });
602
+ }
603
+ /**
604
+ * Adds `delta` (default 1) to an integer value, creating it at zero.
605
+ *
606
+ * `POST /v1/kv-increments` · permission `data:write` · effect `write`
607
+ *
608
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
609
+ */
610
+ async increment(request) {
611
+ return this.client.call({
612
+ method: 'POST',
613
+ path: `/v1/kv-increments`,
614
+ body: runtime.omit(request, []),
615
+ bodyType: 'sylphx.data.v1.IncrementValueRequest',
616
+ responseType: 'sylphx.data.v1.IncrementValueResponse',
617
+ origin: 'https://api.data.sylphx.com',
618
+ effectIds: true,
619
+ mutation: true,
620
+ });
621
+ }
622
+ /**
623
+ * Reads up to 1000 keys at once (MGET). Answers one entry per key, in
624
+ * order; an absent or expired key keeps its key and has no `value`.
625
+ *
626
+ * `POST /v1/kv-mget` · permission `data:read` · effect `read`
627
+ *
628
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
629
+ */
630
+ async getMany(request) {
631
+ return this.client.call({
632
+ method: 'POST',
633
+ path: `/v1/kv-mget`,
634
+ body: runtime.omit(request, []),
635
+ bodyType: 'sylphx.data.v1.GetValuesRequest',
636
+ responseType: 'sylphx.data.v1.GetValuesResponse',
637
+ origin: 'https://api.data.sylphx.com',
638
+ effectIds: true,
639
+ mutation: true,
640
+ });
641
+ }
642
+ /**
643
+ * Sets fields of a hash (HSET), creating it.
644
+ *
645
+ * `POST /v1/kv-hashes` · permission `data:write` · effect `write`
646
+ *
647
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
648
+ */
649
+ async hashSet(request) {
650
+ return this.client.call({
651
+ method: 'POST',
652
+ path: `/v1/kv-hashes`,
653
+ body: runtime.omit(request, []),
654
+ bodyType: 'sylphx.data.v1.HashSetValueRequest',
655
+ responseType: 'sylphx.data.v1.HashSetValueResponse',
656
+ origin: 'https://api.data.sylphx.com',
657
+ effectIds: true,
658
+ mutation: true,
659
+ });
660
+ }
661
+ /**
662
+ * Reads one field of a hash (HGET); an absent field has no `value`.
663
+ *
664
+ * `POST /v1/kv-hash-gets` · permission `data:read` · effect `read`
665
+ *
666
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
667
+ */
668
+ async hashGet(request) {
669
+ return this.client.call({
670
+ method: 'POST',
671
+ path: `/v1/kv-hash-gets`,
672
+ body: runtime.omit(request, []),
673
+ bodyType: 'sylphx.data.v1.HashGetValueRequest',
674
+ responseType: 'sylphx.data.v1.HashGetValueResponse',
675
+ origin: 'https://api.data.sylphx.com',
676
+ effectIds: true,
677
+ mutation: true,
678
+ });
679
+ }
680
+ /**
681
+ * Reads every field of a hash (HGETALL).
682
+ *
683
+ * `POST /v1/kv-hash-getall` · permission `data:read` · effect `read`
684
+ *
685
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
686
+ */
687
+ async hashGetAll(request) {
688
+ return this.client.call({
689
+ method: 'POST',
690
+ path: `/v1/kv-hash-getall`,
691
+ body: runtime.omit(request, []),
692
+ bodyType: 'sylphx.data.v1.HashGetAllRequest',
693
+ responseType: 'sylphx.data.v1.HashGetAllResponse',
694
+ origin: 'https://api.data.sylphx.com',
695
+ effectIds: true,
696
+ mutation: true,
697
+ });
698
+ }
699
+ /**
700
+ * Reads several fields of a hash (HMGET), one per field, in order; an
701
+ * absent field has no `value`.
702
+ *
703
+ * `POST /v1/kv-hash-mget` · permission `data:read` · effect `read`
704
+ *
705
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
706
+ */
707
+ async hashGetMany(request) {
708
+ return this.client.call({
709
+ method: 'POST',
710
+ path: `/v1/kv-hash-mget`,
711
+ body: runtime.omit(request, []),
712
+ bodyType: 'sylphx.data.v1.HashGetFieldsRequest',
713
+ responseType: 'sylphx.data.v1.HashGetFieldsResponse',
714
+ origin: 'https://api.data.sylphx.com',
715
+ effectIds: true,
716
+ mutation: true,
717
+ });
718
+ }
719
+ /**
720
+ * Pushes values onto the head of a list (LPUSH), creating it.
721
+ *
722
+ * `POST /v1/kv-list-pushes` · permission `data:write` · effect `write`
723
+ *
724
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
725
+ */
726
+ async listPush(request) {
727
+ return this.client.call({
728
+ method: 'POST',
729
+ path: `/v1/kv-list-pushes`,
730
+ body: runtime.omit(request, []),
731
+ bodyType: 'sylphx.data.v1.ListPushValueRequest',
732
+ responseType: 'sylphx.data.v1.ListPushValueResponse',
733
+ origin: 'https://api.data.sylphx.com',
734
+ effectIds: true,
735
+ mutation: true,
736
+ });
737
+ }
738
+ /**
739
+ * Reads a range of a list (LRANGE); negative indexes count from the end.
740
+ *
741
+ * `POST /v1/kv-list-ranges` · permission `data:read` · effect `read`
742
+ *
743
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
744
+ */
745
+ async listRange(request) {
746
+ return this.client.call({
747
+ method: 'POST',
748
+ path: `/v1/kv-list-ranges`,
749
+ body: runtime.omit(request, []),
750
+ bodyType: 'sylphx.data.v1.ListRangeValueRequest',
751
+ responseType: 'sylphx.data.v1.ListRangeValueResponse',
752
+ origin: 'https://api.data.sylphx.com',
753
+ effectIds: true,
754
+ mutation: true,
755
+ });
756
+ }
757
+ /**
758
+ * Pops values from the head of a list (LPOP); an emptied list is removed.
759
+ *
760
+ * `POST /v1/kv-list-pops` · permission `data:write` · effect `write`
761
+ *
762
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
763
+ */
764
+ async listPop(request) {
765
+ return this.client.call({
766
+ method: 'POST',
767
+ path: `/v1/kv-list-pops`,
768
+ body: runtime.omit(request, []),
769
+ bodyType: 'sylphx.data.v1.ListPopValueRequest',
770
+ responseType: 'sylphx.data.v1.ListPopValueResponse',
771
+ origin: 'https://api.data.sylphx.com',
772
+ effectIds: true,
773
+ mutation: true,
774
+ });
775
+ }
776
+ /**
777
+ * Reads the length of a list (LLEN); an absent key has length zero.
778
+ *
779
+ * `POST /v1/kv-list-lens` · permission `data:read` · effect `read`
780
+ *
781
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
782
+ */
783
+ async listLength(request) {
784
+ return this.client.call({
785
+ method: 'POST',
786
+ path: `/v1/kv-list-lens`,
787
+ body: runtime.omit(request, []),
788
+ bodyType: 'sylphx.data.v1.ListLenValueRequest',
789
+ responseType: 'sylphx.data.v1.ListLenValueResponse',
790
+ origin: 'https://api.data.sylphx.com',
791
+ effectIds: true,
792
+ mutation: true,
793
+ });
794
+ }
795
+ /**
796
+ * Adds members to a sorted set or updates their scores (ZADD), creating it.
797
+ *
798
+ * `POST /v1/kv-zsets` · permission `data:write` · effect `write`
799
+ *
800
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
801
+ */
802
+ async zsetAdd(request) {
803
+ return this.client.call({
804
+ method: 'POST',
805
+ path: `/v1/kv-zsets`,
806
+ body: runtime.omit(request, []),
807
+ bodyType: 'sylphx.data.v1.ZSetAddValueRequest',
808
+ responseType: 'sylphx.data.v1.ZSetAddValueResponse',
809
+ origin: 'https://api.data.sylphx.com',
810
+ effectIds: true,
811
+ mutation: true,
812
+ });
813
+ }
814
+ /**
815
+ * Reads a range of a sorted set by rank, lowest score first (ZRANGE);
816
+ * negative indexes count from the end.
817
+ *
818
+ * `POST /v1/kv-zset-ranges` · permission `data:read` · effect `read`
819
+ *
820
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
821
+ */
822
+ async zsetRange(request) {
823
+ return this.client.call({
824
+ method: 'POST',
825
+ path: `/v1/kv-zset-ranges`,
826
+ body: runtime.omit(request, []),
827
+ bodyType: 'sylphx.data.v1.ZSetRangeValueRequest',
828
+ responseType: 'sylphx.data.v1.ZSetRangeValueResponse',
829
+ origin: 'https://api.data.sylphx.com',
830
+ effectIds: true,
831
+ mutation: true,
832
+ });
833
+ }
834
+ /**
835
+ * Reads a member's score (ZSCORE); an absent member has no `score`.
836
+ *
837
+ * `POST /v1/kv-zset-scores` · permission `data:read` · effect `read`
838
+ *
839
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
840
+ */
841
+ async zsetScore(request) {
842
+ return this.client.call({
843
+ method: 'POST',
844
+ path: `/v1/kv-zset-scores`,
845
+ body: runtime.omit(request, []),
846
+ bodyType: 'sylphx.data.v1.ZSetScoreValueRequest',
847
+ responseType: 'sylphx.data.v1.ZSetScoreValueResponse',
848
+ origin: 'https://api.data.sylphx.com',
849
+ effectIds: true,
850
+ mutation: true,
851
+ });
852
+ }
853
+ /**
854
+ * Reads the size of a sorted set (ZCARD); an absent key has size zero.
855
+ *
856
+ * `POST /v1/kv-zset-lens` · permission `data:read` · effect `read`
857
+ *
858
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
859
+ */
860
+ async zsetLength(request) {
861
+ return this.client.call({
862
+ method: 'POST',
863
+ path: `/v1/kv-zset-lens`,
864
+ body: runtime.omit(request, []),
865
+ bodyType: 'sylphx.data.v1.ZSetLenValueRequest',
866
+ responseType: 'sylphx.data.v1.ZSetLenValueResponse',
867
+ origin: 'https://api.data.sylphx.com',
868
+ effectIds: true,
869
+ mutation: true,
870
+ });
871
+ }
872
+ /**
873
+ * Walks a namespace's keys that match a glob (SCAN). Call again with the
874
+ * returned `cursor` until it is empty.
875
+ *
876
+ * `POST /v1/kv-scans` · permission `data:read` · effect `read`
877
+ *
878
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
879
+ */
880
+ async scan(request) {
881
+ return this.client.call({
882
+ method: 'POST',
883
+ path: `/v1/kv-scans`,
884
+ body: runtime.omit(request, []),
885
+ bodyType: 'sylphx.data.v1.ScanValuesRequest',
886
+ responseType: 'sylphx.data.v1.ScanValuesResponse',
887
+ origin: 'https://api.data.sylphx.com',
888
+ effectIds: true,
889
+ mutation: true,
890
+ });
891
+ }
892
+ /**
893
+ * Sets a key's time to live (EXPIRE) without rewriting its value; zero
894
+ * makes it persistent.
895
+ *
896
+ * `POST /v1/kv-expiries` · permission `data:write` · effect `write`
897
+ *
898
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
899
+ */
900
+ async expire(request) {
901
+ return this.client.call({
902
+ method: 'POST',
903
+ path: `/v1/kv-expiries`,
904
+ body: runtime.omit(request, []),
905
+ bodyType: 'sylphx.data.v1.ExpireValueRequest',
906
+ responseType: 'sylphx.data.v1.ExpireValueResponse',
907
+ origin: 'https://api.data.sylphx.com',
908
+ effectIds: true,
909
+ mutation: true,
910
+ });
911
+ }
912
+ }
913
+ /** `documents` of Sylphx Data: served at `https://api.data.sylphx.com`. */
914
+ export class DocumentsCollection {
915
+ client;
916
+ constructor(client) {
917
+ this.client = client;
918
+ }
919
+ /**
920
+ * Writes a document to a search index, replacing the current version.
921
+ *
922
+ * `PUT /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `write`
923
+ *
924
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
925
+ */
926
+ async put(request) {
927
+ return this.client.call({
928
+ method: 'PUT',
929
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
930
+ body: runtime.omit(request, ['documentId', 'indexId']),
931
+ bodyType: 'sylphx.data.v1.PutDocumentRequest',
932
+ responseType: 'sylphx.data.v1.PutDocumentResponse',
933
+ origin: 'https://api.data.sylphx.com',
934
+ effectIds: true,
935
+ mutation: true,
936
+ });
937
+ }
938
+ /**
939
+ * Reads a document.
940
+ *
941
+ * `GET /v1/documents/{index_id}/{document_id}` · permission `data:read` · effect `read`
942
+ *
943
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
944
+ */
945
+ async get(request) {
946
+ return this.client.call({
947
+ method: 'GET',
948
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
949
+ responseType: 'sylphx.data.v1.GetDocumentResponse',
950
+ origin: 'https://api.data.sylphx.com',
951
+ effectIds: true,
952
+ mutation: false,
953
+ });
954
+ }
955
+ /**
956
+ * Deletes a document.
957
+ *
958
+ * `DELETE /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `destructive`
959
+ *
960
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
961
+ */
962
+ async delete(request) {
963
+ return this.client.call({
964
+ method: 'DELETE',
965
+ path: `/v1/documents/${runtime.protocolParam(request.indexId, false, 'index_id')}/${runtime.protocolParam(request.documentId, false, 'document_id')}`,
966
+ query: { expected_version: request.expectedVersion },
967
+ responseType: 'sylphx.data.v1.DeleteDocumentResponse',
968
+ origin: 'https://api.data.sylphx.com',
969
+ effectIds: true,
970
+ mutation: true,
971
+ });
972
+ }
973
+ }
974
+ /** `search` of Sylphx Data: served at `https://api.data.sylphx.com`. */
975
+ export class SearchCollection {
976
+ client;
977
+ constructor(client) {
978
+ this.client = client;
979
+ }
980
+ /**
981
+ * Searches an index by text, by vector, or both, best match first, with
982
+ * filters and paging.
983
+ *
984
+ * `POST /v1/search/{index_id}` · permission `data:read` · effect `read`
985
+ *
986
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
987
+ */
988
+ async query(request) {
989
+ return this.client.call({
990
+ method: 'POST',
991
+ path: `/v1/search/${runtime.protocolParam(request.indexId, false, 'index_id')}`,
992
+ body: runtime.omit(request, ['indexId']),
993
+ bodyType: 'sylphx.data.v1.SearchRequest',
994
+ responseType: 'sylphx.data.v1.SearchResponse',
995
+ origin: 'https://api.data.sylphx.com',
996
+ effectIds: true,
997
+ mutation: true,
998
+ });
999
+ }
1000
+ }
227
1001
  /** `databases` of Sylphx Data: Resource type `data.sylphx.com/Database`. */
228
1002
  export class DatabasesCollection {
229
1003
  client;