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