@wix/auto_sdk_data_indexes 1.0.12 → 1.0.14

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { I as Index, L as ListIndexesOptions, a as ListIndexesResponse } from './data-v2-index-indexes.universal-BbNMyDRQ.js';
3
- export { C as CreateIndexRequest, d as CreateIndexResponse, D as DropIndexRequest, e as DropIndexResponse, E as Environment, c as Failure, F as Field, b as IndexSource, h as ListAvailableIndexesRequest, i as ListAvailableIndexesResponse, f as ListIndexesRequest, O as Order, P as Paging, g as PagingMetadata, S as Status } from './data-v2-index-indexes.universal-BbNMyDRQ.js';
2
+ import { Index, ListIndexesOptions, ListIndexesResponse } from './index.typings.js';
3
+ export { CreateIndexRequest, CreateIndexResponse, DropIndexRequest, DropIndexResponse, Environment, Failure, Field, IndexSource, ListAvailableIndexesRequest, ListAvailableIndexesResponse, ListIndexesRequest, Order, Paging, PagingMetadata, Status } from './index.typings.js';
4
4
 
5
5
  declare function createIndex$1(httpClient: HttpClient): CreateIndexSignature;
6
6
  interface CreateIndexSignature {
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2
4
  interface Index {
3
5
  /**
@@ -134,6 +136,8 @@ declare enum Environment {
134
136
  /** Collection [live environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing#live-collections). */
135
137
  LIVE = "LIVE"
136
138
  }
139
+ /** @enumType */
140
+ type EnvironmentWithLiterals = Environment | 'UNKNOWN_ENVIRONMENT' | 'SANDBOX' | 'SANDBOX_PREFERRED' | 'LIVE';
137
141
  interface CreateIndexResponse {
138
142
  /** Details of the index being generated. */
139
143
  index?: Index;
@@ -204,9 +208,68 @@ interface ListAvailableIndexesResponse {
204
208
  /** Overall index limit, missing value means there's no overall limit */
205
209
  total?: number | null;
206
210
  }
211
+ type IndexNonNullablePaths = `name` | `fields` | `fields.${number}.path` | `fields.${number}.order` | `status` | `failure.code` | `failure.description` | `unique` | `caseInsensitive` | `source`;
212
+ /**
213
+ * Creates an index for a data collection.
214
+ *
215
+ * The index can't be used immediately, as the process of generating the index takes time.
216
+ * You can check whether an index is ready by calling List Indexes.
217
+ *
218
+ * Note that when an index fails to create, the failed index still occupies a slot.
219
+ * To remove the failed index and free up the slot for a new index, call Drop Index.
220
+ * @param dataCollectionId - ID of the data collection for which to generate the index.
221
+ * @param index - Details of the index to be created.
222
+ * @public
223
+ * @requiredField dataCollectionId
224
+ * @requiredField index
225
+ * @requiredField index.fields
226
+ * @requiredField index.fields.path
227
+ * @requiredField index.name
228
+ * @param options - Options for creating an index.
229
+ * @permissionId WIX_DATA.CREATE_INDEX
230
+ * @applicableIdentity APP
231
+ * @returns Details of the index being generated.
232
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.CreateIndex
233
+ */
234
+ declare function createIndex(dataCollectionId: string, index: NonNullablePaths<Index, `fields` | `fields.${number}.path` | `name`>): Promise<NonNullablePaths<Index, IndexNonNullablePaths>>;
235
+ /**
236
+ * Removes an index from a data collection.
237
+ *
238
+ * The process of dropping an index from a collection takes time.
239
+ * You can check whether an index has been dropped by calling List Indexes.
240
+ * @param dataCollectionId - ID of the data collection for which the index to be dropped is defined.
241
+ * @param indexName - Name of the index to drop.
242
+ * @public
243
+ * @requiredField dataCollectionId
244
+ * @requiredField indexName
245
+ * @param options - Options for dropping an index.
246
+ * @permissionId WIX_DATA.DROP_INDEX
247
+ * @applicableIdentity APP
248
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.DropIndex
249
+ */
250
+ declare function dropIndex(dataCollectionId: string, indexName: string): Promise<void>;
251
+ /**
252
+ * Lists all indexes defined for a data collection.
253
+ *
254
+ * When an index's status is `ACTIVE`, it is ready to use.
255
+ * While it is still being created, its status is `BUILDING`.
256
+ *
257
+ * When an index's status is `DROPPED`, it has been dropped successfully.
258
+ * While it is still in the process of being removed, its status is `DROPPING`.
259
+ * @param dataCollectionId - ID of the data collection for which to list indexes.
260
+ * @public
261
+ * @requiredField dataCollectionId
262
+ * @param options - Options for retrieving a list of indexes.
263
+ * @permissionId WIX_DATA.LIST_INDEXES
264
+ * @applicableIdentity APP
265
+ * @fqn com.wixpress.cloud.data.api.index.IndexService.ListIndexes
266
+ */
267
+ declare function listIndexes(dataCollectionId: string, options?: ListIndexesOptions): Promise<NonNullablePaths<ListIndexesResponse, {
268
+ [P in IndexNonNullablePaths]: `indexes.${number}.${P}`;
269
+ }[IndexNonNullablePaths]>>;
207
270
  interface ListIndexesOptions {
208
271
  /** Paging options to limit and skip the number of items. */
209
272
  paging?: Paging;
210
273
  }
211
274
 
212
- export { type CreateIndexRequest as C, type DropIndexRequest as D, Environment as E, type Field as F, type Index as I, type ListIndexesOptions as L, Order as O, type Paging as P, Status as S, type ListIndexesResponse as a, IndexSource as b, type Failure as c, type CreateIndexResponse as d, type DropIndexResponse as e, type ListIndexesRequest as f, type PagingMetadata as g, type ListAvailableIndexesRequest as h, type ListAvailableIndexesResponse as i };
275
+ export { type CreateIndexRequest, type CreateIndexResponse, type DropIndexRequest, type DropIndexResponse, Environment, type EnvironmentWithLiterals, type Failure, type Field, type Index, IndexSource, type IndexSourceWithLiterals, type ListAvailableIndexesRequest, type ListAvailableIndexesResponse, type ListIndexesOptions, type ListIndexesRequest, type ListIndexesResponse, Order, type OrderWithLiterals, type Paging, type PagingMetadata, Status, type StatusWithLiterals, createIndex, dropIndex, listIndexes };
@@ -0,0 +1,589 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ Environment: () => Environment,
24
+ IndexSource: () => IndexSource,
25
+ Order: () => Order,
26
+ Status: () => Status,
27
+ createIndex: () => createIndex2,
28
+ dropIndex: () => dropIndex2,
29
+ listAvailableIndexes: () => listAvailableIndexes2,
30
+ listIndexes: () => listIndexes2
31
+ });
32
+ module.exports = __toCommonJS(index_typings_exports);
33
+
34
+ // src/data-v2-index-indexes.universal.ts
35
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
36
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
37
+
38
+ // src/data-v2-index-indexes.http.ts
39
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
40
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
41
+ function resolveComWixpressCloudDataApiIndexIndexServiceUrl(opts) {
42
+ const domainToMappings = {
43
+ "api._api_base_domain_": [
44
+ {
45
+ srcPath: "/cloud-data",
46
+ destPath: ""
47
+ }
48
+ ],
49
+ "code._base_domain_": [
50
+ {
51
+ srcPath: "/_api/cloud-data/v1/data-settings",
52
+ destPath: "/v1/data-settings"
53
+ },
54
+ {
55
+ srcPath: "/_api/cloud-data/v1/schemas",
56
+ destPath: "/v1/schemas"
57
+ },
58
+ {
59
+ srcPath: "/_api/cloud-data/v1/connector",
60
+ destPath: "/v1/connector"
61
+ },
62
+ {
63
+ srcPath: "/_api/data/v1/data-settings",
64
+ destPath: "/v1/data-settings"
65
+ },
66
+ {
67
+ srcPath: "/_api/data/v1/schemas",
68
+ destPath: "/v1/schemas"
69
+ },
70
+ {
71
+ srcPath: "/_api/data/v1/connector",
72
+ destPath: "/v1/connector"
73
+ },
74
+ {
75
+ srcPath: "/_api/cloud-data/v1/wix-data",
76
+ destPath: "/v1/wix-data"
77
+ }
78
+ ],
79
+ "cloud-data.wix-code.com": [
80
+ {
81
+ srcPath: "",
82
+ destPath: ""
83
+ }
84
+ ],
85
+ _: [
86
+ {
87
+ srcPath: "/_api/cloud-data",
88
+ destPath: ""
89
+ }
90
+ ],
91
+ "www._base_domain_": [
92
+ {
93
+ srcPath: "/_api/cloud-data",
94
+ destPath: ""
95
+ },
96
+ {
97
+ srcPath: "/_api/data",
98
+ destPath: ""
99
+ },
100
+ {
101
+ srcPath: "/_api/cloud-data",
102
+ destPath: ""
103
+ }
104
+ ],
105
+ "dev._base_domain_": [
106
+ {
107
+ srcPath: "/_api/cloud-data",
108
+ destPath: ""
109
+ }
110
+ ],
111
+ "bo._base_domain_": [
112
+ {
113
+ srcPath: "/_api/cloud-data/v1",
114
+ destPath: "/v1"
115
+ },
116
+ {
117
+ srcPath: "/_api/cloud-data/v2",
118
+ destPath: "/v2"
119
+ }
120
+ ],
121
+ "wixbo.ai": [
122
+ {
123
+ srcPath: "/_api/cloud-data/v1",
124
+ destPath: "/v1"
125
+ },
126
+ {
127
+ srcPath: "/_api/cloud-data/v2",
128
+ destPath: "/v2"
129
+ }
130
+ ],
131
+ "wix-bo.com": [
132
+ {
133
+ srcPath: "/_api/cloud-data/v1",
134
+ destPath: "/v1"
135
+ },
136
+ {
137
+ srcPath: "/_api/cloud-data/v2",
138
+ destPath: "/v2"
139
+ }
140
+ ],
141
+ "manage._base_domain_": [
142
+ {
143
+ srcPath: "/_api/cloud-data",
144
+ destPath: ""
145
+ },
146
+ {
147
+ srcPath: "/_api/data",
148
+ destPath: ""
149
+ },
150
+ {
151
+ srcPath: "/_api/cloud-data",
152
+ destPath: ""
153
+ }
154
+ ],
155
+ "editor._base_domain_": [
156
+ {
157
+ srcPath: "/_api/cloud-data/v1/schemas",
158
+ destPath: "/v1/schemas"
159
+ },
160
+ {
161
+ srcPath: "/_api/cloud-data/dbs/tasks",
162
+ destPath: "/dbs/tasks"
163
+ },
164
+ {
165
+ srcPath: "/_api/data/v1/schemas",
166
+ destPath: "/v1/schemas"
167
+ },
168
+ {
169
+ srcPath: "/_api/data/dbs/tasks",
170
+ destPath: "/dbs/tasks"
171
+ },
172
+ {
173
+ srcPath: "/_api/cloud-data/v1/wix-data",
174
+ destPath: "/v1/wix-data"
175
+ },
176
+ {
177
+ srcPath: "/_api/cloud-data/v1/data-settings",
178
+ destPath: "/v1/data-settings"
179
+ },
180
+ {
181
+ srcPath: "/_api/data/v2/indexes",
182
+ destPath: "/v2/indexes"
183
+ },
184
+ {
185
+ srcPath: "/_api/cloud-data/v1/external-database-connections",
186
+ destPath: "/v1/external-database-connections"
187
+ },
188
+ {
189
+ srcPath: "/_api/data/v1/data-collection-sharing",
190
+ destPath: "/v1/data-collection-sharing"
191
+ },
192
+ {
193
+ srcPath: "/_api/cloud-data/v2/collections",
194
+ destPath: "/v2/collections"
195
+ },
196
+ {
197
+ srcPath: "/_api/cloud-data/v2/bulk",
198
+ destPath: "/v2/bulk"
199
+ },
200
+ {
201
+ srcPath: "/_api/cloud-data/v2/items",
202
+ destPath: "/v2/items"
203
+ },
204
+ {
205
+ srcPath: "/_api/cloud-data/v2/dbs/tasks",
206
+ destPath: "/v2/dbs/tasks"
207
+ }
208
+ ],
209
+ "blocks._base_domain_": [
210
+ {
211
+ srcPath: "/_api/cloud-data/v1/schemas",
212
+ destPath: "/v1/schemas"
213
+ },
214
+ {
215
+ srcPath: "/_api/cloud-data/dbs/tasks",
216
+ destPath: "/dbs/tasks"
217
+ },
218
+ {
219
+ srcPath: "/_api/data/v1/schemas",
220
+ destPath: "/v1/schemas"
221
+ },
222
+ {
223
+ srcPath: "/_api/data/dbs/tasks",
224
+ destPath: "/dbs/tasks"
225
+ },
226
+ {
227
+ srcPath: "/_api/cloud-data/v1/wix-data",
228
+ destPath: "/v1/wix-data"
229
+ },
230
+ {
231
+ srcPath: "/_api/cloud-data/v1/data-settings",
232
+ destPath: "/v1/data-settings"
233
+ },
234
+ {
235
+ srcPath: "/_api/data/v2/indexes",
236
+ destPath: "/v2/indexes"
237
+ },
238
+ {
239
+ srcPath: "/_api/cloud-data/v1/external-database-connections",
240
+ destPath: "/v1/external-database-connections"
241
+ },
242
+ {
243
+ srcPath: "/_api/data/v1/data-collection-sharing",
244
+ destPath: "/v1/data-collection-sharing"
245
+ },
246
+ {
247
+ srcPath: "/_api/cloud-data/v2/collections",
248
+ destPath: "/v2/collections"
249
+ },
250
+ {
251
+ srcPath: "/_api/cloud-data/v2/bulk",
252
+ destPath: "/v2/bulk"
253
+ },
254
+ {
255
+ srcPath: "/_api/cloud-data/v2/items",
256
+ destPath: "/v2/items"
257
+ },
258
+ {
259
+ srcPath: "/_api/cloud-data/v2/dbs/tasks",
260
+ destPath: "/v2/dbs/tasks"
261
+ }
262
+ ],
263
+ "create.editorx": [
264
+ {
265
+ srcPath: "/_api/cloud-data/v1/schemas",
266
+ destPath: "/v1/schemas"
267
+ },
268
+ {
269
+ srcPath: "/_api/cloud-data/dbs/tasks",
270
+ destPath: "/dbs/tasks"
271
+ },
272
+ {
273
+ srcPath: "/_api/data/v1/schemas",
274
+ destPath: "/v1/schemas"
275
+ },
276
+ {
277
+ srcPath: "/_api/data/dbs/tasks",
278
+ destPath: "/dbs/tasks"
279
+ },
280
+ {
281
+ srcPath: "/_api/cloud-data/v1/wix-data",
282
+ destPath: "/v1/wix-data"
283
+ },
284
+ {
285
+ srcPath: "/_api/cloud-data/v1/data-settings",
286
+ destPath: "/v1/data-settings"
287
+ },
288
+ {
289
+ srcPath: "/_api/data/v2/indexes",
290
+ destPath: "/v2/indexes"
291
+ },
292
+ {
293
+ srcPath: "/_api/cloud-data/v1/external-database-connections",
294
+ destPath: "/v1/external-database-connections"
295
+ },
296
+ {
297
+ srcPath: "/_api/data/v1/data-collection-sharing",
298
+ destPath: "/v1/data-collection-sharing"
299
+ },
300
+ {
301
+ srcPath: "/_api/cloud-data/v2/collections",
302
+ destPath: "/v2/collections"
303
+ },
304
+ {
305
+ srcPath: "/_api/cloud-data/v2/bulk",
306
+ destPath: "/v2/bulk"
307
+ },
308
+ {
309
+ srcPath: "/_api/cloud-data/v2/items",
310
+ destPath: "/v2/items"
311
+ },
312
+ {
313
+ srcPath: "/_api/cloud-data/v2/dbs/tasks",
314
+ destPath: "/v2/dbs/tasks"
315
+ }
316
+ ],
317
+ "www.wixapis.com": [
318
+ {
319
+ srcPath: "/wix-data/v1/collections",
320
+ destPath: "/v1/wix-data/collections"
321
+ },
322
+ {
323
+ srcPath: "/wix-data/v1/external-database-connections",
324
+ destPath: "/v1/external-database-connections"
325
+ },
326
+ {
327
+ srcPath: "/wix-data/v2/indexes",
328
+ destPath: "/v2/indexes"
329
+ },
330
+ {
331
+ srcPath: "/wix-data/v1/items",
332
+ destPath: "/v1/items"
333
+ },
334
+ {
335
+ srcPath: "/wix-data/v1/bulk",
336
+ destPath: "/v1/bulk"
337
+ },
338
+ {
339
+ srcPath: "/wix-data/v1/external-databases",
340
+ destPath: "/v1/external-databases"
341
+ },
342
+ {
343
+ srcPath: "/wix-data/v2",
344
+ destPath: "/v2"
345
+ }
346
+ ],
347
+ "www.wixgateway.com": [
348
+ {
349
+ srcPath: "/wix-data/v1/items",
350
+ destPath: "/v1/items"
351
+ },
352
+ {
353
+ srcPath: "/wix-data/v1/bulk",
354
+ destPath: "/v1/bulk"
355
+ }
356
+ ],
357
+ "*.dev.wix-code.com": [
358
+ {
359
+ srcPath: "/_api/cloud-data/v2",
360
+ destPath: "/v2"
361
+ }
362
+ ]
363
+ };
364
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
365
+ }
366
+ var PACKAGE_NAME = "@wix/auto_sdk_data_indexes";
367
+ function createIndex(payload) {
368
+ function __createIndex({ host }) {
369
+ const metadata = {
370
+ entityFqdn: "wix.data.v2.index",
371
+ method: "POST",
372
+ methodFqn: "com.wixpress.cloud.data.api.index.IndexService.CreateIndex",
373
+ packageName: PACKAGE_NAME,
374
+ url: resolveComWixpressCloudDataApiIndexIndexServiceUrl({
375
+ protoPath: "/v2/indexes",
376
+ data: payload,
377
+ host
378
+ }),
379
+ data: payload
380
+ };
381
+ return metadata;
382
+ }
383
+ return __createIndex;
384
+ }
385
+ function dropIndex(payload) {
386
+ function __dropIndex({ host }) {
387
+ const metadata = {
388
+ entityFqdn: "wix.data.v2.index",
389
+ method: "DELETE",
390
+ methodFqn: "com.wixpress.cloud.data.api.index.IndexService.DropIndex",
391
+ packageName: PACKAGE_NAME,
392
+ url: resolveComWixpressCloudDataApiIndexIndexServiceUrl({
393
+ protoPath: "/v2/indexes",
394
+ data: payload,
395
+ host
396
+ }),
397
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
398
+ };
399
+ return metadata;
400
+ }
401
+ return __dropIndex;
402
+ }
403
+ function listIndexes(payload) {
404
+ function __listIndexes({ host }) {
405
+ const metadata = {
406
+ entityFqdn: "wix.data.v2.index",
407
+ method: "GET",
408
+ methodFqn: "com.wixpress.cloud.data.api.index.IndexService.ListIndexes",
409
+ packageName: PACKAGE_NAME,
410
+ url: resolveComWixpressCloudDataApiIndexIndexServiceUrl({
411
+ protoPath: "/v2/indexes",
412
+ data: payload,
413
+ host
414
+ }),
415
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
416
+ };
417
+ return metadata;
418
+ }
419
+ return __listIndexes;
420
+ }
421
+ function listAvailableIndexes(payload) {
422
+ function __listAvailableIndexes({ host }) {
423
+ const metadata = {
424
+ entityFqdn: "wix.data.v2.index",
425
+ method: "GET",
426
+ methodFqn: "com.wixpress.cloud.data.api.index.IndexService.ListAvailableIndexes",
427
+ packageName: PACKAGE_NAME,
428
+ url: resolveComWixpressCloudDataApiIndexIndexServiceUrl({
429
+ protoPath: "/v2/indexes/available",
430
+ data: payload,
431
+ host
432
+ }),
433
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
434
+ };
435
+ return metadata;
436
+ }
437
+ return __listAvailableIndexes;
438
+ }
439
+
440
+ // src/data-v2-index-indexes.universal.ts
441
+ var Order = /* @__PURE__ */ ((Order2) => {
442
+ Order2["ASC"] = "ASC";
443
+ Order2["DESC"] = "DESC";
444
+ return Order2;
445
+ })(Order || {});
446
+ var Status = /* @__PURE__ */ ((Status2) => {
447
+ Status2["UNKNOWN"] = "UNKNOWN";
448
+ Status2["BUILDING"] = "BUILDING";
449
+ Status2["ACTIVE"] = "ACTIVE";
450
+ Status2["DROPPING"] = "DROPPING";
451
+ Status2["DROPPED"] = "DROPPED";
452
+ Status2["FAILED"] = "FAILED";
453
+ Status2["INVALID"] = "INVALID";
454
+ return Status2;
455
+ })(Status || {});
456
+ var IndexSource = /* @__PURE__ */ ((IndexSource2) => {
457
+ IndexSource2["UNKNOWN_INDEX_SOURCE"] = "UNKNOWN_INDEX_SOURCE";
458
+ IndexSource2["SYSTEM"] = "SYSTEM";
459
+ IndexSource2["USER"] = "USER";
460
+ IndexSource2["AUTO"] = "AUTO";
461
+ return IndexSource2;
462
+ })(IndexSource || {});
463
+ var Environment = /* @__PURE__ */ ((Environment2) => {
464
+ Environment2["UNKNOWN_ENVIRONMENT"] = "UNKNOWN_ENVIRONMENT";
465
+ Environment2["SANDBOX"] = "SANDBOX";
466
+ Environment2["SANDBOX_PREFERRED"] = "SANDBOX_PREFERRED";
467
+ Environment2["LIVE"] = "LIVE";
468
+ return Environment2;
469
+ })(Environment || {});
470
+ async function createIndex2(dataCollectionId, index) {
471
+ const { httpClient, sideEffects } = arguments[2];
472
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
473
+ dataCollectionId,
474
+ index
475
+ });
476
+ const reqOpts = createIndex(payload);
477
+ sideEffects?.onSiteCall?.();
478
+ try {
479
+ const result = await httpClient.request(reqOpts);
480
+ sideEffects?.onSuccess?.(result);
481
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.index;
482
+ } catch (err) {
483
+ const transformedError = (0, import_transform_error.transformError)(
484
+ err,
485
+ {
486
+ spreadPathsToArguments: {},
487
+ explicitPathsToArguments: { dataCollectionId: "$[0]", index: "$[1]" },
488
+ singleArgumentUnchanged: false
489
+ },
490
+ ["dataCollectionId", "index"]
491
+ );
492
+ sideEffects?.onError?.(err);
493
+ throw transformedError;
494
+ }
495
+ }
496
+ async function dropIndex2(dataCollectionId, indexName) {
497
+ const { httpClient, sideEffects } = arguments[2];
498
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
499
+ dataCollectionId,
500
+ indexName
501
+ });
502
+ const reqOpts = dropIndex(payload);
503
+ sideEffects?.onSiteCall?.();
504
+ try {
505
+ const result = await httpClient.request(reqOpts);
506
+ sideEffects?.onSuccess?.(result);
507
+ } catch (err) {
508
+ const transformedError = (0, import_transform_error.transformError)(
509
+ err,
510
+ {
511
+ spreadPathsToArguments: {},
512
+ explicitPathsToArguments: {
513
+ dataCollectionId: "$[0]",
514
+ indexName: "$[1]"
515
+ },
516
+ singleArgumentUnchanged: false
517
+ },
518
+ ["dataCollectionId", "indexName"]
519
+ );
520
+ sideEffects?.onError?.(err);
521
+ throw transformedError;
522
+ }
523
+ }
524
+ async function listIndexes2(dataCollectionId, options) {
525
+ const { httpClient, sideEffects } = arguments[2];
526
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
527
+ dataCollectionId,
528
+ paging: options?.paging
529
+ });
530
+ const reqOpts = listIndexes(payload);
531
+ sideEffects?.onSiteCall?.();
532
+ try {
533
+ const result = await httpClient.request(reqOpts);
534
+ sideEffects?.onSuccess?.(result);
535
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
536
+ } catch (err) {
537
+ const transformedError = (0, import_transform_error.transformError)(
538
+ err,
539
+ {
540
+ spreadPathsToArguments: {},
541
+ explicitPathsToArguments: {
542
+ dataCollectionId: "$[0]",
543
+ paging: "$[1].paging"
544
+ },
545
+ singleArgumentUnchanged: false
546
+ },
547
+ ["dataCollectionId", "options"]
548
+ );
549
+ sideEffects?.onError?.(err);
550
+ throw transformedError;
551
+ }
552
+ }
553
+ async function listAvailableIndexes2(dataCollectionId) {
554
+ const { httpClient, sideEffects } = arguments[1];
555
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
556
+ dataCollectionId
557
+ });
558
+ const reqOpts = listAvailableIndexes(payload);
559
+ sideEffects?.onSiteCall?.();
560
+ try {
561
+ const result = await httpClient.request(reqOpts);
562
+ sideEffects?.onSuccess?.(result);
563
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
564
+ } catch (err) {
565
+ const transformedError = (0, import_transform_error.transformError)(
566
+ err,
567
+ {
568
+ spreadPathsToArguments: {},
569
+ explicitPathsToArguments: { dataCollectionId: "$[0]" },
570
+ singleArgumentUnchanged: false
571
+ },
572
+ ["dataCollectionId"]
573
+ );
574
+ sideEffects?.onError?.(err);
575
+ throw transformedError;
576
+ }
577
+ }
578
+ // Annotate the CommonJS export names for ESM import in node:
579
+ 0 && (module.exports = {
580
+ Environment,
581
+ IndexSource,
582
+ Order,
583
+ Status,
584
+ createIndex,
585
+ dropIndex,
586
+ listAvailableIndexes,
587
+ listIndexes
588
+ });
589
+ //# sourceMappingURL=index.typings.js.map