@wix/auto_sdk_portfolio_project-items 1.0.50 → 1.0.52

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.
@@ -14,6 +14,137 @@ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transform
14
14
  import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
15
15
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
16
16
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
17
+ var TRANSFORM_PATHS_0 = [
18
+ { path: "item.sortOrder" },
19
+ { path: "item.image.focalPoint.x" },
20
+ { path: "item.image.focalPoint.y" },
21
+ { path: "item.image.unsharpMasking.amount" },
22
+ { path: "item.image.unsharpMasking.radius" },
23
+ { path: "item.image.unsharpMasking.threshold" }
24
+ ];
25
+ var TRANSFORM_PATHS_1 = [
26
+ { path: "item.createdDate" },
27
+ { path: "item.updatedDate" },
28
+ { path: "item.image.imageInfo.urlExpirationDate" },
29
+ { path: "item.video.videoInfo.urlExpirationDate" },
30
+ { path: "item.video.videoInfo.resolutions.poster.urlExpirationDate" },
31
+ { path: "item.video.videoInfo.posters.urlExpirationDate" }
32
+ ];
33
+ var TRANSFORM_PATHS_2 = [
34
+ { path: "items.sortOrder" },
35
+ { path: "items.image.focalPoint.x" },
36
+ { path: "items.image.focalPoint.y" },
37
+ { path: "items.image.unsharpMasking.amount" },
38
+ { path: "items.image.unsharpMasking.radius" },
39
+ { path: "items.image.unsharpMasking.threshold" }
40
+ ];
41
+ var TRANSFORM_PATHS_3 = [
42
+ { path: "items.createdDate" },
43
+ { path: "items.updatedDate" },
44
+ { path: "items.image.imageInfo.urlExpirationDate" },
45
+ { path: "items.video.videoInfo.urlExpirationDate" },
46
+ { path: "items.video.videoInfo.resolutions.poster.urlExpirationDate" },
47
+ { path: "items.video.videoInfo.posters.urlExpirationDate" }
48
+ ];
49
+ var TRANSFORM_PATHS_4 = [
50
+ { path: "results.item.sortOrder" },
51
+ { path: "results.item.image.focalPoint.x" },
52
+ { path: "results.item.image.focalPoint.y" },
53
+ { path: "results.item.image.unsharpMasking.amount" },
54
+ { path: "results.item.image.unsharpMasking.radius" },
55
+ { path: "results.item.image.unsharpMasking.threshold" }
56
+ ];
57
+ var TRANSFORM_PATHS_5 = [
58
+ { path: "results.item.createdDate" },
59
+ { path: "results.item.updatedDate" },
60
+ { path: "results.item.image.imageInfo.urlExpirationDate" },
61
+ { path: "results.item.video.videoInfo.urlExpirationDate" },
62
+ { path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate" },
63
+ { path: "results.item.video.videoInfo.posters.urlExpirationDate" }
64
+ ];
65
+ var TRANSFORM_PATHS_6 = [{ path: "mask" }];
66
+ var TRANSFORM_PATHS_7 = [{ path: "items.fieldMask" }];
67
+ var TRANSFORM_PATHS_8 = [
68
+ { path: "items.item.sortOrder" },
69
+ { path: "items.item.image.focalPoint.x" },
70
+ { path: "items.item.image.focalPoint.y" },
71
+ { path: "items.item.image.unsharpMasking.amount" },
72
+ { path: "items.item.image.unsharpMasking.radius" },
73
+ { path: "items.item.image.unsharpMasking.threshold" }
74
+ ];
75
+ var TRANSFORM_PATHS_9 = [
76
+ { path: "items.item.createdDate" },
77
+ { path: "items.item.updatedDate" },
78
+ { path: "items.item.image.imageInfo.urlExpirationDate" },
79
+ { path: "items.item.video.videoInfo.urlExpirationDate" },
80
+ { path: "items.item.video.videoInfo.resolutions.poster.urlExpirationDate" },
81
+ { path: "items.item.video.videoInfo.posters.urlExpirationDate" }
82
+ ];
83
+ function resolveComWixpressPortfolioPortfolioappMediaServiceUrl(opts) {
84
+ const domainToMappings = {
85
+ "manage._base_domain_": [
86
+ {
87
+ srcPath: "/_api/portfolio-app-service",
88
+ destPath: "/api"
89
+ }
90
+ ],
91
+ "editor._base_domain_": [
92
+ {
93
+ srcPath: "/_api/portfolio-app-service",
94
+ destPath: "/api"
95
+ }
96
+ ],
97
+ "blocks._base_domain_": [
98
+ {
99
+ srcPath: "/_api/portfolio-app-service",
100
+ destPath: "/api"
101
+ }
102
+ ],
103
+ "create.editorx": [
104
+ {
105
+ srcPath: "/_api/portfolio-app-service",
106
+ destPath: "/api"
107
+ }
108
+ ],
109
+ _: [
110
+ {
111
+ srcPath: "/_api/portfolio-app-service",
112
+ destPath: "/api"
113
+ }
114
+ ],
115
+ "api._api_base_domain_": [
116
+ {
117
+ srcPath: "/_api/portfolio-app-service",
118
+ destPath: "/api"
119
+ }
120
+ ],
121
+ "www.wixapis.com": [
122
+ {
123
+ srcPath: "/portfolio/v1/settings",
124
+ destPath: "/api/v1/portfolio/settings"
125
+ },
126
+ {
127
+ srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
128
+ destPath: "/api/v1/portfolio/settings"
129
+ },
130
+ {
131
+ srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
132
+ destPath: "/api/v1/portfolio/project/items/media"
133
+ }
134
+ ],
135
+ "*.dev.wix-code.com": [
136
+ {
137
+ srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
138
+ destPath: "/api/v1/portfolio/settings"
139
+ },
140
+ {
141
+ srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
142
+ destPath: "/api/v1/portfolio/project/items/media"
143
+ }
144
+ ]
145
+ };
146
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
147
+ }
17
148
  function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
18
149
  const domainToMappings = {
19
150
  "manage._base_domain_": [
@@ -133,117 +264,17 @@ function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
133
264
  };
134
265
  return resolveUrl(Object.assign(opts, { domainToMappings }));
135
266
  }
136
- function resolveComWixpressPortfolioPortfolioappMediaServiceUrl(opts) {
137
- const domainToMappings = {
138
- "manage._base_domain_": [
139
- {
140
- srcPath: "/_api/portfolio-app-service",
141
- destPath: "/api"
142
- }
143
- ],
144
- "editor._base_domain_": [
145
- {
146
- srcPath: "/_api/portfolio-app-service",
147
- destPath: "/api"
148
- }
149
- ],
150
- "blocks._base_domain_": [
151
- {
152
- srcPath: "/_api/portfolio-app-service",
153
- destPath: "/api"
154
- }
155
- ],
156
- "create.editorx": [
157
- {
158
- srcPath: "/_api/portfolio-app-service",
159
- destPath: "/api"
160
- }
161
- ],
162
- _: [
163
- {
164
- srcPath: "/_api/portfolio-app-service",
165
- destPath: "/api"
166
- }
167
- ],
168
- "api._api_base_domain_": [
169
- {
170
- srcPath: "/_api/portfolio-app-service",
171
- destPath: "/api"
172
- }
173
- ],
174
- "www.wixapis.com": [
175
- {
176
- srcPath: "/portfolio/v1/settings",
177
- destPath: "/api/v1/portfolio/settings"
178
- },
179
- {
180
- srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
181
- destPath: "/api/v1/portfolio/settings"
182
- },
183
- {
184
- srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
185
- destPath: "/api/v1/portfolio/project/items/media"
186
- }
187
- ],
188
- "*.dev.wix-code.com": [
189
- {
190
- srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
191
- destPath: "/api/v1/portfolio/settings"
192
- },
193
- {
194
- srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
195
- destPath: "/api/v1/portfolio/project/items/media"
196
- }
197
- ]
198
- };
199
- return resolveUrl(Object.assign(opts, { domainToMappings }));
200
- }
201
267
  var PACKAGE_NAME = "@wix/auto_sdk_portfolio_project-items";
202
- function generateTokenForProjectItems(payload) {
203
- function __generateTokenForProjectItems({ host }) {
204
- const metadata = {
205
- entityFqdn: "wix.portfolio.project_items.v1.project_item",
206
- method: "POST",
207
- methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
208
- packageName: PACKAGE_NAME,
209
- migrationOptions: {
210
- optInTransformResponse: true
211
- },
212
- url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
213
- protoPath: "/api/v1/portfolio/project/items/media",
214
- data: payload,
215
- host
216
- }),
217
- data: payload
218
- };
219
- return metadata;
220
- }
221
- return __generateTokenForProjectItems;
222
- }
223
268
  function createProjectItem(payload) {
224
269
  function __createProjectItem({ host }) {
225
270
  const serializedData = transformPaths(payload, [
226
271
  {
227
272
  transformFn: transformSDKFloatToRESTFloat,
228
- paths: [
229
- { path: "item.sortOrder" },
230
- { path: "item.image.focalPoint.x" },
231
- { path: "item.image.focalPoint.y" },
232
- { path: "item.image.unsharpMasking.amount" },
233
- { path: "item.image.unsharpMasking.radius" },
234
- { path: "item.image.unsharpMasking.threshold" }
235
- ]
273
+ paths: TRANSFORM_PATHS_0
236
274
  },
237
275
  {
238
276
  transformFn: transformSDKTimestampToRESTTimestamp,
239
- paths: [
240
- { path: "item.createdDate" },
241
- { path: "item.updatedDate" },
242
- { path: "item.image.imageInfo.urlExpirationDate" },
243
- { path: "item.video.videoInfo.urlExpirationDate" },
244
- { path: "item.video.videoInfo.resolutions.poster.urlExpirationDate" },
245
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
246
- ]
277
+ paths: TRANSFORM_PATHS_1
247
278
  }
248
279
  ]);
249
280
  const metadata = {
@@ -263,27 +294,11 @@ function createProjectItem(payload) {
263
294
  transformResponse: (payload2) => transformPaths(payload2, [
264
295
  {
265
296
  transformFn: transformRESTFloatToSDKFloat,
266
- paths: [
267
- { path: "item.sortOrder" },
268
- { path: "item.image.focalPoint.x" },
269
- { path: "item.image.focalPoint.y" },
270
- { path: "item.image.unsharpMasking.amount" },
271
- { path: "item.image.unsharpMasking.radius" },
272
- { path: "item.image.unsharpMasking.threshold" }
273
- ]
297
+ paths: TRANSFORM_PATHS_0
274
298
  },
275
299
  {
276
300
  transformFn: transformRESTTimestampToSDKTimestamp,
277
- paths: [
278
- { path: "item.createdDate" },
279
- { path: "item.updatedDate" },
280
- { path: "item.image.imageInfo.urlExpirationDate" },
281
- { path: "item.video.videoInfo.urlExpirationDate" },
282
- {
283
- path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
284
- },
285
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
286
- ]
301
+ paths: TRANSFORM_PATHS_1
287
302
  }
288
303
  ])
289
304
  };
@@ -296,27 +311,11 @@ function bulkCreateProjectItems(payload) {
296
311
  const serializedData = transformPaths(payload, [
297
312
  {
298
313
  transformFn: transformSDKFloatToRESTFloat,
299
- paths: [
300
- { path: "items.sortOrder" },
301
- { path: "items.image.focalPoint.x" },
302
- { path: "items.image.focalPoint.y" },
303
- { path: "items.image.unsharpMasking.amount" },
304
- { path: "items.image.unsharpMasking.radius" },
305
- { path: "items.image.unsharpMasking.threshold" }
306
- ]
314
+ paths: TRANSFORM_PATHS_2
307
315
  },
308
316
  {
309
317
  transformFn: transformSDKTimestampToRESTTimestamp,
310
- paths: [
311
- { path: "items.createdDate" },
312
- { path: "items.updatedDate" },
313
- { path: "items.image.imageInfo.urlExpirationDate" },
314
- { path: "items.video.videoInfo.urlExpirationDate" },
315
- {
316
- path: "items.video.videoInfo.resolutions.poster.urlExpirationDate"
317
- },
318
- { path: "items.video.videoInfo.posters.urlExpirationDate" }
319
- ]
318
+ paths: TRANSFORM_PATHS_3
320
319
  }
321
320
  ]);
322
321
  const metadata = {
@@ -336,29 +335,11 @@ function bulkCreateProjectItems(payload) {
336
335
  transformResponse: (payload2) => transformPaths(payload2, [
337
336
  {
338
337
  transformFn: transformRESTFloatToSDKFloat,
339
- paths: [
340
- { path: "results.item.sortOrder" },
341
- { path: "results.item.image.focalPoint.x" },
342
- { path: "results.item.image.focalPoint.y" },
343
- { path: "results.item.image.unsharpMasking.amount" },
344
- { path: "results.item.image.unsharpMasking.radius" },
345
- { path: "results.item.image.unsharpMasking.threshold" }
346
- ]
338
+ paths: TRANSFORM_PATHS_4
347
339
  },
348
340
  {
349
341
  transformFn: transformRESTTimestampToSDKTimestamp,
350
- paths: [
351
- { path: "results.item.createdDate" },
352
- { path: "results.item.updatedDate" },
353
- { path: "results.item.image.imageInfo.urlExpirationDate" },
354
- { path: "results.item.video.videoInfo.urlExpirationDate" },
355
- {
356
- path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate"
357
- },
358
- {
359
- path: "results.item.video.videoInfo.posters.urlExpirationDate"
360
- }
361
- ]
342
+ paths: TRANSFORM_PATHS_5
362
343
  }
363
344
  ])
364
345
  };
@@ -385,27 +366,11 @@ function getProjectItem(payload) {
385
366
  transformResponse: (payload2) => transformPaths(payload2, [
386
367
  {
387
368
  transformFn: transformRESTFloatToSDKFloat,
388
- paths: [
389
- { path: "item.sortOrder" },
390
- { path: "item.image.focalPoint.x" },
391
- { path: "item.image.focalPoint.y" },
392
- { path: "item.image.unsharpMasking.amount" },
393
- { path: "item.image.unsharpMasking.radius" },
394
- { path: "item.image.unsharpMasking.threshold" }
395
- ]
369
+ paths: TRANSFORM_PATHS_0
396
370
  },
397
371
  {
398
372
  transformFn: transformRESTTimestampToSDKTimestamp,
399
- paths: [
400
- { path: "item.createdDate" },
401
- { path: "item.updatedDate" },
402
- { path: "item.image.imageInfo.urlExpirationDate" },
403
- { path: "item.video.videoInfo.urlExpirationDate" },
404
- {
405
- path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
406
- },
407
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
408
- ]
373
+ paths: TRANSFORM_PATHS_1
409
374
  }
410
375
  ]),
411
376
  fallback: [
@@ -443,27 +408,11 @@ function listProjectItems(payload) {
443
408
  transformResponse: (payload2) => transformPaths(payload2, [
444
409
  {
445
410
  transformFn: transformRESTFloatToSDKFloat,
446
- paths: [
447
- { path: "items.sortOrder" },
448
- { path: "items.image.focalPoint.x" },
449
- { path: "items.image.focalPoint.y" },
450
- { path: "items.image.unsharpMasking.amount" },
451
- { path: "items.image.unsharpMasking.radius" },
452
- { path: "items.image.unsharpMasking.threshold" }
453
- ]
411
+ paths: TRANSFORM_PATHS_2
454
412
  },
455
413
  {
456
414
  transformFn: transformRESTTimestampToSDKTimestamp,
457
- paths: [
458
- { path: "items.createdDate" },
459
- { path: "items.updatedDate" },
460
- { path: "items.image.imageInfo.urlExpirationDate" },
461
- { path: "items.video.videoInfo.urlExpirationDate" },
462
- {
463
- path: "items.video.videoInfo.resolutions.poster.urlExpirationDate"
464
- },
465
- { path: "items.video.videoInfo.posters.urlExpirationDate" }
466
- ]
415
+ paths: TRANSFORM_PATHS_3
467
416
  }
468
417
  ])
469
418
  };
@@ -476,29 +425,15 @@ function updateProjectItem(payload) {
476
425
  const serializedData = transformPaths(payload, [
477
426
  {
478
427
  transformFn: transformSDKFieldMaskToRESTFieldMask,
479
- paths: [{ path: "mask" }]
428
+ paths: TRANSFORM_PATHS_6
480
429
  },
481
430
  {
482
431
  transformFn: transformSDKFloatToRESTFloat,
483
- paths: [
484
- { path: "item.sortOrder" },
485
- { path: "item.image.focalPoint.x" },
486
- { path: "item.image.focalPoint.y" },
487
- { path: "item.image.unsharpMasking.amount" },
488
- { path: "item.image.unsharpMasking.radius" },
489
- { path: "item.image.unsharpMasking.threshold" }
490
- ]
432
+ paths: TRANSFORM_PATHS_0
491
433
  },
492
434
  {
493
435
  transformFn: transformSDKTimestampToRESTTimestamp,
494
- paths: [
495
- { path: "item.createdDate" },
496
- { path: "item.updatedDate" },
497
- { path: "item.image.imageInfo.urlExpirationDate" },
498
- { path: "item.video.videoInfo.urlExpirationDate" },
499
- { path: "item.video.videoInfo.resolutions.poster.urlExpirationDate" },
500
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
501
- ]
436
+ paths: TRANSFORM_PATHS_1
502
437
  }
503
438
  ]);
504
439
  const metadata = {
@@ -518,27 +453,11 @@ function updateProjectItem(payload) {
518
453
  transformResponse: (payload2) => transformPaths(payload2, [
519
454
  {
520
455
  transformFn: transformRESTFloatToSDKFloat,
521
- paths: [
522
- { path: "item.sortOrder" },
523
- { path: "item.image.focalPoint.x" },
524
- { path: "item.image.focalPoint.y" },
525
- { path: "item.image.unsharpMasking.amount" },
526
- { path: "item.image.unsharpMasking.radius" },
527
- { path: "item.image.unsharpMasking.threshold" }
528
- ]
456
+ paths: TRANSFORM_PATHS_0
529
457
  },
530
458
  {
531
459
  transformFn: transformRESTTimestampToSDKTimestamp,
532
- paths: [
533
- { path: "item.createdDate" },
534
- { path: "item.updatedDate" },
535
- { path: "item.image.imageInfo.urlExpirationDate" },
536
- { path: "item.video.videoInfo.urlExpirationDate" },
537
- {
538
- path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
539
- },
540
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
541
- ]
460
+ paths: TRANSFORM_PATHS_1
542
461
  }
543
462
  ])
544
463
  };
@@ -551,31 +470,15 @@ function bulkUpdateProjectItems(payload) {
551
470
  const serializedData = transformPaths(payload, [
552
471
  {
553
472
  transformFn: transformSDKFieldMaskToRESTFieldMask,
554
- paths: [{ path: "items.fieldMask" }]
473
+ paths: TRANSFORM_PATHS_7
555
474
  },
556
475
  {
557
476
  transformFn: transformSDKFloatToRESTFloat,
558
- paths: [
559
- { path: "items.item.sortOrder" },
560
- { path: "items.item.image.focalPoint.x" },
561
- { path: "items.item.image.focalPoint.y" },
562
- { path: "items.item.image.unsharpMasking.amount" },
563
- { path: "items.item.image.unsharpMasking.radius" },
564
- { path: "items.item.image.unsharpMasking.threshold" }
565
- ]
477
+ paths: TRANSFORM_PATHS_8
566
478
  },
567
479
  {
568
480
  transformFn: transformSDKTimestampToRESTTimestamp,
569
- paths: [
570
- { path: "items.item.createdDate" },
571
- { path: "items.item.updatedDate" },
572
- { path: "items.item.image.imageInfo.urlExpirationDate" },
573
- { path: "items.item.video.videoInfo.urlExpirationDate" },
574
- {
575
- path: "items.item.video.videoInfo.resolutions.poster.urlExpirationDate"
576
- },
577
- { path: "items.item.video.videoInfo.posters.urlExpirationDate" }
578
- ]
481
+ paths: TRANSFORM_PATHS_9
579
482
  }
580
483
  ]);
581
484
  const metadata = {
@@ -595,29 +498,11 @@ function bulkUpdateProjectItems(payload) {
595
498
  transformResponse: (payload2) => transformPaths(payload2, [
596
499
  {
597
500
  transformFn: transformRESTFloatToSDKFloat,
598
- paths: [
599
- { path: "results.item.sortOrder" },
600
- { path: "results.item.image.focalPoint.x" },
601
- { path: "results.item.image.focalPoint.y" },
602
- { path: "results.item.image.unsharpMasking.amount" },
603
- { path: "results.item.image.unsharpMasking.radius" },
604
- { path: "results.item.image.unsharpMasking.threshold" }
605
- ]
501
+ paths: TRANSFORM_PATHS_4
606
502
  },
607
503
  {
608
504
  transformFn: transformRESTTimestampToSDKTimestamp,
609
- paths: [
610
- { path: "results.item.createdDate" },
611
- { path: "results.item.updatedDate" },
612
- { path: "results.item.image.imageInfo.urlExpirationDate" },
613
- { path: "results.item.video.videoInfo.urlExpirationDate" },
614
- {
615
- path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate"
616
- },
617
- {
618
- path: "results.item.video.videoInfo.posters.urlExpirationDate"
619
- }
620
- ]
505
+ paths: TRANSFORM_PATHS_5
621
506
  }
622
507
  ])
623
508
  };
@@ -688,6 +573,27 @@ function duplicateProjectItems(payload) {
688
573
  }
689
574
  return __duplicateProjectItems;
690
575
  }
576
+ function generateTokenForProjectItems(payload) {
577
+ function __generateTokenForProjectItems({ host }) {
578
+ const metadata = {
579
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
580
+ method: "POST",
581
+ methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
582
+ packageName: PACKAGE_NAME,
583
+ migrationOptions: {
584
+ optInTransformResponse: true
585
+ },
586
+ url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
587
+ protoPath: "/api/v1/portfolio/project/items/media",
588
+ data: payload,
589
+ host
590
+ }),
591
+ data: payload
592
+ };
593
+ return metadata;
594
+ }
595
+ return __generateTokenForProjectItems;
596
+ }
691
597
 
692
598
  // src/portfolio-project-items-v1-project-item-project-items.universal.ts
693
599
  import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
@@ -695,6 +601,14 @@ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/i
695
601
  import { transformSDKVideoV2ToRESTVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
696
602
  import { transformRESTVideoV2ToSDKVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
697
603
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
604
+ var TRANSFORM_PATHS_02 = [{ path: "item.image.imageInfo" }];
605
+ var TRANSFORM_PATHS_12 = [{ path: "item.video.videoInfo" }];
606
+ var TRANSFORM_PATHS_22 = [{ path: "items.image.imageInfo" }];
607
+ var TRANSFORM_PATHS_32 = [{ path: "items.video.videoInfo" }];
608
+ var TRANSFORM_PATHS_42 = [{ path: "results.item.image.imageInfo" }];
609
+ var TRANSFORM_PATHS_52 = [{ path: "results.item.video.videoInfo" }];
610
+ var TRANSFORM_PATHS_62 = [{ path: "items.item.image.imageInfo" }];
611
+ var TRANSFORM_PATHS_72 = [{ path: "items.item.video.videoInfo" }];
698
612
  var Type = /* @__PURE__ */ ((Type2) => {
699
613
  Type2["UNDEFINED"] = "UNDEFINED";
700
614
  Type2["IMAGE"] = "IMAGE";
@@ -707,6 +621,11 @@ var ImageType = /* @__PURE__ */ ((ImageType2) => {
707
621
  ImageType2["EXTERNAL"] = "EXTERNAL";
708
622
  return ImageType2;
709
623
  })(ImageType || {});
624
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
625
+ SortOrder2["ASC"] = "ASC";
626
+ SortOrder2["DESC"] = "DESC";
627
+ return SortOrder2;
628
+ })(SortOrder || {});
710
629
  var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
711
630
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
712
631
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
@@ -715,36 +634,6 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
715
634
  WebhookIdentityType2["APP"] = "APP";
716
635
  return WebhookIdentityType2;
717
636
  })(WebhookIdentityType || {});
718
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
719
- SortOrder2["ASC"] = "ASC";
720
- SortOrder2["DESC"] = "DESC";
721
- return SortOrder2;
722
- })(SortOrder || {});
723
- async function generateTokenForProjectItems2(mediaIds) {
724
- const { httpClient, sideEffects } = arguments[1];
725
- const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
726
- const reqOpts = generateTokenForProjectItems(
727
- payload
728
- );
729
- sideEffects?.onSiteCall?.();
730
- try {
731
- const result = await httpClient.request(reqOpts);
732
- sideEffects?.onSuccess?.(result);
733
- return renameKeysFromRESTResponseToSDKResponse(result.data);
734
- } catch (err) {
735
- const transformedError = sdkTransformError(
736
- err,
737
- {
738
- spreadPathsToArguments: {},
739
- explicitPathsToArguments: { mediaIds: "$[0]" },
740
- singleArgumentUnchanged: false
741
- },
742
- ["mediaIds"]
743
- );
744
- sideEffects?.onError?.(err);
745
- throw transformedError;
746
- }
747
- }
748
637
  async function createProjectItem2(item) {
749
638
  const { httpClient, sideEffects } = arguments[1];
750
639
  const payload = transformPaths2(
@@ -752,11 +641,11 @@ async function createProjectItem2(item) {
752
641
  [
753
642
  {
754
643
  transformFn: transformSDKImageToRESTImage,
755
- paths: [{ path: "item.image.imageInfo" }]
644
+ paths: TRANSFORM_PATHS_02
756
645
  },
757
646
  {
758
647
  transformFn: transformSDKVideoV2ToRESTVideoV2,
759
- paths: [{ path: "item.video.videoInfo" }]
648
+ paths: TRANSFORM_PATHS_12
760
649
  }
761
650
  ]
762
651
  );
@@ -769,11 +658,11 @@ async function createProjectItem2(item) {
769
658
  transformPaths2(result.data, [
770
659
  {
771
660
  transformFn: transformRESTImageToSDKImage,
772
- paths: [{ path: "item.image.imageInfo" }]
661
+ paths: TRANSFORM_PATHS_02
773
662
  },
774
663
  {
775
664
  transformFn: transformRESTVideoV2ToSDKVideoV2,
776
- paths: [{ path: "item.video.videoInfo" }]
665
+ paths: TRANSFORM_PATHS_12
777
666
  }
778
667
  ])
779
668
  )?.item;
@@ -801,11 +690,11 @@ async function bulkCreateProjectItems2(options) {
801
690
  [
802
691
  {
803
692
  transformFn: transformSDKImageToRESTImage,
804
- paths: [{ path: "items.image.imageInfo" }]
693
+ paths: TRANSFORM_PATHS_22
805
694
  },
806
695
  {
807
696
  transformFn: transformSDKVideoV2ToRESTVideoV2,
808
- paths: [{ path: "items.video.videoInfo" }]
697
+ paths: TRANSFORM_PATHS_32
809
698
  }
810
699
  ]
811
700
  );
@@ -820,11 +709,11 @@ async function bulkCreateProjectItems2(options) {
820
709
  transformPaths2(result.data, [
821
710
  {
822
711
  transformFn: transformRESTImageToSDKImage,
823
- paths: [{ path: "results.item.image.imageInfo" }]
712
+ paths: TRANSFORM_PATHS_42
824
713
  },
825
714
  {
826
715
  transformFn: transformRESTVideoV2ToSDKVideoV2,
827
- paths: [{ path: "results.item.video.videoInfo" }]
716
+ paths: TRANSFORM_PATHS_52
828
717
  }
829
718
  ])
830
719
  );
@@ -857,11 +746,11 @@ async function getProjectItem2(itemId) {
857
746
  transformPaths2(result.data, [
858
747
  {
859
748
  transformFn: transformRESTImageToSDKImage,
860
- paths: [{ path: "item.image.imageInfo" }]
749
+ paths: TRANSFORM_PATHS_02
861
750
  },
862
751
  {
863
752
  transformFn: transformRESTVideoV2ToSDKVideoV2,
864
- paths: [{ path: "item.video.videoInfo" }]
753
+ paths: TRANSFORM_PATHS_12
865
754
  }
866
755
  ])
867
756
  )?.item;
@@ -894,11 +783,11 @@ async function listProjectItems2(projectId, options) {
894
783
  transformPaths2(result.data, [
895
784
  {
896
785
  transformFn: transformRESTImageToSDKImage,
897
- paths: [{ path: "items.image.imageInfo" }]
786
+ paths: TRANSFORM_PATHS_22
898
787
  },
899
788
  {
900
789
  transformFn: transformRESTVideoV2ToSDKVideoV2,
901
- paths: [{ path: "items.video.videoInfo" }]
790
+ paths: TRANSFORM_PATHS_32
902
791
  }
903
792
  ])
904
793
  );
@@ -923,11 +812,11 @@ async function updateProjectItem2(_id, item) {
923
812
  [
924
813
  {
925
814
  transformFn: transformSDKImageToRESTImage,
926
- paths: [{ path: "item.image.imageInfo" }]
815
+ paths: TRANSFORM_PATHS_02
927
816
  },
928
817
  {
929
818
  transformFn: transformSDKVideoV2ToRESTVideoV2,
930
- paths: [{ path: "item.video.videoInfo" }]
819
+ paths: TRANSFORM_PATHS_12
931
820
  }
932
821
  ]
933
822
  );
@@ -940,11 +829,11 @@ async function updateProjectItem2(_id, item) {
940
829
  transformPaths2(result.data, [
941
830
  {
942
831
  transformFn: transformRESTImageToSDKImage,
943
- paths: [{ path: "item.image.imageInfo" }]
832
+ paths: TRANSFORM_PATHS_02
944
833
  },
945
834
  {
946
835
  transformFn: transformRESTVideoV2ToSDKVideoV2,
947
- paths: [{ path: "item.video.videoInfo" }]
836
+ paths: TRANSFORM_PATHS_12
948
837
  }
949
838
  ])
950
839
  )?.item;
@@ -972,11 +861,11 @@ async function bulkUpdateProjectItems2(options) {
972
861
  [
973
862
  {
974
863
  transformFn: transformSDKImageToRESTImage,
975
- paths: [{ path: "items.item.image.imageInfo" }]
864
+ paths: TRANSFORM_PATHS_62
976
865
  },
977
866
  {
978
867
  transformFn: transformSDKVideoV2ToRESTVideoV2,
979
- paths: [{ path: "items.item.video.videoInfo" }]
868
+ paths: TRANSFORM_PATHS_72
980
869
  }
981
870
  ]
982
871
  );
@@ -991,11 +880,11 @@ async function bulkUpdateProjectItems2(options) {
991
880
  transformPaths2(result.data, [
992
881
  {
993
882
  transformFn: transformRESTImageToSDKImage,
994
- paths: [{ path: "results.item.image.imageInfo" }]
883
+ paths: TRANSFORM_PATHS_42
995
884
  },
996
885
  {
997
886
  transformFn: transformRESTVideoV2ToSDKVideoV2,
998
- paths: [{ path: "results.item.video.videoInfo" }]
887
+ paths: TRANSFORM_PATHS_52
999
888
  }
1000
889
  ])
1001
890
  );
@@ -1097,6 +986,31 @@ async function duplicateProjectItems2(originProjectId, options) {
1097
986
  throw transformedError;
1098
987
  }
1099
988
  }
989
+ async function generateTokenForProjectItems2(mediaIds) {
990
+ const { httpClient, sideEffects } = arguments[1];
991
+ const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
992
+ const reqOpts = generateTokenForProjectItems(
993
+ payload
994
+ );
995
+ sideEffects?.onSiteCall?.();
996
+ try {
997
+ const result = await httpClient.request(reqOpts);
998
+ sideEffects?.onSuccess?.(result);
999
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1000
+ } catch (err) {
1001
+ const transformedError = sdkTransformError(
1002
+ err,
1003
+ {
1004
+ spreadPathsToArguments: {},
1005
+ explicitPathsToArguments: { mediaIds: "$[0]" },
1006
+ singleArgumentUnchanged: false
1007
+ },
1008
+ ["mediaIds"]
1009
+ );
1010
+ sideEffects?.onError?.(err);
1011
+ throw transformedError;
1012
+ }
1013
+ }
1100
1014
  export {
1101
1015
  ImageType,
1102
1016
  SortOrder,