@sylphx/sdk 0.28.0 → 0.31.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 (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -114
  3. package/dist/access.d.ts +670 -0
  4. package/dist/access.js +640 -0
  5. package/dist/access.js.map +1 -0
  6. package/dist/ai.d.ts +176 -0
  7. package/dist/ai.js +112 -0
  8. package/dist/ai.js.map +1 -0
  9. package/dist/artifacts.d.ts +165 -0
  10. package/dist/artifacts.js +129 -0
  11. package/dist/artifacts.js.map +1 -0
  12. package/dist/auth/verify.d.ts +57 -0
  13. package/dist/auth/verify.js +157 -0
  14. package/dist/auth/verify.js.map +1 -0
  15. package/dist/auth.d.ts +896 -0
  16. package/dist/auth.js +828 -0
  17. package/dist/auth.js.map +1 -0
  18. package/dist/billing.d.ts +854 -0
  19. package/dist/billing.js +593 -0
  20. package/dist/billing.js.map +1 -0
  21. package/dist/broker.d.ts +226 -0
  22. package/dist/broker.js +187 -0
  23. package/dist/broker.js.map +1 -0
  24. package/dist/build.d.ts +313 -0
  25. package/dist/build.js +271 -0
  26. package/dist/build.js.map +1 -0
  27. package/dist/common.d.ts +162 -0
  28. package/dist/common.js +41 -0
  29. package/dist/common.js.map +1 -0
  30. package/dist/config.d.ts +198 -0
  31. package/dist/config.js +168 -0
  32. package/dist/config.js.map +1 -0
  33. package/dist/connections.d.ts +354 -0
  34. package/dist/connections.js +313 -0
  35. package/dist/connections.js.map +1 -0
  36. package/dist/data.d.ts +1141 -0
  37. package/dist/data.js +1082 -0
  38. package/dist/data.js.map +1 -0
  39. package/dist/entitlement.d.ts +179 -0
  40. package/dist/entitlement.js +117 -0
  41. package/dist/entitlement.js.map +1 -0
  42. package/dist/events.d.ts +1324 -0
  43. package/dist/events.js +1227 -0
  44. package/dist/events.js.map +1 -0
  45. package/dist/hosting.d.ts +709 -0
  46. package/dist/hosting.js +611 -0
  47. package/dist/hosting.js.map +1 -0
  48. package/dist/index.d.ts +79 -33656
  49. package/dist/index.js +113 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/keys.d.ts +438 -0
  52. package/dist/keys.js +406 -0
  53. package/dist/keys.js.map +1 -0
  54. package/dist/methods.d.ts +2 -0
  55. package/dist/methods.js +4200 -0
  56. package/dist/methods.js.map +1 -0
  57. package/dist/network.d.ts +733 -0
  58. package/dist/network.js +711 -0
  59. package/dist/network.js.map +1 -0
  60. package/dist/notify.d.ts +1753 -0
  61. package/dist/notify.js +1551 -0
  62. package/dist/notify.js.map +1 -0
  63. package/dist/observability.d.ts +509 -0
  64. package/dist/observability.js +437 -0
  65. package/dist/observability.js.map +1 -0
  66. package/dist/release.d.ts +303 -0
  67. package/dist/release.js +214 -0
  68. package/dist/release.js.map +1 -0
  69. package/dist/runners.d.ts +262 -0
  70. package/dist/runners.js +238 -0
  71. package/dist/runners.js.map +1 -0
  72. package/dist/runtime.d.ts +121 -0
  73. package/dist/runtime.js +305 -0
  74. package/dist/runtime.js.map +1 -0
  75. package/dist/sandboxes.d.ts +1705 -0
  76. package/dist/sandboxes.js +1226 -0
  77. package/dist/sandboxes.js.map +1 -0
  78. package/dist/secrets.d.ts +508 -0
  79. package/dist/secrets.js +474 -0
  80. package/dist/secrets.js.map +1 -0
  81. package/dist/workflows.d.ts +678 -0
  82. package/dist/workflows.js +595 -0
  83. package/dist/workflows.js.map +1 -0
  84. package/package.json +33 -112
  85. package/dist/connect.d.ts +0 -2838
  86. package/dist/connect.mjs +0 -220
  87. package/dist/connect.mjs.map +0 -1
  88. package/dist/health/index.d.ts +0 -1394
  89. package/dist/health/index.mjs +0 -1394
  90. package/dist/health/index.mjs.map +0 -1
  91. package/dist/index.mjs +0 -38429
  92. package/dist/index.mjs.map +0 -1
  93. package/dist/nextjs/index.d.ts +0 -724
  94. package/dist/nextjs/index.mjs +0 -3332
  95. package/dist/nextjs/index.mjs.map +0 -1
  96. package/dist/react/index.d.ts +0 -13066
  97. package/dist/react/index.mjs +0 -35329
  98. package/dist/react/index.mjs.map +0 -1
  99. package/dist/server/index.d.ts +0 -2000
  100. package/dist/server/index.mjs +0 -3446
  101. package/dist/server/index.mjs.map +0 -1
  102. package/dist/web-analytics.d.ts +0 -90
  103. package/dist/web-analytics.mjs +0 -225
  104. package/dist/web-analytics.mjs.map +0 -1
package/dist/data.js ADDED
@@ -0,0 +1,1082 @@
1
+ // @generated by sylphx-gen 0.1.0 from contracts@446ceb843d4ff88057b0db68e2e54e4aea52d8143b72d66016122995b878de20. Do not edit.
2
+ // `sylphx.data.v1`.
3
+ import * as runtime from './runtime.js';
4
+ import './common.js';
5
+ runtime.registerSchemas({
6
+ 'sylphx.data.v1.Bucket': [
7
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
8
+ ['spec', 'spec', 'sylphx.data.v1.BucketSpec'],
9
+ ['status', 'status', 'sylphx.data.v1.BucketStatus'],
10
+ ],
11
+ 'sylphx.data.v1.BucketSpec': [
12
+ ['versioningEnabled', 'versioning_enabled'],
13
+ ['deletionProtection', 'deletion_protection'],
14
+ ],
15
+ 'sylphx.data.v1.BucketStatus': [
16
+ ['observedGeneration', 'observed_generation'],
17
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
18
+ ['storageBytes', 'storage_bytes'],
19
+ ['objectCount', 'object_count'],
20
+ ],
21
+ 'sylphx.data.v1.ConnectBucketRequest': [],
22
+ 'sylphx.data.v1.ConnectBucketResponse': [
23
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
24
+ ],
25
+ 'sylphx.data.v1.ConnectDatabaseRequest': [],
26
+ 'sylphx.data.v1.ConnectDatabaseResponse': [
27
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
28
+ ],
29
+ 'sylphx.data.v1.ConnectKvNamespaceRequest': [],
30
+ 'sylphx.data.v1.ConnectKvNamespaceResponse': [
31
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
32
+ ],
33
+ 'sylphx.data.v1.ConnectSearchIndexRequest': [],
34
+ 'sylphx.data.v1.ConnectSearchIndexResponse': [
35
+ ['connectionInfo', 'connection_info', 'sylphx.data.v1.ConnectionInfo'],
36
+ ],
37
+ 'sylphx.data.v1.ConnectionInfo': [
38
+ ['directUri', 'direct_uri'],
39
+ ],
40
+ 'sylphx.data.v1.CreateBucketRequest': [
41
+ ['bucket', 'bucket', 'sylphx.data.v1.Bucket'],
42
+ ['bucketId', 'bucket_id'],
43
+ ['validateOnly', 'validate_only'],
44
+ ],
45
+ 'sylphx.data.v1.CreateDatabaseRequest': [
46
+ ['database', 'database', 'sylphx.data.v1.Database'],
47
+ ['databaseId', 'database_id'],
48
+ ['validateOnly', 'validate_only'],
49
+ ],
50
+ 'sylphx.data.v1.CreateKvNamespaceRequest': [
51
+ ['kvNamespace', 'kv_namespace', 'sylphx.data.v1.KvNamespace'],
52
+ ['kvNamespaceId', 'kv_namespace_id'],
53
+ ['validateOnly', 'validate_only'],
54
+ ],
55
+ 'sylphx.data.v1.CreateSearchIndexRequest': [
56
+ ['searchIndex', 'search_index', 'sylphx.data.v1.SearchIndex'],
57
+ ['searchIndexId', 'search_index_id'],
58
+ ['validateOnly', 'validate_only'],
59
+ ],
60
+ 'sylphx.data.v1.Database': [
61
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
62
+ ['spec', 'spec', 'sylphx.data.v1.DatabaseSpec'],
63
+ ['status', 'status', 'sylphx.data.v1.DatabaseStatus'],
64
+ ],
65
+ 'sylphx.data.v1.DatabaseSpec': [
66
+ ['postgresVersion', 'postgres_version'],
67
+ ['computeUnits', 'compute_units'],
68
+ ['deletionProtection', 'deletion_protection'],
69
+ ],
70
+ 'sylphx.data.v1.DatabaseStatus': [
71
+ ['observedGeneration', 'observed_generation'],
72
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
73
+ ['storageBytes', 'storage_bytes'],
74
+ ['maxConnections', 'max_connections'],
75
+ ['earliestRestoreTime', 'earliest_restore_time'],
76
+ ],
77
+ 'sylphx.data.v1.DeleteBucketRequest': [
78
+ ['allowMissing', 'allow_missing'],
79
+ ['validateOnly', 'validate_only'],
80
+ ],
81
+ 'sylphx.data.v1.DeleteDatabaseRequest': [
82
+ ['allowMissing', 'allow_missing'],
83
+ ['validateOnly', 'validate_only'],
84
+ ],
85
+ 'sylphx.data.v1.DeleteKvNamespaceRequest': [
86
+ ['allowMissing', 'allow_missing'],
87
+ ['validateOnly', 'validate_only'],
88
+ ],
89
+ 'sylphx.data.v1.DeleteObjectRequest': [
90
+ ['bucketId', 'bucket_id'],
91
+ ['expectedVersion', 'expected_version'],
92
+ ],
93
+ 'sylphx.data.v1.DeleteObjectResponse': [
94
+ ['object', 'object', 'sylphx.data.v1.ObjectRecord'],
95
+ ],
96
+ 'sylphx.data.v1.DeleteSearchIndexRequest': [
97
+ ['allowMissing', 'allow_missing'],
98
+ ['validateOnly', 'validate_only'],
99
+ ],
100
+ 'sylphx.data.v1.DeleteValueRequest': [
101
+ ['namespaceId', 'namespace_id'],
102
+ ['expectedVersion', 'expected_version'],
103
+ ],
104
+ 'sylphx.data.v1.DeleteValueResponse': [],
105
+ 'sylphx.data.v1.GetBucketRequest': [],
106
+ 'sylphx.data.v1.GetDatabaseRequest': [],
107
+ 'sylphx.data.v1.GetKvNamespaceRequest': [],
108
+ 'sylphx.data.v1.GetObjectRequest': [
109
+ ['bucketId', 'bucket_id'],
110
+ ],
111
+ 'sylphx.data.v1.GetObjectResponse': [
112
+ ['object', 'object', 'sylphx.data.v1.ObjectRecord'],
113
+ ],
114
+ 'sylphx.data.v1.GetSearchIndexRequest': [],
115
+ 'sylphx.data.v1.GetValueRequest': [
116
+ ['namespaceId', 'namespace_id'],
117
+ ],
118
+ 'sylphx.data.v1.GetValueResponse': [
119
+ ['value', 'value', 'sylphx.data.v1.ValueRecord'],
120
+ ],
121
+ 'sylphx.data.v1.IncrementValueRequest': [
122
+ ['namespaceId', 'namespace_id'],
123
+ ],
124
+ 'sylphx.data.v1.IncrementValueResponse': [
125
+ ['value', 'value', 'sylphx.data.v1.ValueRecord'],
126
+ ],
127
+ 'sylphx.data.v1.KvNamespace': [
128
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
129
+ ['spec', 'spec', 'sylphx.data.v1.KvNamespaceSpec'],
130
+ ['status', 'status', 'sylphx.data.v1.KvNamespaceStatus'],
131
+ ],
132
+ 'sylphx.data.v1.KvNamespaceSpec': [
133
+ ['defaultTtl', 'default_ttl'],
134
+ ['deletionProtection', 'deletion_protection'],
135
+ ],
136
+ 'sylphx.data.v1.KvNamespaceStatus': [
137
+ ['observedGeneration', 'observed_generation'],
138
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
139
+ ['storageBytes', 'storage_bytes'],
140
+ ],
141
+ 'sylphx.data.v1.ListBucketsRequest': [
142
+ ['pageSize', 'page_size'],
143
+ ['pageToken', 'page_token'],
144
+ ['orderBy', 'order_by'],
145
+ ],
146
+ 'sylphx.data.v1.ListBucketsResponse': [
147
+ ['buckets', 'buckets', 'sylphx.data.v1.Bucket'],
148
+ ['nextPageToken', 'next_page_token'],
149
+ ],
150
+ 'sylphx.data.v1.ListDatabasesRequest': [
151
+ ['pageSize', 'page_size'],
152
+ ['pageToken', 'page_token'],
153
+ ['orderBy', 'order_by'],
154
+ ],
155
+ 'sylphx.data.v1.ListDatabasesResponse': [
156
+ ['databases', 'databases', 'sylphx.data.v1.Database'],
157
+ ['nextPageToken', 'next_page_token'],
158
+ ],
159
+ 'sylphx.data.v1.ListKvNamespacesRequest': [
160
+ ['pageSize', 'page_size'],
161
+ ['pageToken', 'page_token'],
162
+ ['orderBy', 'order_by'],
163
+ ],
164
+ 'sylphx.data.v1.ListKvNamespacesResponse': [
165
+ ['kvNamespaces', 'kv_namespaces', 'sylphx.data.v1.KvNamespace'],
166
+ ['nextPageToken', 'next_page_token'],
167
+ ],
168
+ 'sylphx.data.v1.ListObjectsRequest': [
169
+ ['bucketId', 'bucket_id'],
170
+ ['pageSize', 'page_size'],
171
+ ['pageToken', 'page_token'],
172
+ ],
173
+ 'sylphx.data.v1.ListObjectsResponse': [
174
+ ['objects', 'objects', 'sylphx.data.v1.ObjectRecord'],
175
+ ['nextPageToken', 'next_page_token'],
176
+ ],
177
+ 'sylphx.data.v1.ListSearchIndexesRequest': [
178
+ ['pageSize', 'page_size'],
179
+ ['pageToken', 'page_token'],
180
+ ['orderBy', 'order_by'],
181
+ ],
182
+ 'sylphx.data.v1.ListSearchIndexesResponse': [
183
+ ['searchIndexes', 'search_indexes', 'sylphx.data.v1.SearchIndex'],
184
+ ['nextPageToken', 'next_page_token'],
185
+ ],
186
+ 'sylphx.data.v1.ListValuesRequest': [
187
+ ['namespaceId', 'namespace_id'],
188
+ ['pageSize', 'page_size'],
189
+ ['pageToken', 'page_token'],
190
+ ],
191
+ 'sylphx.data.v1.ListValuesResponse': [
192
+ ['values', 'values', 'sylphx.data.v1.ValueRecord'],
193
+ ['nextPageToken', 'next_page_token'],
194
+ ],
195
+ 'sylphx.data.v1.ObjectRecord': [
196
+ ['bucketId', 'bucket_id'],
197
+ ['contentType', 'content_type'],
198
+ ['updatedAtUnixMs', 'updated_at_unix_ms'],
199
+ ['deleteMarker', 'delete_marker'],
200
+ ],
201
+ 'sylphx.data.v1.PutObjectRequest': [
202
+ ['bucketId', 'bucket_id'],
203
+ ['contentType', 'content_type'],
204
+ ['expectedVersion', 'expected_version'],
205
+ ],
206
+ 'sylphx.data.v1.PutObjectResponse': [
207
+ ['object', 'object', 'sylphx.data.v1.ObjectRecord'],
208
+ ],
209
+ 'sylphx.data.v1.PutValueRequest': [
210
+ ['namespaceId', 'namespace_id'],
211
+ ['ttlSeconds', 'ttl_seconds'],
212
+ ['expectedVersion', 'expected_version'],
213
+ ],
214
+ 'sylphx.data.v1.PutValueResponse': [
215
+ ['value', 'value', 'sylphx.data.v1.ValueRecord'],
216
+ ],
217
+ 'sylphx.data.v1.RestoreDatabaseRequest': [
218
+ ['restoreTime', 'restore_time'],
219
+ ['validateOnly', 'validate_only'],
220
+ ],
221
+ 'sylphx.data.v1.RotateBucketCredentialsRequest': [
222
+ ['validateOnly', 'validate_only'],
223
+ ],
224
+ 'sylphx.data.v1.RotateDatabaseCredentialsRequest': [
225
+ ['validateOnly', 'validate_only'],
226
+ ],
227
+ 'sylphx.data.v1.RotateKvNamespaceCredentialsRequest': [
228
+ ['validateOnly', 'validate_only'],
229
+ ],
230
+ 'sylphx.data.v1.RotateSearchIndexCredentialsRequest': [
231
+ ['validateOnly', 'validate_only'],
232
+ ],
233
+ 'sylphx.data.v1.SearchIndex': [
234
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
235
+ ['spec', 'spec', 'sylphx.data.v1.SearchIndexSpec'],
236
+ ['status', 'status', 'sylphx.data.v1.SearchIndexStatus'],
237
+ ],
238
+ 'sylphx.data.v1.SearchIndexSpec': [
239
+ ['vectorDimensions', 'vector_dimensions'],
240
+ ['deletionProtection', 'deletion_protection'],
241
+ ],
242
+ 'sylphx.data.v1.SearchIndexStatus': [
243
+ ['observedGeneration', 'observed_generation'],
244
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
245
+ ['storageBytes', 'storage_bytes'],
246
+ ['documentCount', 'document_count'],
247
+ ],
248
+ 'sylphx.data.v1.UpdateBucketRequest': [
249
+ ['bucket', 'bucket', 'sylphx.data.v1.Bucket'],
250
+ ['updateMask', 'update_mask'],
251
+ ['allowMissing', 'allow_missing'],
252
+ ['validateOnly', 'validate_only'],
253
+ ],
254
+ 'sylphx.data.v1.UpdateDatabaseRequest': [
255
+ ['database', 'database', 'sylphx.data.v1.Database'],
256
+ ['updateMask', 'update_mask'],
257
+ ['allowMissing', 'allow_missing'],
258
+ ['validateOnly', 'validate_only'],
259
+ ],
260
+ 'sylphx.data.v1.UpdateKvNamespaceRequest': [
261
+ ['kvNamespace', 'kv_namespace', 'sylphx.data.v1.KvNamespace'],
262
+ ['updateMask', 'update_mask'],
263
+ ['allowMissing', 'allow_missing'],
264
+ ['validateOnly', 'validate_only'],
265
+ ],
266
+ 'sylphx.data.v1.UpdateSearchIndexRequest': [
267
+ ['searchIndex', 'search_index', 'sylphx.data.v1.SearchIndex'],
268
+ ['updateMask', 'update_mask'],
269
+ ['allowMissing', 'allow_missing'],
270
+ ['validateOnly', 'validate_only'],
271
+ ],
272
+ 'sylphx.data.v1.ValueRecord': [
273
+ ['namespaceId', 'namespace_id'],
274
+ ['expiresAtUnixMs', 'expires_at_unix_ms'],
275
+ ['updatedAtUnixMs', 'updated_at_unix_ms'],
276
+ ],
277
+ });
278
+ /**
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
281
+ * served by Data itself at its origin, not by the Resource API, and is called
282
+ * with the environment's secret key (`SYLPHX_API_KEY`); the key's org,
283
+ * project, and environment are the tenant. Every call carries a new
284
+ * `Sylphx-Effect-Id`, which the SDK sends and reuses on retries.
285
+ *
286
+ * The buckets and namespaces themselves are Resources of DataService. The
287
+ * messages here are Data's wire format
288
+ * (`services/data/proto/sylphx/data/v1/data.proto`), field for field; Data
289
+ * answers ProtoJSON (camelCase names, 64-bit integers and bytes as strings).
290
+ *
291
+ * Namespace of Sylphx Data on `Sylphx`.
292
+ */
293
+ export class DataApi {
294
+ /** The `objects` collection. */
295
+ objects;
296
+ /** The `kv` collection. */
297
+ kv;
298
+ /** The `databases` collection. */
299
+ databases;
300
+ /** The `kv_namespaces` collection. */
301
+ kvNamespaces;
302
+ /** The `buckets` collection. */
303
+ buckets;
304
+ /** The `search_indexes` collection. */
305
+ searchIndexes;
306
+ constructor(client) {
307
+ this.objects = new ObjectsCollection(client);
308
+ this.kv = new KvCollection(client);
309
+ this.databases = new DatabasesCollection(client);
310
+ this.kvNamespaces = new KvNamespacesCollection(client);
311
+ this.buckets = new BucketsCollection(client);
312
+ this.searchIndexes = new SearchIndexesCollection(client);
313
+ }
314
+ }
315
+ /** `objects` of Sylphx Data: served at `https://api.data.sylphx.com`. */
316
+ export class ObjectsCollection {
317
+ client;
318
+ constructor(client) {
319
+ this.client = client;
320
+ }
321
+ /**
322
+ * Writes an object's bytes, replacing the current version. `body` is the
323
+ * base64 of the bytes.
324
+ *
325
+ * `PUT /v1/objects/{bucket_id}/{key=**}` · permission `data:write` · effect `write`
326
+ *
327
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
328
+ */
329
+ async put(request) {
330
+ return this.client.call({
331
+ method: 'PUT',
332
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
333
+ body: runtime.omit(request, ['bucketId', 'key']),
334
+ bodyType: 'sylphx.data.v1.PutObjectRequest',
335
+ responseType: 'sylphx.data.v1.PutObjectResponse',
336
+ origin: 'https://api.data.sylphx.com',
337
+ effectIds: true,
338
+ mutation: true,
339
+ });
340
+ }
341
+ /**
342
+ * Reads an object and its bytes (`body`, base64).
343
+ *
344
+ * `GET /v1/objects/{bucket_id}/{key=**}` · permission `data:read` · effect `read`
345
+ *
346
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
347
+ */
348
+ async get(request) {
349
+ return this.client.call({
350
+ method: 'GET',
351
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
352
+ query: { version: request.version },
353
+ responseType: 'sylphx.data.v1.GetObjectResponse',
354
+ origin: 'https://api.data.sylphx.com',
355
+ effectIds: true,
356
+ mutation: false,
357
+ });
358
+ }
359
+ /**
360
+ * Lists a bucket's objects in key order.
361
+ *
362
+ * `GET /v1/objects/{bucket_id}` · permission `data:read` · effect `read`
363
+ *
364
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
365
+ */
366
+ async list(request) {
367
+ return this.client.call({
368
+ method: 'GET',
369
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}`,
370
+ query: { prefix: request.prefix, page_size: request.pageSize, page_token: request.pageToken },
371
+ responseType: 'sylphx.data.v1.ListObjectsResponse',
372
+ origin: 'https://api.data.sylphx.com',
373
+ effectIds: true,
374
+ mutation: false,
375
+ });
376
+ }
377
+ /**
378
+ * Deletes an object's current version (history is kept).
379
+ *
380
+ * `DELETE /v1/objects/{bucket_id}/{key=**}` · permission `data:write` · effect `destructive`
381
+ *
382
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
383
+ */
384
+ async delete(request) {
385
+ return this.client.call({
386
+ method: 'DELETE',
387
+ path: `/v1/objects/${runtime.protocolParam(request.bucketId, false, 'bucket_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
388
+ query: { expected_version: request.expectedVersion },
389
+ responseType: 'sylphx.data.v1.DeleteObjectResponse',
390
+ origin: 'https://api.data.sylphx.com',
391
+ effectIds: true,
392
+ mutation: true,
393
+ });
394
+ }
395
+ }
396
+ /** `kv` of Sylphx Data: served at `https://api.data.sylphx.com`. */
397
+ export class KvCollection {
398
+ client;
399
+ constructor(client) {
400
+ this.client = client;
401
+ }
402
+ /**
403
+ * Writes a value. Without `ttl_seconds` the namespace default applies; zero
404
+ * means no expiry.
405
+ *
406
+ * `PUT /v1/kv/{namespace_id}/{key=**}` · permission `data:write` · effect `write`
407
+ *
408
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
409
+ */
410
+ async put(request) {
411
+ return this.client.call({
412
+ method: 'PUT',
413
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
414
+ body: runtime.omit(request, ['key', 'namespaceId']),
415
+ bodyType: 'sylphx.data.v1.PutValueRequest',
416
+ responseType: 'sylphx.data.v1.PutValueResponse',
417
+ origin: 'https://api.data.sylphx.com',
418
+ effectIds: true,
419
+ mutation: true,
420
+ });
421
+ }
422
+ /**
423
+ * Reads a value.
424
+ *
425
+ * `GET /v1/kv/{namespace_id}/{key=**}` · permission `data:read` · effect `read`
426
+ *
427
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
428
+ */
429
+ async get(request) {
430
+ return this.client.call({
431
+ method: 'GET',
432
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
433
+ responseType: 'sylphx.data.v1.GetValueResponse',
434
+ origin: 'https://api.data.sylphx.com',
435
+ effectIds: true,
436
+ mutation: false,
437
+ });
438
+ }
439
+ /**
440
+ * Lists a namespace's values in key order.
441
+ *
442
+ * `GET /v1/kv/{namespace_id}` · permission `data:read` · effect `read`
443
+ *
444
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
445
+ */
446
+ async list(request) {
447
+ return this.client.call({
448
+ method: 'GET',
449
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}`,
450
+ query: { prefix: request.prefix, page_size: request.pageSize, page_token: request.pageToken },
451
+ responseType: 'sylphx.data.v1.ListValuesResponse',
452
+ origin: 'https://api.data.sylphx.com',
453
+ effectIds: true,
454
+ mutation: false,
455
+ });
456
+ }
457
+ /**
458
+ * Deletes a value.
459
+ *
460
+ * `DELETE /v1/kv/{namespace_id}/{key=**}` · permission `data:write` · effect `destructive`
461
+ *
462
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`.
463
+ */
464
+ async delete(request) {
465
+ return this.client.call({
466
+ method: 'DELETE',
467
+ path: `/v1/kv/${runtime.protocolParam(request.namespaceId, false, 'namespace_id')}/${runtime.protocolParam(request.key, true, 'key')}`,
468
+ query: { expected_version: request.expectedVersion },
469
+ responseType: 'sylphx.data.v1.DeleteValueResponse',
470
+ origin: 'https://api.data.sylphx.com',
471
+ effectIds: true,
472
+ mutation: true,
473
+ });
474
+ }
475
+ /**
476
+ * Adds `delta` (default 1) to an integer value, creating it at zero.
477
+ *
478
+ * `POST /v1/kv-increments` · permission `data:write` · effect `write`
479
+ *
480
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `RESOURCE_NOT_FOUND`.
481
+ */
482
+ async increment(request) {
483
+ return this.client.call({
484
+ method: 'POST',
485
+ path: `/v1/kv-increments`,
486
+ body: runtime.omit(request, []),
487
+ bodyType: 'sylphx.data.v1.IncrementValueRequest',
488
+ responseType: 'sylphx.data.v1.IncrementValueResponse',
489
+ origin: 'https://api.data.sylphx.com',
490
+ effectIds: true,
491
+ mutation: true,
492
+ });
493
+ }
494
+ }
495
+ /** `databases` of Sylphx Data: Resource type `data.sylphx.com/Database`. */
496
+ export class DatabasesCollection {
497
+ client;
498
+ constructor(client) {
499
+ this.client = client;
500
+ }
501
+ /**
502
+ * Gets a database.
503
+ *
504
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}` · permission `data:read` · effect `read`
505
+ *
506
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
507
+ */
508
+ async get(request) {
509
+ return this.client.call({
510
+ method: 'GET',
511
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}`,
512
+ responseType: 'sylphx.data.v1.Database',
513
+ mutation: false,
514
+ });
515
+ }
516
+ /**
517
+ * Lists databases in a environment.
518
+ *
519
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/databases` · permission `data:read` · effect `read`
520
+ *
521
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
522
+ */
523
+ async list(request) {
524
+ return this.client.call({
525
+ method: 'GET',
526
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/databases`,
527
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
528
+ responseType: 'sylphx.data.v1.ListDatabasesResponse',
529
+ mutation: false,
530
+ });
531
+ }
532
+ /** Every item of every page of `list`. */
533
+ async *listAll(request) {
534
+ let next = request;
535
+ for (;;) {
536
+ const page = await this.list(next);
537
+ yield* page.databases ?? [];
538
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
539
+ return;
540
+ next = { ...request, pageToken: page.nextPageToken };
541
+ }
542
+ }
543
+ /**
544
+ * Creates a database. The Operation is done when the controller settles it.
545
+ *
546
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/databases` · permission `data:write` · effect `write`
547
+ *
548
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
549
+ */
550
+ async create(request) {
551
+ const operation = await this.client.call({
552
+ method: 'POST',
553
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/databases`,
554
+ query: { database_id: request.databaseId, validate_only: request.validateOnly },
555
+ body: request.database ?? {},
556
+ bodyType: 'sylphx.data.v1.Database',
557
+ responseType: 'sylphx.common.v1.Operation',
558
+ mutation: true,
559
+ });
560
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
561
+ }
562
+ /**
563
+ * Updates a database.
564
+ *
565
+ * `PATCH /v1/{database.name=orgs/*\/projects/*\/envs/*\/databases/*}` · permission `data:write` · effect `write`
566
+ *
567
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
568
+ */
569
+ async update(request) {
570
+ const operation = await this.client.call({
571
+ method: 'PATCH',
572
+ path: `/v1/${runtime.pathParam(request.database?.name, 'orgs/*/projects/*/envs/*/databases/*', 'database.name')}`,
573
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
574
+ body: request.database ?? {},
575
+ bodyType: 'sylphx.data.v1.Database',
576
+ responseType: 'sylphx.common.v1.Operation',
577
+ mutation: true,
578
+ });
579
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
580
+ }
581
+ /**
582
+ * Deletes a database. Fails while `spec.deletion_protection` is set.
583
+ *
584
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}` · permission `data:write` · effect `destructive`
585
+ *
586
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
587
+ */
588
+ async delete(request) {
589
+ const operation = await this.client.call({
590
+ method: 'DELETE',
591
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}`,
592
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
593
+ responseType: 'sylphx.common.v1.Operation',
594
+ mutation: true,
595
+ });
596
+ return new runtime.Operation(this.client, operation, undefined);
597
+ }
598
+ /**
599
+ * Returns how to connect to the database: its endpoint and its own engine
600
+ * credentials. The credentials are not API keys and are returned only here.
601
+ *
602
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}:connect` · permission `data:write` · effect `read`
603
+ *
604
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
605
+ */
606
+ async connect(request) {
607
+ return this.client.call({
608
+ method: 'POST',
609
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}:connect`,
610
+ body: runtime.omit(request, ['name']),
611
+ bodyType: 'sylphx.data.v1.ConnectDatabaseRequest',
612
+ responseType: 'sylphx.data.v1.ConnectDatabaseResponse',
613
+ mutation: true,
614
+ });
615
+ }
616
+ /**
617
+ * Replaces the database's engine credentials; the old ones stop working once
618
+ * the new ones are served.
619
+ *
620
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}:rotateCredentials` · permission `data:write` · effect `write`
621
+ *
622
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
623
+ */
624
+ async rotateCredentials(request) {
625
+ const operation = await this.client.call({
626
+ method: 'POST',
627
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}:rotateCredentials`,
628
+ body: runtime.omit(request, ['name']),
629
+ bodyType: 'sylphx.data.v1.RotateDatabaseCredentialsRequest',
630
+ responseType: 'sylphx.common.v1.Operation',
631
+ mutation: true,
632
+ });
633
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
634
+ }
635
+ /**
636
+ * Restores the database in place to a point in time inside its retention
637
+ * window; the database is unavailable while it restores.
638
+ *
639
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/databases/*}:restore` · permission `data:write` · effect `destructive`
640
+ *
641
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
642
+ */
643
+ async restore(request) {
644
+ const operation = await this.client.call({
645
+ method: 'POST',
646
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/databases/*', 'name')}:restore`,
647
+ body: runtime.omit(request, ['name']),
648
+ bodyType: 'sylphx.data.v1.RestoreDatabaseRequest',
649
+ responseType: 'sylphx.common.v1.Operation',
650
+ mutation: true,
651
+ });
652
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Database');
653
+ }
654
+ }
655
+ /** `kv_namespaces` of Sylphx Data: Resource type `data.sylphx.com/KvNamespace`. */
656
+ export class KvNamespacesCollection {
657
+ client;
658
+ constructor(client) {
659
+ this.client = client;
660
+ }
661
+ /**
662
+ * Gets a kv namespace.
663
+ *
664
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}` · permission `data:read` · effect `read`
665
+ *
666
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
667
+ */
668
+ async get(request) {
669
+ return this.client.call({
670
+ method: 'GET',
671
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}`,
672
+ responseType: 'sylphx.data.v1.KvNamespace',
673
+ mutation: false,
674
+ });
675
+ }
676
+ /**
677
+ * Lists kv namespaces in a environment.
678
+ *
679
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/kv_namespaces` · permission `data:read` · effect `read`
680
+ *
681
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
682
+ */
683
+ async list(request) {
684
+ return this.client.call({
685
+ method: 'GET',
686
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/kv_namespaces`,
687
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
688
+ responseType: 'sylphx.data.v1.ListKvNamespacesResponse',
689
+ mutation: false,
690
+ });
691
+ }
692
+ /** Every item of every page of `list`. */
693
+ async *listAll(request) {
694
+ let next = request;
695
+ for (;;) {
696
+ const page = await this.list(next);
697
+ yield* page.kvNamespaces ?? [];
698
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
699
+ return;
700
+ next = { ...request, pageToken: page.nextPageToken };
701
+ }
702
+ }
703
+ /**
704
+ * Creates a kv namespace. The Operation is done when the controller settles
705
+ * it.
706
+ *
707
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/kv_namespaces` · permission `data:write` · effect `write`
708
+ *
709
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
710
+ */
711
+ async create(request) {
712
+ const operation = await this.client.call({
713
+ method: 'POST',
714
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/kv_namespaces`,
715
+ query: { kv_namespace_id: request.kvNamespaceId, validate_only: request.validateOnly },
716
+ body: request.kvNamespace ?? {},
717
+ bodyType: 'sylphx.data.v1.KvNamespace',
718
+ responseType: 'sylphx.common.v1.Operation',
719
+ mutation: true,
720
+ });
721
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.KvNamespace');
722
+ }
723
+ /**
724
+ * Updates a kv namespace.
725
+ *
726
+ * `PATCH /v1/{kv_namespace.name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}` · permission `data:write` · effect `write`
727
+ *
728
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
729
+ */
730
+ async update(request) {
731
+ const operation = await this.client.call({
732
+ method: 'PATCH',
733
+ path: `/v1/${runtime.pathParam(request.kvNamespace?.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'kv_namespace.name')}`,
734
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
735
+ body: request.kvNamespace ?? {},
736
+ bodyType: 'sylphx.data.v1.KvNamespace',
737
+ responseType: 'sylphx.common.v1.Operation',
738
+ mutation: true,
739
+ });
740
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.KvNamespace');
741
+ }
742
+ /**
743
+ * Deletes a kv namespace. Fails while `spec.deletion_protection` is set.
744
+ *
745
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}` · permission `data:write` · effect `destructive`
746
+ *
747
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
748
+ */
749
+ async delete(request) {
750
+ const operation = await this.client.call({
751
+ method: 'DELETE',
752
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}`,
753
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
754
+ responseType: 'sylphx.common.v1.Operation',
755
+ mutation: true,
756
+ });
757
+ return new runtime.Operation(this.client, operation, undefined);
758
+ }
759
+ /**
760
+ * Returns how to connect to the KV namespace: its endpoint and its own
761
+ * engine credentials. The credentials are not API keys and are returned only
762
+ * here.
763
+ *
764
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}:connect` · permission `data:write` · effect `read`
765
+ *
766
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
767
+ */
768
+ async connect(request) {
769
+ return this.client.call({
770
+ method: 'POST',
771
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}:connect`,
772
+ body: runtime.omit(request, ['name']),
773
+ bodyType: 'sylphx.data.v1.ConnectKvNamespaceRequest',
774
+ responseType: 'sylphx.data.v1.ConnectKvNamespaceResponse',
775
+ mutation: true,
776
+ });
777
+ }
778
+ /**
779
+ * Replaces the KV namespace's engine credentials; the old ones stop working
780
+ * once the new ones are served.
781
+ *
782
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/kv_namespaces/*}:rotateCredentials` · permission `data:write` · effect `write`
783
+ *
784
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
785
+ */
786
+ async rotateCredentials(request) {
787
+ const operation = await this.client.call({
788
+ method: 'POST',
789
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/kv_namespaces/*', 'name')}:rotateCredentials`,
790
+ body: runtime.omit(request, ['name']),
791
+ bodyType: 'sylphx.data.v1.RotateKvNamespaceCredentialsRequest',
792
+ responseType: 'sylphx.common.v1.Operation',
793
+ mutation: true,
794
+ });
795
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.KvNamespace');
796
+ }
797
+ }
798
+ /** `buckets` of Sylphx Data: Resource type `data.sylphx.com/Bucket`. */
799
+ export class BucketsCollection {
800
+ client;
801
+ constructor(client) {
802
+ this.client = client;
803
+ }
804
+ /**
805
+ * Gets a bucket.
806
+ *
807
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}` · permission `data:read` · effect `read`
808
+ *
809
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
810
+ */
811
+ async get(request) {
812
+ return this.client.call({
813
+ method: 'GET',
814
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}`,
815
+ responseType: 'sylphx.data.v1.Bucket',
816
+ mutation: false,
817
+ });
818
+ }
819
+ /**
820
+ * Lists buckets in a environment.
821
+ *
822
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/buckets` · permission `data:read` · effect `read`
823
+ *
824
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
825
+ */
826
+ async list(request) {
827
+ return this.client.call({
828
+ method: 'GET',
829
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/buckets`,
830
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
831
+ responseType: 'sylphx.data.v1.ListBucketsResponse',
832
+ mutation: false,
833
+ });
834
+ }
835
+ /** Every item of every page of `list`. */
836
+ async *listAll(request) {
837
+ let next = request;
838
+ for (;;) {
839
+ const page = await this.list(next);
840
+ yield* page.buckets ?? [];
841
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
842
+ return;
843
+ next = { ...request, pageToken: page.nextPageToken };
844
+ }
845
+ }
846
+ /**
847
+ * Creates a bucket. The Operation is done when the controller settles it.
848
+ *
849
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/buckets` · permission `data:write` · effect `write`
850
+ *
851
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
852
+ */
853
+ async create(request) {
854
+ const operation = await this.client.call({
855
+ method: 'POST',
856
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/buckets`,
857
+ query: { bucket_id: request.bucketId, validate_only: request.validateOnly },
858
+ body: request.bucket ?? {},
859
+ bodyType: 'sylphx.data.v1.Bucket',
860
+ responseType: 'sylphx.common.v1.Operation',
861
+ mutation: true,
862
+ });
863
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Bucket');
864
+ }
865
+ /**
866
+ * Updates a bucket.
867
+ *
868
+ * `PATCH /v1/{bucket.name=orgs/*\/projects/*\/envs/*\/buckets/*}` · permission `data:write` · effect `write`
869
+ *
870
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
871
+ */
872
+ async update(request) {
873
+ const operation = await this.client.call({
874
+ method: 'PATCH',
875
+ path: `/v1/${runtime.pathParam(request.bucket?.name, 'orgs/*/projects/*/envs/*/buckets/*', 'bucket.name')}`,
876
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
877
+ body: request.bucket ?? {},
878
+ bodyType: 'sylphx.data.v1.Bucket',
879
+ responseType: 'sylphx.common.v1.Operation',
880
+ mutation: true,
881
+ });
882
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Bucket');
883
+ }
884
+ /**
885
+ * Deletes a bucket. Fails while `spec.deletion_protection` is set.
886
+ *
887
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}` · permission `data:write` · effect `destructive`
888
+ *
889
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
890
+ */
891
+ async delete(request) {
892
+ const operation = await this.client.call({
893
+ method: 'DELETE',
894
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}`,
895
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
896
+ responseType: 'sylphx.common.v1.Operation',
897
+ mutation: true,
898
+ });
899
+ return new runtime.Operation(this.client, operation, undefined);
900
+ }
901
+ /**
902
+ * Returns how to connect to the bucket: its endpoint and its own engine
903
+ * credentials. The credentials are not API keys and are returned only here.
904
+ *
905
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}:connect` · permission `data:write` · effect `read`
906
+ *
907
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
908
+ */
909
+ async connect(request) {
910
+ return this.client.call({
911
+ method: 'POST',
912
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}:connect`,
913
+ body: runtime.omit(request, ['name']),
914
+ bodyType: 'sylphx.data.v1.ConnectBucketRequest',
915
+ responseType: 'sylphx.data.v1.ConnectBucketResponse',
916
+ mutation: true,
917
+ });
918
+ }
919
+ /**
920
+ * Replaces the bucket's engine credentials; the old ones stop working once
921
+ * the new ones are served.
922
+ *
923
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/buckets/*}:rotateCredentials` · permission `data:write` · effect `write`
924
+ *
925
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
926
+ */
927
+ async rotateCredentials(request) {
928
+ const operation = await this.client.call({
929
+ method: 'POST',
930
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/buckets/*', 'name')}:rotateCredentials`,
931
+ body: runtime.omit(request, ['name']),
932
+ bodyType: 'sylphx.data.v1.RotateBucketCredentialsRequest',
933
+ responseType: 'sylphx.common.v1.Operation',
934
+ mutation: true,
935
+ });
936
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.Bucket');
937
+ }
938
+ }
939
+ /** `search_indexes` of Sylphx Data: Resource type `data.sylphx.com/SearchIndex`. */
940
+ export class SearchIndexesCollection {
941
+ client;
942
+ constructor(client) {
943
+ this.client = client;
944
+ }
945
+ /**
946
+ * Gets a search index.
947
+ *
948
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}` · permission `data:read` · effect `read`
949
+ *
950
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
951
+ */
952
+ async get(request) {
953
+ return this.client.call({
954
+ method: 'GET',
955
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}`,
956
+ responseType: 'sylphx.data.v1.SearchIndex',
957
+ mutation: false,
958
+ });
959
+ }
960
+ /**
961
+ * Lists search indexs in a environment.
962
+ *
963
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/search_indexes` · permission `data:read` · effect `read`
964
+ *
965
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
966
+ */
967
+ async list(request) {
968
+ return this.client.call({
969
+ method: 'GET',
970
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/search_indexes`,
971
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
972
+ responseType: 'sylphx.data.v1.ListSearchIndexesResponse',
973
+ mutation: false,
974
+ });
975
+ }
976
+ /** Every item of every page of `list`. */
977
+ async *listAll(request) {
978
+ let next = request;
979
+ for (;;) {
980
+ const page = await this.list(next);
981
+ yield* page.searchIndexes ?? [];
982
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
983
+ return;
984
+ next = { ...request, pageToken: page.nextPageToken };
985
+ }
986
+ }
987
+ /**
988
+ * Creates a search index. The Operation is done when the controller settles
989
+ * it.
990
+ *
991
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/search_indexes` · permission `data:write` · effect `write`
992
+ *
993
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`, `SPEND_LIMIT_REACHED`.
994
+ */
995
+ async create(request) {
996
+ const operation = await this.client.call({
997
+ method: 'POST',
998
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/search_indexes`,
999
+ query: { search_index_id: request.searchIndexId, validate_only: request.validateOnly },
1000
+ body: request.searchIndex ?? {},
1001
+ bodyType: 'sylphx.data.v1.SearchIndex',
1002
+ responseType: 'sylphx.common.v1.Operation',
1003
+ mutation: true,
1004
+ });
1005
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.SearchIndex');
1006
+ }
1007
+ /**
1008
+ * Updates a search index.
1009
+ *
1010
+ * `PATCH /v1/{search_index.name=orgs/*\/projects/*\/envs/*\/search_indexes/*}` · permission `data:write` · effect `write`
1011
+ *
1012
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1013
+ */
1014
+ async update(request) {
1015
+ const operation = await this.client.call({
1016
+ method: 'PATCH',
1017
+ path: `/v1/${runtime.pathParam(request.searchIndex?.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'search_index.name')}`,
1018
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
1019
+ body: request.searchIndex ?? {},
1020
+ bodyType: 'sylphx.data.v1.SearchIndex',
1021
+ responseType: 'sylphx.common.v1.Operation',
1022
+ mutation: true,
1023
+ });
1024
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.SearchIndex');
1025
+ }
1026
+ /**
1027
+ * Deletes a search index. Fails while `spec.deletion_protection` is set.
1028
+ *
1029
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}` · permission `data:write` · effect `destructive`
1030
+ *
1031
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `DELETION_PROTECTED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1032
+ */
1033
+ async delete(request) {
1034
+ const operation = await this.client.call({
1035
+ method: 'DELETE',
1036
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}`,
1037
+ query: { etag: request.etag, allow_missing: request.allowMissing, validate_only: request.validateOnly },
1038
+ responseType: 'sylphx.common.v1.Operation',
1039
+ mutation: true,
1040
+ });
1041
+ return new runtime.Operation(this.client, operation, undefined);
1042
+ }
1043
+ /**
1044
+ * Returns how to connect to the search index: its endpoint and its own
1045
+ * engine credentials. The credentials are not API keys and are returned only
1046
+ * here.
1047
+ *
1048
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}:connect` · permission `data:write` · effect `read`
1049
+ *
1050
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`.
1051
+ */
1052
+ async connect(request) {
1053
+ return this.client.call({
1054
+ method: 'POST',
1055
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}:connect`,
1056
+ body: runtime.omit(request, ['name']),
1057
+ bodyType: 'sylphx.data.v1.ConnectSearchIndexRequest',
1058
+ responseType: 'sylphx.data.v1.ConnectSearchIndexResponse',
1059
+ mutation: true,
1060
+ });
1061
+ }
1062
+ /**
1063
+ * Replaces the search index's engine credentials; the old ones stop working
1064
+ * once the new ones are served.
1065
+ *
1066
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/search_indexes/*}:rotateCredentials` · permission `data:write` · effect `write`
1067
+ *
1068
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1069
+ */
1070
+ async rotateCredentials(request) {
1071
+ const operation = await this.client.call({
1072
+ method: 'POST',
1073
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/search_indexes/*', 'name')}:rotateCredentials`,
1074
+ body: runtime.omit(request, ['name']),
1075
+ bodyType: 'sylphx.data.v1.RotateSearchIndexCredentialsRequest',
1076
+ responseType: 'sylphx.common.v1.Operation',
1077
+ mutation: true,
1078
+ });
1079
+ return new runtime.Operation(this.client, operation, 'sylphx.data.v1.SearchIndex');
1080
+ }
1081
+ }
1082
+ //# sourceMappingURL=data.js.map