@wix/auto_sdk_bookings_resources 1.0.33 → 1.0.35

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 (29) hide show
  1. package/build/cjs/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.ts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.ts} +286 -2
  2. package/build/cjs/index.d.ts +28 -11
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +24 -0
  5. package/build/cjs/index.typings.js +812 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -1
  8. package/build/es/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.mts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.mts} +286 -2
  9. package/build/es/index.d.mts +28 -11
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/index.typings.d.mts +24 -0
  12. package/build/es/index.typings.mjs +768 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +1 -1
  15. package/build/internal/cjs/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.ts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.ts} +286 -2
  16. package/build/internal/cjs/index.d.ts +28 -11
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/index.typings.d.ts +24 -0
  19. package/build/internal/cjs/index.typings.js +812 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +1 -1
  22. package/build/internal/es/{bookings-resources-v2-resource-resources.universal-RnzqwcCV.d.mts → bookings-resources-v2-resource-resources.universal-BmmDoUqF.d.mts} +286 -2
  23. package/build/internal/es/index.d.mts +28 -11
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/index.typings.d.mts +24 -0
  26. package/build/internal/es/index.typings.mjs +768 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +1 -1
  29. package/package.json +2 -2
@@ -0,0 +1,812 @@
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
+ AggregationType: () => AggregationType,
24
+ Interval: () => Interval,
25
+ ManagementType: () => ManagementType,
26
+ MissingValues: () => MissingValues,
27
+ Mode: () => Mode,
28
+ NestedAggregationType: () => NestedAggregationType,
29
+ ScalarType: () => ScalarType,
30
+ SortDirection: () => SortDirection,
31
+ SortOrder: () => SortOrder,
32
+ SortType: () => SortType,
33
+ WebhookIdentityType: () => WebhookIdentityType,
34
+ bulkCreateResources: () => bulkCreateResources2,
35
+ bulkDeleteResources: () => bulkDeleteResources2,
36
+ bulkUpdateResources: () => bulkUpdateResources2,
37
+ countResources: () => countResources2,
38
+ createResource: () => createResource2,
39
+ deleteResource: () => deleteResource2,
40
+ getResource: () => getResource2,
41
+ queryResources: () => queryResources2,
42
+ searchResources: () => searchResources2,
43
+ updateResource: () => updateResource2
44
+ });
45
+ module.exports = __toCommonJS(index_typings_exports);
46
+
47
+ // src/bookings-resources-v2-resource-resources.universal.ts
48
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
49
+ var import_query_builder = require("@wix/sdk-runtime/query-builder");
50
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
51
+
52
+ // src/bookings-resources-v2-resource-resources.http.ts
53
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
54
+ var import_float = require("@wix/sdk-runtime/transformations/float");
55
+ var import_float2 = require("@wix/sdk-runtime/transformations/float");
56
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
57
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
58
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
59
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
60
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
61
+ function resolveWixBookingsResourcesV2ResourcesServiceUrl(opts) {
62
+ const domainToMappings = {
63
+ "manage._base_domain_": [
64
+ {
65
+ srcPath: "/bookings/v2/resources",
66
+ destPath: "/v2/resources"
67
+ },
68
+ {
69
+ srcPath: "/_api/bookings/v2/resources",
70
+ destPath: "/v2/resources"
71
+ },
72
+ {
73
+ srcPath: "/v2/bulk/resources",
74
+ destPath: "/v2/bulk/resources"
75
+ }
76
+ ],
77
+ "api._api_base_domain_": [
78
+ {
79
+ srcPath: "/resources-2",
80
+ destPath: ""
81
+ }
82
+ ],
83
+ "www.wixapis.com": [
84
+ {
85
+ srcPath: "/bookings/v2/resources",
86
+ destPath: "/v2/resources"
87
+ },
88
+ {
89
+ srcPath: "/bookings/v2/bulk/resources",
90
+ destPath: "/v2/bulk/resources"
91
+ }
92
+ ],
93
+ "*.dev.wix-code.com": [
94
+ {
95
+ srcPath: "/_api/resources-2",
96
+ destPath: ""
97
+ }
98
+ ]
99
+ };
100
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
101
+ }
102
+ var PACKAGE_NAME = "@wix/auto_sdk_bookings_resources";
103
+ function createResource(payload) {
104
+ function __createResource({ host }) {
105
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
106
+ {
107
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
108
+ paths: [
109
+ { path: "resource.createdDate" },
110
+ { path: "resource.updatedDate" }
111
+ ]
112
+ }
113
+ ]);
114
+ const metadata = {
115
+ entityFqdn: "wix.bookings.resources.v2.resource",
116
+ method: "POST",
117
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.CreateResource",
118
+ packageName: PACKAGE_NAME,
119
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
120
+ protoPath: "/v2/resources",
121
+ data: serializedData,
122
+ host
123
+ }),
124
+ data: serializedData,
125
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
126
+ {
127
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
128
+ paths: [
129
+ { path: "resource.createdDate" },
130
+ { path: "resource.updatedDate" }
131
+ ]
132
+ }
133
+ ])
134
+ };
135
+ return metadata;
136
+ }
137
+ return __createResource;
138
+ }
139
+ function bulkCreateResources(payload) {
140
+ function __bulkCreateResources({ host }) {
141
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
142
+ {
143
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
144
+ paths: [
145
+ { path: "resources.createdDate" },
146
+ { path: "resources.updatedDate" }
147
+ ]
148
+ }
149
+ ]);
150
+ const metadata = {
151
+ entityFqdn: "wix.bookings.resources.v2.resource",
152
+ method: "POST",
153
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.BulkCreateResources",
154
+ packageName: PACKAGE_NAME,
155
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
156
+ protoPath: "/v2/bulk/resources/create",
157
+ data: serializedData,
158
+ host
159
+ }),
160
+ data: serializedData,
161
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
162
+ {
163
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
164
+ paths: [
165
+ { path: "results.item.createdDate" },
166
+ { path: "results.item.updatedDate" }
167
+ ]
168
+ }
169
+ ])
170
+ };
171
+ return metadata;
172
+ }
173
+ return __bulkCreateResources;
174
+ }
175
+ function getResource(payload) {
176
+ function __getResource({ host }) {
177
+ const metadata = {
178
+ entityFqdn: "wix.bookings.resources.v2.resource",
179
+ method: "GET",
180
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.GetResource",
181
+ packageName: PACKAGE_NAME,
182
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
183
+ protoPath: "/v2/resources/{resourceId}",
184
+ data: payload,
185
+ host
186
+ }),
187
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
188
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
189
+ {
190
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
191
+ paths: [
192
+ { path: "resource.createdDate" },
193
+ { path: "resource.updatedDate" }
194
+ ]
195
+ }
196
+ ])
197
+ };
198
+ return metadata;
199
+ }
200
+ return __getResource;
201
+ }
202
+ function updateResource(payload) {
203
+ function __updateResource({ host }) {
204
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
205
+ {
206
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
207
+ paths: [{ path: "mask" }]
208
+ },
209
+ {
210
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
211
+ paths: [
212
+ { path: "resource.createdDate" },
213
+ { path: "resource.updatedDate" }
214
+ ]
215
+ }
216
+ ]);
217
+ const metadata = {
218
+ entityFqdn: "wix.bookings.resources.v2.resource",
219
+ method: "PATCH",
220
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.UpdateResource",
221
+ packageName: PACKAGE_NAME,
222
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
223
+ protoPath: "/v2/resources/{resource.id}",
224
+ data: serializedData,
225
+ host
226
+ }),
227
+ data: serializedData,
228
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
229
+ {
230
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
231
+ paths: [
232
+ { path: "resource.createdDate" },
233
+ { path: "resource.updatedDate" }
234
+ ]
235
+ }
236
+ ])
237
+ };
238
+ return metadata;
239
+ }
240
+ return __updateResource;
241
+ }
242
+ function bulkUpdateResources(payload) {
243
+ function __bulkUpdateResources({ host }) {
244
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
245
+ {
246
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
247
+ paths: [{ path: "resources.fieldMask" }]
248
+ },
249
+ {
250
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
251
+ paths: [
252
+ { path: "resources.resource.createdDate" },
253
+ { path: "resources.resource.updatedDate" }
254
+ ]
255
+ }
256
+ ]);
257
+ const metadata = {
258
+ entityFqdn: "wix.bookings.resources.v2.resource",
259
+ method: "POST",
260
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.BulkUpdateResources",
261
+ packageName: PACKAGE_NAME,
262
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
263
+ protoPath: "/v2/bulk/resources/update",
264
+ data: serializedData,
265
+ host
266
+ }),
267
+ data: serializedData,
268
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
269
+ {
270
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
271
+ paths: [
272
+ { path: "results.item.createdDate" },
273
+ { path: "results.item.updatedDate" }
274
+ ]
275
+ }
276
+ ])
277
+ };
278
+ return metadata;
279
+ }
280
+ return __bulkUpdateResources;
281
+ }
282
+ function deleteResource(payload) {
283
+ function __deleteResource({ host }) {
284
+ const metadata = {
285
+ entityFqdn: "wix.bookings.resources.v2.resource",
286
+ method: "DELETE",
287
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.DeleteResource",
288
+ packageName: PACKAGE_NAME,
289
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
290
+ protoPath: "/v2/resources/{resourceId}",
291
+ data: payload,
292
+ host
293
+ }),
294
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
295
+ };
296
+ return metadata;
297
+ }
298
+ return __deleteResource;
299
+ }
300
+ function bulkDeleteResources(payload) {
301
+ function __bulkDeleteResources({ host }) {
302
+ const metadata = {
303
+ entityFqdn: "wix.bookings.resources.v2.resource",
304
+ method: "POST",
305
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.BulkDeleteResources",
306
+ packageName: PACKAGE_NAME,
307
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
308
+ protoPath: "/v2/bulk/resources/delete",
309
+ data: payload,
310
+ host
311
+ }),
312
+ data: payload,
313
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
314
+ {
315
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
316
+ paths: [
317
+ { path: "results.item.createdDate" },
318
+ { path: "results.item.updatedDate" }
319
+ ]
320
+ }
321
+ ])
322
+ };
323
+ return metadata;
324
+ }
325
+ return __bulkDeleteResources;
326
+ }
327
+ function searchResources(payload) {
328
+ function __searchResources({ host }) {
329
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
330
+ {
331
+ transformFn: import_float.transformSDKFloatToRESTFloat,
332
+ paths: [
333
+ { path: "search.aggregations.range.buckets.from" },
334
+ { path: "search.aggregations.range.buckets.to" },
335
+ {
336
+ path: "search.aggregations.nested.nestedAggregations.range.buckets.from"
337
+ },
338
+ {
339
+ path: "search.aggregations.nested.nestedAggregations.range.buckets.to"
340
+ }
341
+ ]
342
+ }
343
+ ]);
344
+ const metadata = {
345
+ entityFqdn: "wix.bookings.resources.v2.resource",
346
+ method: "POST",
347
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.SearchResources",
348
+ packageName: PACKAGE_NAME,
349
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
350
+ protoPath: "/v2/resources/search",
351
+ data: serializedData,
352
+ host
353
+ }),
354
+ data: serializedData,
355
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
356
+ {
357
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
358
+ paths: [
359
+ { path: "resources.createdDate" },
360
+ { path: "resources.updatedDate" }
361
+ ]
362
+ },
363
+ {
364
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
365
+ paths: [
366
+ { path: "aggregationData.results.ranges.results.from" },
367
+ { path: "aggregationData.results.ranges.results.to" },
368
+ {
369
+ path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from"
370
+ },
371
+ {
372
+ path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to"
373
+ },
374
+ {
375
+ path: "aggregationData.results.nested.results.results.*.range.from"
376
+ },
377
+ {
378
+ path: "aggregationData.results.nested.results.results.*.range.to"
379
+ },
380
+ { path: "aggregationData.results.scalar.value" },
381
+ {
382
+ path: "aggregationData.results.groupedByValue.results.nestedResults.scalar.value"
383
+ },
384
+ {
385
+ path: "aggregationData.results.nested.results.results.*.scalar.value"
386
+ }
387
+ ]
388
+ }
389
+ ])
390
+ };
391
+ return metadata;
392
+ }
393
+ return __searchResources;
394
+ }
395
+ function queryResources(payload) {
396
+ function __queryResources({ host }) {
397
+ const metadata = {
398
+ entityFqdn: "wix.bookings.resources.v2.resource",
399
+ method: "POST",
400
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.QueryResources",
401
+ packageName: PACKAGE_NAME,
402
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
403
+ protoPath: "/v2/resources/query",
404
+ data: payload,
405
+ host
406
+ }),
407
+ data: payload,
408
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
409
+ {
410
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
411
+ paths: [
412
+ { path: "resources.createdDate" },
413
+ { path: "resources.updatedDate" }
414
+ ]
415
+ }
416
+ ])
417
+ };
418
+ return metadata;
419
+ }
420
+ return __queryResources;
421
+ }
422
+ function countResources(payload) {
423
+ function __countResources({ host }) {
424
+ const metadata = {
425
+ entityFqdn: "wix.bookings.resources.v2.resource",
426
+ method: "POST",
427
+ methodFqn: "wix.bookings.resources.v2.ResourcesService.CountResources",
428
+ packageName: PACKAGE_NAME,
429
+ url: resolveWixBookingsResourcesV2ResourcesServiceUrl({
430
+ protoPath: "/v2/resources/count",
431
+ data: payload,
432
+ host
433
+ }),
434
+ data: payload
435
+ };
436
+ return metadata;
437
+ }
438
+ return __countResources;
439
+ }
440
+
441
+ // src/bookings-resources-v2-resource-resources.universal.ts
442
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
443
+ var ManagementType = /* @__PURE__ */ ((ManagementType2) => {
444
+ ManagementType2["WIX_USER"] = "WIX_USER";
445
+ return ManagementType2;
446
+ })(ManagementType || {});
447
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
448
+ SortOrder2["ASC"] = "ASC";
449
+ SortOrder2["DESC"] = "DESC";
450
+ return SortOrder2;
451
+ })(SortOrder || {});
452
+ var SortType = /* @__PURE__ */ ((SortType2) => {
453
+ SortType2["COUNT"] = "COUNT";
454
+ SortType2["VALUE"] = "VALUE";
455
+ return SortType2;
456
+ })(SortType || {});
457
+ var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
458
+ SortDirection2["DESC"] = "DESC";
459
+ SortDirection2["ASC"] = "ASC";
460
+ return SortDirection2;
461
+ })(SortDirection || {});
462
+ var MissingValues = /* @__PURE__ */ ((MissingValues2) => {
463
+ MissingValues2["EXCLUDE"] = "EXCLUDE";
464
+ MissingValues2["INCLUDE"] = "INCLUDE";
465
+ return MissingValues2;
466
+ })(MissingValues || {});
467
+ var ScalarType = /* @__PURE__ */ ((ScalarType2) => {
468
+ ScalarType2["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
469
+ ScalarType2["COUNT_DISTINCT"] = "COUNT_DISTINCT";
470
+ ScalarType2["MIN"] = "MIN";
471
+ ScalarType2["MAX"] = "MAX";
472
+ return ScalarType2;
473
+ })(ScalarType || {});
474
+ var NestedAggregationType = /* @__PURE__ */ ((NestedAggregationType2) => {
475
+ NestedAggregationType2["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
476
+ NestedAggregationType2["VALUE"] = "VALUE";
477
+ NestedAggregationType2["RANGE"] = "RANGE";
478
+ NestedAggregationType2["SCALAR"] = "SCALAR";
479
+ NestedAggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
480
+ return NestedAggregationType2;
481
+ })(NestedAggregationType || {});
482
+ var Interval = /* @__PURE__ */ ((Interval2) => {
483
+ Interval2["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
484
+ Interval2["YEAR"] = "YEAR";
485
+ Interval2["MONTH"] = "MONTH";
486
+ Interval2["WEEK"] = "WEEK";
487
+ Interval2["DAY"] = "DAY";
488
+ Interval2["HOUR"] = "HOUR";
489
+ Interval2["MINUTE"] = "MINUTE";
490
+ Interval2["SECOND"] = "SECOND";
491
+ return Interval2;
492
+ })(Interval || {});
493
+ var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
494
+ AggregationType2["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
495
+ AggregationType2["VALUE"] = "VALUE";
496
+ AggregationType2["RANGE"] = "RANGE";
497
+ AggregationType2["SCALAR"] = "SCALAR";
498
+ AggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
499
+ AggregationType2["NESTED"] = "NESTED";
500
+ return AggregationType2;
501
+ })(AggregationType || {});
502
+ var Mode = /* @__PURE__ */ ((Mode2) => {
503
+ Mode2["OR"] = "OR";
504
+ Mode2["AND"] = "AND";
505
+ return Mode2;
506
+ })(Mode || {});
507
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
508
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
509
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
510
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
511
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
512
+ WebhookIdentityType2["APP"] = "APP";
513
+ return WebhookIdentityType2;
514
+ })(WebhookIdentityType || {});
515
+ async function createResource2(resource) {
516
+ const { httpClient, sideEffects } = arguments[1];
517
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ resource });
518
+ const reqOpts = createResource(payload);
519
+ sideEffects?.onSiteCall?.();
520
+ try {
521
+ const result = await httpClient.request(reqOpts);
522
+ sideEffects?.onSuccess?.(result);
523
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.resource;
524
+ } catch (err) {
525
+ const transformedError = (0, import_transform_error.transformError)(
526
+ err,
527
+ {
528
+ spreadPathsToArguments: {},
529
+ explicitPathsToArguments: { resource: "$[0]" },
530
+ singleArgumentUnchanged: false
531
+ },
532
+ ["resource"]
533
+ );
534
+ sideEffects?.onError?.(err);
535
+ throw transformedError;
536
+ }
537
+ }
538
+ async function bulkCreateResources2(resources, options) {
539
+ const { httpClient, sideEffects } = arguments[2];
540
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
541
+ resources,
542
+ returnEntity: options?.returnEntity
543
+ });
544
+ const reqOpts = bulkCreateResources(payload);
545
+ sideEffects?.onSiteCall?.();
546
+ try {
547
+ const result = await httpClient.request(reqOpts);
548
+ sideEffects?.onSuccess?.(result);
549
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
550
+ } catch (err) {
551
+ const transformedError = (0, import_transform_error.transformError)(
552
+ err,
553
+ {
554
+ spreadPathsToArguments: {},
555
+ explicitPathsToArguments: {
556
+ resources: "$[0]",
557
+ returnEntity: "$[1].returnEntity"
558
+ },
559
+ singleArgumentUnchanged: false
560
+ },
561
+ ["resources", "options"]
562
+ );
563
+ sideEffects?.onError?.(err);
564
+ throw transformedError;
565
+ }
566
+ }
567
+ async function getResource2(resourceId) {
568
+ const { httpClient, sideEffects } = arguments[1];
569
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
570
+ resourceId
571
+ });
572
+ const reqOpts = getResource(payload);
573
+ sideEffects?.onSiteCall?.();
574
+ try {
575
+ const result = await httpClient.request(reqOpts);
576
+ sideEffects?.onSuccess?.(result);
577
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.resource;
578
+ } catch (err) {
579
+ const transformedError = (0, import_transform_error.transformError)(
580
+ err,
581
+ {
582
+ spreadPathsToArguments: {},
583
+ explicitPathsToArguments: { resourceId: "$[0]" },
584
+ singleArgumentUnchanged: false
585
+ },
586
+ ["resourceId"]
587
+ );
588
+ sideEffects?.onError?.(err);
589
+ throw transformedError;
590
+ }
591
+ }
592
+ async function updateResource2(_id, resource) {
593
+ const { httpClient, sideEffects } = arguments[2];
594
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
595
+ resource: { ...resource, id: _id }
596
+ });
597
+ const reqOpts = updateResource(payload);
598
+ sideEffects?.onSiteCall?.();
599
+ try {
600
+ const result = await httpClient.request(reqOpts);
601
+ sideEffects?.onSuccess?.(result);
602
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.resource;
603
+ } catch (err) {
604
+ const transformedError = (0, import_transform_error.transformError)(
605
+ err,
606
+ {
607
+ spreadPathsToArguments: { resource: "$[1]" },
608
+ explicitPathsToArguments: { "resource.id": "$[0]" },
609
+ singleArgumentUnchanged: false
610
+ },
611
+ ["_id", "resource"]
612
+ );
613
+ sideEffects?.onError?.(err);
614
+ throw transformedError;
615
+ }
616
+ }
617
+ async function bulkUpdateResources2(resources, options) {
618
+ const { httpClient, sideEffects } = arguments[2];
619
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
620
+ resources,
621
+ returnEntity: options?.returnEntity
622
+ });
623
+ const reqOpts = bulkUpdateResources(payload);
624
+ sideEffects?.onSiteCall?.();
625
+ try {
626
+ const result = await httpClient.request(reqOpts);
627
+ sideEffects?.onSuccess?.(result);
628
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
629
+ } catch (err) {
630
+ const transformedError = (0, import_transform_error.transformError)(
631
+ err,
632
+ {
633
+ spreadPathsToArguments: {},
634
+ explicitPathsToArguments: {
635
+ resources: "$[0]",
636
+ returnEntity: "$[1].returnEntity"
637
+ },
638
+ singleArgumentUnchanged: false
639
+ },
640
+ ["resources", "options"]
641
+ );
642
+ sideEffects?.onError?.(err);
643
+ throw transformedError;
644
+ }
645
+ }
646
+ async function deleteResource2(resourceId) {
647
+ const { httpClient, sideEffects } = arguments[1];
648
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
649
+ resourceId
650
+ });
651
+ const reqOpts = deleteResource(payload);
652
+ sideEffects?.onSiteCall?.();
653
+ try {
654
+ const result = await httpClient.request(reqOpts);
655
+ sideEffects?.onSuccess?.(result);
656
+ } catch (err) {
657
+ const transformedError = (0, import_transform_error.transformError)(
658
+ err,
659
+ {
660
+ spreadPathsToArguments: {},
661
+ explicitPathsToArguments: { resourceId: "$[0]" },
662
+ singleArgumentUnchanged: false
663
+ },
664
+ ["resourceId"]
665
+ );
666
+ sideEffects?.onError?.(err);
667
+ throw transformedError;
668
+ }
669
+ }
670
+ async function bulkDeleteResources2(ids) {
671
+ const { httpClient, sideEffects } = arguments[1];
672
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
673
+ const reqOpts = bulkDeleteResources(payload);
674
+ sideEffects?.onSiteCall?.();
675
+ try {
676
+ const result = await httpClient.request(reqOpts);
677
+ sideEffects?.onSuccess?.(result);
678
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
679
+ } catch (err) {
680
+ const transformedError = (0, import_transform_error.transformError)(
681
+ err,
682
+ {
683
+ spreadPathsToArguments: {},
684
+ explicitPathsToArguments: { ids: "$[0]" },
685
+ singleArgumentUnchanged: false
686
+ },
687
+ ["ids"]
688
+ );
689
+ sideEffects?.onError?.(err);
690
+ throw transformedError;
691
+ }
692
+ }
693
+ async function searchResources2(search) {
694
+ const { httpClient, sideEffects } = arguments[1];
695
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ search });
696
+ const reqOpts = searchResources(payload);
697
+ sideEffects?.onSiteCall?.();
698
+ try {
699
+ const result = await httpClient.request(reqOpts);
700
+ sideEffects?.onSuccess?.(result);
701
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
702
+ } catch (err) {
703
+ const transformedError = (0, import_transform_error.transformError)(
704
+ err,
705
+ {
706
+ spreadPathsToArguments: {},
707
+ explicitPathsToArguments: { search: "$[0]" },
708
+ singleArgumentUnchanged: false
709
+ },
710
+ ["search"]
711
+ );
712
+ sideEffects?.onError?.(err);
713
+ throw transformedError;
714
+ }
715
+ }
716
+ function queryResources2() {
717
+ const { httpClient, sideEffects } = arguments[0];
718
+ return (0, import_query_builder.queryBuilder)({
719
+ func: async (payload) => {
720
+ const reqOpts = queryResources(payload);
721
+ sideEffects?.onSiteCall?.();
722
+ try {
723
+ const result = await httpClient.request(reqOpts);
724
+ sideEffects?.onSuccess?.(result);
725
+ return result;
726
+ } catch (err) {
727
+ sideEffects?.onError?.(err);
728
+ throw err;
729
+ }
730
+ },
731
+ requestTransformer: (query) => {
732
+ const args = [query, {}];
733
+ return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
734
+ ...args?.[1],
735
+ query: args?.[0]
736
+ });
737
+ },
738
+ responseTransformer: ({ data }) => {
739
+ const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
740
+ (0, import_transform_paths2.transformPaths)(data, [])
741
+ );
742
+ return {
743
+ items: transformedData?.resources,
744
+ pagingMetadata: transformedData?.pagingMetadata
745
+ };
746
+ },
747
+ errorTransformer: (err) => {
748
+ const transformedError = (0, import_transform_error.transformError)(err, {
749
+ spreadPathsToArguments: {},
750
+ explicitPathsToArguments: { query: "$[0]" },
751
+ singleArgumentUnchanged: false
752
+ });
753
+ throw transformedError;
754
+ },
755
+ pagingMethod: "CURSOR",
756
+ transformationPaths: {}
757
+ });
758
+ }
759
+ async function countResources2(options) {
760
+ const { httpClient, sideEffects } = arguments[1];
761
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
762
+ filter: options?.filter,
763
+ search: options?.search
764
+ });
765
+ const reqOpts = countResources(payload);
766
+ sideEffects?.onSiteCall?.();
767
+ try {
768
+ const result = await httpClient.request(reqOpts);
769
+ sideEffects?.onSuccess?.(result);
770
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
771
+ } catch (err) {
772
+ const transformedError = (0, import_transform_error.transformError)(
773
+ err,
774
+ {
775
+ spreadPathsToArguments: {},
776
+ explicitPathsToArguments: {
777
+ filter: "$[0].filter",
778
+ search: "$[0].search"
779
+ },
780
+ singleArgumentUnchanged: false
781
+ },
782
+ ["options"]
783
+ );
784
+ sideEffects?.onError?.(err);
785
+ throw transformedError;
786
+ }
787
+ }
788
+ // Annotate the CommonJS export names for ESM import in node:
789
+ 0 && (module.exports = {
790
+ AggregationType,
791
+ Interval,
792
+ ManagementType,
793
+ MissingValues,
794
+ Mode,
795
+ NestedAggregationType,
796
+ ScalarType,
797
+ SortDirection,
798
+ SortOrder,
799
+ SortType,
800
+ WebhookIdentityType,
801
+ bulkCreateResources,
802
+ bulkDeleteResources,
803
+ bulkUpdateResources,
804
+ countResources,
805
+ createResource,
806
+ deleteResource,
807
+ getResource,
808
+ queryResources,
809
+ searchResources,
810
+ updateResource
811
+ });
812
+ //# sourceMappingURL=index.typings.js.map