@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.d.ts CHANGED
@@ -45,7 +45,7 @@ export interface BucketStatus {
45
45
  readonly ref?: string;
46
46
  /** The object endpoint host. */
47
47
  readonly host?: string;
48
- /** The Cell the datastore is placed on. */
48
+ /** The cell the datastore is placed on. */
49
49
  readonly cell?: string;
50
50
  /** Bytes stored, at the last usage sample. */
51
51
  readonly storageBytes?: string;
@@ -220,7 +220,7 @@ export interface DatabaseStatus {
220
220
  * profile.
221
221
  */
222
222
  readonly host?: string;
223
- /** The Cell the datastore is placed on. */
223
+ /** The cell the datastore is placed on. */
224
224
  readonly cell?: string;
225
225
  /** Bytes stored, at the last usage sample. */
226
226
  readonly storageBytes?: string;
@@ -251,6 +251,20 @@ export interface DeleteDatabaseRequest {
251
251
  /** Validate without deleting anything. */
252
252
  validateOnly?: boolean;
253
253
  }
254
+ /** The request of DeleteDocument. */
255
+ export interface DeleteDocumentRequest {
256
+ /** The search index's id. */
257
+ indexId: string;
258
+ /** The document's id. */
259
+ documentId: string;
260
+ /** Delete only when the current version equals this one (0: any). */
261
+ expectedVersion?: string;
262
+ }
263
+ /** The response of DeleteDocument. */
264
+ export interface DeleteDocumentResponse {
265
+ /** Whether the document existed. */
266
+ deleted?: boolean;
267
+ }
254
268
  /** The request of DeleteKvNamespace. */
255
269
  export interface DeleteKvNamespaceRequest {
256
270
  /** The name of the kv namespace to delete. */
@@ -262,6 +276,22 @@ export interface DeleteKvNamespaceRequest {
262
276
  /** Validate without deleting anything. */
263
277
  validateOnly?: boolean;
264
278
  }
279
+ /** The request of DeleteObject. */
280
+ export interface DeleteObjectRequest {
281
+ /** The bucket's id. */
282
+ bucketId: string;
283
+ /** The object key. */
284
+ key: string;
285
+ /** Delete only when the current version equals this one (0: any). */
286
+ expectedVersion?: string;
287
+ }
288
+ /** The response of DeleteObject. */
289
+ export interface DeleteObjectResponse {
290
+ /** Whether a current version existed and was deleted. */
291
+ deleted?: boolean;
292
+ /** The delete marker written. */
293
+ object?: ObjectRecord;
294
+ }
265
295
  /** The request of DeleteSearchIndex. */
266
296
  export interface DeleteSearchIndexRequest {
267
297
  /** The name of the search index to delete. */
@@ -273,6 +303,55 @@ export interface DeleteSearchIndexRequest {
273
303
  /** Validate without deleting anything. */
274
304
  validateOnly?: boolean;
275
305
  }
306
+ /** The request of DeleteValue. */
307
+ export interface DeleteValueRequest {
308
+ /** The namespace's id. */
309
+ namespaceId: string;
310
+ /** The key. */
311
+ key: string;
312
+ /** Delete only when the current version equals this one (0: any). */
313
+ expectedVersion?: string;
314
+ }
315
+ /** The response of DeleteValue. */
316
+ export interface DeleteValueResponse {
317
+ /** Whether the key existed. */
318
+ deleted?: boolean;
319
+ }
320
+ /** A document in a search index. */
321
+ export interface DocumentRecord {
322
+ /** The search index's id in the environment, for example `articles`. */
323
+ indexId?: string;
324
+ /** The document's id. */
325
+ documentId?: string;
326
+ /** The document as JSON, base64. */
327
+ documentJson?: string;
328
+ /** The document's embedding; its length is the index's vector dimensions. */
329
+ vector?: number[];
330
+ /** `sha256:<hex>` of the document. */
331
+ sha256?: string;
332
+ /** The version, increasing per document. */
333
+ version?: string;
334
+ /** When this version was written, in Unix milliseconds. */
335
+ updatedAtUnixMs?: string;
336
+ }
337
+ /** The request of ExpireValue. */
338
+ export interface ExpireValueRequest {
339
+ /** The namespace's id. */
340
+ namespaceId: string;
341
+ /** The key. */
342
+ key: string;
343
+ /** Seconds to live, at most one year; zero makes the key persistent. */
344
+ ttlSeconds: string;
345
+ }
346
+ /** The response of ExpireValue. */
347
+ export interface ExpireValueResponse {
348
+ /** Whether the key existed and its expiry was set. */
349
+ applied?: boolean;
350
+ /** The key's version (an expiry does not change it). */
351
+ version?: string;
352
+ /** The new expiry in Unix milliseconds; zero never expires. */
353
+ expiresAtUnixMs?: string;
354
+ }
276
355
  /** The request of GetBucket. */
277
356
  export interface GetBucketRequest {
278
357
  /** The name of the bucket to get. */
@@ -283,16 +362,148 @@ export interface GetDatabaseRequest {
283
362
  /** The name of the database to get. */
284
363
  name: string;
285
364
  }
365
+ /** The request of GetDocument. */
366
+ export interface GetDocumentRequest {
367
+ /** The search index's id. */
368
+ indexId: string;
369
+ /** The document's id. */
370
+ documentId: string;
371
+ }
372
+ /** The response of GetDocument. */
373
+ export interface GetDocumentResponse {
374
+ /** The document. */
375
+ document?: DocumentRecord;
376
+ }
286
377
  /** The request of GetKvNamespace. */
287
378
  export interface GetKvNamespaceRequest {
288
379
  /** The name of the kv namespace to get. */
289
380
  name: string;
290
381
  }
382
+ /** The request of GetObject. */
383
+ export interface GetObjectRequest {
384
+ /** The bucket's id. */
385
+ bucketId: string;
386
+ /** The object key. */
387
+ key: string;
388
+ /** Zero reads the current version; a positive value reads that version. */
389
+ version?: string;
390
+ }
391
+ /** The response of GetObject. */
392
+ export interface GetObjectResponse {
393
+ /** The object's metadata. */
394
+ object?: ObjectRecord;
395
+ /** The bytes, base64. */
396
+ body?: string;
397
+ }
291
398
  /** The request of GetSearchIndex. */
292
399
  export interface GetSearchIndexRequest {
293
400
  /** The name of the search index to get. */
294
401
  name: string;
295
402
  }
403
+ /** The request of GetValue. */
404
+ export interface GetValueRequest {
405
+ /** The namespace's id. */
406
+ namespaceId: string;
407
+ /** The key. */
408
+ key: string;
409
+ }
410
+ /** The response of GetValue. */
411
+ export interface GetValueResponse {
412
+ /** The entry. */
413
+ value?: ValueRecord;
414
+ }
415
+ /** The request of GetValues. */
416
+ export interface GetValuesRequest {
417
+ /** The namespace's id. */
418
+ namespaceId: string;
419
+ /** The keys, at most 1000. */
420
+ keys: string[];
421
+ }
422
+ /** The response of GetValues. */
423
+ export interface GetValuesResponse {
424
+ /**
425
+ * One entry per key, in the order asked; an absent or expired key keeps
426
+ * its key and has no `value` or `version`.
427
+ */
428
+ values?: ValueRecord[];
429
+ }
430
+ /** A field of a hash and its value. */
431
+ export interface HashField {
432
+ /** The field's name. */
433
+ field?: string;
434
+ /** The bytes, base64; unset when the field is absent. */
435
+ value?: string;
436
+ }
437
+ /** The request of HashGetAll. */
438
+ export interface HashGetAllRequest {
439
+ /** The namespace's id. */
440
+ namespaceId: string;
441
+ /** The hash's key. */
442
+ key: string;
443
+ }
444
+ /** The response of HashGetAll. */
445
+ export interface HashGetAllResponse {
446
+ /** Every field of the hash; empty when the hash is absent. */
447
+ fields?: HashField[];
448
+ }
449
+ /** The request of HashGetFields. */
450
+ export interface HashGetFieldsRequest {
451
+ /** The namespace's id. */
452
+ namespaceId: string;
453
+ /** The hash's key. */
454
+ key: string;
455
+ /** The fields' names. */
456
+ fields: string[];
457
+ }
458
+ /** The response of HashGetFields. */
459
+ export interface HashGetFieldsResponse {
460
+ /** One per field asked, in order; an absent field has no `value`. */
461
+ fields?: HashField[];
462
+ }
463
+ /** The request of HashGetValue. */
464
+ export interface HashGetValueRequest {
465
+ /** The namespace's id. */
466
+ namespaceId: string;
467
+ /** The hash's key. */
468
+ key: string;
469
+ /** The field's name. */
470
+ field: string;
471
+ }
472
+ /** The response of HashGetValue. */
473
+ export interface HashGetValueResponse {
474
+ /** The bytes, base64; unset when the field or the hash is absent. */
475
+ value?: string;
476
+ }
477
+ /** The request of HashSetValue. */
478
+ export interface HashSetValueRequest {
479
+ /** The namespace's id. */
480
+ namespaceId: string;
481
+ /** The hash's key. */
482
+ key: string;
483
+ /** The fields to set; at least one. */
484
+ fields: HashField[];
485
+ }
486
+ /** The response of HashSetValue. */
487
+ export interface HashSetValueResponse {
488
+ /** How many fields were new. */
489
+ added?: string;
490
+ /** The hash's version after the write. */
491
+ version?: string;
492
+ }
493
+ /** The request of IncrementValue. */
494
+ export interface IncrementValueRequest {
495
+ /** The namespace's id. */
496
+ namespaceId: string;
497
+ /** The key. */
498
+ key: string;
499
+ /** The amount to add; unset adds 1, and zero reads the count. */
500
+ delta?: string;
501
+ }
502
+ /** The response of IncrementValue. */
503
+ export interface IncrementValueResponse {
504
+ /** The entry after the increment; `value` is the decimal text of the count. */
505
+ value?: ValueRecord;
506
+ }
296
507
  /**
297
508
  * A KvNamespace is one customer key-value store on its own Valkey: versioned
298
509
  * bytes with compare-and-set, TTL, and prefix list, plus a closed Valkey
@@ -335,7 +546,7 @@ export interface KvNamespaceStatus {
335
546
  readonly ref?: string;
336
547
  /** The endpoint host, `{ref}.sylphx.net`, port 6379. */
337
548
  readonly host?: string;
338
- /** The Cell the datastore is placed on. */
549
+ /** The cell the datastore is placed on. */
339
550
  readonly cell?: string;
340
551
  /** Bytes stored, at the last usage sample. */
341
552
  readonly storageBytes?: string;
@@ -400,6 +611,86 @@ export interface ListKvNamespacesResponse {
400
611
  /** The token of the next page; empty on the last page. */
401
612
  nextPageToken?: string;
402
613
  }
614
+ /** The request of ListLenValue. */
615
+ export interface ListLenValueRequest {
616
+ /** The namespace's id. */
617
+ namespaceId: string;
618
+ /** The list's key. */
619
+ key: string;
620
+ }
621
+ /** The response of ListLenValue. */
622
+ export interface ListLenValueResponse {
623
+ /** The list's length. */
624
+ length?: string;
625
+ }
626
+ /** The request of ListObjects. */
627
+ export interface ListObjectsRequest {
628
+ /** The bucket's id. */
629
+ bucketId: string;
630
+ /** Only keys with this prefix. */
631
+ prefix?: string;
632
+ /** At most this many objects; the service caps it. */
633
+ pageSize?: number;
634
+ /** The `next_page_token` of the previous page. */
635
+ pageToken?: string;
636
+ }
637
+ /** The response of ListObjects. */
638
+ export interface ListObjectsResponse {
639
+ /** The page of objects. */
640
+ objects?: ObjectRecord[];
641
+ /** Empty on the last page. */
642
+ nextPageToken?: string;
643
+ }
644
+ /** The request of ListPopValue. */
645
+ export interface ListPopValueRequest {
646
+ /** The namespace's id. */
647
+ namespaceId: string;
648
+ /** The list's key. */
649
+ key: string;
650
+ /** How many values to pop; unset pops one, zero pops none. */
651
+ count?: string;
652
+ }
653
+ /** The response of ListPopValue. */
654
+ export interface ListPopValueResponse {
655
+ /** The popped values, each base64, head first. */
656
+ values?: string[];
657
+ /** The list's length after the pop. */
658
+ length?: string;
659
+ /** The list's version after the pop. */
660
+ version?: string;
661
+ }
662
+ /** The request of ListPushValue. */
663
+ export interface ListPushValueRequest {
664
+ /** The namespace's id. */
665
+ namespaceId: string;
666
+ /** The list's key. */
667
+ key: string;
668
+ /** The values to push, each base64, pushed in order (the last ends first). */
669
+ values: string[];
670
+ }
671
+ /** The response of ListPushValue. */
672
+ export interface ListPushValueResponse {
673
+ /** The list's length after the push. */
674
+ length?: string;
675
+ /** The list's version after the push. */
676
+ version?: string;
677
+ }
678
+ /** The request of ListRangeValue. */
679
+ export interface ListRangeValueRequest {
680
+ /** The namespace's id. */
681
+ namespaceId: string;
682
+ /** The list's key. */
683
+ key: string;
684
+ /** The first index, inclusive; unset is 0, negative counts from the end. */
685
+ start?: string;
686
+ /** The last index, inclusive; unset is -1 (the end). */
687
+ stop?: string;
688
+ }
689
+ /** The response of ListRangeValue. */
690
+ export interface ListRangeValueResponse {
691
+ /** The values in the range, each base64. */
692
+ values?: string[];
693
+ }
403
694
  /** The request of ListSearchIndexes. */
404
695
  export interface ListSearchIndexesRequest {
405
696
  /** The parent to list in. */
@@ -420,6 +711,108 @@ export interface ListSearchIndexesResponse {
420
711
  /** The token of the next page; empty on the last page. */
421
712
  nextPageToken?: string;
422
713
  }
714
+ /** The request of ListValues. */
715
+ export interface ListValuesRequest {
716
+ /** The namespace's id. */
717
+ namespaceId: string;
718
+ /** Only keys with this prefix. */
719
+ prefix?: string;
720
+ /** At most this many entries; the service caps it. */
721
+ pageSize?: number;
722
+ /** The `next_page_token` of the previous page. */
723
+ pageToken?: string;
724
+ }
725
+ /** The response of ListValues. */
726
+ export interface ListValuesResponse {
727
+ /** The page of entries. */
728
+ values?: ValueRecord[];
729
+ /** Empty on the last page. */
730
+ nextPageToken?: string;
731
+ }
732
+ /** An object's metadata. */
733
+ export interface ObjectRecord {
734
+ /** The bucket's id in the environment, for example `uploads`. */
735
+ bucketId?: string;
736
+ /** The object key; `/` separates path segments. */
737
+ key?: string;
738
+ /** `sha256:<hex>` of the bytes. */
739
+ sha256?: string;
740
+ /** Size in bytes. */
741
+ size?: string;
742
+ /** The media type given at put. */
743
+ contentType?: string;
744
+ /** The entity tag of this version. */
745
+ etag?: string;
746
+ /** The version, increasing per key. */
747
+ version?: string;
748
+ /** When this version was written, in Unix milliseconds. */
749
+ updatedAtUnixMs?: string;
750
+ /** Whether this version is a delete marker (exact-version reads only). */
751
+ deleteMarker?: boolean;
752
+ /** `public` or `private` (the default); current version only. */
753
+ visibility?: string;
754
+ }
755
+ /** The request of PutDocument. */
756
+ export interface PutDocumentRequest {
757
+ /** The search index's id. */
758
+ indexId: string;
759
+ /** The document's id. */
760
+ documentId: string;
761
+ /** The document as JSON, base64; at most 1 MiB. */
762
+ documentJson?: string;
763
+ /**
764
+ * The document's embedding, at most 4096 numbers; the index's vector
765
+ * dimensions when it has them.
766
+ */
767
+ vector?: number[];
768
+ /** Write only when the current version equals this one (0: any). */
769
+ expectedVersion?: string;
770
+ }
771
+ /** The response of PutDocument. */
772
+ export interface PutDocumentResponse {
773
+ /** The stored document. */
774
+ document?: DocumentRecord;
775
+ }
776
+ /** The request of PutObject. */
777
+ export interface PutObjectRequest {
778
+ /** The bucket's id. */
779
+ bucketId: string;
780
+ /** The object key. */
781
+ key: string;
782
+ /** The bytes, base64. */
783
+ body?: string;
784
+ /** The media type, for example `application/pdf`. */
785
+ contentType?: string;
786
+ /** Write only when the current version equals this one (0: any). */
787
+ expectedVersion?: string;
788
+ }
789
+ /** The response of PutObject. */
790
+ export interface PutObjectResponse {
791
+ /** The stored object. */
792
+ object?: ObjectRecord;
793
+ }
794
+ /** The request of PutValue. */
795
+ export interface PutValueRequest {
796
+ /** The namespace's id. */
797
+ namespaceId: string;
798
+ /** The key. */
799
+ key: string;
800
+ /** The bytes, base64. */
801
+ value?: string;
802
+ /** Seconds to live; unset uses the namespace default, zero never expires. */
803
+ ttlSeconds?: string;
804
+ /** Write only when the current version equals this one (0: any). */
805
+ expectedVersion?: string;
806
+ /** Write only when the key is absent (SET NX). */
807
+ nx?: boolean;
808
+ /** Write only when the key is present (SET XX); excludes `nx`. */
809
+ xx?: boolean;
810
+ }
811
+ /** The response of PutValue. */
812
+ export interface PutValueResponse {
813
+ /** The stored entry. */
814
+ value?: ValueRecord;
815
+ }
423
816
  /** The request of RestoreDatabase. */
424
817
  export interface RestoreDatabaseRequest {
425
818
  /** The name of the database. */
@@ -467,6 +860,58 @@ export interface RotateSearchIndexCredentialsRequest {
467
860
  /** Validate without acting. */
468
861
  validateOnly?: boolean;
469
862
  }
863
+ /** The request of ScanValues. */
864
+ export interface ScanValuesRequest {
865
+ /** The namespace's id. */
866
+ namespaceId: string;
867
+ /**
868
+ * A glob of the keys to answer (`*`, `?`, `\` escapes); empty matches
869
+ * every key.
870
+ */
871
+ glob?: string;
872
+ /** The `cursor` of the previous call; empty starts the walk. */
873
+ cursor?: string;
874
+ /** At most this many keys per call; the service caps it at 1000. */
875
+ count?: number;
876
+ }
877
+ /** The response of ScanValues. */
878
+ export interface ScanValuesResponse {
879
+ /** The matching keys of this step. */
880
+ keys?: string[];
881
+ /** Pass to the next call; empty when the walk is done. */
882
+ cursor?: string;
883
+ }
884
+ /** A condition on one field of a document. */
885
+ export interface SearchFilter {
886
+ /** A dot path of object keys, for example `price.amount`; at most 8 keys. */
887
+ field?: string;
888
+ /**
889
+ * `eq`, `ne`, `in`, `gt`, `gte`, `lt`, `lte`, or `exists`. `eq` and `in`
890
+ * also match an array field that holds the value; `ne` matches documents
891
+ * without the field.
892
+ */
893
+ op?: string;
894
+ /**
895
+ * The value as JSON: a string, number, or boolean; for `in`, an array of
896
+ * 1 to 100 of them; for the ranges, a number or string; for `exists`,
897
+ * empty.
898
+ */
899
+ valueJson?: string;
900
+ }
901
+ /** A document that matched a search. */
902
+ export interface SearchHit {
903
+ /** The document. */
904
+ document?: DocumentRecord;
905
+ /**
906
+ * How well it matched; higher is better. The text rank, the cosine
907
+ * similarity, or the fused rank; 0 when listing.
908
+ */
909
+ score?: number;
910
+ /** The full-text rank, when the document matched the text. */
911
+ textScore?: number;
912
+ /** The cosine similarity, when the document was in the vector list. */
913
+ vectorScore?: number;
914
+ }
470
915
  /**
471
916
  * A SearchIndex is one customer lexical and vector index of JSON documents.
472
917
  * Dimension 0 is lexical only; a positive dimension adds cosine queries. Data
@@ -509,13 +954,51 @@ export interface SearchIndexStatus {
509
954
  readonly ref?: string;
510
955
  /** The endpoint host, `{ref}.sylphx.net`, port 8108. */
511
956
  readonly host?: string;
512
- /** The Cell the datastore is placed on. */
957
+ /** The cell the datastore is placed on. */
513
958
  readonly cell?: string;
514
959
  /** Bytes stored, at the last usage sample. */
515
960
  readonly storageBytes?: string;
516
961
  /** Indexed documents, at the last usage sample. */
517
962
  readonly documentCount?: string;
518
963
  }
964
+ /**
965
+ * The request of Search. Text alone ranks by full-text relevance, a vector
966
+ * alone by cosine similarity, and both by reciprocal rank fusion (k = 60) of
967
+ * the two lists. With neither, the filtered documents are listed by id.
968
+ */
969
+ export interface SearchRequest {
970
+ /** The search index's id. */
971
+ indexId: string;
972
+ /**
973
+ * Text to match, in web-search syntax: words (all must match), "quoted
974
+ * phrases", `or`, and `-word` to exclude. The last word also matches as a
975
+ * word prefix unless `prefix` is false.
976
+ */
977
+ query?: string;
978
+ /**
979
+ * An embedding to match by cosine similarity; its length is the index's
980
+ * vector dimensions.
981
+ */
982
+ vector?: number[];
983
+ /** At most this many hits, 1 to 100; unset is 20. */
984
+ limit?: number;
985
+ /** Hits to skip; offset + limit is at most 1000. */
986
+ offset?: number;
987
+ /** Conditions every hit meets, at most 16. */
988
+ filters?: SearchFilter[];
989
+ /** The vector list's share of a hybrid score, 0 to 1; unset is 0.5. */
990
+ vectorWeight?: number;
991
+ /**
992
+ * Whether the query's last word also matches as a word prefix; unset is
993
+ * true.
994
+ */
995
+ prefix?: boolean;
996
+ }
997
+ /** The response of Search. */
998
+ export interface SearchResponse {
999
+ /** The hits, best first. */
1000
+ hits?: SearchHit[];
1001
+ }
519
1002
  /** The request of UpdateBucket. */
520
1003
  export interface UpdateBucketRequest {
521
1004
  /** The bucket to update; `name` identifies it. */
@@ -560,19 +1043,120 @@ export interface UpdateSearchIndexRequest {
560
1043
  /** Validate and return the result without writing anything. */
561
1044
  validateOnly?: boolean;
562
1045
  }
1046
+ /** A key-value entry. */
1047
+ export interface ValueRecord {
1048
+ /** The namespace's id in the environment, for example `ratelimit`. */
1049
+ namespaceId?: string;
1050
+ /** The key. */
1051
+ key?: string;
1052
+ /** The bytes, base64. */
1053
+ value?: string;
1054
+ /** `sha256:<hex>` of the value. */
1055
+ sha256?: string;
1056
+ /** The version, increasing per key. */
1057
+ version?: string;
1058
+ /** Expiry in Unix milliseconds; zero never expires. */
1059
+ expiresAtUnixMs?: string;
1060
+ /** When this version was written, in Unix milliseconds. */
1061
+ updatedAtUnixMs?: string;
1062
+ }
1063
+ /** The request of ZSetAddValue. */
1064
+ export interface ZSetAddValueRequest {
1065
+ /** The namespace's id. */
1066
+ namespaceId: string;
1067
+ /** The sorted set's key. */
1068
+ key: string;
1069
+ /** The members to add or rescore. */
1070
+ members: ZSetMember[];
1071
+ }
1072
+ /** The response of ZSetAddValue. */
1073
+ export interface ZSetAddValueResponse {
1074
+ /** How many members were new. */
1075
+ added?: string;
1076
+ /** The sorted set's version after the write. */
1077
+ version?: string;
1078
+ }
1079
+ /** The request of ZSetLenValue. */
1080
+ export interface ZSetLenValueRequest {
1081
+ /** The namespace's id. */
1082
+ namespaceId: string;
1083
+ /** The sorted set's key. */
1084
+ key: string;
1085
+ }
1086
+ /** The response of ZSetLenValue. */
1087
+ export interface ZSetLenValueResponse {
1088
+ /** The number of members. */
1089
+ length?: string;
1090
+ }
1091
+ /** A member of a sorted set and its score. */
1092
+ export interface ZSetMember {
1093
+ /** The member. */
1094
+ member?: string;
1095
+ /** The score; unset in a range read without `with_scores`. */
1096
+ score?: number;
1097
+ }
1098
+ /** The request of ZSetRangeValue. */
1099
+ export interface ZSetRangeValueRequest {
1100
+ /** The namespace's id. */
1101
+ namespaceId: string;
1102
+ /** The sorted set's key. */
1103
+ key: string;
1104
+ /** The first rank, inclusive; unset is 0, negative counts from the end. */
1105
+ start?: string;
1106
+ /** The last rank, inclusive; unset is -1 (the end). */
1107
+ stop?: string;
1108
+ /** Whether to answer each member's score. */
1109
+ withScores?: boolean;
1110
+ }
1111
+ /** The response of ZSetRangeValue. */
1112
+ export interface ZSetRangeValueResponse {
1113
+ /** The members in the range, lowest score first. */
1114
+ members?: ZSetMember[];
1115
+ }
1116
+ /** The request of ZSetScoreValue. */
1117
+ export interface ZSetScoreValueRequest {
1118
+ /** The namespace's id. */
1119
+ namespaceId: string;
1120
+ /** The sorted set's key. */
1121
+ key: string;
1122
+ /** The member. */
1123
+ member: string;
1124
+ }
1125
+ /** The response of ZSetScoreValue. */
1126
+ export interface ZSetScoreValueResponse {
1127
+ /** The member's score; unset when the member or the set is absent. */
1128
+ score?: number;
1129
+ }
563
1130
  /** ConnectionProfile is which Postgres path a connection takes. */
564
1131
  export type ConnectionProfile = 'pooled' | 'direct' | (string & {});
565
1132
  /** DatastoreState is whether a datastore is serving. */
566
1133
  export type DatastoreState = 'provisioning' | 'active' | 'idle' | 'moving' | 'deleting' | (string & {});
567
1134
  /**
568
- * DataService is Sylphx Data's control plane: the four customer datastores and
569
- * how to connect to them (docs/services/data/vision.md). Each datastore is its
570
- * own silo; its engine credentials are not API keys, and every endpoint is
571
- * `{ref}[-direct].sylphx.net` served by Data Edge from the Cell Snapshot.
1135
+ * DataPlaneService is the data plane of Sylphx Data: object bytes, key-value
1136
+ * entries (strings, counters, hashes, lists, and sorted sets), and search
1137
+ * documents in an environment's buckets, KV namespaces, and search indexes. It is
1138
+ * served by Data itself at its origin, not by the Resource API, and is called
1139
+ * with the environment's secret key (`SYLPHX_API_KEY`); the key's org,
1140
+ * project, and environment are the tenant. Every call carries a new
1141
+ * `Sylphx-Effect-Id`, which the SDK sends and reuses on retries.
1142
+ *
1143
+ * The buckets, namespaces, and indexes themselves are Resources of
1144
+ * DataService. The
1145
+ * messages here are Data's wire format
1146
+ * (`services/data/proto/sylphx/data/v1/data.proto`), field for field; Data
1147
+ * answers ProtoJSON (camelCase names, 64-bit integers and bytes as strings).
572
1148
  *
573
1149
  * Namespace of Sylphx Data on `Sylphx`.
574
1150
  */
575
1151
  export declare class DataApi {
1152
+ /** The `objects` collection. */
1153
+ readonly objects: ObjectsCollection;
1154
+ /** The `kv` collection. */
1155
+ readonly kv: KvCollection;
1156
+ /** The `documents` collection. */
1157
+ readonly documents: DocumentsCollection;
1158
+ /** The `search` collection. */
1159
+ readonly search: SearchCollection;
576
1160
  /** The `databases` collection. */
577
1161
  readonly databases: DatabasesCollection;
578
1162
  /** The `kv_namespaces` collection. */
@@ -583,6 +1167,258 @@ export declare class DataApi {
583
1167
  readonly searchIndexes: SearchIndexesCollection;
584
1168
  constructor(client: runtime.Client);
585
1169
  }
1170
+ /** `objects` of Sylphx Data: served at `https://api.data.sylphx.com`. */
1171
+ export declare class ObjectsCollection {
1172
+ private readonly client;
1173
+ constructor(client: runtime.Client);
1174
+ /**
1175
+ * Writes an object's bytes, replacing the current version. `body` is the
1176
+ * base64 of the bytes.
1177
+ *
1178
+ * `PUT /v1/objects/{bucket_id}/{key=**}` · permission `data:write` · effect `write`
1179
+ *
1180
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
1181
+ */
1182
+ put(request: PutObjectRequest): Promise<PutObjectResponse>;
1183
+ /**
1184
+ * Reads an object and its bytes (`body`, base64).
1185
+ *
1186
+ * `GET /v1/objects/{bucket_id}/{key=**}` · permission `data:read` · effect `read`
1187
+ *
1188
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1189
+ */
1190
+ get(request: GetObjectRequest): Promise<GetObjectResponse>;
1191
+ /**
1192
+ * Lists a bucket's objects in key order.
1193
+ *
1194
+ * `GET /v1/objects/{bucket_id}` · permission `data:read` · effect `read`
1195
+ *
1196
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
1197
+ */
1198
+ list(request: ListObjectsRequest): Promise<ListObjectsResponse>;
1199
+ /**
1200
+ * Deletes an object's current version (history is kept).
1201
+ *
1202
+ * `DELETE /v1/objects/{bucket_id}/{key=**}` · permission `data:write` · effect `destructive`
1203
+ *
1204
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
1205
+ */
1206
+ delete(request: DeleteObjectRequest): Promise<DeleteObjectResponse>;
1207
+ }
1208
+ /** `kv` of Sylphx Data: served at `https://api.data.sylphx.com`. */
1209
+ export declare class KvCollection {
1210
+ private readonly client;
1211
+ constructor(client: runtime.Client);
1212
+ /**
1213
+ * Writes a value. Without `ttl_seconds` the namespace default applies; zero
1214
+ * means no expiry.
1215
+ *
1216
+ * `PUT /v1/kv/{namespace_id}/{key=**}` · permission `data:write` · effect `write`
1217
+ *
1218
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
1219
+ */
1220
+ put(request: PutValueRequest): Promise<PutValueResponse>;
1221
+ /**
1222
+ * Reads a value.
1223
+ *
1224
+ * `GET /v1/kv/{namespace_id}/{key=**}` · permission `data:read` · effect `read`
1225
+ *
1226
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1227
+ */
1228
+ get(request: GetValueRequest): Promise<GetValueResponse>;
1229
+ /**
1230
+ * Lists a namespace's values in key order.
1231
+ *
1232
+ * `GET /v1/kv/{namespace_id}` · permission `data:read` · effect `read`
1233
+ *
1234
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
1235
+ */
1236
+ list(request: ListValuesRequest): Promise<ListValuesResponse>;
1237
+ /**
1238
+ * Deletes a value.
1239
+ *
1240
+ * `DELETE /v1/kv/{namespace_id}/{key=**}` · permission `data:write` · effect `destructive`
1241
+ *
1242
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
1243
+ */
1244
+ delete(request: DeleteValueRequest): Promise<DeleteValueResponse>;
1245
+ /**
1246
+ * Adds `delta` (default 1) to an integer value, creating it at zero.
1247
+ *
1248
+ * `POST /v1/kv-increments` · permission `data:write` · effect `write`
1249
+ *
1250
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1251
+ */
1252
+ increment(request: IncrementValueRequest): Promise<IncrementValueResponse>;
1253
+ /**
1254
+ * Reads up to 1000 keys at once (MGET). Answers one entry per key, in
1255
+ * order; an absent or expired key keeps its key and has no `value`.
1256
+ *
1257
+ * `POST /v1/kv-mget` · permission `data:read` · effect `read`
1258
+ *
1259
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1260
+ */
1261
+ getMany(request: GetValuesRequest): Promise<GetValuesResponse>;
1262
+ /**
1263
+ * Sets fields of a hash (HSET), creating it.
1264
+ *
1265
+ * `POST /v1/kv-hashes` · permission `data:write` · effect `write`
1266
+ *
1267
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1268
+ */
1269
+ hashSet(request: HashSetValueRequest): Promise<HashSetValueResponse>;
1270
+ /**
1271
+ * Reads one field of a hash (HGET); an absent field has no `value`.
1272
+ *
1273
+ * `POST /v1/kv-hash-gets` · permission `data:read` · effect `read`
1274
+ *
1275
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1276
+ */
1277
+ hashGet(request: HashGetValueRequest): Promise<HashGetValueResponse>;
1278
+ /**
1279
+ * Reads every field of a hash (HGETALL).
1280
+ *
1281
+ * `POST /v1/kv-hash-getall` · permission `data:read` · effect `read`
1282
+ *
1283
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1284
+ */
1285
+ hashGetAll(request: HashGetAllRequest): Promise<HashGetAllResponse>;
1286
+ /**
1287
+ * Reads several fields of a hash (HMGET), one per field, in order; an
1288
+ * absent field has no `value`.
1289
+ *
1290
+ * `POST /v1/kv-hash-mget` · permission `data:read` · effect `read`
1291
+ *
1292
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1293
+ */
1294
+ hashGetMany(request: HashGetFieldsRequest): Promise<HashGetFieldsResponse>;
1295
+ /**
1296
+ * Pushes values onto the head of a list (LPUSH), creating it.
1297
+ *
1298
+ * `POST /v1/kv-list-pushes` · permission `data:write` · effect `write`
1299
+ *
1300
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1301
+ */
1302
+ listPush(request: ListPushValueRequest): Promise<ListPushValueResponse>;
1303
+ /**
1304
+ * Reads a range of a list (LRANGE); negative indexes count from the end.
1305
+ *
1306
+ * `POST /v1/kv-list-ranges` · permission `data:read` · effect `read`
1307
+ *
1308
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1309
+ */
1310
+ listRange(request: ListRangeValueRequest): Promise<ListRangeValueResponse>;
1311
+ /**
1312
+ * Pops values from the head of a list (LPOP); an emptied list is removed.
1313
+ *
1314
+ * `POST /v1/kv-list-pops` · permission `data:write` · effect `write`
1315
+ *
1316
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1317
+ */
1318
+ listPop(request: ListPopValueRequest): Promise<ListPopValueResponse>;
1319
+ /**
1320
+ * Reads the length of a list (LLEN); an absent key has length zero.
1321
+ *
1322
+ * `POST /v1/kv-list-lens` · permission `data:read` · effect `read`
1323
+ *
1324
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1325
+ */
1326
+ listLength(request: ListLenValueRequest): Promise<ListLenValueResponse>;
1327
+ /**
1328
+ * Adds members to a sorted set or updates their scores (ZADD), creating it.
1329
+ *
1330
+ * `POST /v1/kv-zsets` · permission `data:write` · effect `write`
1331
+ *
1332
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1333
+ */
1334
+ zsetAdd(request: ZSetAddValueRequest): Promise<ZSetAddValueResponse>;
1335
+ /**
1336
+ * Reads a range of a sorted set by rank, lowest score first (ZRANGE);
1337
+ * negative indexes count from the end.
1338
+ *
1339
+ * `POST /v1/kv-zset-ranges` · permission `data:read` · effect `read`
1340
+ *
1341
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1342
+ */
1343
+ zsetRange(request: ZSetRangeValueRequest): Promise<ZSetRangeValueResponse>;
1344
+ /**
1345
+ * Reads a member's score (ZSCORE); an absent member has no `score`.
1346
+ *
1347
+ * `POST /v1/kv-zset-scores` · permission `data:read` · effect `read`
1348
+ *
1349
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1350
+ */
1351
+ zsetScore(request: ZSetScoreValueRequest): Promise<ZSetScoreValueResponse>;
1352
+ /**
1353
+ * Reads the size of a sorted set (ZCARD); an absent key has size zero.
1354
+ *
1355
+ * `POST /v1/kv-zset-lens` · permission `data:read` · effect `read`
1356
+ *
1357
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1358
+ */
1359
+ zsetLength(request: ZSetLenValueRequest): Promise<ZSetLenValueResponse>;
1360
+ /**
1361
+ * Walks a namespace's keys that match a glob (SCAN). Call again with the
1362
+ * returned `cursor` until it is empty.
1363
+ *
1364
+ * `POST /v1/kv-scans` · permission `data:read` · effect `read`
1365
+ *
1366
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1367
+ */
1368
+ scan(request: ScanValuesRequest): Promise<ScanValuesResponse>;
1369
+ /**
1370
+ * Sets a key's time to live (EXPIRE) without rewriting its value; zero
1371
+ * makes it persistent.
1372
+ *
1373
+ * `POST /v1/kv-expiries` · permission `data:write` · effect `write`
1374
+ *
1375
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1376
+ */
1377
+ expire(request: ExpireValueRequest): Promise<ExpireValueResponse>;
1378
+ }
1379
+ /** `documents` of Sylphx Data: served at `https://api.data.sylphx.com`. */
1380
+ export declare class DocumentsCollection {
1381
+ private readonly client;
1382
+ constructor(client: runtime.Client);
1383
+ /**
1384
+ * Writes a document to a search index, replacing the current version.
1385
+ *
1386
+ * `PUT /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `write`
1387
+ *
1388
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
1389
+ */
1390
+ put(request: PutDocumentRequest): Promise<PutDocumentResponse>;
1391
+ /**
1392
+ * Reads a document.
1393
+ *
1394
+ * `GET /v1/documents/{index_id}/{document_id}` · permission `data:read` · effect `read`
1395
+ *
1396
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1397
+ */
1398
+ get(request: GetDocumentRequest): Promise<GetDocumentResponse>;
1399
+ /**
1400
+ * Deletes a document.
1401
+ *
1402
+ * `DELETE /v1/documents/{index_id}/{document_id}` · permission `data:write` · effect `destructive`
1403
+ *
1404
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
1405
+ */
1406
+ delete(request: DeleteDocumentRequest): Promise<DeleteDocumentResponse>;
1407
+ }
1408
+ /** `search` of Sylphx Data: served at `https://api.data.sylphx.com`. */
1409
+ export declare class SearchCollection {
1410
+ private readonly client;
1411
+ constructor(client: runtime.Client);
1412
+ /**
1413
+ * Searches an index by text, by vector, or both, best match first, with
1414
+ * filters and paging.
1415
+ *
1416
+ * `POST /v1/search/{index_id}` · permission `data:read` · effect `read`
1417
+ *
1418
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
1419
+ */
1420
+ query(request: SearchRequest): Promise<SearchResponse>;
1421
+ }
586
1422
  /** `databases` of Sylphx Data: Resource type `data.sylphx.com/Database`. */
587
1423
  export declare class DatabasesCollection {
588
1424
  private readonly client;