@wix/auto_sdk_portfolio_project-items 1.0.17 → 1.0.19

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.
@@ -0,0 +1,1086 @@
1
+ // src/portfolio-project-items-v1-project-item-project-items.universal.ts
2
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
+ import {
4
+ renameKeysFromSDKRequestToRESTRequest,
5
+ renameKeysFromRESTResponseToSDKResponse
6
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
7
+
8
+ // src/portfolio-project-items-v1-project-item-project-items.http.ts
9
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
10
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
11
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
12
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
13
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
14
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
15
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
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
+ }
82
+ function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
83
+ const domainToMappings = {
84
+ "manage._base_domain_": [
85
+ {
86
+ srcPath: "/_api/project-items-service",
87
+ destPath: "/api"
88
+ }
89
+ ],
90
+ _: [
91
+ {
92
+ srcPath: "/_api/project-items-service",
93
+ destPath: "/api"
94
+ },
95
+ {
96
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/create",
97
+ destPath: "/api/v1/bulk/portfolio/items/create"
98
+ },
99
+ {
100
+ srcPath: "/portfolio/project-items/api/v1/items/duplicate",
101
+ destPath: "/api/v1/items/duplicate"
102
+ },
103
+ {
104
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/delete",
105
+ destPath: "/api/v1/bulk/portfolio/items/delete"
106
+ },
107
+ {
108
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/update",
109
+ destPath: "/api/v1/bulk/portfolio/items/update"
110
+ }
111
+ ],
112
+ "editor._base_domain_": [
113
+ {
114
+ srcPath: "/_api/project-items-service",
115
+ destPath: "/api"
116
+ }
117
+ ],
118
+ "blocks._base_domain_": [
119
+ {
120
+ srcPath: "/_api/project-items-service",
121
+ destPath: "/api"
122
+ }
123
+ ],
124
+ "create.editorx": [
125
+ {
126
+ srcPath: "/_api/project-items-service",
127
+ destPath: "/api"
128
+ }
129
+ ],
130
+ "*.dev.wix-code.com": [
131
+ {
132
+ srcPath: "/_api/project-items-service",
133
+ destPath: "/api"
134
+ },
135
+ {
136
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/create",
137
+ destPath: "/api/v1/bulk/portfolio/items/create"
138
+ },
139
+ {
140
+ srcPath: "/portfolio/project-items/api/v1/items/duplicate",
141
+ destPath: "/api/v1/items/duplicate"
142
+ },
143
+ {
144
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/delete",
145
+ destPath: "/api/v1/bulk/portfolio/items/delete"
146
+ },
147
+ {
148
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/update",
149
+ destPath: "/api/v1/bulk/portfolio/items/update"
150
+ }
151
+ ],
152
+ "www._base_domain_": [
153
+ {
154
+ srcPath: "/_api/project-items-service",
155
+ destPath: "/api"
156
+ }
157
+ ],
158
+ "www.wixapis.com": [
159
+ {
160
+ srcPath: "/portfolio/v1/projectItems",
161
+ destPath: "/api/v1/portfolio/projects"
162
+ },
163
+ {
164
+ srcPath: "/portfolio/v1/items",
165
+ destPath: "/api/v1/portfolio/items"
166
+ },
167
+ {
168
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/create",
169
+ destPath: "/api/v1/bulk/portfolio/items/create"
170
+ },
171
+ {
172
+ srcPath: "/portfolio/project-items/api/v1/items/duplicate",
173
+ destPath: "/api/v1/items/duplicate"
174
+ },
175
+ {
176
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/delete",
177
+ destPath: "/api/v1/bulk/portfolio/items/delete"
178
+ },
179
+ {
180
+ srcPath: "/portfolio/project-items/api/v1/bulk/portfolio/items/update",
181
+ destPath: "/api/v1/bulk/portfolio/items/update"
182
+ },
183
+ {
184
+ srcPath: "/portfolio/project-items/api/v1/portfolio/items",
185
+ destPath: "/api/v1/portfolio/items"
186
+ },
187
+ {
188
+ srcPath: "/portfolio/project-items/api/v1/portfolio/projects",
189
+ destPath: "/api/v1/portfolio/projects"
190
+ }
191
+ ],
192
+ "api._api_base_domain_": [
193
+ {
194
+ srcPath: "/project-items-service",
195
+ destPath: ""
196
+ }
197
+ ]
198
+ };
199
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
200
+ }
201
+ var PACKAGE_NAME = "@wix/auto_sdk_portfolio_project-items";
202
+ function createProjectItem(payload) {
203
+ function __createProjectItem({ host }) {
204
+ const serializedData = transformPaths(payload, [
205
+ {
206
+ 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
+ ]
215
+ },
216
+ {
217
+ 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
+ ]
226
+ }
227
+ ]);
228
+ const metadata = {
229
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
230
+ method: "POST",
231
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.CreateProjectItem",
232
+ packageName: PACKAGE_NAME,
233
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
234
+ protoPath: "/api/v1/portfolio/items",
235
+ data: serializedData,
236
+ host
237
+ }),
238
+ data: serializedData,
239
+ transformResponse: (payload2) => transformPaths(payload2, [
240
+ {
241
+ transformFn: transformRESTFloatToSDKFloat,
242
+ paths: [
243
+ { path: "item.sortOrder" },
244
+ { path: "item.image.focalPoint.x" },
245
+ { path: "item.image.focalPoint.y" },
246
+ { path: "item.image.unsharpMasking.amount" },
247
+ { path: "item.image.unsharpMasking.radius" },
248
+ { path: "item.image.unsharpMasking.threshold" }
249
+ ]
250
+ },
251
+ {
252
+ transformFn: transformRESTTimestampToSDKTimestamp,
253
+ paths: [
254
+ { path: "item.createdDate" },
255
+ { path: "item.updatedDate" },
256
+ { path: "item.image.imageInfo.urlExpirationDate" },
257
+ { path: "item.video.videoInfo.urlExpirationDate" },
258
+ {
259
+ path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
260
+ },
261
+ { path: "item.video.videoInfo.posters.urlExpirationDate" }
262
+ ]
263
+ }
264
+ ])
265
+ };
266
+ return metadata;
267
+ }
268
+ return __createProjectItem;
269
+ }
270
+ function bulkCreateProjectItems(payload) {
271
+ function __bulkCreateProjectItems({ host }) {
272
+ const serializedData = transformPaths(payload, [
273
+ {
274
+ transformFn: transformSDKFloatToRESTFloat,
275
+ paths: [
276
+ { path: "items.sortOrder" },
277
+ { path: "items.image.focalPoint.x" },
278
+ { path: "items.image.focalPoint.y" },
279
+ { path: "items.image.unsharpMasking.amount" },
280
+ { path: "items.image.unsharpMasking.radius" },
281
+ { path: "items.image.unsharpMasking.threshold" }
282
+ ]
283
+ },
284
+ {
285
+ transformFn: transformSDKTimestampToRESTTimestamp,
286
+ paths: [
287
+ { path: "items.createdDate" },
288
+ { path: "items.updatedDate" },
289
+ { path: "items.image.imageInfo.urlExpirationDate" },
290
+ { path: "items.video.videoInfo.urlExpirationDate" },
291
+ {
292
+ path: "items.video.videoInfo.resolutions.poster.urlExpirationDate"
293
+ },
294
+ { path: "items.video.videoInfo.posters.urlExpirationDate" }
295
+ ]
296
+ }
297
+ ]);
298
+ const metadata = {
299
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
300
+ method: "POST",
301
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.BulkCreateProjectItems",
302
+ packageName: PACKAGE_NAME,
303
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
304
+ protoPath: "/api/v1/bulk/portfolio/items/create",
305
+ data: serializedData,
306
+ host
307
+ }),
308
+ data: serializedData,
309
+ transformResponse: (payload2) => transformPaths(payload2, [
310
+ {
311
+ transformFn: transformRESTFloatToSDKFloat,
312
+ paths: [
313
+ { path: "results.item.sortOrder" },
314
+ { path: "results.item.image.focalPoint.x" },
315
+ { path: "results.item.image.focalPoint.y" },
316
+ { path: "results.item.image.unsharpMasking.amount" },
317
+ { path: "results.item.image.unsharpMasking.radius" },
318
+ { path: "results.item.image.unsharpMasking.threshold" }
319
+ ]
320
+ },
321
+ {
322
+ transformFn: transformRESTTimestampToSDKTimestamp,
323
+ paths: [
324
+ { path: "results.item.createdDate" },
325
+ { path: "results.item.updatedDate" },
326
+ { path: "results.item.image.imageInfo.urlExpirationDate" },
327
+ { path: "results.item.video.videoInfo.urlExpirationDate" },
328
+ {
329
+ path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate"
330
+ },
331
+ {
332
+ path: "results.item.video.videoInfo.posters.urlExpirationDate"
333
+ }
334
+ ]
335
+ }
336
+ ])
337
+ };
338
+ return metadata;
339
+ }
340
+ return __bulkCreateProjectItems;
341
+ }
342
+ function getProjectItem(payload) {
343
+ function __getProjectItem({ host }) {
344
+ const metadata = {
345
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
346
+ method: "GET",
347
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.GetProjectItem",
348
+ packageName: PACKAGE_NAME,
349
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
350
+ protoPath: "/api/v1/portfolio/items/{itemId}",
351
+ data: payload,
352
+ host
353
+ }),
354
+ params: toURLSearchParams(payload),
355
+ transformResponse: (payload2) => transformPaths(payload2, [
356
+ {
357
+ transformFn: transformRESTFloatToSDKFloat,
358
+ paths: [
359
+ { path: "item.sortOrder" },
360
+ { path: "item.image.focalPoint.x" },
361
+ { path: "item.image.focalPoint.y" },
362
+ { path: "item.image.unsharpMasking.amount" },
363
+ { path: "item.image.unsharpMasking.radius" },
364
+ { path: "item.image.unsharpMasking.threshold" }
365
+ ]
366
+ },
367
+ {
368
+ transformFn: transformRESTTimestampToSDKTimestamp,
369
+ paths: [
370
+ { path: "item.createdDate" },
371
+ { path: "item.updatedDate" },
372
+ { path: "item.image.imageInfo.urlExpirationDate" },
373
+ { path: "item.video.videoInfo.urlExpirationDate" },
374
+ {
375
+ path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
376
+ },
377
+ { path: "item.video.videoInfo.posters.urlExpirationDate" }
378
+ ]
379
+ }
380
+ ]),
381
+ fallback: [
382
+ {
383
+ method: "GET",
384
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
385
+ protoPath: "/api/v1/portfolio/items/{itemId}",
386
+ data: payload,
387
+ host
388
+ }),
389
+ params: toURLSearchParams(payload)
390
+ }
391
+ ]
392
+ };
393
+ return metadata;
394
+ }
395
+ return __getProjectItem;
396
+ }
397
+ function listProjectItems(payload) {
398
+ function __listProjectItems({ host }) {
399
+ const metadata = {
400
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
401
+ method: "GET",
402
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.ListProjectItems",
403
+ packageName: PACKAGE_NAME,
404
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
405
+ protoPath: "/api/v1/portfolio/projects/{projectId}/items",
406
+ data: payload,
407
+ host
408
+ }),
409
+ params: toURLSearchParams(payload),
410
+ transformResponse: (payload2) => transformPaths(payload2, [
411
+ {
412
+ transformFn: transformRESTFloatToSDKFloat,
413
+ paths: [
414
+ { path: "items.sortOrder" },
415
+ { path: "items.image.focalPoint.x" },
416
+ { path: "items.image.focalPoint.y" },
417
+ { path: "items.image.unsharpMasking.amount" },
418
+ { path: "items.image.unsharpMasking.radius" },
419
+ { path: "items.image.unsharpMasking.threshold" }
420
+ ]
421
+ },
422
+ {
423
+ transformFn: transformRESTTimestampToSDKTimestamp,
424
+ paths: [
425
+ { path: "items.createdDate" },
426
+ { path: "items.updatedDate" },
427
+ { path: "items.image.imageInfo.urlExpirationDate" },
428
+ { path: "items.video.videoInfo.urlExpirationDate" },
429
+ {
430
+ path: "items.video.videoInfo.resolutions.poster.urlExpirationDate"
431
+ },
432
+ { path: "items.video.videoInfo.posters.urlExpirationDate" }
433
+ ]
434
+ }
435
+ ])
436
+ };
437
+ return metadata;
438
+ }
439
+ return __listProjectItems;
440
+ }
441
+ function updateProjectItem(payload) {
442
+ function __updateProjectItem({ host }) {
443
+ const serializedData = transformPaths(payload, [
444
+ {
445
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
446
+ paths: [{ path: "mask" }]
447
+ },
448
+ {
449
+ transformFn: transformSDKFloatToRESTFloat,
450
+ paths: [
451
+ { path: "item.sortOrder" },
452
+ { path: "item.image.focalPoint.x" },
453
+ { path: "item.image.focalPoint.y" },
454
+ { path: "item.image.unsharpMasking.amount" },
455
+ { path: "item.image.unsharpMasking.radius" },
456
+ { path: "item.image.unsharpMasking.threshold" }
457
+ ]
458
+ },
459
+ {
460
+ transformFn: transformSDKTimestampToRESTTimestamp,
461
+ paths: [
462
+ { path: "item.createdDate" },
463
+ { path: "item.updatedDate" },
464
+ { path: "item.image.imageInfo.urlExpirationDate" },
465
+ { path: "item.video.videoInfo.urlExpirationDate" },
466
+ { path: "item.video.videoInfo.resolutions.poster.urlExpirationDate" },
467
+ { path: "item.video.videoInfo.posters.urlExpirationDate" }
468
+ ]
469
+ }
470
+ ]);
471
+ const metadata = {
472
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
473
+ method: "PATCH",
474
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.UpdateProjectItem",
475
+ packageName: PACKAGE_NAME,
476
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
477
+ protoPath: "/api/v1/portfolio/items/{item.id}",
478
+ data: serializedData,
479
+ host
480
+ }),
481
+ data: serializedData,
482
+ transformResponse: (payload2) => transformPaths(payload2, [
483
+ {
484
+ transformFn: transformRESTFloatToSDKFloat,
485
+ paths: [
486
+ { path: "item.sortOrder" },
487
+ { path: "item.image.focalPoint.x" },
488
+ { path: "item.image.focalPoint.y" },
489
+ { path: "item.image.unsharpMasking.amount" },
490
+ { path: "item.image.unsharpMasking.radius" },
491
+ { path: "item.image.unsharpMasking.threshold" }
492
+ ]
493
+ },
494
+ {
495
+ transformFn: transformRESTTimestampToSDKTimestamp,
496
+ paths: [
497
+ { path: "item.createdDate" },
498
+ { path: "item.updatedDate" },
499
+ { path: "item.image.imageInfo.urlExpirationDate" },
500
+ { path: "item.video.videoInfo.urlExpirationDate" },
501
+ {
502
+ path: "item.video.videoInfo.resolutions.poster.urlExpirationDate"
503
+ },
504
+ { path: "item.video.videoInfo.posters.urlExpirationDate" }
505
+ ]
506
+ }
507
+ ])
508
+ };
509
+ return metadata;
510
+ }
511
+ return __updateProjectItem;
512
+ }
513
+ function bulkUpdateProjectItems(payload) {
514
+ function __bulkUpdateProjectItems({ host }) {
515
+ const serializedData = transformPaths(payload, [
516
+ {
517
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
518
+ paths: [{ path: "items.fieldMask" }]
519
+ },
520
+ {
521
+ transformFn: transformSDKFloatToRESTFloat,
522
+ paths: [
523
+ { path: "items.item.sortOrder" },
524
+ { path: "items.item.image.focalPoint.x" },
525
+ { path: "items.item.image.focalPoint.y" },
526
+ { path: "items.item.image.unsharpMasking.amount" },
527
+ { path: "items.item.image.unsharpMasking.radius" },
528
+ { path: "items.item.image.unsharpMasking.threshold" }
529
+ ]
530
+ },
531
+ {
532
+ transformFn: transformSDKTimestampToRESTTimestamp,
533
+ paths: [
534
+ { path: "items.item.createdDate" },
535
+ { path: "items.item.updatedDate" },
536
+ { path: "items.item.image.imageInfo.urlExpirationDate" },
537
+ { path: "items.item.video.videoInfo.urlExpirationDate" },
538
+ {
539
+ path: "items.item.video.videoInfo.resolutions.poster.urlExpirationDate"
540
+ },
541
+ { path: "items.item.video.videoInfo.posters.urlExpirationDate" }
542
+ ]
543
+ }
544
+ ]);
545
+ const metadata = {
546
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
547
+ method: "PATCH",
548
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.BulkUpdateProjectItems",
549
+ packageName: PACKAGE_NAME,
550
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
551
+ protoPath: "/api/v1/bulk/portfolio/items/update",
552
+ data: serializedData,
553
+ host
554
+ }),
555
+ data: serializedData,
556
+ transformResponse: (payload2) => transformPaths(payload2, [
557
+ {
558
+ transformFn: transformRESTFloatToSDKFloat,
559
+ paths: [
560
+ { path: "results.item.sortOrder" },
561
+ { path: "results.item.image.focalPoint.x" },
562
+ { path: "results.item.image.focalPoint.y" },
563
+ { path: "results.item.image.unsharpMasking.amount" },
564
+ { path: "results.item.image.unsharpMasking.radius" },
565
+ { path: "results.item.image.unsharpMasking.threshold" }
566
+ ]
567
+ },
568
+ {
569
+ transformFn: transformRESTTimestampToSDKTimestamp,
570
+ paths: [
571
+ { path: "results.item.createdDate" },
572
+ { path: "results.item.updatedDate" },
573
+ { path: "results.item.image.imageInfo.urlExpirationDate" },
574
+ { path: "results.item.video.videoInfo.urlExpirationDate" },
575
+ {
576
+ path: "results.item.video.videoInfo.resolutions.poster.urlExpirationDate"
577
+ },
578
+ {
579
+ path: "results.item.video.videoInfo.posters.urlExpirationDate"
580
+ }
581
+ ]
582
+ }
583
+ ])
584
+ };
585
+ return metadata;
586
+ }
587
+ return __bulkUpdateProjectItems;
588
+ }
589
+ function deleteProjectItem(payload) {
590
+ function __deleteProjectItem({ host }) {
591
+ const metadata = {
592
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
593
+ method: "DELETE",
594
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.DeleteProjectItem",
595
+ packageName: PACKAGE_NAME,
596
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
597
+ protoPath: "/api/v1/portfolio/items/{itemId}",
598
+ data: payload,
599
+ host
600
+ }),
601
+ params: toURLSearchParams(payload)
602
+ };
603
+ return metadata;
604
+ }
605
+ return __deleteProjectItem;
606
+ }
607
+ function bulkDeleteProjectItems(payload) {
608
+ function __bulkDeleteProjectItems({ host }) {
609
+ const metadata = {
610
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
611
+ method: "DELETE",
612
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.BulkDeleteProjectItems",
613
+ packageName: PACKAGE_NAME,
614
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
615
+ protoPath: "/api/v1/bulk/portfolio/items/delete",
616
+ data: payload,
617
+ host
618
+ }),
619
+ params: toURLSearchParams(payload)
620
+ };
621
+ return metadata;
622
+ }
623
+ return __bulkDeleteProjectItems;
624
+ }
625
+ function duplicateProjectItems(payload) {
626
+ function __duplicateProjectItems({ host }) {
627
+ const metadata = {
628
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
629
+ method: "POST",
630
+ methodFqn: "com.wixpress.portfolio.projectitems.ProjectItemsService.DuplicateProjectItems",
631
+ packageName: PACKAGE_NAME,
632
+ url: resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl({
633
+ protoPath: "/api/v1/items/duplicate",
634
+ data: payload,
635
+ host
636
+ }),
637
+ data: payload
638
+ };
639
+ return metadata;
640
+ }
641
+ return __duplicateProjectItems;
642
+ }
643
+ function generateTokenForProjectItems(payload) {
644
+ function __generateTokenForProjectItems({ host }) {
645
+ const metadata = {
646
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
647
+ method: "POST",
648
+ methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
649
+ packageName: PACKAGE_NAME,
650
+ url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
651
+ protoPath: "/api/v1/portfolio/project/items/media",
652
+ data: payload,
653
+ host
654
+ }),
655
+ data: payload
656
+ };
657
+ return metadata;
658
+ }
659
+ return __generateTokenForProjectItems;
660
+ }
661
+
662
+ // src/portfolio-project-items-v1-project-item-project-items.universal.ts
663
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
664
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
665
+ import { transformSDKVideoV2ToRESTVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
666
+ import { transformRESTVideoV2ToSDKVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
667
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
668
+ var Type = /* @__PURE__ */ ((Type2) => {
669
+ Type2["UNDEFINED"] = "UNDEFINED";
670
+ Type2["IMAGE"] = "IMAGE";
671
+ Type2["VIDEO"] = "VIDEO";
672
+ return Type2;
673
+ })(Type || {});
674
+ var ImageType = /* @__PURE__ */ ((ImageType2) => {
675
+ ImageType2["UNDEFINED"] = "UNDEFINED";
676
+ ImageType2["WIX_MEDIA"] = "WIX_MEDIA";
677
+ ImageType2["EXTERNAL"] = "EXTERNAL";
678
+ return ImageType2;
679
+ })(ImageType || {});
680
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
681
+ SortOrder2["ASC"] = "ASC";
682
+ SortOrder2["DESC"] = "DESC";
683
+ return SortOrder2;
684
+ })(SortOrder || {});
685
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
686
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
687
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
688
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
689
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
690
+ WebhookIdentityType2["APP"] = "APP";
691
+ return WebhookIdentityType2;
692
+ })(WebhookIdentityType || {});
693
+ async function createProjectItem2(item) {
694
+ const { httpClient, sideEffects } = arguments[1];
695
+ const payload = transformPaths2(
696
+ renameKeysFromSDKRequestToRESTRequest({ item }),
697
+ [
698
+ {
699
+ transformFn: transformSDKImageToRESTImage,
700
+ paths: [{ path: "item.image.imageInfo" }]
701
+ },
702
+ {
703
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
704
+ paths: [{ path: "item.video.videoInfo" }]
705
+ }
706
+ ]
707
+ );
708
+ const reqOpts = createProjectItem(payload);
709
+ sideEffects?.onSiteCall?.();
710
+ try {
711
+ const result = await httpClient.request(reqOpts);
712
+ sideEffects?.onSuccess?.(result);
713
+ return renameKeysFromRESTResponseToSDKResponse(
714
+ transformPaths2(result.data, [
715
+ {
716
+ transformFn: transformRESTImageToSDKImage,
717
+ paths: [{ path: "item.image.imageInfo" }]
718
+ },
719
+ {
720
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
721
+ paths: [{ path: "item.video.videoInfo" }]
722
+ }
723
+ ])
724
+ )?.item;
725
+ } catch (err) {
726
+ const transformedError = sdkTransformError(
727
+ err,
728
+ {
729
+ spreadPathsToArguments: {},
730
+ explicitPathsToArguments: { item: "$[0]" },
731
+ singleArgumentUnchanged: false
732
+ },
733
+ ["item"]
734
+ );
735
+ sideEffects?.onError?.(err);
736
+ throw transformedError;
737
+ }
738
+ }
739
+ async function bulkCreateProjectItems2(options) {
740
+ const { httpClient, sideEffects } = arguments[1];
741
+ const payload = transformPaths2(
742
+ renameKeysFromSDKRequestToRESTRequest({
743
+ items: options?.items,
744
+ returnFullEntity: options?.returnFullEntity
745
+ }),
746
+ [
747
+ {
748
+ transformFn: transformSDKImageToRESTImage,
749
+ paths: [{ path: "items.image.imageInfo" }]
750
+ },
751
+ {
752
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
753
+ paths: [{ path: "items.video.videoInfo" }]
754
+ }
755
+ ]
756
+ );
757
+ const reqOpts = bulkCreateProjectItems(
758
+ payload
759
+ );
760
+ sideEffects?.onSiteCall?.();
761
+ try {
762
+ const result = await httpClient.request(reqOpts);
763
+ sideEffects?.onSuccess?.(result);
764
+ return renameKeysFromRESTResponseToSDKResponse(
765
+ transformPaths2(result.data, [
766
+ {
767
+ transformFn: transformRESTImageToSDKImage,
768
+ paths: [{ path: "results.item.image.imageInfo" }]
769
+ },
770
+ {
771
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
772
+ paths: [{ path: "results.item.video.videoInfo" }]
773
+ }
774
+ ])
775
+ );
776
+ } catch (err) {
777
+ const transformedError = sdkTransformError(
778
+ err,
779
+ {
780
+ spreadPathsToArguments: {},
781
+ explicitPathsToArguments: {
782
+ items: "$[0].items",
783
+ returnFullEntity: "$[0].returnFullEntity"
784
+ },
785
+ singleArgumentUnchanged: false
786
+ },
787
+ ["options"]
788
+ );
789
+ sideEffects?.onError?.(err);
790
+ throw transformedError;
791
+ }
792
+ }
793
+ async function getProjectItem2(itemId) {
794
+ const { httpClient, sideEffects } = arguments[1];
795
+ const payload = renameKeysFromSDKRequestToRESTRequest({ itemId });
796
+ const reqOpts = getProjectItem(payload);
797
+ sideEffects?.onSiteCall?.();
798
+ try {
799
+ const result = await httpClient.request(reqOpts);
800
+ sideEffects?.onSuccess?.(result);
801
+ return renameKeysFromRESTResponseToSDKResponse(
802
+ transformPaths2(result.data, [
803
+ {
804
+ transformFn: transformRESTImageToSDKImage,
805
+ paths: [{ path: "item.image.imageInfo" }]
806
+ },
807
+ {
808
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
809
+ paths: [{ path: "item.video.videoInfo" }]
810
+ }
811
+ ])
812
+ )?.item;
813
+ } catch (err) {
814
+ const transformedError = sdkTransformError(
815
+ err,
816
+ {
817
+ spreadPathsToArguments: {},
818
+ explicitPathsToArguments: { itemId: "$[0]" },
819
+ singleArgumentUnchanged: false
820
+ },
821
+ ["itemId"]
822
+ );
823
+ sideEffects?.onError?.(err);
824
+ throw transformedError;
825
+ }
826
+ }
827
+ async function listProjectItems2(projectId, options) {
828
+ const { httpClient, sideEffects } = arguments[2];
829
+ const payload = renameKeysFromSDKRequestToRESTRequest({
830
+ projectId,
831
+ paging: options?.paging
832
+ });
833
+ const reqOpts = listProjectItems(payload);
834
+ sideEffects?.onSiteCall?.();
835
+ try {
836
+ const result = await httpClient.request(reqOpts);
837
+ sideEffects?.onSuccess?.(result);
838
+ return renameKeysFromRESTResponseToSDKResponse(
839
+ transformPaths2(result.data, [
840
+ {
841
+ transformFn: transformRESTImageToSDKImage,
842
+ paths: [{ path: "items.image.imageInfo" }]
843
+ },
844
+ {
845
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
846
+ paths: [{ path: "items.video.videoInfo" }]
847
+ }
848
+ ])
849
+ );
850
+ } catch (err) {
851
+ const transformedError = sdkTransformError(
852
+ err,
853
+ {
854
+ spreadPathsToArguments: {},
855
+ explicitPathsToArguments: { projectId: "$[0]", paging: "$[1].paging" },
856
+ singleArgumentUnchanged: false
857
+ },
858
+ ["projectId", "options"]
859
+ );
860
+ sideEffects?.onError?.(err);
861
+ throw transformedError;
862
+ }
863
+ }
864
+ async function updateProjectItem2(_id, item) {
865
+ const { httpClient, sideEffects } = arguments[2];
866
+ const payload = transformPaths2(
867
+ renameKeysFromSDKRequestToRESTRequest({ item: { ...item, id: _id } }),
868
+ [
869
+ {
870
+ transformFn: transformSDKImageToRESTImage,
871
+ paths: [{ path: "item.image.imageInfo" }]
872
+ },
873
+ {
874
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
875
+ paths: [{ path: "item.video.videoInfo" }]
876
+ }
877
+ ]
878
+ );
879
+ const reqOpts = updateProjectItem(payload);
880
+ sideEffects?.onSiteCall?.();
881
+ try {
882
+ const result = await httpClient.request(reqOpts);
883
+ sideEffects?.onSuccess?.(result);
884
+ return renameKeysFromRESTResponseToSDKResponse(
885
+ transformPaths2(result.data, [
886
+ {
887
+ transformFn: transformRESTImageToSDKImage,
888
+ paths: [{ path: "item.image.imageInfo" }]
889
+ },
890
+ {
891
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
892
+ paths: [{ path: "item.video.videoInfo" }]
893
+ }
894
+ ])
895
+ )?.item;
896
+ } catch (err) {
897
+ const transformedError = sdkTransformError(
898
+ err,
899
+ {
900
+ spreadPathsToArguments: { item: "$[1]" },
901
+ explicitPathsToArguments: { "item.id": "$[0]" },
902
+ singleArgumentUnchanged: false
903
+ },
904
+ ["_id", "item"]
905
+ );
906
+ sideEffects?.onError?.(err);
907
+ throw transformedError;
908
+ }
909
+ }
910
+ async function bulkUpdateProjectItems2(options) {
911
+ const { httpClient, sideEffects } = arguments[1];
912
+ const payload = transformPaths2(
913
+ renameKeysFromSDKRequestToRESTRequest({
914
+ items: options?.items,
915
+ returnFullEntity: options?.returnFullEntity
916
+ }),
917
+ [
918
+ {
919
+ transformFn: transformSDKImageToRESTImage,
920
+ paths: [{ path: "items.item.image.imageInfo" }]
921
+ },
922
+ {
923
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
924
+ paths: [{ path: "items.item.video.videoInfo" }]
925
+ }
926
+ ]
927
+ );
928
+ const reqOpts = bulkUpdateProjectItems(
929
+ payload
930
+ );
931
+ sideEffects?.onSiteCall?.();
932
+ try {
933
+ const result = await httpClient.request(reqOpts);
934
+ sideEffects?.onSuccess?.(result);
935
+ return renameKeysFromRESTResponseToSDKResponse(
936
+ transformPaths2(result.data, [
937
+ {
938
+ transformFn: transformRESTImageToSDKImage,
939
+ paths: [{ path: "results.item.image.imageInfo" }]
940
+ },
941
+ {
942
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
943
+ paths: [{ path: "results.item.video.videoInfo" }]
944
+ }
945
+ ])
946
+ );
947
+ } catch (err) {
948
+ const transformedError = sdkTransformError(
949
+ err,
950
+ {
951
+ spreadPathsToArguments: {},
952
+ explicitPathsToArguments: {
953
+ items: "$[0].items",
954
+ returnFullEntity: "$[0].returnFullEntity"
955
+ },
956
+ singleArgumentUnchanged: false
957
+ },
958
+ ["options"]
959
+ );
960
+ sideEffects?.onError?.(err);
961
+ throw transformedError;
962
+ }
963
+ }
964
+ async function deleteProjectItem2(itemId) {
965
+ const { httpClient, sideEffects } = arguments[1];
966
+ const payload = renameKeysFromSDKRequestToRESTRequest({ itemId });
967
+ const reqOpts = deleteProjectItem(payload);
968
+ sideEffects?.onSiteCall?.();
969
+ try {
970
+ const result = await httpClient.request(reqOpts);
971
+ sideEffects?.onSuccess?.(result);
972
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
973
+ } catch (err) {
974
+ const transformedError = sdkTransformError(
975
+ err,
976
+ {
977
+ spreadPathsToArguments: {},
978
+ explicitPathsToArguments: { itemId: "$[0]" },
979
+ singleArgumentUnchanged: false
980
+ },
981
+ ["itemId"]
982
+ );
983
+ sideEffects?.onError?.(err);
984
+ throw transformedError;
985
+ }
986
+ }
987
+ async function bulkDeleteProjectItems2(options) {
988
+ const { httpClient, sideEffects } = arguments[1];
989
+ const payload = renameKeysFromSDKRequestToRESTRequest({
990
+ itemIds: options?.itemIds
991
+ });
992
+ const reqOpts = bulkDeleteProjectItems(
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: { itemIds: "$[0].itemIds" },
1006
+ singleArgumentUnchanged: false
1007
+ },
1008
+ ["options"]
1009
+ );
1010
+ sideEffects?.onError?.(err);
1011
+ throw transformedError;
1012
+ }
1013
+ }
1014
+ async function duplicateProjectItems2(originProjectId, options) {
1015
+ const { httpClient, sideEffects } = arguments[2];
1016
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1017
+ originProjectId,
1018
+ targetProjectId: options?.targetProjectId
1019
+ });
1020
+ const reqOpts = duplicateProjectItems(
1021
+ payload
1022
+ );
1023
+ sideEffects?.onSiteCall?.();
1024
+ try {
1025
+ const result = await httpClient.request(reqOpts);
1026
+ sideEffects?.onSuccess?.(result);
1027
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1028
+ } catch (err) {
1029
+ const transformedError = sdkTransformError(
1030
+ err,
1031
+ {
1032
+ spreadPathsToArguments: {},
1033
+ explicitPathsToArguments: {
1034
+ originProjectId: "$[0]",
1035
+ targetProjectId: "$[1].targetProjectId"
1036
+ },
1037
+ singleArgumentUnchanged: false
1038
+ },
1039
+ ["originProjectId", "options"]
1040
+ );
1041
+ sideEffects?.onError?.(err);
1042
+ throw transformedError;
1043
+ }
1044
+ }
1045
+ async function generateTokenForProjectItems2(mediaIds) {
1046
+ const { httpClient, sideEffects } = arguments[1];
1047
+ const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
1048
+ const reqOpts = generateTokenForProjectItems(
1049
+ payload
1050
+ );
1051
+ sideEffects?.onSiteCall?.();
1052
+ try {
1053
+ const result = await httpClient.request(reqOpts);
1054
+ sideEffects?.onSuccess?.(result);
1055
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1056
+ } catch (err) {
1057
+ const transformedError = sdkTransformError(
1058
+ err,
1059
+ {
1060
+ spreadPathsToArguments: {},
1061
+ explicitPathsToArguments: { mediaIds: "$[0]" },
1062
+ singleArgumentUnchanged: false
1063
+ },
1064
+ ["mediaIds"]
1065
+ );
1066
+ sideEffects?.onError?.(err);
1067
+ throw transformedError;
1068
+ }
1069
+ }
1070
+ export {
1071
+ ImageType,
1072
+ SortOrder,
1073
+ Type,
1074
+ WebhookIdentityType,
1075
+ bulkCreateProjectItems2 as bulkCreateProjectItems,
1076
+ bulkDeleteProjectItems2 as bulkDeleteProjectItems,
1077
+ bulkUpdateProjectItems2 as bulkUpdateProjectItems,
1078
+ createProjectItem2 as createProjectItem,
1079
+ deleteProjectItem2 as deleteProjectItem,
1080
+ duplicateProjectItems2 as duplicateProjectItems,
1081
+ generateTokenForProjectItems2 as generateTokenForProjectItems,
1082
+ getProjectItem2 as getProjectItem,
1083
+ listProjectItems2 as listProjectItems,
1084
+ updateProjectItem2 as updateProjectItem
1085
+ };
1086
+ //# sourceMappingURL=index.typings.mjs.map