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