@wix/auto_sdk_online-programs_sections 1.0.16 → 1.0.18

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 (50) hide show
  1. package/build/cjs/index.d.ts +6 -16
  2. package/build/cjs/index.js +0 -149
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +9 -32
  5. package/build/cjs/index.typings.js +0 -140
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +5 -8
  8. package/build/cjs/meta.js +0 -109
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +6 -16
  11. package/build/es/index.mjs +0 -148
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +9 -32
  14. package/build/es/index.typings.mjs +0 -139
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +5 -8
  17. package/build/es/meta.mjs +0 -108
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +6 -16
  20. package/build/internal/cjs/index.typings.d.ts +13 -31
  21. package/build/internal/cjs/meta.d.ts +9 -7
  22. package/build/internal/es/index.d.mts +6 -16
  23. package/build/internal/es/index.typings.d.mts +13 -31
  24. package/build/internal/es/meta.d.mts +9 -7
  25. package/package.json +4 -11
  26. package/build/cjs/schemas.d.ts +0 -637
  27. package/build/cjs/schemas.js +0 -999
  28. package/build/cjs/schemas.js.map +0 -1
  29. package/build/es/schemas.d.mts +0 -637
  30. package/build/es/schemas.mjs +0 -941
  31. package/build/es/schemas.mjs.map +0 -1
  32. package/build/internal/cjs/index.js +0 -1593
  33. package/build/internal/cjs/index.js.map +0 -1
  34. package/build/internal/cjs/index.typings.js +0 -1475
  35. package/build/internal/cjs/index.typings.js.map +0 -1
  36. package/build/internal/cjs/meta.js +0 -1135
  37. package/build/internal/cjs/meta.js.map +0 -1
  38. package/build/internal/cjs/schemas.d.ts +0 -637
  39. package/build/internal/cjs/schemas.js +0 -999
  40. package/build/internal/cjs/schemas.js.map +0 -1
  41. package/build/internal/es/index.mjs +0 -1550
  42. package/build/internal/es/index.mjs.map +0 -1
  43. package/build/internal/es/index.typings.mjs +0 -1431
  44. package/build/internal/es/index.typings.mjs.map +0 -1
  45. package/build/internal/es/meta.mjs +0 -1090
  46. package/build/internal/es/meta.mjs.map +0 -1
  47. package/build/internal/es/schemas.d.mts +0 -637
  48. package/build/internal/es/schemas.mjs +0 -941
  49. package/build/internal/es/schemas.mjs.map +0 -1
  50. package/schemas/package.json +0 -3
@@ -1,1593 +0,0 @@
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.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- BulkActionType: () => BulkActionType,
24
- DescriptionFieldSet: () => DescriptionFieldSet,
25
- Enum: () => Enum,
26
- RequestedFields: () => RequestedFields,
27
- SearchIndexingNotificationState: () => SearchIndexingNotificationState,
28
- SortOrder: () => SortOrder,
29
- State: () => State,
30
- WebhookIdentityType: () => WebhookIdentityType,
31
- bulkCreateSection: () => bulkCreateSection4,
32
- bulkCreateSections: () => bulkCreateSections4,
33
- cloneSection: () => cloneSection4,
34
- createSection: () => createSection4,
35
- deleteSection: () => deleteSection4,
36
- getSection: () => getSection4,
37
- listSections: () => listSections4,
38
- moveSection: () => moveSection4,
39
- publishSection: () => publishSection4,
40
- querySections: () => querySections4,
41
- updateSection: () => updateSection4,
42
- utils: () => utils
43
- });
44
- module.exports = __toCommonJS(index_exports);
45
-
46
- // src/online-programs-v3-section-sections.universal.ts
47
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
48
- var import_query_builder = require("@wix/sdk-runtime/query-builder");
49
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
50
-
51
- // src/online-programs-v3-section-sections.http.ts
52
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
53
- var import_float = require("@wix/sdk-runtime/transformations/float");
54
- var import_float2 = require("@wix/sdk-runtime/transformations/float");
55
- var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
56
- var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
57
- var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
58
- var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
59
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
60
- function resolveWixOnlineprogramsSectionsV3SectionsServiceUrl(opts) {
61
- const domainToMappings = {
62
- "bo._base_domain_": [
63
- {
64
- srcPath: "/program-sections-service",
65
- destPath: ""
66
- }
67
- ],
68
- "wixbo.ai": [
69
- {
70
- srcPath: "/program-sections-service",
71
- destPath: ""
72
- }
73
- ],
74
- "wix-bo.com": [
75
- {
76
- srcPath: "/program-sections-service",
77
- destPath: ""
78
- }
79
- ],
80
- "api._api_base_domain_": [
81
- {
82
- srcPath: "/program-sections-service",
83
- destPath: ""
84
- }
85
- ],
86
- "manage._base_domain_": [
87
- {
88
- srcPath: "/_api/program-sections-service",
89
- destPath: ""
90
- }
91
- ],
92
- "www._base_domain_": [
93
- {
94
- srcPath: "/_api/program-sections-service",
95
- destPath: ""
96
- }
97
- ],
98
- "*.dev.wix-code.com": [
99
- {
100
- srcPath: "/_api/program-sections-service",
101
- destPath: ""
102
- },
103
- {
104
- srcPath: "/program-sections-service",
105
- destPath: ""
106
- }
107
- ],
108
- "editor._base_domain_": [
109
- {
110
- srcPath: "/_api/program-sections-service",
111
- destPath: ""
112
- }
113
- ],
114
- "blocks._base_domain_": [
115
- {
116
- srcPath: "/_api/program-sections-service",
117
- destPath: ""
118
- }
119
- ],
120
- "create.editorx": [
121
- {
122
- srcPath: "/_api/program-sections-service",
123
- destPath: ""
124
- }
125
- ],
126
- "editor.wixapps.net": [
127
- {
128
- srcPath: "/_api/program-sections-service",
129
- destPath: ""
130
- },
131
- {
132
- srcPath: "/program-sections-service",
133
- destPath: ""
134
- }
135
- ],
136
- _: [
137
- {
138
- srcPath: "/program-sections-service",
139
- destPath: ""
140
- }
141
- ],
142
- "www.wixapis.com": [
143
- {
144
- srcPath: "/program-sections-service",
145
- destPath: ""
146
- },
147
- {
148
- srcPath: "/online-programs/v3/sections",
149
- destPath: "/v3/sections"
150
- },
151
- {
152
- srcPath: "/online-programs/v3/bulk/sections",
153
- destPath: "/v3/bulk/sections"
154
- }
155
- ]
156
- };
157
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
158
- }
159
- var PACKAGE_NAME = "@wix/auto_sdk_online-programs_sections";
160
- function createSection(payload) {
161
- function __createSection({ host }) {
162
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
163
- {
164
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
165
- paths: [
166
- { path: "section.createdDate" },
167
- { path: "section.updatedDate" },
168
- { path: "section.description.image.urlExpirationDate" },
169
- { path: "section.description.video.urlExpirationDate" },
170
- { path: "section.description.video.resolutions.urlExpirationDate" },
171
- {
172
- path: "section.description.video.resolutions.poster.urlExpirationDate"
173
- },
174
- { path: "section.description.video.posters.urlExpirationDate" }
175
- ]
176
- },
177
- {
178
- transformFn: import_float.transformSDKFloatToRESTFloat,
179
- paths: [
180
- { path: "section.ordering" },
181
- { path: "section.description.image.focalPoint.x" },
182
- { path: "section.description.image.focalPoint.y" },
183
- { path: "section.description.video.resolutions.poster.focalPoint.x" },
184
- { path: "section.description.video.resolutions.poster.focalPoint.y" },
185
- { path: "section.description.video.posters.focalPoint.x" },
186
- { path: "section.description.video.posters.focalPoint.y" }
187
- ]
188
- }
189
- ]);
190
- const metadata = {
191
- entityFqdn: "wix.online_programs.v3.section",
192
- method: "POST",
193
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.CreateSection",
194
- packageName: PACKAGE_NAME,
195
- migrationOptions: {
196
- optInTransformResponse: true
197
- },
198
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
199
- protoPath: "/v3/sections",
200
- data: serializedData,
201
- host
202
- }),
203
- data: serializedData,
204
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
205
- {
206
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
207
- paths: [
208
- { path: "section.createdDate" },
209
- { path: "section.updatedDate" },
210
- { path: "section.description.image.urlExpirationDate" },
211
- { path: "section.description.video.urlExpirationDate" },
212
- {
213
- path: "section.description.video.resolutions.urlExpirationDate"
214
- },
215
- {
216
- path: "section.description.video.resolutions.poster.urlExpirationDate"
217
- },
218
- { path: "section.description.video.posters.urlExpirationDate" }
219
- ]
220
- },
221
- {
222
- transformFn: import_float2.transformRESTFloatToSDKFloat,
223
- paths: [
224
- { path: "section.ordering" },
225
- { path: "section.description.image.focalPoint.x" },
226
- { path: "section.description.image.focalPoint.y" },
227
- {
228
- path: "section.description.video.resolutions.poster.focalPoint.x"
229
- },
230
- {
231
- path: "section.description.video.resolutions.poster.focalPoint.y"
232
- },
233
- { path: "section.description.video.posters.focalPoint.x" },
234
- { path: "section.description.video.posters.focalPoint.y" }
235
- ]
236
- }
237
- ])
238
- };
239
- return metadata;
240
- }
241
- return __createSection;
242
- }
243
- function bulkCreateSections(payload) {
244
- function __bulkCreateSections({ host }) {
245
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
246
- {
247
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
248
- paths: [
249
- { path: "sections.createdDate" },
250
- { path: "sections.updatedDate" },
251
- { path: "sections.description.image.urlExpirationDate" },
252
- { path: "sections.description.video.urlExpirationDate" },
253
- { path: "sections.description.video.resolutions.urlExpirationDate" },
254
- {
255
- path: "sections.description.video.resolutions.poster.urlExpirationDate"
256
- },
257
- { path: "sections.description.video.posters.urlExpirationDate" }
258
- ]
259
- },
260
- {
261
- transformFn: import_float.transformSDKFloatToRESTFloat,
262
- paths: [
263
- { path: "sections.ordering" },
264
- { path: "sections.description.image.focalPoint.x" },
265
- { path: "sections.description.image.focalPoint.y" },
266
- {
267
- path: "sections.description.video.resolutions.poster.focalPoint.x"
268
- },
269
- {
270
- path: "sections.description.video.resolutions.poster.focalPoint.y"
271
- },
272
- { path: "sections.description.video.posters.focalPoint.x" },
273
- { path: "sections.description.video.posters.focalPoint.y" }
274
- ]
275
- }
276
- ]);
277
- const metadata = {
278
- entityFqdn: "wix.online_programs.v3.section",
279
- method: "POST",
280
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.BulkCreateSections",
281
- packageName: PACKAGE_NAME,
282
- migrationOptions: {
283
- optInTransformResponse: true
284
- },
285
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
286
- protoPath: "/v3/bulk/sections/create",
287
- data: serializedData,
288
- host
289
- }),
290
- data: serializedData,
291
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
292
- {
293
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
294
- paths: [
295
- { path: "results.item.createdDate" },
296
- { path: "results.item.updatedDate" },
297
- { path: "results.item.description.image.urlExpirationDate" },
298
- { path: "results.item.description.video.urlExpirationDate" },
299
- {
300
- path: "results.item.description.video.resolutions.urlExpirationDate"
301
- },
302
- {
303
- path: "results.item.description.video.resolutions.poster.urlExpirationDate"
304
- },
305
- {
306
- path: "results.item.description.video.posters.urlExpirationDate"
307
- }
308
- ]
309
- },
310
- {
311
- transformFn: import_float2.transformRESTFloatToSDKFloat,
312
- paths: [
313
- { path: "results.item.ordering" },
314
- { path: "results.item.description.image.focalPoint.x" },
315
- { path: "results.item.description.image.focalPoint.y" },
316
- {
317
- path: "results.item.description.video.resolutions.poster.focalPoint.x"
318
- },
319
- {
320
- path: "results.item.description.video.resolutions.poster.focalPoint.y"
321
- },
322
- { path: "results.item.description.video.posters.focalPoint.x" },
323
- { path: "results.item.description.video.posters.focalPoint.y" }
324
- ]
325
- }
326
- ])
327
- };
328
- return metadata;
329
- }
330
- return __bulkCreateSections;
331
- }
332
- function bulkCreateSection(payload) {
333
- function __bulkCreateSection({ host }) {
334
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
335
- {
336
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
337
- paths: [
338
- { path: "sections.createdDate" },
339
- { path: "sections.updatedDate" },
340
- { path: "sections.description.image.urlExpirationDate" },
341
- { path: "sections.description.video.urlExpirationDate" },
342
- { path: "sections.description.video.resolutions.urlExpirationDate" },
343
- {
344
- path: "sections.description.video.resolutions.poster.urlExpirationDate"
345
- },
346
- { path: "sections.description.video.posters.urlExpirationDate" }
347
- ]
348
- },
349
- {
350
- transformFn: import_float.transformSDKFloatToRESTFloat,
351
- paths: [
352
- { path: "sections.ordering" },
353
- { path: "sections.description.image.focalPoint.x" },
354
- { path: "sections.description.image.focalPoint.y" },
355
- {
356
- path: "sections.description.video.resolutions.poster.focalPoint.x"
357
- },
358
- {
359
- path: "sections.description.video.resolutions.poster.focalPoint.y"
360
- },
361
- { path: "sections.description.video.posters.focalPoint.x" },
362
- { path: "sections.description.video.posters.focalPoint.y" }
363
- ]
364
- }
365
- ]);
366
- const metadata = {
367
- entityFqdn: "wix.online_programs.v3.section",
368
- method: "POST",
369
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.BulkCreateSection",
370
- packageName: PACKAGE_NAME,
371
- migrationOptions: {
372
- optInTransformResponse: true
373
- },
374
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
375
- protoPath: "/v3/bulk/sections/create-deprecated",
376
- data: serializedData,
377
- host
378
- }),
379
- data: serializedData,
380
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
381
- {
382
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
383
- paths: [
384
- { path: "results.item.createdDate" },
385
- { path: "results.item.updatedDate" },
386
- { path: "results.item.description.image.urlExpirationDate" },
387
- { path: "results.item.description.video.urlExpirationDate" },
388
- {
389
- path: "results.item.description.video.resolutions.urlExpirationDate"
390
- },
391
- {
392
- path: "results.item.description.video.resolutions.poster.urlExpirationDate"
393
- },
394
- {
395
- path: "results.item.description.video.posters.urlExpirationDate"
396
- }
397
- ]
398
- },
399
- {
400
- transformFn: import_float2.transformRESTFloatToSDKFloat,
401
- paths: [
402
- { path: "results.item.ordering" },
403
- { path: "results.item.description.image.focalPoint.x" },
404
- { path: "results.item.description.image.focalPoint.y" },
405
- {
406
- path: "results.item.description.video.resolutions.poster.focalPoint.x"
407
- },
408
- {
409
- path: "results.item.description.video.resolutions.poster.focalPoint.y"
410
- },
411
- { path: "results.item.description.video.posters.focalPoint.x" },
412
- { path: "results.item.description.video.posters.focalPoint.y" }
413
- ]
414
- }
415
- ])
416
- };
417
- return metadata;
418
- }
419
- return __bulkCreateSection;
420
- }
421
- function getSection(payload) {
422
- function __getSection({ host }) {
423
- const metadata = {
424
- entityFqdn: "wix.online_programs.v3.section",
425
- method: "GET",
426
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.GetSection",
427
- packageName: PACKAGE_NAME,
428
- migrationOptions: {
429
- optInTransformResponse: true
430
- },
431
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
432
- protoPath: "/v3/sections/{sectionId}",
433
- data: payload,
434
- host
435
- }),
436
- params: (0, import_rest_modules.toURLSearchParams)(payload),
437
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
438
- {
439
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
440
- paths: [
441
- { path: "section.createdDate" },
442
- { path: "section.updatedDate" },
443
- { path: "section.description.image.urlExpirationDate" },
444
- { path: "section.description.video.urlExpirationDate" },
445
- {
446
- path: "section.description.video.resolutions.urlExpirationDate"
447
- },
448
- {
449
- path: "section.description.video.resolutions.poster.urlExpirationDate"
450
- },
451
- { path: "section.description.video.posters.urlExpirationDate" }
452
- ]
453
- },
454
- {
455
- transformFn: import_float2.transformRESTFloatToSDKFloat,
456
- paths: [
457
- { path: "section.ordering" },
458
- { path: "section.description.image.focalPoint.x" },
459
- { path: "section.description.image.focalPoint.y" },
460
- {
461
- path: "section.description.video.resolutions.poster.focalPoint.x"
462
- },
463
- {
464
- path: "section.description.video.resolutions.poster.focalPoint.y"
465
- },
466
- { path: "section.description.video.posters.focalPoint.x" },
467
- { path: "section.description.video.posters.focalPoint.y" }
468
- ]
469
- }
470
- ])
471
- };
472
- return metadata;
473
- }
474
- return __getSection;
475
- }
476
- function updateSection(payload) {
477
- function __updateSection({ host }) {
478
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
479
- {
480
- transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
481
- paths: [{ path: "fieldMask" }]
482
- },
483
- {
484
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
485
- paths: [
486
- { path: "section.createdDate" },
487
- { path: "section.updatedDate" },
488
- { path: "section.description.image.urlExpirationDate" },
489
- { path: "section.description.video.urlExpirationDate" },
490
- { path: "section.description.video.resolutions.urlExpirationDate" },
491
- {
492
- path: "section.description.video.resolutions.poster.urlExpirationDate"
493
- },
494
- { path: "section.description.video.posters.urlExpirationDate" }
495
- ]
496
- },
497
- {
498
- transformFn: import_float.transformSDKFloatToRESTFloat,
499
- paths: [
500
- { path: "section.ordering" },
501
- { path: "section.description.image.focalPoint.x" },
502
- { path: "section.description.image.focalPoint.y" },
503
- { path: "section.description.video.resolutions.poster.focalPoint.x" },
504
- { path: "section.description.video.resolutions.poster.focalPoint.y" },
505
- { path: "section.description.video.posters.focalPoint.x" },
506
- { path: "section.description.video.posters.focalPoint.y" }
507
- ]
508
- }
509
- ]);
510
- const metadata = {
511
- entityFqdn: "wix.online_programs.v3.section",
512
- method: "PATCH",
513
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.UpdateSection",
514
- packageName: PACKAGE_NAME,
515
- migrationOptions: {
516
- optInTransformResponse: true
517
- },
518
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
519
- protoPath: "/v3/sections/{section.id}",
520
- data: serializedData,
521
- host
522
- }),
523
- data: serializedData,
524
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
525
- {
526
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
527
- paths: [
528
- { path: "section.createdDate" },
529
- { path: "section.updatedDate" },
530
- { path: "section.description.image.urlExpirationDate" },
531
- { path: "section.description.video.urlExpirationDate" },
532
- {
533
- path: "section.description.video.resolutions.urlExpirationDate"
534
- },
535
- {
536
- path: "section.description.video.resolutions.poster.urlExpirationDate"
537
- },
538
- { path: "section.description.video.posters.urlExpirationDate" }
539
- ]
540
- },
541
- {
542
- transformFn: import_float2.transformRESTFloatToSDKFloat,
543
- paths: [
544
- { path: "section.ordering" },
545
- { path: "section.description.image.focalPoint.x" },
546
- { path: "section.description.image.focalPoint.y" },
547
- {
548
- path: "section.description.video.resolutions.poster.focalPoint.x"
549
- },
550
- {
551
- path: "section.description.video.resolutions.poster.focalPoint.y"
552
- },
553
- { path: "section.description.video.posters.focalPoint.x" },
554
- { path: "section.description.video.posters.focalPoint.y" }
555
- ]
556
- }
557
- ])
558
- };
559
- return metadata;
560
- }
561
- return __updateSection;
562
- }
563
- function deleteSection(payload) {
564
- function __deleteSection({ host }) {
565
- const metadata = {
566
- entityFqdn: "wix.online_programs.v3.section",
567
- method: "DELETE",
568
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.DeleteSection",
569
- packageName: PACKAGE_NAME,
570
- migrationOptions: {
571
- optInTransformResponse: true
572
- },
573
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
574
- protoPath: "/v3/sections/{sectionId}",
575
- data: payload,
576
- host
577
- }),
578
- params: (0, import_rest_modules.toURLSearchParams)(payload)
579
- };
580
- return metadata;
581
- }
582
- return __deleteSection;
583
- }
584
- function querySections(payload) {
585
- function __querySections({ host }) {
586
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
587
- {
588
- transformFn: import_float.transformSDKFloatToRESTFloat,
589
- paths: [
590
- { path: "query.sort.origin.latitude" },
591
- { path: "query.sort.origin.longitude" }
592
- ]
593
- }
594
- ]);
595
- const metadata = {
596
- entityFqdn: "wix.online_programs.v3.section",
597
- method: "POST",
598
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.QuerySections",
599
- packageName: PACKAGE_NAME,
600
- migrationOptions: {
601
- optInTransformResponse: true
602
- },
603
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
604
- protoPath: "/v3/sections/query",
605
- data: serializedData,
606
- host
607
- }),
608
- data: serializedData,
609
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
610
- {
611
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
612
- paths: [
613
- { path: "sections.createdDate" },
614
- { path: "sections.updatedDate" },
615
- { path: "sections.description.image.urlExpirationDate" },
616
- { path: "sections.description.video.urlExpirationDate" },
617
- {
618
- path: "sections.description.video.resolutions.urlExpirationDate"
619
- },
620
- {
621
- path: "sections.description.video.resolutions.poster.urlExpirationDate"
622
- },
623
- { path: "sections.description.video.posters.urlExpirationDate" }
624
- ]
625
- },
626
- {
627
- transformFn: import_float2.transformRESTFloatToSDKFloat,
628
- paths: [
629
- { path: "sections.ordering" },
630
- { path: "sections.description.image.focalPoint.x" },
631
- { path: "sections.description.image.focalPoint.y" },
632
- {
633
- path: "sections.description.video.resolutions.poster.focalPoint.x"
634
- },
635
- {
636
- path: "sections.description.video.resolutions.poster.focalPoint.y"
637
- },
638
- { path: "sections.description.video.posters.focalPoint.x" },
639
- { path: "sections.description.video.posters.focalPoint.y" }
640
- ]
641
- }
642
- ])
643
- };
644
- return metadata;
645
- }
646
- return __querySections;
647
- }
648
- function listSections(payload) {
649
- function __listSections({ host }) {
650
- const metadata = {
651
- entityFqdn: "wix.online_programs.v3.section",
652
- method: "GET",
653
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.ListSections",
654
- packageName: PACKAGE_NAME,
655
- migrationOptions: {
656
- optInTransformResponse: true
657
- },
658
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
659
- protoPath: "/v3/sections",
660
- data: payload,
661
- host
662
- }),
663
- params: (0, import_rest_modules.toURLSearchParams)(payload),
664
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
665
- {
666
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
667
- paths: [
668
- { path: "sections.createdDate" },
669
- { path: "sections.updatedDate" },
670
- { path: "sections.description.image.urlExpirationDate" },
671
- { path: "sections.description.video.urlExpirationDate" },
672
- {
673
- path: "sections.description.video.resolutions.urlExpirationDate"
674
- },
675
- {
676
- path: "sections.description.video.resolutions.poster.urlExpirationDate"
677
- },
678
- { path: "sections.description.video.posters.urlExpirationDate" }
679
- ]
680
- },
681
- {
682
- transformFn: import_float2.transformRESTFloatToSDKFloat,
683
- paths: [
684
- { path: "sections.ordering" },
685
- { path: "sections.description.image.focalPoint.x" },
686
- { path: "sections.description.image.focalPoint.y" },
687
- {
688
- path: "sections.description.video.resolutions.poster.focalPoint.x"
689
- },
690
- {
691
- path: "sections.description.video.resolutions.poster.focalPoint.y"
692
- },
693
- { path: "sections.description.video.posters.focalPoint.x" },
694
- { path: "sections.description.video.posters.focalPoint.y" }
695
- ]
696
- }
697
- ])
698
- };
699
- return metadata;
700
- }
701
- return __listSections;
702
- }
703
- function cloneSection(payload) {
704
- function __cloneSection({ host }) {
705
- const metadata = {
706
- entityFqdn: "wix.online_programs.v3.section",
707
- method: "POST",
708
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.CloneSection",
709
- packageName: PACKAGE_NAME,
710
- migrationOptions: {
711
- optInTransformResponse: true
712
- },
713
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
714
- protoPath: "/v3/sections/{sectionId}/clone",
715
- data: payload,
716
- host
717
- }),
718
- data: payload,
719
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
720
- {
721
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
722
- paths: [
723
- { path: "section.createdDate" },
724
- { path: "section.updatedDate" },
725
- { path: "section.description.image.urlExpirationDate" },
726
- { path: "section.description.video.urlExpirationDate" },
727
- {
728
- path: "section.description.video.resolutions.urlExpirationDate"
729
- },
730
- {
731
- path: "section.description.video.resolutions.poster.urlExpirationDate"
732
- },
733
- { path: "section.description.video.posters.urlExpirationDate" }
734
- ]
735
- },
736
- {
737
- transformFn: import_float2.transformRESTFloatToSDKFloat,
738
- paths: [
739
- { path: "section.ordering" },
740
- { path: "section.description.image.focalPoint.x" },
741
- { path: "section.description.image.focalPoint.y" },
742
- {
743
- path: "section.description.video.resolutions.poster.focalPoint.x"
744
- },
745
- {
746
- path: "section.description.video.resolutions.poster.focalPoint.y"
747
- },
748
- { path: "section.description.video.posters.focalPoint.x" },
749
- { path: "section.description.video.posters.focalPoint.y" }
750
- ]
751
- }
752
- ])
753
- };
754
- return metadata;
755
- }
756
- return __cloneSection;
757
- }
758
- function moveSection(payload) {
759
- function __moveSection({ host }) {
760
- const metadata = {
761
- entityFqdn: "wix.online_programs.v3.section",
762
- method: "PATCH",
763
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.MoveSection",
764
- packageName: PACKAGE_NAME,
765
- migrationOptions: {
766
- optInTransformResponse: true
767
- },
768
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
769
- protoPath: "/v3/sections/move",
770
- data: payload,
771
- host
772
- }),
773
- data: payload,
774
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
775
- {
776
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
777
- paths: [
778
- { path: "section.createdDate" },
779
- { path: "section.updatedDate" },
780
- { path: "section.description.image.urlExpirationDate" },
781
- { path: "section.description.video.urlExpirationDate" },
782
- {
783
- path: "section.description.video.resolutions.urlExpirationDate"
784
- },
785
- {
786
- path: "section.description.video.resolutions.poster.urlExpirationDate"
787
- },
788
- { path: "section.description.video.posters.urlExpirationDate" }
789
- ]
790
- },
791
- {
792
- transformFn: import_float2.transformRESTFloatToSDKFloat,
793
- paths: [
794
- { path: "section.ordering" },
795
- { path: "section.description.image.focalPoint.x" },
796
- { path: "section.description.image.focalPoint.y" },
797
- {
798
- path: "section.description.video.resolutions.poster.focalPoint.x"
799
- },
800
- {
801
- path: "section.description.video.resolutions.poster.focalPoint.y"
802
- },
803
- { path: "section.description.video.posters.focalPoint.x" },
804
- { path: "section.description.video.posters.focalPoint.y" }
805
- ]
806
- }
807
- ])
808
- };
809
- return metadata;
810
- }
811
- return __moveSection;
812
- }
813
- function publishSection(payload) {
814
- function __publishSection({ host }) {
815
- const metadata = {
816
- entityFqdn: "wix.online_programs.v3.section",
817
- method: "PATCH",
818
- methodFqn: "wix.onlineprograms.sections.v3.SectionsService.PublishSection",
819
- packageName: PACKAGE_NAME,
820
- migrationOptions: {
821
- optInTransformResponse: true
822
- },
823
- url: resolveWixOnlineprogramsSectionsV3SectionsServiceUrl({
824
- protoPath: "/v3/sections/publish",
825
- data: payload,
826
- host
827
- }),
828
- data: payload,
829
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
830
- {
831
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
832
- paths: [
833
- { path: "section.createdDate" },
834
- { path: "section.updatedDate" },
835
- { path: "section.description.image.urlExpirationDate" },
836
- { path: "section.description.video.urlExpirationDate" },
837
- {
838
- path: "section.description.video.resolutions.urlExpirationDate"
839
- },
840
- {
841
- path: "section.description.video.resolutions.poster.urlExpirationDate"
842
- },
843
- { path: "section.description.video.posters.urlExpirationDate" }
844
- ]
845
- },
846
- {
847
- transformFn: import_float2.transformRESTFloatToSDKFloat,
848
- paths: [
849
- { path: "section.ordering" },
850
- { path: "section.description.image.focalPoint.x" },
851
- { path: "section.description.image.focalPoint.y" },
852
- {
853
- path: "section.description.video.resolutions.poster.focalPoint.x"
854
- },
855
- {
856
- path: "section.description.video.resolutions.poster.focalPoint.y"
857
- },
858
- { path: "section.description.video.posters.focalPoint.x" },
859
- { path: "section.description.video.posters.focalPoint.y" }
860
- ]
861
- }
862
- ])
863
- };
864
- return metadata;
865
- }
866
- return __publishSection;
867
- }
868
-
869
- // src/online-programs-v3-section-sections.universal.ts
870
- var import_image = require("@wix/sdk-runtime/transformations/image");
871
- var import_image2 = require("@wix/sdk-runtime/transformations/image");
872
- var import_video_v2 = require("@wix/sdk-runtime/transformations/video-v2");
873
- var import_video_v22 = require("@wix/sdk-runtime/transformations/video-v2");
874
- var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
875
- var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
876
- var State = /* @__PURE__ */ ((State2) => {
877
- State2["DRAFT"] = "DRAFT";
878
- State2["PUBLISHED"] = "PUBLISHED";
879
- return State2;
880
- })(State || {});
881
- var Enum = /* @__PURE__ */ ((Enum2) => {
882
- Enum2["UNKNOWN"] = "UNKNOWN";
883
- Enum2["PROTECTED"] = "PROTECTED";
884
- Enum2["PRIVATE"] = "PRIVATE";
885
- Enum2["PUBLIC"] = "PUBLIC";
886
- Enum2["UNCHANGED"] = "UNCHANGED";
887
- Enum2["GROUP_PROTECTED"] = "GROUP_PROTECTED";
888
- return Enum2;
889
- })(Enum || {});
890
- var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
891
- RequestedFields2["TOTAL_STEPS"] = "TOTAL_STEPS";
892
- return RequestedFields2;
893
- })(RequestedFields || {});
894
- var BulkActionType = /* @__PURE__ */ ((BulkActionType2) => {
895
- BulkActionType2["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
896
- BulkActionType2["INSERT"] = "INSERT";
897
- BulkActionType2["UPDATE"] = "UPDATE";
898
- BulkActionType2["DELETE"] = "DELETE";
899
- return BulkActionType2;
900
- })(BulkActionType || {});
901
- var DescriptionFieldSet = /* @__PURE__ */ ((DescriptionFieldSet2) => {
902
- DescriptionFieldSet2["STANDARD"] = "STANDARD";
903
- DescriptionFieldSet2["EXTENDED"] = "EXTENDED";
904
- return DescriptionFieldSet2;
905
- })(DescriptionFieldSet || {});
906
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
907
- SortOrder2["ASC"] = "ASC";
908
- SortOrder2["DESC"] = "DESC";
909
- return SortOrder2;
910
- })(SortOrder || {});
911
- var SearchIndexingNotificationState = /* @__PURE__ */ ((SearchIndexingNotificationState2) => {
912
- SearchIndexingNotificationState2["Unknown"] = "Unknown";
913
- SearchIndexingNotificationState2["Off"] = "Off";
914
- SearchIndexingNotificationState2["On"] = "On";
915
- return SearchIndexingNotificationState2;
916
- })(SearchIndexingNotificationState || {});
917
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
918
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
919
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
920
- WebhookIdentityType2["MEMBER"] = "MEMBER";
921
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
922
- WebhookIdentityType2["APP"] = "APP";
923
- return WebhookIdentityType2;
924
- })(WebhookIdentityType || {});
925
- async function createSection2(section, options) {
926
- const { httpClient, sideEffects } = arguments[2];
927
- const payload = (0, import_transform_paths2.transformPaths)(
928
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
929
- section,
930
- fields: options?.fields
931
- }),
932
- [
933
- {
934
- transformFn: import_image.transformSDKImageToRESTImage,
935
- paths: [{ path: "section.description.image" }]
936
- },
937
- {
938
- transformFn: import_video_v2.transformSDKVideoV2ToRESTVideoV2,
939
- paths: [{ path: "section.description.video" }]
940
- }
941
- ]
942
- );
943
- const reqOpts = createSection(payload);
944
- sideEffects?.onSiteCall?.();
945
- try {
946
- const result = await httpClient.request(reqOpts);
947
- sideEffects?.onSuccess?.(result);
948
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
949
- (0, import_transform_paths2.transformPaths)(result.data, [
950
- {
951
- transformFn: import_image2.transformRESTImageToSDKImage,
952
- paths: [{ path: "section.description.image" }]
953
- },
954
- {
955
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
956
- paths: [{ path: "section.description.video" }]
957
- }
958
- ])
959
- )?.section;
960
- } catch (err) {
961
- const transformedError = (0, import_transform_error.transformError)(
962
- err,
963
- {
964
- spreadPathsToArguments: {},
965
- explicitPathsToArguments: { section: "$[0]", fields: "$[1].fields" },
966
- singleArgumentUnchanged: false
967
- },
968
- ["section", "options"]
969
- );
970
- sideEffects?.onError?.(err);
971
- throw transformedError;
972
- }
973
- }
974
- async function bulkCreateSections2(sections, options) {
975
- const { httpClient, sideEffects } = arguments[2];
976
- const payload = (0, import_transform_paths2.transformPaths)(
977
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
978
- sections,
979
- fields: options?.fields
980
- }),
981
- [
982
- {
983
- transformFn: import_image.transformSDKImageToRESTImage,
984
- paths: [{ path: "sections.description.image" }]
985
- },
986
- {
987
- transformFn: import_video_v2.transformSDKVideoV2ToRESTVideoV2,
988
- paths: [{ path: "sections.description.video" }]
989
- }
990
- ]
991
- );
992
- const reqOpts = bulkCreateSections(payload);
993
- sideEffects?.onSiteCall?.();
994
- try {
995
- const result = await httpClient.request(reqOpts);
996
- sideEffects?.onSuccess?.(result);
997
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
998
- (0, import_transform_paths2.transformPaths)(result.data, [
999
- {
1000
- transformFn: import_image2.transformRESTImageToSDKImage,
1001
- paths: [{ path: "results.item.description.image" }]
1002
- },
1003
- {
1004
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1005
- paths: [{ path: "results.item.description.video" }]
1006
- }
1007
- ])
1008
- );
1009
- } catch (err) {
1010
- const transformedError = (0, import_transform_error.transformError)(
1011
- err,
1012
- {
1013
- spreadPathsToArguments: {},
1014
- explicitPathsToArguments: { sections: "$[0]", fields: "$[1].fields" },
1015
- singleArgumentUnchanged: false
1016
- },
1017
- ["sections", "options"]
1018
- );
1019
- sideEffects?.onError?.(err);
1020
- throw transformedError;
1021
- }
1022
- }
1023
- async function bulkCreateSection2(sections, options) {
1024
- const { httpClient, sideEffects } = arguments[2];
1025
- const payload = (0, import_transform_paths2.transformPaths)(
1026
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1027
- sections,
1028
- fields: options?.fields
1029
- }),
1030
- [
1031
- {
1032
- transformFn: import_image.transformSDKImageToRESTImage,
1033
- paths: [{ path: "sections.description.image" }]
1034
- },
1035
- {
1036
- transformFn: import_video_v2.transformSDKVideoV2ToRESTVideoV2,
1037
- paths: [{ path: "sections.description.video" }]
1038
- }
1039
- ]
1040
- );
1041
- const reqOpts = bulkCreateSection(payload);
1042
- sideEffects?.onSiteCall?.();
1043
- try {
1044
- const result = await httpClient.request(reqOpts);
1045
- sideEffects?.onSuccess?.(result);
1046
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1047
- (0, import_transform_paths2.transformPaths)(result.data, [
1048
- {
1049
- transformFn: import_image2.transformRESTImageToSDKImage,
1050
- paths: [{ path: "results.item.description.image" }]
1051
- },
1052
- {
1053
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1054
- paths: [{ path: "results.item.description.video" }]
1055
- }
1056
- ])
1057
- );
1058
- } catch (err) {
1059
- const transformedError = (0, import_transform_error.transformError)(
1060
- err,
1061
- {
1062
- spreadPathsToArguments: {},
1063
- explicitPathsToArguments: { sections: "$[0]", fields: "$[1].fields" },
1064
- singleArgumentUnchanged: false
1065
- },
1066
- ["sections", "options"]
1067
- );
1068
- sideEffects?.onError?.(err);
1069
- throw transformedError;
1070
- }
1071
- }
1072
- async function getSection2(sectionId, options) {
1073
- const { httpClient, sideEffects } = arguments[2];
1074
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1075
- sectionId,
1076
- descriptionFieldSet: options?.descriptionFieldSet,
1077
- fields: options?.fields
1078
- });
1079
- const reqOpts = getSection(payload);
1080
- sideEffects?.onSiteCall?.();
1081
- try {
1082
- const result = await httpClient.request(reqOpts);
1083
- sideEffects?.onSuccess?.(result);
1084
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1085
- (0, import_transform_paths2.transformPaths)(result.data, [
1086
- {
1087
- transformFn: import_image2.transformRESTImageToSDKImage,
1088
- paths: [{ path: "section.description.image" }]
1089
- },
1090
- {
1091
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1092
- paths: [{ path: "section.description.video" }]
1093
- }
1094
- ])
1095
- )?.section;
1096
- } catch (err) {
1097
- const transformedError = (0, import_transform_error.transformError)(
1098
- err,
1099
- {
1100
- spreadPathsToArguments: {},
1101
- explicitPathsToArguments: {
1102
- sectionId: "$[0]",
1103
- descriptionFieldSet: "$[1].descriptionFieldSet",
1104
- fields: "$[1].fields"
1105
- },
1106
- singleArgumentUnchanged: false
1107
- },
1108
- ["sectionId", "options"]
1109
- );
1110
- sideEffects?.onError?.(err);
1111
- throw transformedError;
1112
- }
1113
- }
1114
- async function updateSection2(_id, options) {
1115
- const { httpClient, sideEffects } = arguments[2];
1116
- const payload = (0, import_transform_paths2.transformPaths)(
1117
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1118
- section: { ...options?.section, id: _id },
1119
- fields: options?.fields
1120
- }),
1121
- [
1122
- {
1123
- transformFn: import_image.transformSDKImageToRESTImage,
1124
- paths: [{ path: "section.description.image" }]
1125
- },
1126
- {
1127
- transformFn: import_video_v2.transformSDKVideoV2ToRESTVideoV2,
1128
- paths: [{ path: "section.description.video" }]
1129
- }
1130
- ]
1131
- );
1132
- const reqOpts = updateSection(payload);
1133
- sideEffects?.onSiteCall?.();
1134
- try {
1135
- const result = await httpClient.request(reqOpts);
1136
- sideEffects?.onSuccess?.(result);
1137
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1138
- (0, import_transform_paths2.transformPaths)(result.data, [
1139
- {
1140
- transformFn: import_image2.transformRESTImageToSDKImage,
1141
- paths: [{ path: "section.description.image" }]
1142
- },
1143
- {
1144
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1145
- paths: [{ path: "section.description.video" }]
1146
- }
1147
- ])
1148
- )?.section;
1149
- } catch (err) {
1150
- const transformedError = (0, import_transform_error.transformError)(
1151
- err,
1152
- {
1153
- spreadPathsToArguments: { section: "$[1].section" },
1154
- explicitPathsToArguments: {
1155
- "section.id": "$[0]",
1156
- fields: "$[1].fields"
1157
- },
1158
- singleArgumentUnchanged: false
1159
- },
1160
- ["_id", "options"]
1161
- );
1162
- sideEffects?.onError?.(err);
1163
- throw transformedError;
1164
- }
1165
- }
1166
- async function deleteSection2(sectionId) {
1167
- const { httpClient, sideEffects } = arguments[1];
1168
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1169
- sectionId
1170
- });
1171
- const reqOpts = deleteSection(payload);
1172
- sideEffects?.onSiteCall?.();
1173
- try {
1174
- const result = await httpClient.request(reqOpts);
1175
- sideEffects?.onSuccess?.(result);
1176
- } catch (err) {
1177
- const transformedError = (0, import_transform_error.transformError)(
1178
- err,
1179
- {
1180
- spreadPathsToArguments: {},
1181
- explicitPathsToArguments: { sectionId: "$[0]" },
1182
- singleArgumentUnchanged: false
1183
- },
1184
- ["sectionId"]
1185
- );
1186
- sideEffects?.onError?.(err);
1187
- throw transformedError;
1188
- }
1189
- }
1190
- function querySections2(options) {
1191
- const { httpClient, sideEffects } = arguments[1];
1192
- return (0, import_query_builder.queryBuilder)({
1193
- func: async (payload) => {
1194
- const reqOpts = querySections({
1195
- ...payload,
1196
- ...options ?? {}
1197
- });
1198
- sideEffects?.onSiteCall?.();
1199
- try {
1200
- const result = await httpClient.request(reqOpts);
1201
- sideEffects?.onSuccess?.(result);
1202
- return result;
1203
- } catch (err) {
1204
- sideEffects?.onError?.(err);
1205
- throw err;
1206
- }
1207
- },
1208
- requestTransformer: (query) => {
1209
- const args = [query, options];
1210
- return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1211
- ...args?.[1],
1212
- query: args?.[0]
1213
- });
1214
- },
1215
- responseTransformer: ({ data }) => {
1216
- const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1217
- (0, import_transform_paths2.transformPaths)(data, [
1218
- {
1219
- transformFn: import_image2.transformRESTImageToSDKImage,
1220
- paths: [{ path: "sections.description.image" }]
1221
- },
1222
- {
1223
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1224
- paths: [{ path: "sections.description.video" }]
1225
- }
1226
- ])
1227
- );
1228
- return {
1229
- items: transformedData?.sections,
1230
- pagingMetadata: transformedData?.pagingMetadata
1231
- };
1232
- },
1233
- errorTransformer: (err) => {
1234
- const transformedError = (0, import_transform_error.transformError)(err, {
1235
- spreadPathsToArguments: {},
1236
- explicitPathsToArguments: { query: "$[0]" },
1237
- singleArgumentUnchanged: false
1238
- });
1239
- throw transformedError;
1240
- },
1241
- pagingMethod: "CURSOR",
1242
- transformationPaths: {}
1243
- });
1244
- }
1245
- async function typedQuerySections(query, options) {
1246
- const { httpClient, sideEffects } = arguments[2];
1247
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1248
- query,
1249
- ...options
1250
- });
1251
- const reqOpts = querySections(payload);
1252
- sideEffects?.onSiteCall?.();
1253
- try {
1254
- const result = await httpClient.request(reqOpts);
1255
- sideEffects?.onSuccess?.(result);
1256
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1257
- (0, import_transform_paths2.transformPaths)(result.data, [
1258
- {
1259
- transformFn: import_image2.transformRESTImageToSDKImage,
1260
- paths: [{ path: "sections.description.image" }]
1261
- },
1262
- {
1263
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1264
- paths: [{ path: "sections.description.video" }]
1265
- }
1266
- ])
1267
- );
1268
- } catch (err) {
1269
- const transformedError = (0, import_transform_error.transformError)(
1270
- err,
1271
- {
1272
- spreadPathsToArguments: {},
1273
- explicitPathsToArguments: { query: "$[0]" },
1274
- singleArgumentUnchanged: false
1275
- },
1276
- ["query", "options"]
1277
- );
1278
- sideEffects?.onError?.(err);
1279
- throw transformedError;
1280
- }
1281
- }
1282
- var utils = {
1283
- query: /* @__PURE__ */ (0, import_query_builder_utils.createQueryUtils)()
1284
- };
1285
- async function listSections2(programId, options) {
1286
- const { httpClient, sideEffects } = arguments[2];
1287
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1288
- programId,
1289
- descriptionFieldSet: options?.descriptionFieldSet,
1290
- fields: options?.fields
1291
- });
1292
- const reqOpts = listSections(payload);
1293
- sideEffects?.onSiteCall?.();
1294
- try {
1295
- const result = await httpClient.request(reqOpts);
1296
- sideEffects?.onSuccess?.(result);
1297
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1298
- (0, import_transform_paths2.transformPaths)(result.data, [
1299
- {
1300
- transformFn: import_image2.transformRESTImageToSDKImage,
1301
- paths: [{ path: "sections.description.image" }]
1302
- },
1303
- {
1304
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1305
- paths: [{ path: "sections.description.video" }]
1306
- }
1307
- ])
1308
- );
1309
- } catch (err) {
1310
- const transformedError = (0, import_transform_error.transformError)(
1311
- err,
1312
- {
1313
- spreadPathsToArguments: {},
1314
- explicitPathsToArguments: {
1315
- programId: "$[0]",
1316
- descriptionFieldSet: "$[1].descriptionFieldSet",
1317
- fields: "$[1].fields"
1318
- },
1319
- singleArgumentUnchanged: false
1320
- },
1321
- ["programId", "options"]
1322
- );
1323
- sideEffects?.onError?.(err);
1324
- throw transformedError;
1325
- }
1326
- }
1327
- async function cloneSection2(sectionId, options) {
1328
- const { httpClient, sideEffects } = arguments[2];
1329
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1330
- sectionId,
1331
- fields: options?.fields
1332
- });
1333
- const reqOpts = cloneSection(payload);
1334
- sideEffects?.onSiteCall?.();
1335
- try {
1336
- const result = await httpClient.request(reqOpts);
1337
- sideEffects?.onSuccess?.(result);
1338
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1339
- (0, import_transform_paths2.transformPaths)(result.data, [
1340
- {
1341
- transformFn: import_image2.transformRESTImageToSDKImage,
1342
- paths: [{ path: "section.description.image" }]
1343
- },
1344
- {
1345
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1346
- paths: [{ path: "section.description.video" }]
1347
- }
1348
- ])
1349
- );
1350
- } catch (err) {
1351
- const transformedError = (0, import_transform_error.transformError)(
1352
- err,
1353
- {
1354
- spreadPathsToArguments: {},
1355
- explicitPathsToArguments: { sectionId: "$[0]", fields: "$[1].fields" },
1356
- singleArgumentUnchanged: false
1357
- },
1358
- ["sectionId", "options"]
1359
- );
1360
- sideEffects?.onError?.(err);
1361
- throw transformedError;
1362
- }
1363
- }
1364
- async function moveSection2(options) {
1365
- const { httpClient, sideEffects } = arguments[1];
1366
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1367
- sectionId: options?.sectionId,
1368
- afterSectionId: options?.afterSectionId,
1369
- revision: options?.revision,
1370
- fields: options?.fields
1371
- });
1372
- const reqOpts = moveSection(payload);
1373
- sideEffects?.onSiteCall?.();
1374
- try {
1375
- const result = await httpClient.request(reqOpts);
1376
- sideEffects?.onSuccess?.(result);
1377
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1378
- (0, import_transform_paths2.transformPaths)(result.data, [
1379
- {
1380
- transformFn: import_image2.transformRESTImageToSDKImage,
1381
- paths: [{ path: "section.description.image" }]
1382
- },
1383
- {
1384
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1385
- paths: [{ path: "section.description.video" }]
1386
- }
1387
- ])
1388
- );
1389
- } catch (err) {
1390
- const transformedError = (0, import_transform_error.transformError)(
1391
- err,
1392
- {
1393
- spreadPathsToArguments: {},
1394
- explicitPathsToArguments: {
1395
- sectionId: "$[0].sectionId",
1396
- afterSectionId: "$[0].afterSectionId",
1397
- revision: "$[0].revision",
1398
- fields: "$[0].fields"
1399
- },
1400
- singleArgumentUnchanged: false
1401
- },
1402
- ["options"]
1403
- );
1404
- sideEffects?.onError?.(err);
1405
- throw transformedError;
1406
- }
1407
- }
1408
- async function publishSection2(options) {
1409
- const { httpClient, sideEffects } = arguments[1];
1410
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1411
- sectionId: options?.sectionId,
1412
- revision: options?.revision,
1413
- fields: options?.fields
1414
- });
1415
- const reqOpts = publishSection(payload);
1416
- sideEffects?.onSiteCall?.();
1417
- try {
1418
- const result = await httpClient.request(reqOpts);
1419
- sideEffects?.onSuccess?.(result);
1420
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1421
- (0, import_transform_paths2.transformPaths)(result.data, [
1422
- {
1423
- transformFn: import_image2.transformRESTImageToSDKImage,
1424
- paths: [{ path: "section.description.image" }]
1425
- },
1426
- {
1427
- transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1428
- paths: [{ path: "section.description.video" }]
1429
- }
1430
- ])
1431
- );
1432
- } catch (err) {
1433
- const transformedError = (0, import_transform_error.transformError)(
1434
- err,
1435
- {
1436
- spreadPathsToArguments: {},
1437
- explicitPathsToArguments: {
1438
- sectionId: "$[0].sectionId",
1439
- revision: "$[0].revision",
1440
- fields: "$[0].fields"
1441
- },
1442
- singleArgumentUnchanged: false
1443
- },
1444
- ["options"]
1445
- );
1446
- sideEffects?.onError?.(err);
1447
- throw transformedError;
1448
- }
1449
- }
1450
-
1451
- // src/online-programs-v3-section-sections.public.ts
1452
- function createSection3(httpClient) {
1453
- return (section, options) => createSection2(
1454
- section,
1455
- options,
1456
- // @ts-ignore
1457
- { httpClient }
1458
- );
1459
- }
1460
- function bulkCreateSections3(httpClient) {
1461
- return (sections, options) => bulkCreateSections2(
1462
- sections,
1463
- options,
1464
- // @ts-ignore
1465
- { httpClient }
1466
- );
1467
- }
1468
- function bulkCreateSection3(httpClient) {
1469
- return (sections, options) => bulkCreateSection2(
1470
- sections,
1471
- options,
1472
- // @ts-ignore
1473
- { httpClient }
1474
- );
1475
- }
1476
- function getSection3(httpClient) {
1477
- return (sectionId, options) => getSection2(
1478
- sectionId,
1479
- options,
1480
- // @ts-ignore
1481
- { httpClient }
1482
- );
1483
- }
1484
- function updateSection3(httpClient) {
1485
- return (_id, options) => updateSection2(
1486
- _id,
1487
- options,
1488
- // @ts-ignore
1489
- { httpClient }
1490
- );
1491
- }
1492
- function deleteSection3(httpClient) {
1493
- return (sectionId) => deleteSection2(
1494
- sectionId,
1495
- // @ts-ignore
1496
- { httpClient }
1497
- );
1498
- }
1499
- function querySections3(httpClient) {
1500
- return (options) => querySections2(
1501
- options,
1502
- // @ts-ignore
1503
- { httpClient }
1504
- );
1505
- }
1506
- function typedQuerySections2(httpClient) {
1507
- return (query, options) => typedQuerySections(
1508
- query,
1509
- options,
1510
- // @ts-ignore
1511
- { httpClient }
1512
- );
1513
- }
1514
- function listSections3(httpClient) {
1515
- return (programId, options) => listSections2(
1516
- programId,
1517
- options,
1518
- // @ts-ignore
1519
- { httpClient }
1520
- );
1521
- }
1522
- function cloneSection3(httpClient) {
1523
- return (sectionId, options) => cloneSection2(
1524
- sectionId,
1525
- options,
1526
- // @ts-ignore
1527
- { httpClient }
1528
- );
1529
- }
1530
- function moveSection3(httpClient) {
1531
- return (options) => moveSection2(
1532
- options,
1533
- // @ts-ignore
1534
- { httpClient }
1535
- );
1536
- }
1537
- function publishSection3(httpClient) {
1538
- return (options) => publishSection2(
1539
- options,
1540
- // @ts-ignore
1541
- { httpClient }
1542
- );
1543
- }
1544
-
1545
- // src/online-programs-v3-section-sections.context.ts
1546
- var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
1547
- var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
1548
- function customQuerySections(httpClient) {
1549
- const router = /* @__PURE__ */ (0, import_query_method_router.createQueryOverloadRouter)({
1550
- builderQueryFunction: (options) => querySections3(httpClient)(options),
1551
- typedQueryFunction: (query, options) => typedQuerySections2(httpClient)(query, options),
1552
- hasOptionsParameter: true
1553
- });
1554
- function overloadedQuery(queryOrOptions, options) {
1555
- return router(...arguments);
1556
- }
1557
- return overloadedQuery;
1558
- }
1559
- var createSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSection3);
1560
- var bulkCreateSections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateSections3);
1561
- var bulkCreateSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateSection3);
1562
- var getSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getSection3);
1563
- var updateSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateSection3);
1564
- var deleteSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteSection3);
1565
- var listSections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listSections3);
1566
- var cloneSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(cloneSection3);
1567
- var moveSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(moveSection3);
1568
- var publishSection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(publishSection3);
1569
- var querySections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQuerySections);
1570
- // Annotate the CommonJS export names for ESM import in node:
1571
- 0 && (module.exports = {
1572
- BulkActionType,
1573
- DescriptionFieldSet,
1574
- Enum,
1575
- RequestedFields,
1576
- SearchIndexingNotificationState,
1577
- SortOrder,
1578
- State,
1579
- WebhookIdentityType,
1580
- bulkCreateSection,
1581
- bulkCreateSections,
1582
- cloneSection,
1583
- createSection,
1584
- deleteSection,
1585
- getSection,
1586
- listSections,
1587
- moveSection,
1588
- publishSection,
1589
- querySections,
1590
- updateSection,
1591
- utils
1592
- });
1593
- //# sourceMappingURL=index.js.map