@wix/auto_sdk_media_files 1.0.19 → 1.0.21

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,1887 @@
1
+ // src/media-site-media-v1-file-descriptor-files.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/media-site-media-v1-file-descriptor-files.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 resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
18
+ const domainToMappings = {
19
+ "apps._base_domain_": [
20
+ {
21
+ srcPath: "/_api/wix-privatemedia-proxy-server",
22
+ destPath: "/api"
23
+ },
24
+ {
25
+ srcPath: "/_api/wix-privatemedia-proxy-server/v1",
26
+ destPath: "/v1"
27
+ }
28
+ ],
29
+ "manage._base_domain_": [
30
+ {
31
+ srcPath: "/_api/wix-privatemedia-proxy-server",
32
+ destPath: ""
33
+ }
34
+ ],
35
+ "www.wixapis.com": [
36
+ {
37
+ srcPath: "/site-media/v1",
38
+ destPath: "/v1"
39
+ }
40
+ ],
41
+ "*.dev.wix-code.com": [
42
+ {
43
+ srcPath: "/_api/wix-privatemedia-proxy-server",
44
+ destPath: ""
45
+ }
46
+ ],
47
+ "api._api_base_domain_": [
48
+ {
49
+ srcPath: "/wix-privatemedia-proxy-server",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "bo._base_domain_": [
54
+ {
55
+ srcPath: "/wix-privatemedia-proxy-server",
56
+ destPath: ""
57
+ }
58
+ ],
59
+ "wixbo.ai": [
60
+ {
61
+ srcPath: "/wix-privatemedia-proxy-server",
62
+ destPath: ""
63
+ }
64
+ ],
65
+ "wix-bo.com": [
66
+ {
67
+ srcPath: "/wix-privatemedia-proxy-server",
68
+ destPath: ""
69
+ }
70
+ ],
71
+ _: [
72
+ {
73
+ srcPath: "/wix-privatemedia-proxy-server",
74
+ destPath: ""
75
+ }
76
+ ],
77
+ "editor._base_domain_": [
78
+ {
79
+ srcPath: "/_api/wix-privatemedia-proxy-server",
80
+ destPath: ""
81
+ }
82
+ ],
83
+ "blocks._base_domain_": [
84
+ {
85
+ srcPath: "/_api/wix-privatemedia-proxy-server",
86
+ destPath: ""
87
+ }
88
+ ],
89
+ "create.editorx": [
90
+ {
91
+ srcPath: "/_api/wix-privatemedia-proxy-server",
92
+ destPath: ""
93
+ }
94
+ ],
95
+ "platform.rise.ai": [
96
+ {
97
+ srcPath: "/_api/wix-privatemedia-proxy-server",
98
+ destPath: ""
99
+ }
100
+ ]
101
+ };
102
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
103
+ }
104
+ var PACKAGE_NAME = "@wix/auto_sdk_media_files";
105
+ function generateFilesDownloadUrl(payload) {
106
+ function __generateFilesDownloadUrl({ host }) {
107
+ const metadata = {
108
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
109
+ method: "POST",
110
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GenerateFilesDownloadUrl",
111
+ packageName: PACKAGE_NAME,
112
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
113
+ protoPath: "/v1/files/generate-download-url",
114
+ data: payload,
115
+ host
116
+ }),
117
+ data: payload
118
+ };
119
+ return metadata;
120
+ }
121
+ return __generateFilesDownloadUrl;
122
+ }
123
+ function generateFileDownloadUrl(payload) {
124
+ function __generateFileDownloadUrl({ host }) {
125
+ const metadata = {
126
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
127
+ method: "POST",
128
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GenerateFileDownloadUrl",
129
+ packageName: PACKAGE_NAME,
130
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
131
+ protoPath: "/v1/files/generate-file-download-url",
132
+ data: payload,
133
+ host
134
+ }),
135
+ data: payload
136
+ };
137
+ return metadata;
138
+ }
139
+ return __generateFileDownloadUrl;
140
+ }
141
+ function getFileDescriptor(payload) {
142
+ function __getFileDescriptor({ host }) {
143
+ const metadata = {
144
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
145
+ method: "GET",
146
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GetFileDescriptor",
147
+ packageName: PACKAGE_NAME,
148
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
149
+ protoPath: "/v1/files/get-file-by-id",
150
+ data: payload,
151
+ host
152
+ }),
153
+ params: toURLSearchParams(payload),
154
+ transformResponse: (payload2) => transformPaths(payload2, [
155
+ {
156
+ transformFn: transformRESTTimestampToSDKTimestamp,
157
+ paths: [
158
+ { path: "file.createdDate" },
159
+ { path: "file.updatedDate" },
160
+ { path: "file.lastUsedDate" },
161
+ { path: "file.media.image.image.urlExpirationDate" },
162
+ { path: "file.media.image.previewImage.urlExpirationDate" },
163
+ { path: "file.media.video.urlExpirationDate" },
164
+ { path: "file.media.video.resolutions.urlExpirationDate" },
165
+ { path: "file.media.video.resolutions.poster.urlExpirationDate" },
166
+ { path: "file.media.video.posters.urlExpirationDate" },
167
+ { path: "file.media.audio.assets.urlExpirationDate" },
168
+ { path: "file.media.document.urlExpirationDate" },
169
+ { path: "file.media.document.thumbnail.urlExpirationDate" },
170
+ { path: "file.media.vector.image.urlExpirationDate" },
171
+ { path: "file.media.vector.previewImage.urlExpirationDate" },
172
+ { path: "file.media.archive.urlExpirationDate" },
173
+ { path: "file.media.model3d.urlExpirationDate" },
174
+ { path: "file.media.model3d.thumbnail.urlExpirationDate" },
175
+ { path: "file.media.icon.image.urlExpirationDate" },
176
+ { path: "file.media.icon.previewImage.urlExpirationDate" }
177
+ ]
178
+ },
179
+ {
180
+ transformFn: transformRESTFloatToSDKFloat,
181
+ paths: [
182
+ { path: "file.media.image.image.focalPoint.x" },
183
+ { path: "file.media.image.image.focalPoint.y" },
184
+ { path: "file.media.image.faces.confidence" },
185
+ { path: "file.media.image.previewImage.focalPoint.x" },
186
+ { path: "file.media.image.previewImage.focalPoint.y" },
187
+ { path: "file.media.video.resolutions.poster.focalPoint.x" },
188
+ { path: "file.media.video.resolutions.poster.focalPoint.y" },
189
+ { path: "file.media.video.posters.focalPoint.x" },
190
+ { path: "file.media.video.posters.focalPoint.y" },
191
+ { path: "file.media.document.thumbnail.focalPoint.x" },
192
+ { path: "file.media.document.thumbnail.focalPoint.y" },
193
+ { path: "file.media.vector.image.focalPoint.x" },
194
+ { path: "file.media.vector.image.focalPoint.y" },
195
+ { path: "file.media.vector.faces.confidence" },
196
+ { path: "file.media.vector.previewImage.focalPoint.x" },
197
+ { path: "file.media.vector.previewImage.focalPoint.y" },
198
+ { path: "file.media.model3d.thumbnail.focalPoint.x" },
199
+ { path: "file.media.model3d.thumbnail.focalPoint.y" },
200
+ { path: "file.media.icon.image.focalPoint.x" },
201
+ { path: "file.media.icon.image.focalPoint.y" },
202
+ { path: "file.media.icon.faces.confidence" },
203
+ { path: "file.media.icon.previewImage.focalPoint.x" },
204
+ { path: "file.media.icon.previewImage.focalPoint.y" }
205
+ ]
206
+ }
207
+ ]),
208
+ fallback: [
209
+ {
210
+ method: "GET",
211
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
212
+ protoPath: "/v1/files/get-file-by-id",
213
+ data: payload,
214
+ host
215
+ }),
216
+ params: toURLSearchParams(payload)
217
+ }
218
+ ]
219
+ };
220
+ return metadata;
221
+ }
222
+ return __getFileDescriptor;
223
+ }
224
+ function getFileDescriptors(payload) {
225
+ function __getFileDescriptors({ host }) {
226
+ const metadata = {
227
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
228
+ method: "POST",
229
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GetFileDescriptors",
230
+ packageName: PACKAGE_NAME,
231
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
232
+ protoPath: "/v1/files/get-files",
233
+ data: payload,
234
+ host
235
+ }),
236
+ data: payload,
237
+ transformResponse: (payload2) => transformPaths(payload2, [
238
+ {
239
+ transformFn: transformRESTTimestampToSDKTimestamp,
240
+ paths: [
241
+ { path: "files.createdDate" },
242
+ { path: "files.updatedDate" },
243
+ { path: "files.lastUsedDate" },
244
+ { path: "files.media.image.image.urlExpirationDate" },
245
+ { path: "files.media.image.previewImage.urlExpirationDate" },
246
+ { path: "files.media.video.urlExpirationDate" },
247
+ { path: "files.media.video.resolutions.urlExpirationDate" },
248
+ {
249
+ path: "files.media.video.resolutions.poster.urlExpirationDate"
250
+ },
251
+ { path: "files.media.video.posters.urlExpirationDate" },
252
+ { path: "files.media.audio.assets.urlExpirationDate" },
253
+ { path: "files.media.document.urlExpirationDate" },
254
+ { path: "files.media.document.thumbnail.urlExpirationDate" },
255
+ { path: "files.media.vector.image.urlExpirationDate" },
256
+ { path: "files.media.vector.previewImage.urlExpirationDate" },
257
+ { path: "files.media.archive.urlExpirationDate" },
258
+ { path: "files.media.model3d.urlExpirationDate" },
259
+ { path: "files.media.model3d.thumbnail.urlExpirationDate" },
260
+ { path: "files.media.icon.image.urlExpirationDate" },
261
+ { path: "files.media.icon.previewImage.urlExpirationDate" }
262
+ ]
263
+ },
264
+ {
265
+ transformFn: transformRESTFloatToSDKFloat,
266
+ paths: [
267
+ { path: "files.media.image.image.focalPoint.x" },
268
+ { path: "files.media.image.image.focalPoint.y" },
269
+ { path: "files.media.image.faces.confidence" },
270
+ { path: "files.media.image.previewImage.focalPoint.x" },
271
+ { path: "files.media.image.previewImage.focalPoint.y" },
272
+ { path: "files.media.video.resolutions.poster.focalPoint.x" },
273
+ { path: "files.media.video.resolutions.poster.focalPoint.y" },
274
+ { path: "files.media.video.posters.focalPoint.x" },
275
+ { path: "files.media.video.posters.focalPoint.y" },
276
+ { path: "files.media.document.thumbnail.focalPoint.x" },
277
+ { path: "files.media.document.thumbnail.focalPoint.y" },
278
+ { path: "files.media.vector.image.focalPoint.x" },
279
+ { path: "files.media.vector.image.focalPoint.y" },
280
+ { path: "files.media.vector.faces.confidence" },
281
+ { path: "files.media.vector.previewImage.focalPoint.x" },
282
+ { path: "files.media.vector.previewImage.focalPoint.y" },
283
+ { path: "files.media.model3d.thumbnail.focalPoint.x" },
284
+ { path: "files.media.model3d.thumbnail.focalPoint.y" },
285
+ { path: "files.media.icon.image.focalPoint.x" },
286
+ { path: "files.media.icon.image.focalPoint.y" },
287
+ { path: "files.media.icon.faces.confidence" },
288
+ { path: "files.media.icon.previewImage.focalPoint.x" },
289
+ { path: "files.media.icon.previewImage.focalPoint.y" }
290
+ ]
291
+ }
292
+ ])
293
+ };
294
+ return metadata;
295
+ }
296
+ return __getFileDescriptors;
297
+ }
298
+ function updateFileDescriptor(payload) {
299
+ function __updateFileDescriptor({ host }) {
300
+ const serializedData = transformPaths(payload, [
301
+ {
302
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
303
+ paths: [{ path: "fieldMask" }]
304
+ },
305
+ {
306
+ transformFn: transformSDKTimestampToRESTTimestamp,
307
+ paths: [
308
+ { path: "file.createdDate" },
309
+ { path: "file.updatedDate" },
310
+ { path: "file.lastUsedDate" },
311
+ { path: "file.media.image.image.urlExpirationDate" },
312
+ { path: "file.media.image.previewImage.urlExpirationDate" },
313
+ { path: "file.media.video.urlExpirationDate" },
314
+ { path: "file.media.video.resolutions.urlExpirationDate" },
315
+ { path: "file.media.video.resolutions.poster.urlExpirationDate" },
316
+ { path: "file.media.video.posters.urlExpirationDate" },
317
+ { path: "file.media.audio.assets.urlExpirationDate" },
318
+ { path: "file.media.document.urlExpirationDate" },
319
+ { path: "file.media.document.thumbnail.urlExpirationDate" },
320
+ { path: "file.media.vector.image.urlExpirationDate" },
321
+ { path: "file.media.vector.previewImage.urlExpirationDate" },
322
+ { path: "file.media.archive.urlExpirationDate" },
323
+ { path: "file.media.model3d.urlExpirationDate" },
324
+ { path: "file.media.model3d.thumbnail.urlExpirationDate" },
325
+ { path: "file.media.icon.image.urlExpirationDate" },
326
+ { path: "file.media.icon.previewImage.urlExpirationDate" }
327
+ ]
328
+ },
329
+ {
330
+ transformFn: transformSDKFloatToRESTFloat,
331
+ paths: [
332
+ { path: "file.media.image.image.focalPoint.x" },
333
+ { path: "file.media.image.image.focalPoint.y" },
334
+ { path: "file.media.image.faces.confidence" },
335
+ { path: "file.media.image.previewImage.focalPoint.x" },
336
+ { path: "file.media.image.previewImage.focalPoint.y" },
337
+ { path: "file.media.video.resolutions.poster.focalPoint.x" },
338
+ { path: "file.media.video.resolutions.poster.focalPoint.y" },
339
+ { path: "file.media.video.posters.focalPoint.x" },
340
+ { path: "file.media.video.posters.focalPoint.y" },
341
+ { path: "file.media.document.thumbnail.focalPoint.x" },
342
+ { path: "file.media.document.thumbnail.focalPoint.y" },
343
+ { path: "file.media.vector.image.focalPoint.x" },
344
+ { path: "file.media.vector.image.focalPoint.y" },
345
+ { path: "file.media.vector.faces.confidence" },
346
+ { path: "file.media.vector.previewImage.focalPoint.x" },
347
+ { path: "file.media.vector.previewImage.focalPoint.y" },
348
+ { path: "file.media.model3d.thumbnail.focalPoint.x" },
349
+ { path: "file.media.model3d.thumbnail.focalPoint.y" },
350
+ { path: "file.media.icon.image.focalPoint.x" },
351
+ { path: "file.media.icon.image.focalPoint.y" },
352
+ { path: "file.media.icon.faces.confidence" },
353
+ { path: "file.media.icon.previewImage.focalPoint.x" },
354
+ { path: "file.media.icon.previewImage.focalPoint.y" }
355
+ ]
356
+ }
357
+ ]);
358
+ const metadata = {
359
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
360
+ method: "PATCH",
361
+ methodFqn: "com.wix.media.site_media.v1.FilesService.UpdateFileDescriptor",
362
+ packageName: PACKAGE_NAME,
363
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
364
+ protoPath: "/v1/files/update-file-descriptor",
365
+ data: serializedData,
366
+ host
367
+ }),
368
+ data: serializedData,
369
+ transformResponse: (payload2) => transformPaths(payload2, [
370
+ {
371
+ transformFn: transformRESTTimestampToSDKTimestamp,
372
+ paths: [
373
+ { path: "file.createdDate" },
374
+ { path: "file.updatedDate" },
375
+ { path: "file.lastUsedDate" },
376
+ { path: "file.media.image.image.urlExpirationDate" },
377
+ { path: "file.media.image.previewImage.urlExpirationDate" },
378
+ { path: "file.media.video.urlExpirationDate" },
379
+ { path: "file.media.video.resolutions.urlExpirationDate" },
380
+ { path: "file.media.video.resolutions.poster.urlExpirationDate" },
381
+ { path: "file.media.video.posters.urlExpirationDate" },
382
+ { path: "file.media.audio.assets.urlExpirationDate" },
383
+ { path: "file.media.document.urlExpirationDate" },
384
+ { path: "file.media.document.thumbnail.urlExpirationDate" },
385
+ { path: "file.media.vector.image.urlExpirationDate" },
386
+ { path: "file.media.vector.previewImage.urlExpirationDate" },
387
+ { path: "file.media.archive.urlExpirationDate" },
388
+ { path: "file.media.model3d.urlExpirationDate" },
389
+ { path: "file.media.model3d.thumbnail.urlExpirationDate" },
390
+ { path: "file.media.icon.image.urlExpirationDate" },
391
+ { path: "file.media.icon.previewImage.urlExpirationDate" }
392
+ ]
393
+ },
394
+ {
395
+ transformFn: transformRESTFloatToSDKFloat,
396
+ paths: [
397
+ { path: "file.media.image.image.focalPoint.x" },
398
+ { path: "file.media.image.image.focalPoint.y" },
399
+ { path: "file.media.image.faces.confidence" },
400
+ { path: "file.media.image.previewImage.focalPoint.x" },
401
+ { path: "file.media.image.previewImage.focalPoint.y" },
402
+ { path: "file.media.video.resolutions.poster.focalPoint.x" },
403
+ { path: "file.media.video.resolutions.poster.focalPoint.y" },
404
+ { path: "file.media.video.posters.focalPoint.x" },
405
+ { path: "file.media.video.posters.focalPoint.y" },
406
+ { path: "file.media.document.thumbnail.focalPoint.x" },
407
+ { path: "file.media.document.thumbnail.focalPoint.y" },
408
+ { path: "file.media.vector.image.focalPoint.x" },
409
+ { path: "file.media.vector.image.focalPoint.y" },
410
+ { path: "file.media.vector.faces.confidence" },
411
+ { path: "file.media.vector.previewImage.focalPoint.x" },
412
+ { path: "file.media.vector.previewImage.focalPoint.y" },
413
+ { path: "file.media.model3d.thumbnail.focalPoint.x" },
414
+ { path: "file.media.model3d.thumbnail.focalPoint.y" },
415
+ { path: "file.media.icon.image.focalPoint.x" },
416
+ { path: "file.media.icon.image.focalPoint.y" },
417
+ { path: "file.media.icon.faces.confidence" },
418
+ { path: "file.media.icon.previewImage.focalPoint.x" },
419
+ { path: "file.media.icon.previewImage.focalPoint.y" }
420
+ ]
421
+ }
422
+ ])
423
+ };
424
+ return metadata;
425
+ }
426
+ return __updateFileDescriptor;
427
+ }
428
+ function generateFileUploadUrl(payload) {
429
+ function __generateFileUploadUrl({ host }) {
430
+ const metadata = {
431
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
432
+ method: "POST",
433
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GenerateFileUploadUrl",
434
+ packageName: PACKAGE_NAME,
435
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
436
+ protoPath: "/v1/files/generate-upload-url",
437
+ data: payload,
438
+ host
439
+ }),
440
+ data: payload
441
+ };
442
+ return metadata;
443
+ }
444
+ return __generateFileUploadUrl;
445
+ }
446
+ function generateFileResumableUploadUrl(payload) {
447
+ function __generateFileResumableUploadUrl({ host }) {
448
+ const metadata = {
449
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
450
+ method: "POST",
451
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GenerateFileResumableUploadUrl",
452
+ packageName: PACKAGE_NAME,
453
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
454
+ protoPath: "/v1/files/generate-resumable-upload-url",
455
+ data: payload,
456
+ host
457
+ }),
458
+ data: payload
459
+ };
460
+ return metadata;
461
+ }
462
+ return __generateFileResumableUploadUrl;
463
+ }
464
+ function importFile(payload) {
465
+ function __importFile({ host }) {
466
+ const metadata = {
467
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
468
+ method: "POST",
469
+ methodFqn: "com.wix.media.site_media.v1.FilesService.ImportFile",
470
+ packageName: PACKAGE_NAME,
471
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
472
+ protoPath: "/v1/files/import",
473
+ data: payload,
474
+ host
475
+ }),
476
+ data: payload,
477
+ transformResponse: (payload2) => transformPaths(payload2, [
478
+ {
479
+ transformFn: transformRESTTimestampToSDKTimestamp,
480
+ paths: [
481
+ { path: "file.createdDate" },
482
+ { path: "file.updatedDate" },
483
+ { path: "file.lastUsedDate" },
484
+ { path: "file.media.image.image.urlExpirationDate" },
485
+ { path: "file.media.image.previewImage.urlExpirationDate" },
486
+ { path: "file.media.video.urlExpirationDate" },
487
+ { path: "file.media.video.resolutions.urlExpirationDate" },
488
+ { path: "file.media.video.resolutions.poster.urlExpirationDate" },
489
+ { path: "file.media.video.posters.urlExpirationDate" },
490
+ { path: "file.media.audio.assets.urlExpirationDate" },
491
+ { path: "file.media.document.urlExpirationDate" },
492
+ { path: "file.media.document.thumbnail.urlExpirationDate" },
493
+ { path: "file.media.vector.image.urlExpirationDate" },
494
+ { path: "file.media.vector.previewImage.urlExpirationDate" },
495
+ { path: "file.media.archive.urlExpirationDate" },
496
+ { path: "file.media.model3d.urlExpirationDate" },
497
+ { path: "file.media.model3d.thumbnail.urlExpirationDate" },
498
+ { path: "file.media.icon.image.urlExpirationDate" },
499
+ { path: "file.media.icon.previewImage.urlExpirationDate" }
500
+ ]
501
+ },
502
+ {
503
+ transformFn: transformRESTFloatToSDKFloat,
504
+ paths: [
505
+ { path: "file.media.image.image.focalPoint.x" },
506
+ { path: "file.media.image.image.focalPoint.y" },
507
+ { path: "file.media.image.faces.confidence" },
508
+ { path: "file.media.image.previewImage.focalPoint.x" },
509
+ { path: "file.media.image.previewImage.focalPoint.y" },
510
+ { path: "file.media.video.resolutions.poster.focalPoint.x" },
511
+ { path: "file.media.video.resolutions.poster.focalPoint.y" },
512
+ { path: "file.media.video.posters.focalPoint.x" },
513
+ { path: "file.media.video.posters.focalPoint.y" },
514
+ { path: "file.media.document.thumbnail.focalPoint.x" },
515
+ { path: "file.media.document.thumbnail.focalPoint.y" },
516
+ { path: "file.media.vector.image.focalPoint.x" },
517
+ { path: "file.media.vector.image.focalPoint.y" },
518
+ { path: "file.media.vector.faces.confidence" },
519
+ { path: "file.media.vector.previewImage.focalPoint.x" },
520
+ { path: "file.media.vector.previewImage.focalPoint.y" },
521
+ { path: "file.media.model3d.thumbnail.focalPoint.x" },
522
+ { path: "file.media.model3d.thumbnail.focalPoint.y" },
523
+ { path: "file.media.icon.image.focalPoint.x" },
524
+ { path: "file.media.icon.image.focalPoint.y" },
525
+ { path: "file.media.icon.faces.confidence" },
526
+ { path: "file.media.icon.previewImage.focalPoint.x" },
527
+ { path: "file.media.icon.previewImage.focalPoint.y" }
528
+ ]
529
+ }
530
+ ])
531
+ };
532
+ return metadata;
533
+ }
534
+ return __importFile;
535
+ }
536
+ function bulkImportFiles(payload) {
537
+ function __bulkImportFiles({ host }) {
538
+ const metadata = {
539
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
540
+ method: "POST",
541
+ methodFqn: "com.wix.media.site_media.v1.FilesService.BulkImportFiles",
542
+ packageName: PACKAGE_NAME,
543
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
544
+ protoPath: "/v1/bulk/files/import",
545
+ data: payload,
546
+ host
547
+ }),
548
+ data: payload,
549
+ transformResponse: (payload2) => transformPaths(payload2, [
550
+ {
551
+ transformFn: transformRESTTimestampToSDKTimestamp,
552
+ paths: [
553
+ { path: "files.createdDate" },
554
+ { path: "files.updatedDate" },
555
+ { path: "files.lastUsedDate" },
556
+ { path: "files.media.image.image.urlExpirationDate" },
557
+ { path: "files.media.image.previewImage.urlExpirationDate" },
558
+ { path: "files.media.video.urlExpirationDate" },
559
+ { path: "files.media.video.resolutions.urlExpirationDate" },
560
+ {
561
+ path: "files.media.video.resolutions.poster.urlExpirationDate"
562
+ },
563
+ { path: "files.media.video.posters.urlExpirationDate" },
564
+ { path: "files.media.audio.assets.urlExpirationDate" },
565
+ { path: "files.media.document.urlExpirationDate" },
566
+ { path: "files.media.document.thumbnail.urlExpirationDate" },
567
+ { path: "files.media.vector.image.urlExpirationDate" },
568
+ { path: "files.media.vector.previewImage.urlExpirationDate" },
569
+ { path: "files.media.archive.urlExpirationDate" },
570
+ { path: "files.media.model3d.urlExpirationDate" },
571
+ { path: "files.media.model3d.thumbnail.urlExpirationDate" },
572
+ { path: "files.media.icon.image.urlExpirationDate" },
573
+ { path: "files.media.icon.previewImage.urlExpirationDate" }
574
+ ]
575
+ },
576
+ {
577
+ transformFn: transformRESTFloatToSDKFloat,
578
+ paths: [
579
+ { path: "files.media.image.image.focalPoint.x" },
580
+ { path: "files.media.image.image.focalPoint.y" },
581
+ { path: "files.media.image.faces.confidence" },
582
+ { path: "files.media.image.previewImage.focalPoint.x" },
583
+ { path: "files.media.image.previewImage.focalPoint.y" },
584
+ { path: "files.media.video.resolutions.poster.focalPoint.x" },
585
+ { path: "files.media.video.resolutions.poster.focalPoint.y" },
586
+ { path: "files.media.video.posters.focalPoint.x" },
587
+ { path: "files.media.video.posters.focalPoint.y" },
588
+ { path: "files.media.document.thumbnail.focalPoint.x" },
589
+ { path: "files.media.document.thumbnail.focalPoint.y" },
590
+ { path: "files.media.vector.image.focalPoint.x" },
591
+ { path: "files.media.vector.image.focalPoint.y" },
592
+ { path: "files.media.vector.faces.confidence" },
593
+ { path: "files.media.vector.previewImage.focalPoint.x" },
594
+ { path: "files.media.vector.previewImage.focalPoint.y" },
595
+ { path: "files.media.model3d.thumbnail.focalPoint.x" },
596
+ { path: "files.media.model3d.thumbnail.focalPoint.y" },
597
+ { path: "files.media.icon.image.focalPoint.x" },
598
+ { path: "files.media.icon.image.focalPoint.y" },
599
+ { path: "files.media.icon.faces.confidence" },
600
+ { path: "files.media.icon.previewImage.focalPoint.x" },
601
+ { path: "files.media.icon.previewImage.focalPoint.y" }
602
+ ]
603
+ }
604
+ ])
605
+ };
606
+ return metadata;
607
+ }
608
+ return __bulkImportFiles;
609
+ }
610
+ function bulkImportFile(payload) {
611
+ function __bulkImportFile({ host }) {
612
+ const metadata = {
613
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
614
+ method: "POST",
615
+ methodFqn: "com.wix.media.site_media.v1.FilesService.BulkImportFile",
616
+ packageName: PACKAGE_NAME,
617
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
618
+ protoPath: "/v1/bulk/files/import-v2",
619
+ data: payload,
620
+ host
621
+ }),
622
+ data: payload,
623
+ transformResponse: (payload2) => transformPaths(payload2, [
624
+ {
625
+ transformFn: transformRESTTimestampToSDKTimestamp,
626
+ paths: [
627
+ { path: "results.item.createdDate" },
628
+ { path: "results.item.updatedDate" },
629
+ { path: "results.item.lastUsedDate" },
630
+ { path: "results.item.media.image.image.urlExpirationDate" },
631
+ {
632
+ path: "results.item.media.image.previewImage.urlExpirationDate"
633
+ },
634
+ { path: "results.item.media.video.urlExpirationDate" },
635
+ {
636
+ path: "results.item.media.video.resolutions.urlExpirationDate"
637
+ },
638
+ {
639
+ path: "results.item.media.video.resolutions.poster.urlExpirationDate"
640
+ },
641
+ { path: "results.item.media.video.posters.urlExpirationDate" },
642
+ { path: "results.item.media.audio.assets.urlExpirationDate" },
643
+ { path: "results.item.media.document.urlExpirationDate" },
644
+ {
645
+ path: "results.item.media.document.thumbnail.urlExpirationDate"
646
+ },
647
+ { path: "results.item.media.vector.image.urlExpirationDate" },
648
+ {
649
+ path: "results.item.media.vector.previewImage.urlExpirationDate"
650
+ },
651
+ { path: "results.item.media.archive.urlExpirationDate" },
652
+ { path: "results.item.media.model3d.urlExpirationDate" },
653
+ {
654
+ path: "results.item.media.model3d.thumbnail.urlExpirationDate"
655
+ },
656
+ { path: "results.item.media.icon.image.urlExpirationDate" },
657
+ {
658
+ path: "results.item.media.icon.previewImage.urlExpirationDate"
659
+ }
660
+ ]
661
+ },
662
+ {
663
+ transformFn: transformRESTFloatToSDKFloat,
664
+ paths: [
665
+ { path: "results.item.media.image.image.focalPoint.x" },
666
+ { path: "results.item.media.image.image.focalPoint.y" },
667
+ { path: "results.item.media.image.faces.confidence" },
668
+ { path: "results.item.media.image.previewImage.focalPoint.x" },
669
+ { path: "results.item.media.image.previewImage.focalPoint.y" },
670
+ {
671
+ path: "results.item.media.video.resolutions.poster.focalPoint.x"
672
+ },
673
+ {
674
+ path: "results.item.media.video.resolutions.poster.focalPoint.y"
675
+ },
676
+ { path: "results.item.media.video.posters.focalPoint.x" },
677
+ { path: "results.item.media.video.posters.focalPoint.y" },
678
+ { path: "results.item.media.document.thumbnail.focalPoint.x" },
679
+ { path: "results.item.media.document.thumbnail.focalPoint.y" },
680
+ { path: "results.item.media.vector.image.focalPoint.x" },
681
+ { path: "results.item.media.vector.image.focalPoint.y" },
682
+ { path: "results.item.media.vector.faces.confidence" },
683
+ { path: "results.item.media.vector.previewImage.focalPoint.x" },
684
+ { path: "results.item.media.vector.previewImage.focalPoint.y" },
685
+ { path: "results.item.media.model3d.thumbnail.focalPoint.x" },
686
+ { path: "results.item.media.model3d.thumbnail.focalPoint.y" },
687
+ { path: "results.item.media.icon.image.focalPoint.x" },
688
+ { path: "results.item.media.icon.image.focalPoint.y" },
689
+ { path: "results.item.media.icon.faces.confidence" },
690
+ { path: "results.item.media.icon.previewImage.focalPoint.x" },
691
+ { path: "results.item.media.icon.previewImage.focalPoint.y" }
692
+ ]
693
+ }
694
+ ])
695
+ };
696
+ return metadata;
697
+ }
698
+ return __bulkImportFile;
699
+ }
700
+ function listFiles(payload) {
701
+ function __listFiles({ host }) {
702
+ const metadata = {
703
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
704
+ method: "GET",
705
+ methodFqn: "com.wix.media.site_media.v1.FilesService.ListFiles",
706
+ packageName: PACKAGE_NAME,
707
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
708
+ protoPath: "/v1/files",
709
+ data: payload,
710
+ host
711
+ }),
712
+ params: toURLSearchParams(payload, true),
713
+ transformResponse: (payload2) => transformPaths(payload2, [
714
+ {
715
+ transformFn: transformRESTTimestampToSDKTimestamp,
716
+ paths: [
717
+ { path: "files.createdDate" },
718
+ { path: "files.updatedDate" },
719
+ { path: "files.lastUsedDate" },
720
+ { path: "files.media.image.image.urlExpirationDate" },
721
+ { path: "files.media.image.previewImage.urlExpirationDate" },
722
+ { path: "files.media.video.urlExpirationDate" },
723
+ { path: "files.media.video.resolutions.urlExpirationDate" },
724
+ {
725
+ path: "files.media.video.resolutions.poster.urlExpirationDate"
726
+ },
727
+ { path: "files.media.video.posters.urlExpirationDate" },
728
+ { path: "files.media.audio.assets.urlExpirationDate" },
729
+ { path: "files.media.document.urlExpirationDate" },
730
+ { path: "files.media.document.thumbnail.urlExpirationDate" },
731
+ { path: "files.media.vector.image.urlExpirationDate" },
732
+ { path: "files.media.vector.previewImage.urlExpirationDate" },
733
+ { path: "files.media.archive.urlExpirationDate" },
734
+ { path: "files.media.model3d.urlExpirationDate" },
735
+ { path: "files.media.model3d.thumbnail.urlExpirationDate" },
736
+ { path: "files.media.icon.image.urlExpirationDate" },
737
+ { path: "files.media.icon.previewImage.urlExpirationDate" }
738
+ ]
739
+ },
740
+ {
741
+ transformFn: transformRESTFloatToSDKFloat,
742
+ paths: [
743
+ { path: "files.media.image.image.focalPoint.x" },
744
+ { path: "files.media.image.image.focalPoint.y" },
745
+ { path: "files.media.image.faces.confidence" },
746
+ { path: "files.media.image.previewImage.focalPoint.x" },
747
+ { path: "files.media.image.previewImage.focalPoint.y" },
748
+ { path: "files.media.video.resolutions.poster.focalPoint.x" },
749
+ { path: "files.media.video.resolutions.poster.focalPoint.y" },
750
+ { path: "files.media.video.posters.focalPoint.x" },
751
+ { path: "files.media.video.posters.focalPoint.y" },
752
+ { path: "files.media.document.thumbnail.focalPoint.x" },
753
+ { path: "files.media.document.thumbnail.focalPoint.y" },
754
+ { path: "files.media.vector.image.focalPoint.x" },
755
+ { path: "files.media.vector.image.focalPoint.y" },
756
+ { path: "files.media.vector.faces.confidence" },
757
+ { path: "files.media.vector.previewImage.focalPoint.x" },
758
+ { path: "files.media.vector.previewImage.focalPoint.y" },
759
+ { path: "files.media.model3d.thumbnail.focalPoint.x" },
760
+ { path: "files.media.model3d.thumbnail.focalPoint.y" },
761
+ { path: "files.media.icon.image.focalPoint.x" },
762
+ { path: "files.media.icon.image.focalPoint.y" },
763
+ { path: "files.media.icon.faces.confidence" },
764
+ { path: "files.media.icon.previewImage.focalPoint.x" },
765
+ { path: "files.media.icon.previewImage.focalPoint.y" }
766
+ ]
767
+ }
768
+ ])
769
+ };
770
+ return metadata;
771
+ }
772
+ return __listFiles;
773
+ }
774
+ function searchFiles(payload) {
775
+ function __searchFiles({ host }) {
776
+ const metadata = {
777
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
778
+ method: "POST",
779
+ methodFqn: "com.wix.media.site_media.v1.FilesService.SearchFiles",
780
+ packageName: PACKAGE_NAME,
781
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
782
+ protoPath: "/v1/files/search",
783
+ data: payload,
784
+ host
785
+ }),
786
+ data: payload,
787
+ transformResponse: (payload2) => transformPaths(payload2, [
788
+ {
789
+ transformFn: transformRESTTimestampToSDKTimestamp,
790
+ paths: [
791
+ { path: "files.createdDate" },
792
+ { path: "files.updatedDate" },
793
+ { path: "files.lastUsedDate" },
794
+ { path: "files.media.image.image.urlExpirationDate" },
795
+ { path: "files.media.image.previewImage.urlExpirationDate" },
796
+ { path: "files.media.video.urlExpirationDate" },
797
+ { path: "files.media.video.resolutions.urlExpirationDate" },
798
+ {
799
+ path: "files.media.video.resolutions.poster.urlExpirationDate"
800
+ },
801
+ { path: "files.media.video.posters.urlExpirationDate" },
802
+ { path: "files.media.audio.assets.urlExpirationDate" },
803
+ { path: "files.media.document.urlExpirationDate" },
804
+ { path: "files.media.document.thumbnail.urlExpirationDate" },
805
+ { path: "files.media.vector.image.urlExpirationDate" },
806
+ { path: "files.media.vector.previewImage.urlExpirationDate" },
807
+ { path: "files.media.archive.urlExpirationDate" },
808
+ { path: "files.media.model3d.urlExpirationDate" },
809
+ { path: "files.media.model3d.thumbnail.urlExpirationDate" },
810
+ { path: "files.media.icon.image.urlExpirationDate" },
811
+ { path: "files.media.icon.previewImage.urlExpirationDate" }
812
+ ]
813
+ },
814
+ {
815
+ transformFn: transformRESTFloatToSDKFloat,
816
+ paths: [
817
+ { path: "files.media.image.image.focalPoint.x" },
818
+ { path: "files.media.image.image.focalPoint.y" },
819
+ { path: "files.media.image.faces.confidence" },
820
+ { path: "files.media.image.previewImage.focalPoint.x" },
821
+ { path: "files.media.image.previewImage.focalPoint.y" },
822
+ { path: "files.media.video.resolutions.poster.focalPoint.x" },
823
+ { path: "files.media.video.resolutions.poster.focalPoint.y" },
824
+ { path: "files.media.video.posters.focalPoint.x" },
825
+ { path: "files.media.video.posters.focalPoint.y" },
826
+ { path: "files.media.document.thumbnail.focalPoint.x" },
827
+ { path: "files.media.document.thumbnail.focalPoint.y" },
828
+ { path: "files.media.vector.image.focalPoint.x" },
829
+ { path: "files.media.vector.image.focalPoint.y" },
830
+ { path: "files.media.vector.faces.confidence" },
831
+ { path: "files.media.vector.previewImage.focalPoint.x" },
832
+ { path: "files.media.vector.previewImage.focalPoint.y" },
833
+ { path: "files.media.model3d.thumbnail.focalPoint.x" },
834
+ { path: "files.media.model3d.thumbnail.focalPoint.y" },
835
+ { path: "files.media.icon.image.focalPoint.x" },
836
+ { path: "files.media.icon.image.focalPoint.y" },
837
+ { path: "files.media.icon.faces.confidence" },
838
+ { path: "files.media.icon.previewImage.focalPoint.x" },
839
+ { path: "files.media.icon.previewImage.focalPoint.y" }
840
+ ]
841
+ }
842
+ ])
843
+ };
844
+ return metadata;
845
+ }
846
+ return __searchFiles;
847
+ }
848
+ function generateVideoStreamingUrl(payload) {
849
+ function __generateVideoStreamingUrl({ host }) {
850
+ const metadata = {
851
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
852
+ method: "POST",
853
+ methodFqn: "com.wix.media.site_media.v1.FilesService.GenerateVideoStreamingUrl",
854
+ packageName: PACKAGE_NAME,
855
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
856
+ protoPath: "/v1/files/generate-video-stream-url",
857
+ data: payload,
858
+ host
859
+ }),
860
+ data: payload
861
+ };
862
+ return metadata;
863
+ }
864
+ return __generateVideoStreamingUrl;
865
+ }
866
+ function bulkDeleteFiles(payload) {
867
+ function __bulkDeleteFiles({ host }) {
868
+ const metadata = {
869
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
870
+ method: "POST",
871
+ methodFqn: "com.wix.media.site_media.v1.FilesService.BulkDeleteFiles",
872
+ packageName: PACKAGE_NAME,
873
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
874
+ protoPath: "/v1/bulk/files/delete",
875
+ data: payload,
876
+ host
877
+ }),
878
+ data: payload
879
+ };
880
+ return metadata;
881
+ }
882
+ return __bulkDeleteFiles;
883
+ }
884
+ function bulkRestoreFilesFromTrashBin(payload) {
885
+ function __bulkRestoreFilesFromTrashBin({ host }) {
886
+ const metadata = {
887
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
888
+ method: "POST",
889
+ methodFqn: "com.wix.media.site_media.v1.FilesService.BulkRestoreFilesFromTrashBin",
890
+ packageName: PACKAGE_NAME,
891
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
892
+ protoPath: "/v1/bulk/trash-bin/files/restore",
893
+ data: payload,
894
+ host
895
+ }),
896
+ data: payload
897
+ };
898
+ return metadata;
899
+ }
900
+ return __bulkRestoreFilesFromTrashBin;
901
+ }
902
+ function listDeletedFiles(payload) {
903
+ function __listDeletedFiles({ host }) {
904
+ const metadata = {
905
+ entityFqdn: "wix.media.site_media.v1.file_descriptor",
906
+ method: "GET",
907
+ methodFqn: "com.wix.media.site_media.v1.FilesService.ListDeletedFiles",
908
+ packageName: PACKAGE_NAME,
909
+ url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
910
+ protoPath: "/v1/trash-bin/files",
911
+ data: payload,
912
+ host
913
+ }),
914
+ params: toURLSearchParams(payload, true),
915
+ transformResponse: (payload2) => transformPaths(payload2, [
916
+ {
917
+ transformFn: transformRESTTimestampToSDKTimestamp,
918
+ paths: [
919
+ { path: "files.createdDate" },
920
+ { path: "files.updatedDate" },
921
+ { path: "files.lastUsedDate" },
922
+ { path: "files.media.image.image.urlExpirationDate" },
923
+ { path: "files.media.image.previewImage.urlExpirationDate" },
924
+ { path: "files.media.video.urlExpirationDate" },
925
+ { path: "files.media.video.resolutions.urlExpirationDate" },
926
+ {
927
+ path: "files.media.video.resolutions.poster.urlExpirationDate"
928
+ },
929
+ { path: "files.media.video.posters.urlExpirationDate" },
930
+ { path: "files.media.audio.assets.urlExpirationDate" },
931
+ { path: "files.media.document.urlExpirationDate" },
932
+ { path: "files.media.document.thumbnail.urlExpirationDate" },
933
+ { path: "files.media.vector.image.urlExpirationDate" },
934
+ { path: "files.media.vector.previewImage.urlExpirationDate" },
935
+ { path: "files.media.archive.urlExpirationDate" },
936
+ { path: "files.media.model3d.urlExpirationDate" },
937
+ { path: "files.media.model3d.thumbnail.urlExpirationDate" },
938
+ { path: "files.media.icon.image.urlExpirationDate" },
939
+ { path: "files.media.icon.previewImage.urlExpirationDate" }
940
+ ]
941
+ },
942
+ {
943
+ transformFn: transformRESTFloatToSDKFloat,
944
+ paths: [
945
+ { path: "files.media.image.image.focalPoint.x" },
946
+ { path: "files.media.image.image.focalPoint.y" },
947
+ { path: "files.media.image.faces.confidence" },
948
+ { path: "files.media.image.previewImage.focalPoint.x" },
949
+ { path: "files.media.image.previewImage.focalPoint.y" },
950
+ { path: "files.media.video.resolutions.poster.focalPoint.x" },
951
+ { path: "files.media.video.resolutions.poster.focalPoint.y" },
952
+ { path: "files.media.video.posters.focalPoint.x" },
953
+ { path: "files.media.video.posters.focalPoint.y" },
954
+ { path: "files.media.document.thumbnail.focalPoint.x" },
955
+ { path: "files.media.document.thumbnail.focalPoint.y" },
956
+ { path: "files.media.vector.image.focalPoint.x" },
957
+ { path: "files.media.vector.image.focalPoint.y" },
958
+ { path: "files.media.vector.faces.confidence" },
959
+ { path: "files.media.vector.previewImage.focalPoint.x" },
960
+ { path: "files.media.vector.previewImage.focalPoint.y" },
961
+ { path: "files.media.model3d.thumbnail.focalPoint.x" },
962
+ { path: "files.media.model3d.thumbnail.focalPoint.y" },
963
+ { path: "files.media.icon.image.focalPoint.x" },
964
+ { path: "files.media.icon.image.focalPoint.y" },
965
+ { path: "files.media.icon.faces.confidence" },
966
+ { path: "files.media.icon.previewImage.focalPoint.x" },
967
+ { path: "files.media.icon.previewImage.focalPoint.y" }
968
+ ]
969
+ }
970
+ ])
971
+ };
972
+ return metadata;
973
+ }
974
+ return __listDeletedFiles;
975
+ }
976
+
977
+ // src/media-site-media-v1-file-descriptor-files.universal.ts
978
+ import { transformSDKAudioToRESTAudio } from "@wix/sdk-runtime/transformations/audio";
979
+ import { transformRESTAudioToSDKAudio } from "@wix/sdk-runtime/transformations/audio";
980
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
981
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
982
+ import { transformSDKVideoV2ToRESTVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
983
+ import { transformRESTVideoV2ToSDKVideoV2 } from "@wix/sdk-runtime/transformations/video-v2";
984
+ import { transformSDKDocumentToRESTDocument } from "@wix/sdk-runtime/transformations/document";
985
+ import { transformRESTDocumentToSDKDocument } from "@wix/sdk-runtime/transformations/document";
986
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
987
+ var MediaType = /* @__PURE__ */ ((MediaType2) => {
988
+ MediaType2["UNKNOWN"] = "UNKNOWN";
989
+ MediaType2["IMAGE"] = "IMAGE";
990
+ MediaType2["VIDEO"] = "VIDEO";
991
+ MediaType2["AUDIO"] = "AUDIO";
992
+ MediaType2["DOCUMENT"] = "DOCUMENT";
993
+ MediaType2["VECTOR"] = "VECTOR";
994
+ MediaType2["ARCHIVE"] = "ARCHIVE";
995
+ MediaType2["MODEL3D"] = "MODEL3D";
996
+ MediaType2["OTHER"] = "OTHER";
997
+ return MediaType2;
998
+ })(MediaType || {});
999
+ var OperationStatus = /* @__PURE__ */ ((OperationStatus2) => {
1000
+ OperationStatus2["FAILED"] = "FAILED";
1001
+ OperationStatus2["READY"] = "READY";
1002
+ OperationStatus2["PENDING"] = "PENDING";
1003
+ return OperationStatus2;
1004
+ })(OperationStatus || {});
1005
+ var State = /* @__PURE__ */ ((State2) => {
1006
+ State2["OK"] = "OK";
1007
+ State2["DELETED"] = "DELETED";
1008
+ return State2;
1009
+ })(State || {});
1010
+ var Namespace = /* @__PURE__ */ ((Namespace2) => {
1011
+ Namespace2["NO_NAMESPACE"] = "NO_NAMESPACE";
1012
+ Namespace2["OTHERS"] = "OTHERS";
1013
+ Namespace2["WIX_VIDEO"] = "WIX_VIDEO";
1014
+ Namespace2["WIX_MUSIC"] = "WIX_MUSIC";
1015
+ Namespace2["ALBUMS_AND_ART_STORE"] = "ALBUMS_AND_ART_STORE";
1016
+ Namespace2["WIX_ECOM"] = "WIX_ECOM";
1017
+ Namespace2["PHOTO_SHARE_APP"] = "PHOTO_SHARE_APP";
1018
+ Namespace2["SHARING_APP"] = "SHARING_APP";
1019
+ Namespace2["CHAT"] = "CHAT";
1020
+ Namespace2["LOGO_BUILDER"] = "LOGO_BUILDER";
1021
+ Namespace2["ALBUMS_OLD"] = "ALBUMS_OLD";
1022
+ Namespace2["CHAT_MOBILE"] = "CHAT_MOBILE";
1023
+ Namespace2["WIX_FORMS"] = "WIX_FORMS";
1024
+ Namespace2["WIX_LEGENDS"] = "WIX_LEGENDS";
1025
+ return Namespace2;
1026
+ })(Namespace || {});
1027
+ var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
1028
+ IdentityType2["UNKNOWN"] = "UNKNOWN";
1029
+ IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
1030
+ IdentityType2["MEMBER"] = "MEMBER";
1031
+ IdentityType2["WIX_USER"] = "WIX_USER";
1032
+ IdentityType2["APP"] = "APP";
1033
+ return IdentityType2;
1034
+ })(IdentityType || {});
1035
+ var ImageAnnotationType = /* @__PURE__ */ ((ImageAnnotationType2) => {
1036
+ ImageAnnotationType2["UNKNOWN_IMAGE_ANNOTATION_TYPE"] = "UNKNOWN_IMAGE_ANNOTATION_TYPE";
1037
+ ImageAnnotationType2["CONTAINS_TEXT"] = "CONTAINS_TEXT";
1038
+ ImageAnnotationType2["IS_ANIMATED"] = "IS_ANIMATED";
1039
+ ImageAnnotationType2["FACES"] = "FACES";
1040
+ ImageAnnotationType2["LABELS"] = "LABELS";
1041
+ ImageAnnotationType2["COLORS"] = "COLORS";
1042
+ ImageAnnotationType2["CAPTION"] = "CAPTION";
1043
+ return ImageAnnotationType2;
1044
+ })(ImageAnnotationType || {});
1045
+ var ContentDisposition = /* @__PURE__ */ ((ContentDisposition2) => {
1046
+ ContentDisposition2["ATTACHMENT"] = "ATTACHMENT";
1047
+ ContentDisposition2["INLINE"] = "INLINE";
1048
+ return ContentDisposition2;
1049
+ })(ContentDisposition || {});
1050
+ var UploadProtocol = /* @__PURE__ */ ((UploadProtocol2) => {
1051
+ UploadProtocol2["TUS"] = "TUS";
1052
+ return UploadProtocol2;
1053
+ })(UploadProtocol || {});
1054
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
1055
+ SortOrder2["ASC"] = "ASC";
1056
+ SortOrder2["DESC"] = "DESC";
1057
+ return SortOrder2;
1058
+ })(SortOrder || {});
1059
+ var RootFolder = /* @__PURE__ */ ((RootFolder2) => {
1060
+ RootFolder2["MEDIA_ROOT"] = "MEDIA_ROOT";
1061
+ RootFolder2["TRASH_ROOT"] = "TRASH_ROOT";
1062
+ RootFolder2["VISITOR_UPLOADS_ROOT"] = "VISITOR_UPLOADS_ROOT";
1063
+ return RootFolder2;
1064
+ })(RootFolder || {});
1065
+ var StreamFormat = /* @__PURE__ */ ((StreamFormat2) => {
1066
+ StreamFormat2["UNKNOWN"] = "UNKNOWN";
1067
+ StreamFormat2["HLS"] = "HLS";
1068
+ StreamFormat2["DASH"] = "DASH";
1069
+ return StreamFormat2;
1070
+ })(StreamFormat || {});
1071
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
1072
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
1073
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
1074
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
1075
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
1076
+ WebhookIdentityType2["APP"] = "APP";
1077
+ return WebhookIdentityType2;
1078
+ })(WebhookIdentityType || {});
1079
+ async function generateFilesDownloadUrl2(fileIds) {
1080
+ const { httpClient, sideEffects } = arguments[1];
1081
+ const payload = renameKeysFromSDKRequestToRESTRequest({ fileIds });
1082
+ const reqOpts = generateFilesDownloadUrl(
1083
+ payload
1084
+ );
1085
+ sideEffects?.onSiteCall?.();
1086
+ try {
1087
+ const result = await httpClient.request(reqOpts);
1088
+ sideEffects?.onSuccess?.(result);
1089
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1090
+ } catch (err) {
1091
+ const transformedError = sdkTransformError(
1092
+ err,
1093
+ {
1094
+ spreadPathsToArguments: {},
1095
+ explicitPathsToArguments: { fileIds: "$[0]" },
1096
+ singleArgumentUnchanged: false
1097
+ },
1098
+ ["fileIds"]
1099
+ );
1100
+ sideEffects?.onError?.(err);
1101
+ throw transformedError;
1102
+ }
1103
+ }
1104
+ async function generateFileDownloadUrl2(fileId, options) {
1105
+ const { httpClient, sideEffects } = arguments[2];
1106
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1107
+ fileId,
1108
+ downloadFileName: options?.downloadFileName,
1109
+ expirationInMinutes: options?.expirationInMinutes,
1110
+ expirationRedirectUrl: options?.expirationRedirectUrl,
1111
+ assetKeys: options?.assetKeys,
1112
+ contentDisposition: options?.contentDisposition
1113
+ });
1114
+ const reqOpts = generateFileDownloadUrl(
1115
+ payload
1116
+ );
1117
+ sideEffects?.onSiteCall?.();
1118
+ try {
1119
+ const result = await httpClient.request(reqOpts);
1120
+ sideEffects?.onSuccess?.(result);
1121
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1122
+ } catch (err) {
1123
+ const transformedError = sdkTransformError(
1124
+ err,
1125
+ {
1126
+ spreadPathsToArguments: {},
1127
+ explicitPathsToArguments: {
1128
+ fileId: "$[0]",
1129
+ downloadFileName: "$[1].downloadFileName",
1130
+ expirationInMinutes: "$[1].expirationInMinutes",
1131
+ expirationRedirectUrl: "$[1].expirationRedirectUrl",
1132
+ assetKeys: "$[1].assetKeys",
1133
+ contentDisposition: "$[1].contentDisposition"
1134
+ },
1135
+ singleArgumentUnchanged: false
1136
+ },
1137
+ ["fileId", "options"]
1138
+ );
1139
+ sideEffects?.onError?.(err);
1140
+ throw transformedError;
1141
+ }
1142
+ }
1143
+ async function getFileDescriptor2(fileId) {
1144
+ const { httpClient, sideEffects } = arguments[1];
1145
+ const payload = renameKeysFromSDKRequestToRESTRequest({ fileId });
1146
+ const reqOpts = getFileDescriptor(payload);
1147
+ sideEffects?.onSiteCall?.();
1148
+ try {
1149
+ const result = await httpClient.request(reqOpts);
1150
+ sideEffects?.onSuccess?.(result);
1151
+ return renameKeysFromRESTResponseToSDKResponse(
1152
+ transformPaths2(result.data, [
1153
+ {
1154
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1155
+ paths: [{ path: "file.media.video" }]
1156
+ },
1157
+ {
1158
+ transformFn: transformRESTDocumentToSDKDocument,
1159
+ paths: [{ path: "file.media.document" }]
1160
+ },
1161
+ {
1162
+ transformFn: transformRESTImageToSDKImage,
1163
+ paths: [
1164
+ { path: "file.media.image.image" },
1165
+ { path: "file.media.image.previewImage" },
1166
+ { path: "file.media.vector.image" },
1167
+ { path: "file.media.vector.previewImage" },
1168
+ { path: "file.media.model3d.thumbnail" },
1169
+ { path: "file.media.icon.image" },
1170
+ { path: "file.media.icon.previewImage" }
1171
+ ]
1172
+ },
1173
+ {
1174
+ transformFn: transformRESTAudioToSDKAudio,
1175
+ paths: [{ path: "file.media.audio.assets", isRepeated: true }]
1176
+ }
1177
+ ])
1178
+ )?.file;
1179
+ } catch (err) {
1180
+ const transformedError = sdkTransformError(
1181
+ err,
1182
+ {
1183
+ spreadPathsToArguments: {},
1184
+ explicitPathsToArguments: { fileId: "$[0]" },
1185
+ singleArgumentUnchanged: false
1186
+ },
1187
+ ["fileId"]
1188
+ );
1189
+ sideEffects?.onError?.(err);
1190
+ throw transformedError;
1191
+ }
1192
+ }
1193
+ async function getFileDescriptors2(fileIds) {
1194
+ const { httpClient, sideEffects } = arguments[1];
1195
+ const payload = renameKeysFromSDKRequestToRESTRequest({ fileIds });
1196
+ const reqOpts = getFileDescriptors(payload);
1197
+ sideEffects?.onSiteCall?.();
1198
+ try {
1199
+ const result = await httpClient.request(reqOpts);
1200
+ sideEffects?.onSuccess?.(result);
1201
+ return renameKeysFromRESTResponseToSDKResponse(
1202
+ transformPaths2(result.data, [
1203
+ {
1204
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1205
+ paths: [{ path: "files.media.video" }]
1206
+ },
1207
+ {
1208
+ transformFn: transformRESTDocumentToSDKDocument,
1209
+ paths: [{ path: "files.media.document" }]
1210
+ },
1211
+ {
1212
+ transformFn: transformRESTImageToSDKImage,
1213
+ paths: [
1214
+ { path: "files.media.image.image" },
1215
+ { path: "files.media.image.previewImage" },
1216
+ { path: "files.media.vector.image" },
1217
+ { path: "files.media.vector.previewImage" },
1218
+ { path: "files.media.model3d.thumbnail" },
1219
+ { path: "files.media.icon.image" },
1220
+ { path: "files.media.icon.previewImage" }
1221
+ ]
1222
+ },
1223
+ {
1224
+ transformFn: transformRESTAudioToSDKAudio,
1225
+ paths: [{ path: "files.media.audio.assets", isRepeated: true }]
1226
+ }
1227
+ ])
1228
+ );
1229
+ } catch (err) {
1230
+ const transformedError = sdkTransformError(
1231
+ err,
1232
+ {
1233
+ spreadPathsToArguments: {},
1234
+ explicitPathsToArguments: { fileIds: "$[0]" },
1235
+ singleArgumentUnchanged: false
1236
+ },
1237
+ ["fileIds"]
1238
+ );
1239
+ sideEffects?.onError?.(err);
1240
+ throw transformedError;
1241
+ }
1242
+ }
1243
+ async function updateFileDescriptor2(file) {
1244
+ const { httpClient, sideEffects } = arguments[1];
1245
+ const payload = transformPaths2(
1246
+ renameKeysFromSDKRequestToRESTRequest({ file }),
1247
+ [
1248
+ {
1249
+ transformFn: transformSDKVideoV2ToRESTVideoV2,
1250
+ paths: [{ path: "file.media.video" }]
1251
+ },
1252
+ {
1253
+ transformFn: transformSDKDocumentToRESTDocument,
1254
+ paths: [{ path: "file.media.document" }]
1255
+ },
1256
+ {
1257
+ transformFn: transformSDKImageToRESTImage,
1258
+ paths: [
1259
+ { path: "file.media.image.image" },
1260
+ { path: "file.media.image.previewImage" },
1261
+ { path: "file.media.vector.image" },
1262
+ { path: "file.media.vector.previewImage" },
1263
+ { path: "file.media.model3d.thumbnail" },
1264
+ { path: "file.media.icon.image" },
1265
+ { path: "file.media.icon.previewImage" }
1266
+ ]
1267
+ },
1268
+ {
1269
+ transformFn: transformSDKAudioToRESTAudio,
1270
+ paths: [{ path: "file.media.audio.assets", isRepeated: true }]
1271
+ }
1272
+ ]
1273
+ );
1274
+ const reqOpts = updateFileDescriptor(payload);
1275
+ sideEffects?.onSiteCall?.();
1276
+ try {
1277
+ const result = await httpClient.request(reqOpts);
1278
+ sideEffects?.onSuccess?.(result);
1279
+ return renameKeysFromRESTResponseToSDKResponse(
1280
+ transformPaths2(result.data, [
1281
+ {
1282
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1283
+ paths: [{ path: "file.media.video" }]
1284
+ },
1285
+ {
1286
+ transformFn: transformRESTDocumentToSDKDocument,
1287
+ paths: [{ path: "file.media.document" }]
1288
+ },
1289
+ {
1290
+ transformFn: transformRESTImageToSDKImage,
1291
+ paths: [
1292
+ { path: "file.media.image.image" },
1293
+ { path: "file.media.image.previewImage" },
1294
+ { path: "file.media.vector.image" },
1295
+ { path: "file.media.vector.previewImage" },
1296
+ { path: "file.media.model3d.thumbnail" },
1297
+ { path: "file.media.icon.image" },
1298
+ { path: "file.media.icon.previewImage" }
1299
+ ]
1300
+ },
1301
+ {
1302
+ transformFn: transformRESTAudioToSDKAudio,
1303
+ paths: [{ path: "file.media.audio.assets", isRepeated: true }]
1304
+ }
1305
+ ])
1306
+ )?.file;
1307
+ } catch (err) {
1308
+ const transformedError = sdkTransformError(
1309
+ err,
1310
+ {
1311
+ spreadPathsToArguments: {},
1312
+ explicitPathsToArguments: { file: "$[0]" },
1313
+ singleArgumentUnchanged: false
1314
+ },
1315
+ ["file"]
1316
+ );
1317
+ sideEffects?.onError?.(err);
1318
+ throw transformedError;
1319
+ }
1320
+ }
1321
+ async function generateFileUploadUrl2(mimeType, options) {
1322
+ const { httpClient, sideEffects } = arguments[2];
1323
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1324
+ mimeType,
1325
+ fileName: options?.fileName,
1326
+ sizeInBytes: options?.sizeInBytes,
1327
+ parentFolderId: options?.parentFolderId,
1328
+ private: options?.private,
1329
+ labels: options?.labels,
1330
+ externalInfo: options?.externalInfo,
1331
+ filePath: options?.filePath
1332
+ });
1333
+ const reqOpts = generateFileUploadUrl(payload);
1334
+ sideEffects?.onSiteCall?.();
1335
+ try {
1336
+ const result = await httpClient.request(reqOpts);
1337
+ sideEffects?.onSuccess?.(result);
1338
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1339
+ } catch (err) {
1340
+ const transformedError = sdkTransformError(
1341
+ err,
1342
+ {
1343
+ spreadPathsToArguments: {},
1344
+ explicitPathsToArguments: {
1345
+ mimeType: "$[0]",
1346
+ fileName: "$[1].fileName",
1347
+ sizeInBytes: "$[1].sizeInBytes",
1348
+ parentFolderId: "$[1].parentFolderId",
1349
+ private: "$[1].private",
1350
+ labels: "$[1].labels",
1351
+ externalInfo: "$[1].externalInfo",
1352
+ filePath: "$[1].filePath"
1353
+ },
1354
+ singleArgumentUnchanged: false
1355
+ },
1356
+ ["mimeType", "options"]
1357
+ );
1358
+ sideEffects?.onError?.(err);
1359
+ throw transformedError;
1360
+ }
1361
+ }
1362
+ async function generateFileResumableUploadUrl2(mimeType, options) {
1363
+ const { httpClient, sideEffects } = arguments[2];
1364
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1365
+ mimeType,
1366
+ fileName: options?.fileName,
1367
+ sizeInBytes: options?.sizeInBytes,
1368
+ parentFolderId: options?.parentFolderId,
1369
+ private: options?.private,
1370
+ labels: options?.labels,
1371
+ uploadProtocol: options?.uploadProtocol,
1372
+ filePath: options?.filePath
1373
+ });
1374
+ const reqOpts = generateFileResumableUploadUrl(
1375
+ payload
1376
+ );
1377
+ sideEffects?.onSiteCall?.();
1378
+ try {
1379
+ const result = await httpClient.request(reqOpts);
1380
+ sideEffects?.onSuccess?.(result);
1381
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1382
+ } catch (err) {
1383
+ const transformedError = sdkTransformError(
1384
+ err,
1385
+ {
1386
+ spreadPathsToArguments: {},
1387
+ explicitPathsToArguments: {
1388
+ mimeType: "$[0]",
1389
+ fileName: "$[1].fileName",
1390
+ sizeInBytes: "$[1].sizeInBytes",
1391
+ parentFolderId: "$[1].parentFolderId",
1392
+ private: "$[1].private",
1393
+ labels: "$[1].labels",
1394
+ uploadProtocol: "$[1].uploadProtocol",
1395
+ filePath: "$[1].filePath"
1396
+ },
1397
+ singleArgumentUnchanged: false
1398
+ },
1399
+ ["mimeType", "options"]
1400
+ );
1401
+ sideEffects?.onError?.(err);
1402
+ throw transformedError;
1403
+ }
1404
+ }
1405
+ async function importFile2(url, options) {
1406
+ const { httpClient, sideEffects } = arguments[2];
1407
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1408
+ url,
1409
+ mediaType: options?.mediaType,
1410
+ displayName: options?.displayName,
1411
+ parentFolderId: options?.parentFolderId,
1412
+ private: options?.private,
1413
+ labels: options?.labels,
1414
+ mimeType: options?.mimeType,
1415
+ externalInfo: options?.externalInfo,
1416
+ urlParams: options?.urlParams,
1417
+ urlHeaders: options?.urlHeaders,
1418
+ filePath: options?.filePath
1419
+ });
1420
+ const reqOpts = importFile(payload);
1421
+ sideEffects?.onSiteCall?.();
1422
+ try {
1423
+ const result = await httpClient.request(reqOpts);
1424
+ sideEffects?.onSuccess?.(result);
1425
+ return renameKeysFromRESTResponseToSDKResponse(
1426
+ transformPaths2(result.data, [
1427
+ {
1428
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1429
+ paths: [{ path: "file.media.video" }]
1430
+ },
1431
+ {
1432
+ transformFn: transformRESTDocumentToSDKDocument,
1433
+ paths: [{ path: "file.media.document" }]
1434
+ },
1435
+ {
1436
+ transformFn: transformRESTImageToSDKImage,
1437
+ paths: [
1438
+ { path: "file.media.image.image" },
1439
+ { path: "file.media.image.previewImage" },
1440
+ { path: "file.media.vector.image" },
1441
+ { path: "file.media.vector.previewImage" },
1442
+ { path: "file.media.model3d.thumbnail" },
1443
+ { path: "file.media.icon.image" },
1444
+ { path: "file.media.icon.previewImage" }
1445
+ ]
1446
+ },
1447
+ {
1448
+ transformFn: transformRESTAudioToSDKAudio,
1449
+ paths: [{ path: "file.media.audio.assets", isRepeated: true }]
1450
+ }
1451
+ ])
1452
+ );
1453
+ } catch (err) {
1454
+ const transformedError = sdkTransformError(
1455
+ err,
1456
+ {
1457
+ spreadPathsToArguments: {},
1458
+ explicitPathsToArguments: {
1459
+ url: "$[0]",
1460
+ mediaType: "$[1].mediaType",
1461
+ displayName: "$[1].displayName",
1462
+ parentFolderId: "$[1].parentFolderId",
1463
+ private: "$[1].private",
1464
+ labels: "$[1].labels",
1465
+ mimeType: "$[1].mimeType",
1466
+ externalInfo: "$[1].externalInfo",
1467
+ urlParams: "$[1].urlParams",
1468
+ urlHeaders: "$[1].urlHeaders",
1469
+ filePath: "$[1].filePath"
1470
+ },
1471
+ singleArgumentUnchanged: false
1472
+ },
1473
+ ["url", "options"]
1474
+ );
1475
+ sideEffects?.onError?.(err);
1476
+ throw transformedError;
1477
+ }
1478
+ }
1479
+ async function bulkImportFiles2(importFileRequests) {
1480
+ const { httpClient, sideEffects } = arguments[1];
1481
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1482
+ importFileRequests
1483
+ });
1484
+ const reqOpts = bulkImportFiles(payload);
1485
+ sideEffects?.onSiteCall?.();
1486
+ try {
1487
+ const result = await httpClient.request(reqOpts);
1488
+ sideEffects?.onSuccess?.(result);
1489
+ return renameKeysFromRESTResponseToSDKResponse(
1490
+ transformPaths2(result.data, [
1491
+ {
1492
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1493
+ paths: [{ path: "files.media.video" }]
1494
+ },
1495
+ {
1496
+ transformFn: transformRESTDocumentToSDKDocument,
1497
+ paths: [{ path: "files.media.document" }]
1498
+ },
1499
+ {
1500
+ transformFn: transformRESTImageToSDKImage,
1501
+ paths: [
1502
+ { path: "files.media.image.image" },
1503
+ { path: "files.media.image.previewImage" },
1504
+ { path: "files.media.vector.image" },
1505
+ { path: "files.media.vector.previewImage" },
1506
+ { path: "files.media.model3d.thumbnail" },
1507
+ { path: "files.media.icon.image" },
1508
+ { path: "files.media.icon.previewImage" }
1509
+ ]
1510
+ },
1511
+ {
1512
+ transformFn: transformRESTAudioToSDKAudio,
1513
+ paths: [{ path: "files.media.audio.assets", isRepeated: true }]
1514
+ }
1515
+ ])
1516
+ );
1517
+ } catch (err) {
1518
+ const transformedError = sdkTransformError(
1519
+ err,
1520
+ {
1521
+ spreadPathsToArguments: {},
1522
+ explicitPathsToArguments: { importFileRequests: "$[0]" },
1523
+ singleArgumentUnchanged: false
1524
+ },
1525
+ ["importFileRequests"]
1526
+ );
1527
+ sideEffects?.onError?.(err);
1528
+ throw transformedError;
1529
+ }
1530
+ }
1531
+ async function bulkImportFile2(importFileRequests, options) {
1532
+ const { httpClient, sideEffects } = arguments[2];
1533
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1534
+ importFileRequests,
1535
+ returnEntity: options?.returnEntity
1536
+ });
1537
+ const reqOpts = bulkImportFile(payload);
1538
+ sideEffects?.onSiteCall?.();
1539
+ try {
1540
+ const result = await httpClient.request(reqOpts);
1541
+ sideEffects?.onSuccess?.(result);
1542
+ return renameKeysFromRESTResponseToSDKResponse(
1543
+ transformPaths2(result.data, [
1544
+ {
1545
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1546
+ paths: [{ path: "results.item.media.video" }]
1547
+ },
1548
+ {
1549
+ transformFn: transformRESTDocumentToSDKDocument,
1550
+ paths: [{ path: "results.item.media.document" }]
1551
+ },
1552
+ {
1553
+ transformFn: transformRESTImageToSDKImage,
1554
+ paths: [
1555
+ { path: "results.item.media.image.image" },
1556
+ { path: "results.item.media.image.previewImage" },
1557
+ { path: "results.item.media.vector.image" },
1558
+ { path: "results.item.media.vector.previewImage" },
1559
+ { path: "results.item.media.model3d.thumbnail" },
1560
+ { path: "results.item.media.icon.image" },
1561
+ { path: "results.item.media.icon.previewImage" }
1562
+ ]
1563
+ },
1564
+ {
1565
+ transformFn: transformRESTAudioToSDKAudio,
1566
+ paths: [
1567
+ { path: "results.item.media.audio.assets", isRepeated: true }
1568
+ ]
1569
+ }
1570
+ ])
1571
+ );
1572
+ } catch (err) {
1573
+ const transformedError = sdkTransformError(
1574
+ err,
1575
+ {
1576
+ spreadPathsToArguments: {},
1577
+ explicitPathsToArguments: {
1578
+ importFileRequests: "$[0]",
1579
+ returnEntity: "$[1].returnEntity"
1580
+ },
1581
+ singleArgumentUnchanged: false
1582
+ },
1583
+ ["importFileRequests", "options"]
1584
+ );
1585
+ sideEffects?.onError?.(err);
1586
+ throw transformedError;
1587
+ }
1588
+ }
1589
+ async function listFiles2(options) {
1590
+ const { httpClient, sideEffects } = arguments[1];
1591
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1592
+ parentFolderId: options?.parentFolderId,
1593
+ mediaTypes: options?.mediaTypes,
1594
+ private: options?.private,
1595
+ sort: options?.sort,
1596
+ paging: options?.paging
1597
+ });
1598
+ const reqOpts = listFiles(payload);
1599
+ sideEffects?.onSiteCall?.();
1600
+ try {
1601
+ const result = await httpClient.request(reqOpts);
1602
+ sideEffects?.onSuccess?.(result);
1603
+ return renameKeysFromRESTResponseToSDKResponse(
1604
+ transformPaths2(result.data, [
1605
+ {
1606
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1607
+ paths: [{ path: "files.media.video" }]
1608
+ },
1609
+ {
1610
+ transformFn: transformRESTDocumentToSDKDocument,
1611
+ paths: [{ path: "files.media.document" }]
1612
+ },
1613
+ {
1614
+ transformFn: transformRESTImageToSDKImage,
1615
+ paths: [
1616
+ { path: "files.media.image.image" },
1617
+ { path: "files.media.image.previewImage" },
1618
+ { path: "files.media.vector.image" },
1619
+ { path: "files.media.vector.previewImage" },
1620
+ { path: "files.media.model3d.thumbnail" },
1621
+ { path: "files.media.icon.image" },
1622
+ { path: "files.media.icon.previewImage" }
1623
+ ]
1624
+ },
1625
+ {
1626
+ transformFn: transformRESTAudioToSDKAudio,
1627
+ paths: [{ path: "files.media.audio.assets", isRepeated: true }]
1628
+ }
1629
+ ])
1630
+ );
1631
+ } catch (err) {
1632
+ const transformedError = sdkTransformError(
1633
+ err,
1634
+ {
1635
+ spreadPathsToArguments: {},
1636
+ explicitPathsToArguments: {
1637
+ parentFolderId: "$[0].parentFolderId",
1638
+ mediaTypes: "$[0].mediaTypes",
1639
+ private: "$[0].private",
1640
+ sort: "$[0].sort",
1641
+ paging: "$[0].paging"
1642
+ },
1643
+ singleArgumentUnchanged: false
1644
+ },
1645
+ ["options"]
1646
+ );
1647
+ sideEffects?.onError?.(err);
1648
+ throw transformedError;
1649
+ }
1650
+ }
1651
+ async function searchFiles2(options) {
1652
+ const { httpClient, sideEffects } = arguments[1];
1653
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1654
+ search: options?.search,
1655
+ rootFolder: options?.rootFolder,
1656
+ mediaTypes: options?.mediaTypes,
1657
+ private: options?.private,
1658
+ sort: options?.sort,
1659
+ paging: options?.paging
1660
+ });
1661
+ const reqOpts = searchFiles(payload);
1662
+ sideEffects?.onSiteCall?.();
1663
+ try {
1664
+ const result = await httpClient.request(reqOpts);
1665
+ sideEffects?.onSuccess?.(result);
1666
+ return renameKeysFromRESTResponseToSDKResponse(
1667
+ transformPaths2(result.data, [
1668
+ {
1669
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1670
+ paths: [{ path: "files.media.video" }]
1671
+ },
1672
+ {
1673
+ transformFn: transformRESTDocumentToSDKDocument,
1674
+ paths: [{ path: "files.media.document" }]
1675
+ },
1676
+ {
1677
+ transformFn: transformRESTImageToSDKImage,
1678
+ paths: [
1679
+ { path: "files.media.image.image" },
1680
+ { path: "files.media.image.previewImage" },
1681
+ { path: "files.media.vector.image" },
1682
+ { path: "files.media.vector.previewImage" },
1683
+ { path: "files.media.model3d.thumbnail" },
1684
+ { path: "files.media.icon.image" },
1685
+ { path: "files.media.icon.previewImage" }
1686
+ ]
1687
+ },
1688
+ {
1689
+ transformFn: transformRESTAudioToSDKAudio,
1690
+ paths: [{ path: "files.media.audio.assets", isRepeated: true }]
1691
+ }
1692
+ ])
1693
+ );
1694
+ } catch (err) {
1695
+ const transformedError = sdkTransformError(
1696
+ err,
1697
+ {
1698
+ spreadPathsToArguments: {},
1699
+ explicitPathsToArguments: {
1700
+ search: "$[0].search",
1701
+ rootFolder: "$[0].rootFolder",
1702
+ mediaTypes: "$[0].mediaTypes",
1703
+ private: "$[0].private",
1704
+ sort: "$[0].sort",
1705
+ paging: "$[0].paging"
1706
+ },
1707
+ singleArgumentUnchanged: false
1708
+ },
1709
+ ["options"]
1710
+ );
1711
+ sideEffects?.onError?.(err);
1712
+ throw transformedError;
1713
+ }
1714
+ }
1715
+ async function generateVideoStreamingUrl2(fileId, options) {
1716
+ const { httpClient, sideEffects } = arguments[2];
1717
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1718
+ fileId,
1719
+ format: options?.format
1720
+ });
1721
+ const reqOpts = generateVideoStreamingUrl(
1722
+ payload
1723
+ );
1724
+ sideEffects?.onSiteCall?.();
1725
+ try {
1726
+ const result = await httpClient.request(reqOpts);
1727
+ sideEffects?.onSuccess?.(result);
1728
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1729
+ } catch (err) {
1730
+ const transformedError = sdkTransformError(
1731
+ err,
1732
+ {
1733
+ spreadPathsToArguments: {},
1734
+ explicitPathsToArguments: { fileId: "$[0]", format: "$[1].format" },
1735
+ singleArgumentUnchanged: false
1736
+ },
1737
+ ["fileId", "options"]
1738
+ );
1739
+ sideEffects?.onError?.(err);
1740
+ throw transformedError;
1741
+ }
1742
+ }
1743
+ async function bulkDeleteFiles2(fileIds, options) {
1744
+ const { httpClient, sideEffects } = arguments[2];
1745
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1746
+ fileIds,
1747
+ permanent: options?.permanent
1748
+ });
1749
+ const reqOpts = bulkDeleteFiles(payload);
1750
+ sideEffects?.onSiteCall?.();
1751
+ try {
1752
+ const result = await httpClient.request(reqOpts);
1753
+ sideEffects?.onSuccess?.(result);
1754
+ } catch (err) {
1755
+ const transformedError = sdkTransformError(
1756
+ err,
1757
+ {
1758
+ spreadPathsToArguments: {},
1759
+ explicitPathsToArguments: {
1760
+ fileIds: "$[0]",
1761
+ permanent: "$[1].permanent"
1762
+ },
1763
+ singleArgumentUnchanged: false
1764
+ },
1765
+ ["fileIds", "options"]
1766
+ );
1767
+ sideEffects?.onError?.(err);
1768
+ throw transformedError;
1769
+ }
1770
+ }
1771
+ async function bulkRestoreFilesFromTrashBin2(fileIds) {
1772
+ const { httpClient, sideEffects } = arguments[1];
1773
+ const payload = renameKeysFromSDKRequestToRESTRequest({ fileIds });
1774
+ const reqOpts = bulkRestoreFilesFromTrashBin(
1775
+ payload
1776
+ );
1777
+ sideEffects?.onSiteCall?.();
1778
+ try {
1779
+ const result = await httpClient.request(reqOpts);
1780
+ sideEffects?.onSuccess?.(result);
1781
+ } catch (err) {
1782
+ const transformedError = sdkTransformError(
1783
+ err,
1784
+ {
1785
+ spreadPathsToArguments: {},
1786
+ explicitPathsToArguments: { fileIds: "$[0]" },
1787
+ singleArgumentUnchanged: false
1788
+ },
1789
+ ["fileIds"]
1790
+ );
1791
+ sideEffects?.onError?.(err);
1792
+ throw transformedError;
1793
+ }
1794
+ }
1795
+ async function listDeletedFiles2(options) {
1796
+ const { httpClient, sideEffects } = arguments[1];
1797
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1798
+ parentFolderId: options?.parentFolderId,
1799
+ mediaTypes: options?.mediaTypes,
1800
+ private: options?.private,
1801
+ sort: options?.sort,
1802
+ paging: options?.paging
1803
+ });
1804
+ const reqOpts = listDeletedFiles(payload);
1805
+ sideEffects?.onSiteCall?.();
1806
+ try {
1807
+ const result = await httpClient.request(reqOpts);
1808
+ sideEffects?.onSuccess?.(result);
1809
+ return renameKeysFromRESTResponseToSDKResponse(
1810
+ transformPaths2(result.data, [
1811
+ {
1812
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1813
+ paths: [{ path: "files.media.video" }]
1814
+ },
1815
+ {
1816
+ transformFn: transformRESTDocumentToSDKDocument,
1817
+ paths: [{ path: "files.media.document" }]
1818
+ },
1819
+ {
1820
+ transformFn: transformRESTImageToSDKImage,
1821
+ paths: [
1822
+ { path: "files.media.image.image" },
1823
+ { path: "files.media.image.previewImage" },
1824
+ { path: "files.media.vector.image" },
1825
+ { path: "files.media.vector.previewImage" },
1826
+ { path: "files.media.model3d.thumbnail" },
1827
+ { path: "files.media.icon.image" },
1828
+ { path: "files.media.icon.previewImage" }
1829
+ ]
1830
+ },
1831
+ {
1832
+ transformFn: transformRESTAudioToSDKAudio,
1833
+ paths: [{ path: "files.media.audio.assets", isRepeated: true }]
1834
+ }
1835
+ ])
1836
+ );
1837
+ } catch (err) {
1838
+ const transformedError = sdkTransformError(
1839
+ err,
1840
+ {
1841
+ spreadPathsToArguments: {},
1842
+ explicitPathsToArguments: {
1843
+ parentFolderId: "$[0].parentFolderId",
1844
+ mediaTypes: "$[0].mediaTypes",
1845
+ private: "$[0].private",
1846
+ sort: "$[0].sort",
1847
+ paging: "$[0].paging"
1848
+ },
1849
+ singleArgumentUnchanged: false
1850
+ },
1851
+ ["options"]
1852
+ );
1853
+ sideEffects?.onError?.(err);
1854
+ throw transformedError;
1855
+ }
1856
+ }
1857
+ export {
1858
+ ContentDisposition,
1859
+ IdentityType,
1860
+ ImageAnnotationType,
1861
+ MediaType,
1862
+ Namespace,
1863
+ OperationStatus,
1864
+ RootFolder,
1865
+ SortOrder,
1866
+ State,
1867
+ StreamFormat,
1868
+ UploadProtocol,
1869
+ WebhookIdentityType,
1870
+ bulkDeleteFiles2 as bulkDeleteFiles,
1871
+ bulkImportFile2 as bulkImportFile,
1872
+ bulkImportFiles2 as bulkImportFiles,
1873
+ bulkRestoreFilesFromTrashBin2 as bulkRestoreFilesFromTrashBin,
1874
+ generateFileDownloadUrl2 as generateFileDownloadUrl,
1875
+ generateFileResumableUploadUrl2 as generateFileResumableUploadUrl,
1876
+ generateFileUploadUrl2 as generateFileUploadUrl,
1877
+ generateFilesDownloadUrl2 as generateFilesDownloadUrl,
1878
+ generateVideoStreamingUrl2 as generateVideoStreamingUrl,
1879
+ getFileDescriptor2 as getFileDescriptor,
1880
+ getFileDescriptors2 as getFileDescriptors,
1881
+ importFile2 as importFile,
1882
+ listDeletedFiles2 as listDeletedFiles,
1883
+ listFiles2 as listFiles,
1884
+ searchFiles2 as searchFiles,
1885
+ updateFileDescriptor2 as updateFileDescriptor
1886
+ };
1887
+ //# sourceMappingURL=index.typings.mjs.map