@wix/auto_sdk_portfolio_project-items 1.0.51 → 1.0.53

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,71 +14,72 @@ 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
- function resolveComWixpressPortfolioPortfolioappMediaServiceUrl(opts) {
18
- const domainToMappings = {
19
- "manage._base_domain_": [
20
- {
21
- srcPath: "/_api/portfolio-app-service",
22
- destPath: "/api"
23
- }
24
- ],
25
- "editor._base_domain_": [
26
- {
27
- srcPath: "/_api/portfolio-app-service",
28
- destPath: "/api"
29
- }
30
- ],
31
- "blocks._base_domain_": [
32
- {
33
- srcPath: "/_api/portfolio-app-service",
34
- destPath: "/api"
35
- }
36
- ],
37
- "create.editorx": [
38
- {
39
- srcPath: "/_api/portfolio-app-service",
40
- destPath: "/api"
41
- }
42
- ],
43
- _: [
44
- {
45
- srcPath: "/_api/portfolio-app-service",
46
- destPath: "/api"
47
- }
48
- ],
49
- "api._api_base_domain_": [
50
- {
51
- srcPath: "/_api/portfolio-app-service",
52
- destPath: "/api"
53
- }
54
- ],
55
- "www.wixapis.com": [
56
- {
57
- srcPath: "/portfolio/v1/settings",
58
- destPath: "/api/v1/portfolio/settings"
59
- },
60
- {
61
- srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
62
- destPath: "/api/v1/portfolio/settings"
63
- },
64
- {
65
- srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
66
- destPath: "/api/v1/portfolio/project/items/media"
67
- }
68
- ],
69
- "*.dev.wix-code.com": [
70
- {
71
- srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
72
- destPath: "/api/v1/portfolio/settings"
73
- },
74
- {
75
- srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
76
- destPath: "/api/v1/portfolio/project/items/media"
77
- }
78
- ]
79
- };
80
- return resolveUrl(Object.assign(opts, { domainToMappings }));
81
- }
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
+ ];
82
83
  function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
83
84
  const domainToMappings = {
84
85
  "manage._base_domain_": [
@@ -198,31 +199,103 @@ function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
198
199
  };
199
200
  return resolveUrl(Object.assign(opts, { domainToMappings }));
200
201
  }
202
+ function resolveComWixpressPortfolioPortfolioappMediaServiceUrl(opts) {
203
+ const domainToMappings = {
204
+ "manage._base_domain_": [
205
+ {
206
+ srcPath: "/_api/portfolio-app-service",
207
+ destPath: "/api"
208
+ }
209
+ ],
210
+ "editor._base_domain_": [
211
+ {
212
+ srcPath: "/_api/portfolio-app-service",
213
+ destPath: "/api"
214
+ }
215
+ ],
216
+ "blocks._base_domain_": [
217
+ {
218
+ srcPath: "/_api/portfolio-app-service",
219
+ destPath: "/api"
220
+ }
221
+ ],
222
+ "create.editorx": [
223
+ {
224
+ srcPath: "/_api/portfolio-app-service",
225
+ destPath: "/api"
226
+ }
227
+ ],
228
+ _: [
229
+ {
230
+ srcPath: "/_api/portfolio-app-service",
231
+ destPath: "/api"
232
+ }
233
+ ],
234
+ "api._api_base_domain_": [
235
+ {
236
+ srcPath: "/_api/portfolio-app-service",
237
+ destPath: "/api"
238
+ }
239
+ ],
240
+ "www.wixapis.com": [
241
+ {
242
+ srcPath: "/portfolio/v1/settings",
243
+ destPath: "/api/v1/portfolio/settings"
244
+ },
245
+ {
246
+ srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
247
+ destPath: "/api/v1/portfolio/settings"
248
+ },
249
+ {
250
+ srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
251
+ destPath: "/api/v1/portfolio/project/items/media"
252
+ }
253
+ ],
254
+ "*.dev.wix-code.com": [
255
+ {
256
+ srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
257
+ destPath: "/api/v1/portfolio/settings"
258
+ },
259
+ {
260
+ srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
261
+ destPath: "/api/v1/portfolio/project/items/media"
262
+ }
263
+ ]
264
+ };
265
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
266
+ }
201
267
  var PACKAGE_NAME = "@wix/auto_sdk_portfolio_project-items";
268
+ function generateTokenForProjectItems(payload) {
269
+ function __generateTokenForProjectItems({ host }) {
270
+ const metadata = {
271
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
272
+ method: "POST",
273
+ methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
274
+ packageName: PACKAGE_NAME,
275
+ migrationOptions: {
276
+ optInTransformResponse: true
277
+ },
278
+ url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
279
+ protoPath: "/api/v1/portfolio/project/items/media",
280
+ data: payload,
281
+ host
282
+ }),
283
+ data: payload
284
+ };
285
+ return metadata;
286
+ }
287
+ return __generateTokenForProjectItems;
288
+ }
202
289
  function createProjectItem(payload) {
203
290
  function __createProjectItem({ host }) {
204
291
  const serializedData = transformPaths(payload, [
205
292
  {
206
293
  transformFn: transformSDKFloatToRESTFloat,
207
- paths: [
208
- { path: "item.sortOrder" },
209
- { path: "item.image.focalPoint.x" },
210
- { path: "item.image.focalPoint.y" },
211
- { path: "item.image.unsharpMasking.amount" },
212
- { path: "item.image.unsharpMasking.radius" },
213
- { path: "item.image.unsharpMasking.threshold" }
214
- ]
294
+ paths: TRANSFORM_PATHS_0
215
295
  },
216
296
  {
217
297
  transformFn: transformSDKTimestampToRESTTimestamp,
218
- paths: [
219
- { path: "item.createdDate" },
220
- { path: "item.updatedDate" },
221
- { path: "item.image.imageInfo.urlExpirationDate" },
222
- { path: "item.video.videoInfo.urlExpirationDate" },
223
- { path: "item.video.videoInfo.resolutions.poster.urlExpirationDate" },
224
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
225
- ]
298
+ paths: TRANSFORM_PATHS_1
226
299
  }
227
300
  ]);
228
301
  const metadata = {
@@ -242,27 +315,11 @@ function createProjectItem(payload) {
242
315
  transformResponse: (payload2) => transformPaths(payload2, [
243
316
  {
244
317
  transformFn: transformRESTFloatToSDKFloat,
245
- paths: [
246
- { path: "item.sortOrder" },
247
- { path: "item.image.focalPoint.x" },
248
- { path: "item.image.focalPoint.y" },
249
- { path: "item.image.unsharpMasking.amount" },
250
- { path: "item.image.unsharpMasking.radius" },
251
- { path: "item.image.unsharpMasking.threshold" }
252
- ]
318
+ paths: TRANSFORM_PATHS_0
253
319
  },
254
320
  {
255
321
  transformFn: transformRESTTimestampToSDKTimestamp,
256
- paths: [
257
- { path: "item.createdDate" },
258
- { path: "item.updatedDate" },
259
- { path: "item.image.imageInfo.urlExpirationDate" },
260
- { path: "item.video.videoInfo.urlExpirationDate" },
261
- {
262
- path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
263
- },
264
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
265
- ]
322
+ paths: TRANSFORM_PATHS_1
266
323
  }
267
324
  ])
268
325
  };
@@ -275,27 +332,11 @@ function bulkCreateProjectItems(payload) {
275
332
  const serializedData = transformPaths(payload, [
276
333
  {
277
334
  transformFn: transformSDKFloatToRESTFloat,
278
- paths: [
279
- { path: "items.sortOrder" },
280
- { path: "items.image.focalPoint.x" },
281
- { path: "items.image.focalPoint.y" },
282
- { path: "items.image.unsharpMasking.amount" },
283
- { path: "items.image.unsharpMasking.radius" },
284
- { path: "items.image.unsharpMasking.threshold" }
285
- ]
335
+ paths: TRANSFORM_PATHS_2
286
336
  },
287
337
  {
288
338
  transformFn: transformSDKTimestampToRESTTimestamp,
289
- paths: [
290
- { path: "items.createdDate" },
291
- { path: "items.updatedDate" },
292
- { path: "items.image.imageInfo.urlExpirationDate" },
293
- { path: "items.video.videoInfo.urlExpirationDate" },
294
- {
295
- path: "items.video.videoInfo.resolutions.poster.urlExpirationDate"
296
- },
297
- { path: "items.video.videoInfo.posters.urlExpirationDate" }
298
- ]
339
+ paths: TRANSFORM_PATHS_3
299
340
  }
300
341
  ]);
301
342
  const metadata = {
@@ -315,29 +356,11 @@ function bulkCreateProjectItems(payload) {
315
356
  transformResponse: (payload2) => transformPaths(payload2, [
316
357
  {
317
358
  transformFn: transformRESTFloatToSDKFloat,
318
- paths: [
319
- { path: "results.item.sortOrder" },
320
- { path: "results.item.image.focalPoint.x" },
321
- { path: "results.item.image.focalPoint.y" },
322
- { path: "results.item.image.unsharpMasking.amount" },
323
- { path: "results.item.image.unsharpMasking.radius" },
324
- { path: "results.item.image.unsharpMasking.threshold" }
325
- ]
359
+ paths: TRANSFORM_PATHS_4
326
360
  },
327
361
  {
328
362
  transformFn: transformRESTTimestampToSDKTimestamp,
329
- paths: [
330
- { path: "results.item.createdDate" },
331
- { path: "results.item.updatedDate" },
332
- { path: "results.item.image.imageInfo.urlExpirationDate" },
333
- { path: "results.item.video.videoInfo.urlExpirationDate" },
334
- {
335
- path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate"
336
- },
337
- {
338
- path: "results.item.video.videoInfo.posters.urlExpirationDate"
339
- }
340
- ]
363
+ paths: TRANSFORM_PATHS_5
341
364
  }
342
365
  ])
343
366
  };
@@ -364,27 +387,11 @@ function getProjectItem(payload) {
364
387
  transformResponse: (payload2) => transformPaths(payload2, [
365
388
  {
366
389
  transformFn: transformRESTFloatToSDKFloat,
367
- paths: [
368
- { path: "item.sortOrder" },
369
- { path: "item.image.focalPoint.x" },
370
- { path: "item.image.focalPoint.y" },
371
- { path: "item.image.unsharpMasking.amount" },
372
- { path: "item.image.unsharpMasking.radius" },
373
- { path: "item.image.unsharpMasking.threshold" }
374
- ]
390
+ paths: TRANSFORM_PATHS_0
375
391
  },
376
392
  {
377
393
  transformFn: transformRESTTimestampToSDKTimestamp,
378
- paths: [
379
- { path: "item.createdDate" },
380
- { path: "item.updatedDate" },
381
- { path: "item.image.imageInfo.urlExpirationDate" },
382
- { path: "item.video.videoInfo.urlExpirationDate" },
383
- {
384
- path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
385
- },
386
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
387
- ]
394
+ paths: TRANSFORM_PATHS_1
388
395
  }
389
396
  ]),
390
397
  fallback: [
@@ -422,27 +429,11 @@ function listProjectItems(payload) {
422
429
  transformResponse: (payload2) => transformPaths(payload2, [
423
430
  {
424
431
  transformFn: transformRESTFloatToSDKFloat,
425
- paths: [
426
- { path: "items.sortOrder" },
427
- { path: "items.image.focalPoint.x" },
428
- { path: "items.image.focalPoint.y" },
429
- { path: "items.image.unsharpMasking.amount" },
430
- { path: "items.image.unsharpMasking.radius" },
431
- { path: "items.image.unsharpMasking.threshold" }
432
- ]
432
+ paths: TRANSFORM_PATHS_2
433
433
  },
434
434
  {
435
435
  transformFn: transformRESTTimestampToSDKTimestamp,
436
- paths: [
437
- { path: "items.createdDate" },
438
- { path: "items.updatedDate" },
439
- { path: "items.image.imageInfo.urlExpirationDate" },
440
- { path: "items.video.videoInfo.urlExpirationDate" },
441
- {
442
- path: "items.video.videoInfo.resolutions.poster.urlExpirationDate"
443
- },
444
- { path: "items.video.videoInfo.posters.urlExpirationDate" }
445
- ]
436
+ paths: TRANSFORM_PATHS_3
446
437
  }
447
438
  ])
448
439
  };
@@ -455,29 +446,15 @@ function updateProjectItem(payload) {
455
446
  const serializedData = transformPaths(payload, [
456
447
  {
457
448
  transformFn: transformSDKFieldMaskToRESTFieldMask,
458
- paths: [{ path: "mask" }]
449
+ paths: TRANSFORM_PATHS_6
459
450
  },
460
451
  {
461
452
  transformFn: transformSDKFloatToRESTFloat,
462
- paths: [
463
- { path: "item.sortOrder" },
464
- { path: "item.image.focalPoint.x" },
465
- { path: "item.image.focalPoint.y" },
466
- { path: "item.image.unsharpMasking.amount" },
467
- { path: "item.image.unsharpMasking.radius" },
468
- { path: "item.image.unsharpMasking.threshold" }
469
- ]
453
+ paths: TRANSFORM_PATHS_0
470
454
  },
471
455
  {
472
456
  transformFn: transformSDKTimestampToRESTTimestamp,
473
- paths: [
474
- { path: "item.createdDate" },
475
- { path: "item.updatedDate" },
476
- { path: "item.image.imageInfo.urlExpirationDate" },
477
- { path: "item.video.videoInfo.urlExpirationDate" },
478
- { path: "item.video.videoInfo.resolutions.poster.urlExpirationDate" },
479
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
480
- ]
457
+ paths: TRANSFORM_PATHS_1
481
458
  }
482
459
  ]);
483
460
  const metadata = {
@@ -497,27 +474,11 @@ function updateProjectItem(payload) {
497
474
  transformResponse: (payload2) => transformPaths(payload2, [
498
475
  {
499
476
  transformFn: transformRESTFloatToSDKFloat,
500
- paths: [
501
- { path: "item.sortOrder" },
502
- { path: "item.image.focalPoint.x" },
503
- { path: "item.image.focalPoint.y" },
504
- { path: "item.image.unsharpMasking.amount" },
505
- { path: "item.image.unsharpMasking.radius" },
506
- { path: "item.image.unsharpMasking.threshold" }
507
- ]
477
+ paths: TRANSFORM_PATHS_0
508
478
  },
509
479
  {
510
480
  transformFn: transformRESTTimestampToSDKTimestamp,
511
- paths: [
512
- { path: "item.createdDate" },
513
- { path: "item.updatedDate" },
514
- { path: "item.image.imageInfo.urlExpirationDate" },
515
- { path: "item.video.videoInfo.urlExpirationDate" },
516
- {
517
- path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
518
- },
519
- { path: "item.video.videoInfo.posters.urlExpirationDate" }
520
- ]
481
+ paths: TRANSFORM_PATHS_1
521
482
  }
522
483
  ])
523
484
  };
@@ -530,31 +491,15 @@ function bulkUpdateProjectItems(payload) {
530
491
  const serializedData = transformPaths(payload, [
531
492
  {
532
493
  transformFn: transformSDKFieldMaskToRESTFieldMask,
533
- paths: [{ path: "items.fieldMask" }]
494
+ paths: TRANSFORM_PATHS_7
534
495
  },
535
496
  {
536
497
  transformFn: transformSDKFloatToRESTFloat,
537
- paths: [
538
- { path: "items.item.sortOrder" },
539
- { path: "items.item.image.focalPoint.x" },
540
- { path: "items.item.image.focalPoint.y" },
541
- { path: "items.item.image.unsharpMasking.amount" },
542
- { path: "items.item.image.unsharpMasking.radius" },
543
- { path: "items.item.image.unsharpMasking.threshold" }
544
- ]
498
+ paths: TRANSFORM_PATHS_8
545
499
  },
546
500
  {
547
501
  transformFn: transformSDKTimestampToRESTTimestamp,
548
- paths: [
549
- { path: "items.item.createdDate" },
550
- { path: "items.item.updatedDate" },
551
- { path: "items.item.image.imageInfo.urlExpirationDate" },
552
- { path: "items.item.video.videoInfo.urlExpirationDate" },
553
- {
554
- path: "items.item.video.videoInfo.resolutions.poster.urlExpirationDate"
555
- },
556
- { path: "items.item.video.videoInfo.posters.urlExpirationDate" }
557
- ]
502
+ paths: TRANSFORM_PATHS_9
558
503
  }
559
504
  ]);
560
505
  const metadata = {
@@ -574,29 +519,11 @@ function bulkUpdateProjectItems(payload) {
574
519
  transformResponse: (payload2) => transformPaths(payload2, [
575
520
  {
576
521
  transformFn: transformRESTFloatToSDKFloat,
577
- paths: [
578
- { path: "results.item.sortOrder" },
579
- { path: "results.item.image.focalPoint.x" },
580
- { path: "results.item.image.focalPoint.y" },
581
- { path: "results.item.image.unsharpMasking.amount" },
582
- { path: "results.item.image.unsharpMasking.radius" },
583
- { path: "results.item.image.unsharpMasking.threshold" }
584
- ]
522
+ paths: TRANSFORM_PATHS_4
585
523
  },
586
524
  {
587
525
  transformFn: transformRESTTimestampToSDKTimestamp,
588
- paths: [
589
- { path: "results.item.createdDate" },
590
- { path: "results.item.updatedDate" },
591
- { path: "results.item.image.imageInfo.urlExpirationDate" },
592
- { path: "results.item.video.videoInfo.urlExpirationDate" },
593
- {
594
- path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate"
595
- },
596
- {
597
- path: "results.item.video.videoInfo.posters.urlExpirationDate"
598
- }
599
- ]
526
+ paths: TRANSFORM_PATHS_5
600
527
  }
601
528
  ])
602
529
  };
@@ -667,27 +594,6 @@ function duplicateProjectItems(payload) {
667
594
  }
668
595
  return __duplicateProjectItems;
669
596
  }
670
- function generateTokenForProjectItems(payload) {
671
- function __generateTokenForProjectItems({ host }) {
672
- const metadata = {
673
- entityFqdn: "wix.portfolio.project_items.v1.project_item",
674
- method: "POST",
675
- methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
676
- packageName: PACKAGE_NAME,
677
- migrationOptions: {
678
- optInTransformResponse: true
679
- },
680
- url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
681
- protoPath: "/api/v1/portfolio/project/items/media",
682
- data: payload,
683
- host
684
- }),
685
- data: payload
686
- };
687
- return metadata;
688
- }
689
- return __generateTokenForProjectItems;
690
- }
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,11 +621,6 @@ var ImageType = /* @__PURE__ */ ((ImageType2) => {
707
621
  ImageType2["EXTERNAL"] = "EXTERNAL";
708
622
  return ImageType2;
709
623
  })(ImageType || {});
710
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
711
- SortOrder2["ASC"] = "ASC";
712
- SortOrder2["DESC"] = "DESC";
713
- return SortOrder2;
714
- })(SortOrder || {});
715
624
  var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
716
625
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
717
626
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
@@ -720,6 +629,36 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
720
629
  WebhookIdentityType2["APP"] = "APP";
721
630
  return WebhookIdentityType2;
722
631
  })(WebhookIdentityType || {});
632
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
633
+ SortOrder2["ASC"] = "ASC";
634
+ SortOrder2["DESC"] = "DESC";
635
+ return SortOrder2;
636
+ })(SortOrder || {});
637
+ async function generateTokenForProjectItems2(mediaIds) {
638
+ const { httpClient, sideEffects } = arguments[1];
639
+ const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
640
+ const reqOpts = generateTokenForProjectItems(
641
+ payload
642
+ );
643
+ sideEffects?.onSiteCall?.();
644
+ try {
645
+ const result = await httpClient.request(reqOpts);
646
+ sideEffects?.onSuccess?.(result);
647
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
648
+ } catch (err) {
649
+ const transformedError = sdkTransformError(
650
+ err,
651
+ {
652
+ spreadPathsToArguments: {},
653
+ explicitPathsToArguments: { mediaIds: "$[0]" },
654
+ singleArgumentUnchanged: false
655
+ },
656
+ ["mediaIds"]
657
+ );
658
+ sideEffects?.onError?.(err);
659
+ throw transformedError;
660
+ }
661
+ }
723
662
  async function createProjectItem2(item) {
724
663
  const { httpClient, sideEffects } = arguments[1];
725
664
  const payload = transformPaths2(
@@ -727,11 +666,11 @@ async function createProjectItem2(item) {
727
666
  [
728
667
  {
729
668
  transformFn: transformSDKImageToRESTImage,
730
- paths: [{ path: "item.image.imageInfo" }]
669
+ paths: TRANSFORM_PATHS_02
731
670
  },
732
671
  {
733
672
  transformFn: transformSDKVideoV2ToRESTVideoV2,
734
- paths: [{ path: "item.video.videoInfo" }]
673
+ paths: TRANSFORM_PATHS_12
735
674
  }
736
675
  ]
737
676
  );
@@ -744,11 +683,11 @@ async function createProjectItem2(item) {
744
683
  transformPaths2(result.data, [
745
684
  {
746
685
  transformFn: transformRESTImageToSDKImage,
747
- paths: [{ path: "item.image.imageInfo" }]
686
+ paths: TRANSFORM_PATHS_02
748
687
  },
749
688
  {
750
689
  transformFn: transformRESTVideoV2ToSDKVideoV2,
751
- paths: [{ path: "item.video.videoInfo" }]
690
+ paths: TRANSFORM_PATHS_12
752
691
  }
753
692
  ])
754
693
  )?.item;
@@ -776,11 +715,11 @@ async function bulkCreateProjectItems2(options) {
776
715
  [
777
716
  {
778
717
  transformFn: transformSDKImageToRESTImage,
779
- paths: [{ path: "items.image.imageInfo" }]
718
+ paths: TRANSFORM_PATHS_22
780
719
  },
781
720
  {
782
721
  transformFn: transformSDKVideoV2ToRESTVideoV2,
783
- paths: [{ path: "items.video.videoInfo" }]
722
+ paths: TRANSFORM_PATHS_32
784
723
  }
785
724
  ]
786
725
  );
@@ -795,11 +734,11 @@ async function bulkCreateProjectItems2(options) {
795
734
  transformPaths2(result.data, [
796
735
  {
797
736
  transformFn: transformRESTImageToSDKImage,
798
- paths: [{ path: "results.item.image.imageInfo" }]
737
+ paths: TRANSFORM_PATHS_42
799
738
  },
800
739
  {
801
740
  transformFn: transformRESTVideoV2ToSDKVideoV2,
802
- paths: [{ path: "results.item.video.videoInfo" }]
741
+ paths: TRANSFORM_PATHS_52
803
742
  }
804
743
  ])
805
744
  );
@@ -832,11 +771,11 @@ async function getProjectItem2(itemId) {
832
771
  transformPaths2(result.data, [
833
772
  {
834
773
  transformFn: transformRESTImageToSDKImage,
835
- paths: [{ path: "item.image.imageInfo" }]
774
+ paths: TRANSFORM_PATHS_02
836
775
  },
837
776
  {
838
777
  transformFn: transformRESTVideoV2ToSDKVideoV2,
839
- paths: [{ path: "item.video.videoInfo" }]
778
+ paths: TRANSFORM_PATHS_12
840
779
  }
841
780
  ])
842
781
  )?.item;
@@ -869,11 +808,11 @@ async function listProjectItems2(projectId, options) {
869
808
  transformPaths2(result.data, [
870
809
  {
871
810
  transformFn: transformRESTImageToSDKImage,
872
- paths: [{ path: "items.image.imageInfo" }]
811
+ paths: TRANSFORM_PATHS_22
873
812
  },
874
813
  {
875
814
  transformFn: transformRESTVideoV2ToSDKVideoV2,
876
- paths: [{ path: "items.video.videoInfo" }]
815
+ paths: TRANSFORM_PATHS_32
877
816
  }
878
817
  ])
879
818
  );
@@ -898,11 +837,11 @@ async function updateProjectItem2(_id, item) {
898
837
  [
899
838
  {
900
839
  transformFn: transformSDKImageToRESTImage,
901
- paths: [{ path: "item.image.imageInfo" }]
840
+ paths: TRANSFORM_PATHS_02
902
841
  },
903
842
  {
904
843
  transformFn: transformSDKVideoV2ToRESTVideoV2,
905
- paths: [{ path: "item.video.videoInfo" }]
844
+ paths: TRANSFORM_PATHS_12
906
845
  }
907
846
  ]
908
847
  );
@@ -915,11 +854,11 @@ async function updateProjectItem2(_id, item) {
915
854
  transformPaths2(result.data, [
916
855
  {
917
856
  transformFn: transformRESTImageToSDKImage,
918
- paths: [{ path: "item.image.imageInfo" }]
857
+ paths: TRANSFORM_PATHS_02
919
858
  },
920
859
  {
921
860
  transformFn: transformRESTVideoV2ToSDKVideoV2,
922
- paths: [{ path: "item.video.videoInfo" }]
861
+ paths: TRANSFORM_PATHS_12
923
862
  }
924
863
  ])
925
864
  )?.item;
@@ -947,11 +886,11 @@ async function bulkUpdateProjectItems2(options) {
947
886
  [
948
887
  {
949
888
  transformFn: transformSDKImageToRESTImage,
950
- paths: [{ path: "items.item.image.imageInfo" }]
889
+ paths: TRANSFORM_PATHS_62
951
890
  },
952
891
  {
953
892
  transformFn: transformSDKVideoV2ToRESTVideoV2,
954
- paths: [{ path: "items.item.video.videoInfo" }]
893
+ paths: TRANSFORM_PATHS_72
955
894
  }
956
895
  ]
957
896
  );
@@ -966,11 +905,11 @@ async function bulkUpdateProjectItems2(options) {
966
905
  transformPaths2(result.data, [
967
906
  {
968
907
  transformFn: transformRESTImageToSDKImage,
969
- paths: [{ path: "results.item.image.imageInfo" }]
908
+ paths: TRANSFORM_PATHS_42
970
909
  },
971
910
  {
972
911
  transformFn: transformRESTVideoV2ToSDKVideoV2,
973
- paths: [{ path: "results.item.video.videoInfo" }]
912
+ paths: TRANSFORM_PATHS_52
974
913
  }
975
914
  ])
976
915
  );
@@ -1072,31 +1011,6 @@ async function duplicateProjectItems2(originProjectId, options) {
1072
1011
  throw transformedError;
1073
1012
  }
1074
1013
  }
1075
- async function generateTokenForProjectItems2(mediaIds) {
1076
- const { httpClient, sideEffects } = arguments[1];
1077
- const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
1078
- const reqOpts = generateTokenForProjectItems(
1079
- payload
1080
- );
1081
- sideEffects?.onSiteCall?.();
1082
- try {
1083
- const result = await httpClient.request(reqOpts);
1084
- sideEffects?.onSuccess?.(result);
1085
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1086
- } catch (err) {
1087
- const transformedError = sdkTransformError(
1088
- err,
1089
- {
1090
- spreadPathsToArguments: {},
1091
- explicitPathsToArguments: { mediaIds: "$[0]" },
1092
- singleArgumentUnchanged: false
1093
- },
1094
- ["mediaIds"]
1095
- );
1096
- sideEffects?.onError?.(err);
1097
- throw transformedError;
1098
- }
1099
- }
1100
1014
  export {
1101
1015
  ImageType,
1102
1016
  SortOrder,