@wix/auto_sdk_fast-gallery_galleries 1.0.0 → 1.0.2

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.
@@ -0,0 +1,891 @@
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
+ SortOrder: () => SortOrder,
24
+ Variant: () => Variant,
25
+ WebhookIdentityType: () => WebhookIdentityType,
26
+ bulkCreateGalleries: () => bulkCreateGalleries2,
27
+ bulkDeleteGalleries: () => bulkDeleteGalleries2,
28
+ bulkUpdateGalleries: () => bulkUpdateGalleries2,
29
+ createGallery: () => createGallery2,
30
+ getDeletedGallery: () => getDeletedGallery2,
31
+ getGallery: () => getGallery2,
32
+ getGalleryByDraftGalleryId: () => getGalleryByDraftGalleryId2,
33
+ listDeletedGalleries: () => listDeletedGalleries2,
34
+ queryGalleries: () => queryGalleries2,
35
+ removeGalleryFromTrashBin: () => removeGalleryFromTrashBin2,
36
+ restoreGalleryFromTrashBin: () => restoreGalleryFromTrashBin2,
37
+ updateExtendedFields: () => updateExtendedFields2,
38
+ updateGallery: () => updateGallery2
39
+ });
40
+ module.exports = __toCommonJS(index_typings_exports);
41
+
42
+ // src/fastgallery-gallery-v1-gallery-galleries.universal.ts
43
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
44
+ var import_query_builder = require("@wix/sdk-runtime/query-builder");
45
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
46
+
47
+ // src/fastgallery-gallery-v1-gallery-galleries.http.ts
48
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
49
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
50
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
51
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
52
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
53
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
54
+ function resolveWixFastgalleryGalleryV1GalleryServiceUrl(opts) {
55
+ const domainToMappings = {
56
+ "editor._base_domain_": [
57
+ {
58
+ srcPath: "/_api/gallery",
59
+ destPath: ""
60
+ }
61
+ ],
62
+ "blocks._base_domain_": [
63
+ {
64
+ srcPath: "/_api/gallery",
65
+ destPath: ""
66
+ }
67
+ ],
68
+ "create.editorx": [
69
+ {
70
+ srcPath: "/_api/gallery",
71
+ destPath: ""
72
+ }
73
+ ],
74
+ _: [
75
+ {
76
+ srcPath: "/_api/gallery",
77
+ destPath: ""
78
+ }
79
+ ],
80
+ "*.dev.wix-code.com": [
81
+ {
82
+ srcPath: "/_api/gallery",
83
+ destPath: ""
84
+ }
85
+ ],
86
+ "www.wixapis.com": [
87
+ {
88
+ srcPath: "/fastgallery/gallery/v1/bulk/galleries",
89
+ destPath: "/v1/bulk/galleries"
90
+ },
91
+ {
92
+ srcPath: "/fastgallery/gallery/v1/galleries",
93
+ destPath: "/v1/galleries"
94
+ }
95
+ ]
96
+ };
97
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
98
+ }
99
+ var PACKAGE_NAME = "@wix/auto_sdk_fast-gallery_galleries";
100
+ function createGallery(payload) {
101
+ function __createGallery({ host }) {
102
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
103
+ {
104
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
105
+ paths: [
106
+ { path: "gallery.createdDate" },
107
+ { path: "gallery.updatedDate" }
108
+ ]
109
+ }
110
+ ]);
111
+ const metadata = {
112
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
113
+ method: "POST",
114
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.CreateGallery",
115
+ packageName: PACKAGE_NAME,
116
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
117
+ protoPath: "/v1/galleries",
118
+ data: serializedData,
119
+ host
120
+ }),
121
+ data: serializedData,
122
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
123
+ {
124
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
125
+ paths: [
126
+ { path: "gallery.createdDate" },
127
+ { path: "gallery.updatedDate" }
128
+ ]
129
+ }
130
+ ])
131
+ };
132
+ return metadata;
133
+ }
134
+ return __createGallery;
135
+ }
136
+ function getGallery(payload) {
137
+ function __getGallery({ host }) {
138
+ const metadata = {
139
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
140
+ method: "GET",
141
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.GetGallery",
142
+ packageName: PACKAGE_NAME,
143
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
144
+ protoPath: "/v1/galleries/{galleryId}",
145
+ data: payload,
146
+ host
147
+ }),
148
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
149
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
150
+ {
151
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
152
+ paths: [
153
+ { path: "gallery.createdDate" },
154
+ { path: "gallery.updatedDate" }
155
+ ]
156
+ }
157
+ ])
158
+ };
159
+ return metadata;
160
+ }
161
+ return __getGallery;
162
+ }
163
+ function getGalleryByDraftGalleryId(payload) {
164
+ function __getGalleryByDraftGalleryId({ host }) {
165
+ const metadata = {
166
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
167
+ method: "GET",
168
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.GetGalleryByDraftGalleryId",
169
+ packageName: PACKAGE_NAME,
170
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
171
+ protoPath: "/v1/galleries/draft-gallery-id/{draftGalleryId}",
172
+ data: payload,
173
+ host
174
+ }),
175
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
176
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
177
+ {
178
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
179
+ paths: [
180
+ { path: "gallery.createdDate" },
181
+ { path: "gallery.updatedDate" }
182
+ ]
183
+ }
184
+ ])
185
+ };
186
+ return metadata;
187
+ }
188
+ return __getGalleryByDraftGalleryId;
189
+ }
190
+ function updateGallery(payload) {
191
+ function __updateGallery({ host }) {
192
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
193
+ {
194
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
195
+ paths: [{ path: "fieldMask" }]
196
+ },
197
+ {
198
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
199
+ paths: [
200
+ { path: "gallery.createdDate" },
201
+ { path: "gallery.updatedDate" }
202
+ ]
203
+ }
204
+ ]);
205
+ const metadata = {
206
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
207
+ method: "PATCH",
208
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.UpdateGallery",
209
+ packageName: PACKAGE_NAME,
210
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
211
+ protoPath: "/v1/galleries/{gallery.id}",
212
+ data: serializedData,
213
+ host
214
+ }),
215
+ data: serializedData,
216
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
217
+ {
218
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
219
+ paths: [
220
+ { path: "gallery.createdDate" },
221
+ { path: "gallery.updatedDate" }
222
+ ]
223
+ }
224
+ ])
225
+ };
226
+ return metadata;
227
+ }
228
+ return __updateGallery;
229
+ }
230
+ function queryGalleries(payload) {
231
+ function __queryGalleries({ host }) {
232
+ const metadata = {
233
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
234
+ method: "POST",
235
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.QueryGalleries",
236
+ packageName: PACKAGE_NAME,
237
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
238
+ protoPath: "/v1/galleries/query",
239
+ data: payload,
240
+ host
241
+ }),
242
+ data: payload,
243
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
244
+ {
245
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
246
+ paths: [
247
+ { path: "galleries.createdDate" },
248
+ { path: "galleries.updatedDate" }
249
+ ]
250
+ }
251
+ ]),
252
+ fallback: [
253
+ {
254
+ method: "POST",
255
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
256
+ protoPath: "/v1/galleries/query",
257
+ data: payload,
258
+ host
259
+ }),
260
+ data: payload
261
+ }
262
+ ]
263
+ };
264
+ return metadata;
265
+ }
266
+ return __queryGalleries;
267
+ }
268
+ function updateExtendedFields(payload) {
269
+ function __updateExtendedFields({ host }) {
270
+ const metadata = {
271
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
272
+ method: "POST",
273
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.UpdateExtendedFields",
274
+ packageName: PACKAGE_NAME,
275
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
276
+ protoPath: "/v1/galleries/{id}/update-extended-fields",
277
+ data: payload,
278
+ host
279
+ }),
280
+ data: payload,
281
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
282
+ {
283
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
284
+ paths: [
285
+ { path: "gallery.createdDate" },
286
+ { path: "gallery.updatedDate" }
287
+ ]
288
+ }
289
+ ])
290
+ };
291
+ return metadata;
292
+ }
293
+ return __updateExtendedFields;
294
+ }
295
+ function bulkCreateGalleries(payload) {
296
+ function __bulkCreateGalleries({ host }) {
297
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
298
+ {
299
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
300
+ paths: [
301
+ { path: "galleries.createdDate" },
302
+ { path: "galleries.updatedDate" }
303
+ ]
304
+ }
305
+ ]);
306
+ const metadata = {
307
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
308
+ method: "POST",
309
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.BulkCreateGalleries",
310
+ packageName: PACKAGE_NAME,
311
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
312
+ protoPath: "/v1/bulk/galleries/create",
313
+ data: serializedData,
314
+ host
315
+ }),
316
+ data: serializedData,
317
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
318
+ {
319
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
320
+ paths: [
321
+ { path: "results.item.createdDate" },
322
+ { path: "results.item.updatedDate" }
323
+ ]
324
+ }
325
+ ])
326
+ };
327
+ return metadata;
328
+ }
329
+ return __bulkCreateGalleries;
330
+ }
331
+ function bulkUpdateGalleries(payload) {
332
+ function __bulkUpdateGalleries({ host }) {
333
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
334
+ {
335
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
336
+ paths: [{ path: "galleries.fieldMask" }]
337
+ },
338
+ {
339
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
340
+ paths: [
341
+ { path: "galleries.gallery.createdDate" },
342
+ { path: "galleries.gallery.updatedDate" }
343
+ ]
344
+ }
345
+ ]);
346
+ const metadata = {
347
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
348
+ method: "POST",
349
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.BulkUpdateGalleries",
350
+ packageName: PACKAGE_NAME,
351
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
352
+ protoPath: "/v1/bulk/galleries/update",
353
+ data: serializedData,
354
+ host
355
+ }),
356
+ data: serializedData,
357
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
358
+ {
359
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
360
+ paths: [
361
+ { path: "results.item.createdDate" },
362
+ { path: "results.item.updatedDate" }
363
+ ]
364
+ }
365
+ ])
366
+ };
367
+ return metadata;
368
+ }
369
+ return __bulkUpdateGalleries;
370
+ }
371
+ function bulkDeleteGalleries(payload) {
372
+ function __bulkDeleteGalleries({ host }) {
373
+ const metadata = {
374
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
375
+ method: "POST",
376
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.BulkDeleteGalleries",
377
+ packageName: PACKAGE_NAME,
378
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
379
+ protoPath: "/v1/bulk/galleries/delete",
380
+ data: payload,
381
+ host
382
+ }),
383
+ data: payload
384
+ };
385
+ return metadata;
386
+ }
387
+ return __bulkDeleteGalleries;
388
+ }
389
+ function getDeletedGallery(payload) {
390
+ function __getDeletedGallery({ host }) {
391
+ const metadata = {
392
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
393
+ method: "GET",
394
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.GetDeletedGallery",
395
+ packageName: PACKAGE_NAME,
396
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
397
+ protoPath: "/v1/galleries/trash-bin/{galleryId}",
398
+ data: payload,
399
+ host
400
+ }),
401
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
402
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
403
+ {
404
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
405
+ paths: [
406
+ { path: "gallery.createdDate" },
407
+ { path: "gallery.updatedDate" }
408
+ ]
409
+ }
410
+ ])
411
+ };
412
+ return metadata;
413
+ }
414
+ return __getDeletedGallery;
415
+ }
416
+ function listDeletedGalleries(payload) {
417
+ function __listDeletedGalleries({ host }) {
418
+ const metadata = {
419
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
420
+ method: "GET",
421
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.ListDeletedGalleries",
422
+ packageName: PACKAGE_NAME,
423
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
424
+ protoPath: "/v1/galleries/trash-bin",
425
+ data: payload,
426
+ host
427
+ }),
428
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
429
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
430
+ {
431
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
432
+ paths: [
433
+ { path: "galleries.createdDate" },
434
+ { path: "galleries.updatedDate" }
435
+ ]
436
+ }
437
+ ])
438
+ };
439
+ return metadata;
440
+ }
441
+ return __listDeletedGalleries;
442
+ }
443
+ function restoreGalleryFromTrashBin(payload) {
444
+ function __restoreGalleryFromTrashBin({ host }) {
445
+ const metadata = {
446
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
447
+ method: "POST",
448
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.RestoreGalleryFromTrashBin",
449
+ packageName: PACKAGE_NAME,
450
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
451
+ protoPath: "/v1/galleries/trash-bin/{galleryId}/restore",
452
+ data: payload,
453
+ host
454
+ }),
455
+ data: payload,
456
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
457
+ {
458
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
459
+ paths: [
460
+ { path: "gallery.createdDate" },
461
+ { path: "gallery.updatedDate" }
462
+ ]
463
+ }
464
+ ])
465
+ };
466
+ return metadata;
467
+ }
468
+ return __restoreGalleryFromTrashBin;
469
+ }
470
+ function removeGalleryFromTrashBin(payload) {
471
+ function __removeGalleryFromTrashBin({ host }) {
472
+ const metadata = {
473
+ entityFqdn: "wix.fastgallery.gallery.v1.gallery",
474
+ method: "DELETE",
475
+ methodFqn: "wix.fastgallery.gallery.v1.GalleryService.RemoveGalleryFromTrashBin",
476
+ packageName: PACKAGE_NAME,
477
+ url: resolveWixFastgalleryGalleryV1GalleryServiceUrl({
478
+ protoPath: "/v1/galleries/trash-bin/{galleryId}",
479
+ data: payload,
480
+ host
481
+ }),
482
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
483
+ };
484
+ return metadata;
485
+ }
486
+ return __removeGalleryFromTrashBin;
487
+ }
488
+
489
+ // src/fastgallery-gallery-v1-gallery-galleries.universal.ts
490
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
491
+ var Variant = /* @__PURE__ */ ((Variant2) => {
492
+ Variant2["UNKNOWN_VARIANT"] = "UNKNOWN_VARIANT";
493
+ Variant2["LIVE"] = "LIVE";
494
+ Variant2["RC"] = "RC";
495
+ return Variant2;
496
+ })(Variant || {});
497
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
498
+ SortOrder2["ASC"] = "ASC";
499
+ SortOrder2["DESC"] = "DESC";
500
+ return SortOrder2;
501
+ })(SortOrder || {});
502
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
503
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
504
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
505
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
506
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
507
+ WebhookIdentityType2["APP"] = "APP";
508
+ return WebhookIdentityType2;
509
+ })(WebhookIdentityType || {});
510
+ async function createGallery2(gallery) {
511
+ const { httpClient, sideEffects } = arguments[1];
512
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ gallery });
513
+ const reqOpts = createGallery(payload);
514
+ sideEffects?.onSiteCall?.();
515
+ try {
516
+ const result = await httpClient.request(reqOpts);
517
+ sideEffects?.onSuccess?.(result);
518
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.gallery;
519
+ } catch (err) {
520
+ const transformedError = (0, import_transform_error.transformError)(
521
+ err,
522
+ {
523
+ spreadPathsToArguments: {},
524
+ explicitPathsToArguments: { gallery: "$[0]" },
525
+ singleArgumentUnchanged: false
526
+ },
527
+ ["gallery"]
528
+ );
529
+ sideEffects?.onError?.(err);
530
+ throw transformedError;
531
+ }
532
+ }
533
+ async function getGallery2(galleryId) {
534
+ const { httpClient, sideEffects } = arguments[1];
535
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
536
+ galleryId
537
+ });
538
+ const reqOpts = getGallery(payload);
539
+ sideEffects?.onSiteCall?.();
540
+ try {
541
+ const result = await httpClient.request(reqOpts);
542
+ sideEffects?.onSuccess?.(result);
543
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.gallery;
544
+ } catch (err) {
545
+ const transformedError = (0, import_transform_error.transformError)(
546
+ err,
547
+ {
548
+ spreadPathsToArguments: {},
549
+ explicitPathsToArguments: { galleryId: "$[0]" },
550
+ singleArgumentUnchanged: false
551
+ },
552
+ ["galleryId"]
553
+ );
554
+ sideEffects?.onError?.(err);
555
+ throw transformedError;
556
+ }
557
+ }
558
+ async function getGalleryByDraftGalleryId2(draftGalleryId) {
559
+ const { httpClient, sideEffects } = arguments[1];
560
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
561
+ draftGalleryId
562
+ });
563
+ const reqOpts = getGalleryByDraftGalleryId(
564
+ payload
565
+ );
566
+ sideEffects?.onSiteCall?.();
567
+ try {
568
+ const result = await httpClient.request(reqOpts);
569
+ sideEffects?.onSuccess?.(result);
570
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
571
+ } catch (err) {
572
+ const transformedError = (0, import_transform_error.transformError)(
573
+ err,
574
+ {
575
+ spreadPathsToArguments: {},
576
+ explicitPathsToArguments: { draftGalleryId: "$[0]" },
577
+ singleArgumentUnchanged: false
578
+ },
579
+ ["draftGalleryId"]
580
+ );
581
+ sideEffects?.onError?.(err);
582
+ throw transformedError;
583
+ }
584
+ }
585
+ async function updateGallery2(_id, gallery) {
586
+ const { httpClient, sideEffects } = arguments[2];
587
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
588
+ gallery: { ...gallery, id: _id }
589
+ });
590
+ const reqOpts = updateGallery(payload);
591
+ sideEffects?.onSiteCall?.();
592
+ try {
593
+ const result = await httpClient.request(reqOpts);
594
+ sideEffects?.onSuccess?.(result);
595
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.gallery;
596
+ } catch (err) {
597
+ const transformedError = (0, import_transform_error.transformError)(
598
+ err,
599
+ {
600
+ spreadPathsToArguments: { gallery: "$[1]" },
601
+ explicitPathsToArguments: { "gallery.id": "$[0]" },
602
+ singleArgumentUnchanged: false
603
+ },
604
+ ["_id", "gallery"]
605
+ );
606
+ sideEffects?.onError?.(err);
607
+ throw transformedError;
608
+ }
609
+ }
610
+ function queryGalleries2() {
611
+ const { httpClient, sideEffects } = arguments[0];
612
+ return (0, import_query_builder.queryBuilder)({
613
+ func: async (payload) => {
614
+ const reqOpts = queryGalleries(payload);
615
+ sideEffects?.onSiteCall?.();
616
+ try {
617
+ const result = await httpClient.request(reqOpts);
618
+ sideEffects?.onSuccess?.(result);
619
+ return result;
620
+ } catch (err) {
621
+ sideEffects?.onError?.(err);
622
+ throw err;
623
+ }
624
+ },
625
+ requestTransformer: (query) => {
626
+ const args = [query, {}];
627
+ return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
628
+ ...args?.[1],
629
+ query: args?.[0]
630
+ });
631
+ },
632
+ responseTransformer: ({ data }) => {
633
+ const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
634
+ (0, import_transform_paths2.transformPaths)(data, [])
635
+ );
636
+ return {
637
+ items: transformedData?.galleries,
638
+ pagingMetadata: transformedData?.pagingMetadata
639
+ };
640
+ },
641
+ errorTransformer: (err) => {
642
+ const transformedError = (0, import_transform_error.transformError)(err, {
643
+ spreadPathsToArguments: {},
644
+ explicitPathsToArguments: { query: "$[0]" },
645
+ singleArgumentUnchanged: false
646
+ });
647
+ throw transformedError;
648
+ },
649
+ pagingMethod: "CURSOR",
650
+ transformationPaths: {}
651
+ });
652
+ }
653
+ async function updateExtendedFields2(_id, namespace, options) {
654
+ const { httpClient, sideEffects } = arguments[3];
655
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
656
+ id: _id,
657
+ namespace,
658
+ namespaceData: options?.namespaceData
659
+ });
660
+ const reqOpts = updateExtendedFields(payload);
661
+ sideEffects?.onSiteCall?.();
662
+ try {
663
+ const result = await httpClient.request(reqOpts);
664
+ sideEffects?.onSuccess?.(result);
665
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
666
+ } catch (err) {
667
+ const transformedError = (0, import_transform_error.transformError)(
668
+ err,
669
+ {
670
+ spreadPathsToArguments: {},
671
+ explicitPathsToArguments: {
672
+ id: "$[0]",
673
+ namespace: "$[1]",
674
+ namespaceData: "$[2].namespaceData"
675
+ },
676
+ singleArgumentUnchanged: false
677
+ },
678
+ ["_id", "namespace", "options"]
679
+ );
680
+ sideEffects?.onError?.(err);
681
+ throw transformedError;
682
+ }
683
+ }
684
+ async function bulkCreateGalleries2(galleries, options) {
685
+ const { httpClient, sideEffects } = arguments[2];
686
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
687
+ galleries,
688
+ returnEntity: options?.returnEntity
689
+ });
690
+ const reqOpts = bulkCreateGalleries(payload);
691
+ sideEffects?.onSiteCall?.();
692
+ try {
693
+ const result = await httpClient.request(reqOpts);
694
+ sideEffects?.onSuccess?.(result);
695
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
696
+ } catch (err) {
697
+ const transformedError = (0, import_transform_error.transformError)(
698
+ err,
699
+ {
700
+ spreadPathsToArguments: {},
701
+ explicitPathsToArguments: {
702
+ galleries: "$[0]",
703
+ returnEntity: "$[1].returnEntity"
704
+ },
705
+ singleArgumentUnchanged: false
706
+ },
707
+ ["galleries", "options"]
708
+ );
709
+ sideEffects?.onError?.(err);
710
+ throw transformedError;
711
+ }
712
+ }
713
+ async function bulkUpdateGalleries2(galleries, options) {
714
+ const { httpClient, sideEffects } = arguments[2];
715
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
716
+ galleries,
717
+ returnEntity: options?.returnEntity
718
+ });
719
+ const reqOpts = bulkUpdateGalleries(payload);
720
+ sideEffects?.onSiteCall?.();
721
+ try {
722
+ const result = await httpClient.request(reqOpts);
723
+ sideEffects?.onSuccess?.(result);
724
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
725
+ } catch (err) {
726
+ const transformedError = (0, import_transform_error.transformError)(
727
+ err,
728
+ {
729
+ spreadPathsToArguments: {},
730
+ explicitPathsToArguments: {
731
+ galleries: "$[0]",
732
+ returnEntity: "$[1].returnEntity"
733
+ },
734
+ singleArgumentUnchanged: false
735
+ },
736
+ ["galleries", "options"]
737
+ );
738
+ sideEffects?.onError?.(err);
739
+ throw transformedError;
740
+ }
741
+ }
742
+ async function bulkDeleteGalleries2(galleryIds) {
743
+ const { httpClient, sideEffects } = arguments[1];
744
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
745
+ galleryIds
746
+ });
747
+ const reqOpts = bulkDeleteGalleries(payload);
748
+ sideEffects?.onSiteCall?.();
749
+ try {
750
+ const result = await httpClient.request(reqOpts);
751
+ sideEffects?.onSuccess?.(result);
752
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
753
+ } catch (err) {
754
+ const transformedError = (0, import_transform_error.transformError)(
755
+ err,
756
+ {
757
+ spreadPathsToArguments: {},
758
+ explicitPathsToArguments: { galleryIds: "$[0]" },
759
+ singleArgumentUnchanged: false
760
+ },
761
+ ["galleryIds"]
762
+ );
763
+ sideEffects?.onError?.(err);
764
+ throw transformedError;
765
+ }
766
+ }
767
+ async function getDeletedGallery2(galleryId) {
768
+ const { httpClient, sideEffects } = arguments[1];
769
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
770
+ galleryId
771
+ });
772
+ const reqOpts = getDeletedGallery(payload);
773
+ sideEffects?.onSiteCall?.();
774
+ try {
775
+ const result = await httpClient.request(reqOpts);
776
+ sideEffects?.onSuccess?.(result);
777
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
778
+ } catch (err) {
779
+ const transformedError = (0, import_transform_error.transformError)(
780
+ err,
781
+ {
782
+ spreadPathsToArguments: {},
783
+ explicitPathsToArguments: { galleryId: "$[0]" },
784
+ singleArgumentUnchanged: false
785
+ },
786
+ ["galleryId"]
787
+ );
788
+ sideEffects?.onError?.(err);
789
+ throw transformedError;
790
+ }
791
+ }
792
+ async function listDeletedGalleries2(options) {
793
+ const { httpClient, sideEffects } = arguments[1];
794
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
795
+ cursorPaging: options?.cursorPaging,
796
+ galleryIds: options?.galleryIds
797
+ });
798
+ const reqOpts = listDeletedGalleries(payload);
799
+ sideEffects?.onSiteCall?.();
800
+ try {
801
+ const result = await httpClient.request(reqOpts);
802
+ sideEffects?.onSuccess?.(result);
803
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
804
+ } catch (err) {
805
+ const transformedError = (0, import_transform_error.transformError)(
806
+ err,
807
+ {
808
+ spreadPathsToArguments: {},
809
+ explicitPathsToArguments: {
810
+ cursorPaging: "$[0].cursorPaging",
811
+ galleryIds: "$[0].galleryIds"
812
+ },
813
+ singleArgumentUnchanged: false
814
+ },
815
+ ["options"]
816
+ );
817
+ sideEffects?.onError?.(err);
818
+ throw transformedError;
819
+ }
820
+ }
821
+ async function restoreGalleryFromTrashBin2(galleryId) {
822
+ const { httpClient, sideEffects } = arguments[1];
823
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
824
+ galleryId
825
+ });
826
+ const reqOpts = restoreGalleryFromTrashBin(
827
+ payload
828
+ );
829
+ sideEffects?.onSiteCall?.();
830
+ try {
831
+ const result = await httpClient.request(reqOpts);
832
+ sideEffects?.onSuccess?.(result);
833
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
834
+ } catch (err) {
835
+ const transformedError = (0, import_transform_error.transformError)(
836
+ err,
837
+ {
838
+ spreadPathsToArguments: {},
839
+ explicitPathsToArguments: { galleryId: "$[0]" },
840
+ singleArgumentUnchanged: false
841
+ },
842
+ ["galleryId"]
843
+ );
844
+ sideEffects?.onError?.(err);
845
+ throw transformedError;
846
+ }
847
+ }
848
+ async function removeGalleryFromTrashBin2(galleryId) {
849
+ const { httpClient, sideEffects } = arguments[1];
850
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
851
+ galleryId
852
+ });
853
+ const reqOpts = removeGalleryFromTrashBin(payload);
854
+ sideEffects?.onSiteCall?.();
855
+ try {
856
+ const result = await httpClient.request(reqOpts);
857
+ sideEffects?.onSuccess?.(result);
858
+ } catch (err) {
859
+ const transformedError = (0, import_transform_error.transformError)(
860
+ err,
861
+ {
862
+ spreadPathsToArguments: {},
863
+ explicitPathsToArguments: { galleryId: "$[0]" },
864
+ singleArgumentUnchanged: false
865
+ },
866
+ ["galleryId"]
867
+ );
868
+ sideEffects?.onError?.(err);
869
+ throw transformedError;
870
+ }
871
+ }
872
+ // Annotate the CommonJS export names for ESM import in node:
873
+ 0 && (module.exports = {
874
+ SortOrder,
875
+ Variant,
876
+ WebhookIdentityType,
877
+ bulkCreateGalleries,
878
+ bulkDeleteGalleries,
879
+ bulkUpdateGalleries,
880
+ createGallery,
881
+ getDeletedGallery,
882
+ getGallery,
883
+ getGalleryByDraftGalleryId,
884
+ listDeletedGalleries,
885
+ queryGalleries,
886
+ removeGalleryFromTrashBin,
887
+ restoreGalleryFromTrashBin,
888
+ updateExtendedFields,
889
+ updateGallery
890
+ });
891
+ //# sourceMappingURL=index.typings.js.map