@wix/media 1.0.50 → 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/build/cjs/index.js +5 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.js +5 -1
  4. package/build/cjs/index.typings.js.map +1 -1
  5. package/build/cjs/meta.js +5 -1
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/src/media-site-media-v1-file-descriptor.http.d.ts +83 -34
  8. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +433 -350
  9. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
  10. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.d.ts +1 -1
  11. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js +5 -1
  12. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js.map +1 -1
  13. package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +10 -10
  14. package/build/cjs/src/media-site-media-v1-file-descriptor.types.d.ts +5 -6
  15. package/build/cjs/src/media-site-media-v1-file-descriptor.types.js +10 -10
  16. package/build/cjs/src/media-site-media-v1-file-descriptor.types.js.map +1 -1
  17. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +126 -69
  18. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +227 -99
  19. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
  20. package/build/cjs/src/media-site-media-v1-folder.http.js +84 -89
  21. package/build/cjs/src/media-site-media-v1-folder.http.js.map +1 -1
  22. package/build/cjs/src/media-site-media-v1-folder.meta.d.ts +1 -1
  23. package/build/cjs/src/media-site-media-v1-folder.meta.js +5 -1
  24. package/build/cjs/src/media-site-media-v1-folder.meta.js.map +1 -1
  25. package/build/cjs/src/media-site-media-v1-folder.public.d.ts +5 -5
  26. package/build/cjs/src/media-site-media-v1-folder.types.d.ts +4 -5
  27. package/build/cjs/src/media-site-media-v1-folder.types.js +4 -4
  28. package/build/cjs/src/media-site-media-v1-folder.types.js.map +1 -1
  29. package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +4 -5
  30. package/build/cjs/src/media-site-media-v1-folder.universal.js +74 -37
  31. package/build/cjs/src/media-site-media-v1-folder.universal.js.map +1 -1
  32. package/build/es/src/media-site-media-v1-file-descriptor.http.d.ts +83 -34
  33. package/build/es/src/media-site-media-v1-file-descriptor.http.js +433 -350
  34. package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
  35. package/build/es/src/media-site-media-v1-file-descriptor.meta.d.ts +1 -1
  36. package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +10 -10
  37. package/build/es/src/media-site-media-v1-file-descriptor.types.d.ts +5 -6
  38. package/build/es/src/media-site-media-v1-file-descriptor.types.js.map +1 -1
  39. package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +126 -69
  40. package/build/es/src/media-site-media-v1-file-descriptor.universal.js +213 -89
  41. package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
  42. package/build/es/src/media-site-media-v1-folder.http.js +84 -89
  43. package/build/es/src/media-site-media-v1-folder.http.js.map +1 -1
  44. package/build/es/src/media-site-media-v1-folder.meta.d.ts +1 -1
  45. package/build/es/src/media-site-media-v1-folder.public.d.ts +5 -5
  46. package/build/es/src/media-site-media-v1-folder.types.d.ts +4 -5
  47. package/build/es/src/media-site-media-v1-folder.types.js.map +1 -1
  48. package/build/es/src/media-site-media-v1-folder.universal.d.ts +4 -5
  49. package/build/es/src/media-site-media-v1-folder.universal.js +66 -33
  50. package/build/es/src/media-site-media-v1-folder.universal.js.map +1 -1
  51. package/package.json +7 -3
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -30,6 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30
34
  Object.defineProperty(exports, "__esModule", { value: true });
31
35
  exports.listDeletedFiles = exports.bulkRestoreFilesFromTrashBin = exports.bulkDeleteFiles = exports.generateVideoStreamingUrl = exports.searchFiles = exports.listFiles = exports.bulkImportFile = exports.bulkImportFiles = exports.importFile = exports.generateFileResumableUploadUrl = exports.generateFileUploadUrl = exports.updateFileDescriptor = exports.getFileDescriptors = exports.getFileDescriptor = exports.generateFileDownloadUrl = exports.generateFilesDownloadUrl = exports.StreamFormat = exports.RootFolder = exports.SortOrder = exports.UploadProtocol = exports.ContentDisposition = exports.IdentityType = exports.Namespace = exports.State = exports.OperationStatus = exports.MediaType = exports.__debug = void 0;
32
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
33
38
  const ambassadorWixMediaSiteMediaV1FileDescriptor = __importStar(require("./media-site-media-v1-file-descriptor.http"));
34
39
  let __verbose = false;
35
40
  function __log(...args) {
@@ -57,7 +62,7 @@ var MediaType;
57
62
  MediaType["ARCHIVE"] = "ARCHIVE";
58
63
  MediaType["MODEL3D"] = "MODEL3D";
59
64
  MediaType["OTHER"] = "OTHER";
60
- })(MediaType = exports.MediaType || (exports.MediaType = {}));
65
+ })(MediaType || (exports.MediaType = MediaType = {}));
61
66
  var OperationStatus;
62
67
  (function (OperationStatus) {
63
68
  /** File upload or processing failed */
@@ -66,14 +71,14 @@ var OperationStatus;
66
71
  OperationStatus["READY"] = "READY";
67
72
  /** File is waiting for processing or currently being processed */
68
73
  OperationStatus["PENDING"] = "PENDING";
69
- })(OperationStatus = exports.OperationStatus || (exports.OperationStatus = {}));
74
+ })(OperationStatus || (exports.OperationStatus = OperationStatus = {}));
70
75
  var State;
71
76
  (function (State) {
72
77
  /** File is ready for consumption */
73
78
  State["OK"] = "OK";
74
79
  /** Deleted file */
75
80
  State["DELETED"] = "DELETED";
76
- })(State = exports.State || (exports.State = {}));
81
+ })(State || (exports.State = State = {}));
77
82
  var Namespace;
78
83
  (function (Namespace) {
79
84
  Namespace["NO_NAMESPACE"] = "NO_NAMESPACE";
@@ -100,7 +105,7 @@ var Namespace;
100
105
  Namespace["CHAT_MOBILE"] = "CHAT_MOBILE";
101
106
  /** _nsWixForms */
102
107
  Namespace["WIX_FORMS"] = "WIX_FORMS";
103
- })(Namespace = exports.Namespace || (exports.Namespace = {}));
108
+ })(Namespace || (exports.Namespace = Namespace = {}));
104
109
  var IdentityType;
105
110
  (function (IdentityType) {
106
111
  IdentityType["UNKNOWN"] = "UNKNOWN";
@@ -108,24 +113,24 @@ var IdentityType;
108
113
  IdentityType["MEMBER"] = "MEMBER";
109
114
  IdentityType["WIX_USER"] = "WIX_USER";
110
115
  IdentityType["APP"] = "APP";
111
- })(IdentityType = exports.IdentityType || (exports.IdentityType = {}));
116
+ })(IdentityType || (exports.IdentityType = IdentityType = {}));
112
117
  var ContentDisposition;
113
118
  (function (ContentDisposition) {
114
119
  /** Using the link in the browser will download the file */
115
120
  ContentDisposition["ATTACHMENT"] = "ATTACHMENT";
116
121
  /** Using the link in the browser will open the file in the browser */
117
122
  ContentDisposition["INLINE"] = "INLINE";
118
- })(ContentDisposition = exports.ContentDisposition || (exports.ContentDisposition = {}));
123
+ })(ContentDisposition || (exports.ContentDisposition = ContentDisposition = {}));
119
124
  var UploadProtocol;
120
125
  (function (UploadProtocol) {
121
126
  /** The upload protocol to use for implementing the resumable upload. */
122
127
  UploadProtocol["TUS"] = "TUS";
123
- })(UploadProtocol = exports.UploadProtocol || (exports.UploadProtocol = {}));
128
+ })(UploadProtocol || (exports.UploadProtocol = UploadProtocol = {}));
124
129
  var SortOrder;
125
130
  (function (SortOrder) {
126
131
  SortOrder["ASC"] = "ASC";
127
132
  SortOrder["DESC"] = "DESC";
128
- })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
133
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
129
134
  var RootFolder;
130
135
  (function (RootFolder) {
131
136
  /** Root of all site media */
@@ -134,13 +139,13 @@ var RootFolder;
134
139
  RootFolder["TRASH_ROOT"] = "TRASH_ROOT";
135
140
  /** Root of all visitor uploads */
136
141
  RootFolder["VISITOR_UPLOADS_ROOT"] = "VISITOR_UPLOADS_ROOT";
137
- })(RootFolder = exports.RootFolder || (exports.RootFolder = {}));
142
+ })(RootFolder || (exports.RootFolder = RootFolder = {}));
138
143
  var StreamFormat;
139
144
  (function (StreamFormat) {
140
145
  StreamFormat["UNKNOWN"] = "UNKNOWN";
141
146
  StreamFormat["HLS"] = "HLS";
142
147
  StreamFormat["DASH"] = "DASH";
143
- })(StreamFormat = exports.StreamFormat || (exports.StreamFormat = {}));
148
+ })(StreamFormat || (exports.StreamFormat = StreamFormat = {}));
144
149
  const _audioV2 = { assets: 'wix.common.Audio' };
145
150
  const _bulkDeleteFilesRequest = {};
146
151
  const _bulkDeleteFilesResponse = {};
@@ -192,6 +197,8 @@ const _updateFileDescriptorResponse = { file: '_fileDescriptor' };
192
197
  /**
193
198
  * Generates a URL for downloading a compressed file containing specific files in the Media Manager.
194
199
  *
200
+ * The `generateFilesDownloadUrl()` function returns a Promise that resolves to a download URL.
201
+ *
195
202
  * The compressed file can contain up to 1000 files.
196
203
  * @param fileIds - IDs of the files to download.
197
204
  * @public
@@ -236,9 +243,11 @@ function generateFilesDownloadUrl(fileIds) {
236
243
  return fromJSON(result.data);
237
244
  }
238
245
  catch (err) {
239
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
240
- 'fileIds',
241
- ]);
246
+ const transformedError = (0, transform_error_1.transformError)(err, {
247
+ spreadPathsToArguments: {},
248
+ explicitPathsToArguments: { fileIds: '$[0]' },
249
+ singleArgumentUnchanged: false,
250
+ }, ['fileIds']);
242
251
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
243
252
  throw transformedError;
244
253
  }
@@ -248,10 +257,12 @@ exports.generateFilesDownloadUrl = generateFilesDownloadUrl;
248
257
  /**
249
258
  * Generates one or more temporary URLs for downloading a specific file in the Media Manager.
250
259
  *
260
+ * The `generateFileDownloadUrl()` function returns a Promise that resolves to an array containing download URLs for the assets specified in the options parameter.
261
+ *
251
262
  * To download different assets of the file, use the `assetKeys` parameter which generates a download URL for each asset.
252
- * If no `assetKey` is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
263
+ * If no asset key is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
253
264
  *
254
- * Use this endpoint to grant external clients access to a private media file. Use the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect url when the URL expires.
265
+ * Use this endpoint to grant external clients access to a private media file. Use the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect URL when the URL expires.
255
266
  * @param fileId - File ID.
256
267
  * @public
257
268
  * @requiredField fileId
@@ -302,10 +313,18 @@ function generateFileDownloadUrl(fileId, options) {
302
313
  return fromJSON(result.data);
303
314
  }
304
315
  catch (err) {
305
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
306
- 'fileId',
307
- 'options',
308
- ]);
316
+ const transformedError = (0, transform_error_1.transformError)(err, {
317
+ spreadPathsToArguments: {},
318
+ explicitPathsToArguments: {
319
+ fileId: '$[0]',
320
+ downloadFileName: '$[1].downloadFileName',
321
+ expirationInMinutes: '$[1].expirationInMinutes',
322
+ expirationRedirectUrl: '$[1].expirationRedirectUrl',
323
+ assetKeys: '$[1].assetKeys',
324
+ contentDisposition: '$[1].contentDisposition',
325
+ },
326
+ singleArgumentUnchanged: false,
327
+ }, ['fileId', 'options']);
309
328
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
310
329
  throw transformedError;
311
330
  }
@@ -314,6 +333,11 @@ function generateFileDownloadUrl(fileId, options) {
314
333
  exports.generateFileDownloadUrl = generateFileDownloadUrl;
315
334
  /**
316
335
  * Gets information about the specified file in the Media Manager.
336
+ *
337
+ *
338
+ * The `getFileDescriptor()` function returns a Promise that resolves to the specified file's descriptor.
339
+ *
340
+ * Use `getFileDescriptors()` to get multiple file descriptors at once.
317
341
  * @param fileId - File ID.
318
342
  * @public
319
343
  * @documentationMaturity preview
@@ -365,9 +389,11 @@ function getFileDescriptor(fileId) {
365
389
  return fromJSON(result.data);
366
390
  }
367
391
  catch (err) {
368
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
369
- 'fileId',
370
- ]);
392
+ const transformedError = (0, transform_error_1.transformError)(err, {
393
+ spreadPathsToArguments: {},
394
+ explicitPathsToArguments: { fileId: '$[0]' },
395
+ singleArgumentUnchanged: false,
396
+ }, ['fileId']);
371
397
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
372
398
  throw transformedError;
373
399
  }
@@ -376,6 +402,11 @@ function getFileDescriptor(fileId) {
376
402
  exports.getFileDescriptor = getFileDescriptor;
377
403
  /**
378
404
  * Gets information about the specified files in the Media Manager.
405
+ *
406
+ *
407
+ * The `getFileDescriptors()` function returns a Promise that resolves to an array containing the specified files' descriptors.
408
+ *
409
+ * Use `getFileDescriptor()` to get a single file descriptor.
379
410
  * @param fileIds - File IDs.
380
411
  * @public
381
412
  * @documentationMaturity preview
@@ -426,9 +457,11 @@ function getFileDescriptors(fileIds) {
426
457
  return fromJSON(result.data);
427
458
  }
428
459
  catch (err) {
429
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
430
- 'fileIds',
431
- ]);
460
+ const transformedError = (0, transform_error_1.transformError)(err, {
461
+ spreadPathsToArguments: {},
462
+ explicitPathsToArguments: { fileIds: '$[0]' },
463
+ singleArgumentUnchanged: false,
464
+ }, ['fileIds']);
432
465
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
433
466
  throw transformedError;
434
467
  }
@@ -436,7 +469,10 @@ function getFileDescriptors(fileIds) {
436
469
  }
437
470
  exports.getFileDescriptors = getFileDescriptors;
438
471
  /**
439
- * Updates a file. <br />
472
+ * Updates a file.
473
+ *
474
+ *
475
+ * The `updateFileDescriptor()` function returns a Promise that resolves to the updated file's descriptor.
440
476
  *
441
477
  * You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
442
478
  * @param _id - File ID. Generated when a file is uploaded to the Media Manager.
@@ -496,10 +532,11 @@ function updateFileDescriptor(_id, file) {
496
532
  return fromJSON(result.data);
497
533
  }
498
534
  catch (err) {
499
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
500
- '_id',
501
- 'file',
502
- ]);
535
+ const transformedError = (0, transform_error_1.transformError)(err, {
536
+ spreadPathsToArguments: { file: '$[1]' },
537
+ explicitPathsToArguments: { 'file.id': '$[0]' },
538
+ singleArgumentUnchanged: false,
539
+ }, ['_id', 'file']);
503
540
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
504
541
  throw transformedError;
505
542
  }
@@ -509,9 +546,11 @@ exports.updateFileDescriptor = updateFileDescriptor;
509
546
  /**
510
547
  * Generates an upload URL to allow external clients to upload a file to the Media Manager.
511
548
  *
549
+ * The `generateFileUploadUrl()` function returns a Promise that resolves to an upload URL.
550
+ *
512
551
  * To learn how external clients can use the generated upload URL in the response to upload a file to the Media Manager, see the Upload API article.
513
552
  *
514
- * > **Note:** Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, use the generateFileResumableUploadUrl() instead. With the resumable upload URL, any interruption in the upload process pauses the file upload, and resumes the file upload process after the interruption.
553
+ * > **Note:** Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, use `generateFileResumableUploadUrl()` instead. With the resumable upload URL, any interruption in the upload process pauses the file upload, and resumes the file upload process after the interruption.
515
554
  * @param mimeType - File mime type.
516
555
  * @public
517
556
  * @documentationMaturity preview
@@ -564,10 +603,19 @@ function generateFileUploadUrl(mimeType, options) {
564
603
  return fromJSON(result.data);
565
604
  }
566
605
  catch (err) {
567
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
568
- 'mimeType',
569
- 'options',
570
- ]);
606
+ const transformedError = (0, transform_error_1.transformError)(err, {
607
+ spreadPathsToArguments: {},
608
+ explicitPathsToArguments: {
609
+ mimeType: '$[0]',
610
+ fileName: '$[1].fileName',
611
+ sizeInBytes: '$[1].sizeInBytes',
612
+ parentFolderId: '$[1].parentFolderId',
613
+ private: '$[1].private',
614
+ labels: '$[1].labels',
615
+ externalInfo: '$[1].externalInfo',
616
+ },
617
+ singleArgumentUnchanged: false,
618
+ }, ['mimeType', 'options']);
571
619
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
572
620
  throw transformedError;
573
621
  }
@@ -575,9 +623,11 @@ function generateFileUploadUrl(mimeType, options) {
575
623
  }
576
624
  exports.generateFileUploadUrl = generateFileUploadUrl;
577
625
  /**
578
- * Generates a resumable upload URL to allow external clients to easily upload large files over 10MB to the Media Manager.
626
+ * Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
579
627
  *
580
- * With the resumable upload URL, any interruptions in the upload process pauses the file upload, and resumes the file upload process after the interruption. The resumable upload URL is also helpful when network connection is poor.
628
+ * The `generateFileResumableUploadUrl()` function returns a Promise that resolves to an upload URL, token, and protocol.
629
+ *
630
+ * When using the resumable upload URL, any interruptions will pause the file upload process, which automatically resumes once the interruption is resolved. The resumable upload URL is also helpful when network connection is poor.
581
631
  *
582
632
  * To learn how external clients can use the generated upload URL in the response to upload large files to the Media Manager, see the Resumable Upload API article.
583
633
  * @param mimeType - File mime type.
@@ -632,10 +682,19 @@ function generateFileResumableUploadUrl(mimeType, options) {
632
682
  return fromJSON(result.data);
633
683
  }
634
684
  catch (err) {
635
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
636
- 'mimeType',
637
- 'options',
638
- ]);
685
+ const transformedError = (0, transform_error_1.transformError)(err, {
686
+ spreadPathsToArguments: {},
687
+ explicitPathsToArguments: {
688
+ mimeType: '$[0]',
689
+ fileName: '$[1].fileName',
690
+ sizeInBytes: '$[1].sizeInBytes',
691
+ parentFolderId: '$[1].parentFolderId',
692
+ private: '$[1].private',
693
+ labels: '$[1].labels',
694
+ uploadProtocol: '$[1].uploadProtocol',
695
+ },
696
+ singleArgumentUnchanged: false,
697
+ }, ['mimeType', 'options']);
639
698
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
640
699
  throw transformedError;
641
700
  }
@@ -643,19 +702,18 @@ function generateFileResumableUploadUrl(mimeType, options) {
643
702
  }
644
703
  exports.generateFileResumableUploadUrl = generateFileResumableUploadUrl;
645
704
  /**
646
- * Imports a file to the Media Manager using an external url.
705
+ * Imports a file to the Media Manager using an external URL.
706
+ *
707
+ * The `importFile()` function returns a Promise that resolves to the imported file's descriptor.
647
708
  *
648
- * This function returns information about the imported file.
709
+ * This function returns information about the imported file. Importing a file is the method through which you can add files to the Media Manager.
649
710
  * Use the `parentFolderId` parameter to specify which folder you want the file to be imported to.
650
711
  * If no folder is specified, the file is imported to the `media-root` folder.
651
712
  *
652
- * To import a file, you need to provide one of the following:
653
- * 1. Pass the file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
654
- * 2. Pass the file's name and extension. For example, `'my-image.png'`.
655
- * 3. If you don't know the file's extension or MIME type, pass its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
656
- *
657
- * >**Note:** The `media` property isn't returned in the `files` response object.
658
- *
713
+ * To import a file, you need to pass one of the following:
714
+ * - The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
715
+ * - The file's name and extension. For example, `'my-image.png'`.
716
+ * - If you don't know the file's extension or MIME type, its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
659
717
  * @param url - Publicly accessible external file URL.
660
718
  * @public
661
719
  * @documentationMaturity preview
@@ -717,10 +775,22 @@ function importFile(url, options) {
717
775
  return fromJSON(result.data);
718
776
  }
719
777
  catch (err) {
720
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
721
- 'url',
722
- 'options',
723
- ]);
778
+ const transformedError = (0, transform_error_1.transformError)(err, {
779
+ spreadPathsToArguments: {},
780
+ explicitPathsToArguments: {
781
+ url: '$[0]',
782
+ mediaType: '$[1].mediaType',
783
+ displayName: '$[1].displayName',
784
+ parentFolderId: '$[1].parentFolderId',
785
+ private: '$[1].private',
786
+ labels: '$[1].labels',
787
+ mimeType: '$[1].mimeType',
788
+ externalInfo: '$[1].externalInfo',
789
+ urlParams: '$[1].urlParams',
790
+ urlHeaders: '$[1].urlHeaders',
791
+ },
792
+ singleArgumentUnchanged: false,
793
+ }, ['url', 'options']);
724
794
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
725
795
  throw transformedError;
726
796
  }
@@ -732,15 +802,17 @@ exports.importFile = importFile;
732
802
  * > This function has been replaced with `bulkImportFile()`, and will be removed on March 31, 2024.
733
803
  *
734
804
  *
805
+ * The `bulkImportFiles()` function returns a Promise that resolves to an array of the imported files' descriptors.
806
+ *
735
807
  * Imports a bulk of files to the Media Manager using external urls.
736
808
  *
737
809
  * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
738
810
  * If no folder is specified, the file is imported to the `media-root` folder.
739
811
  *
740
- * To import files, you need to provide one of the following:
741
- * 1. Pass each file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
742
- * 2. Pass each file's name and extension. For example, `'my-image.png'`.
743
- * 3. If you don't know a file's extension or MIME type, pass its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
812
+ * To import a file, you need to pass one of the following:
813
+ * - The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
814
+ * - The file's name and extension. For example, `'my-image.png'`.
815
+ * - If you don't know the file's extension or MIME type, its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
744
816
  *
745
817
  * >**Note:** The `media` property isn't returned in the `files` response object.
746
818
  * @param importFileRequests - Information about the files to import.
@@ -794,9 +866,11 @@ function bulkImportFiles(importFileRequests) {
794
866
  return fromJSON(result.data);
795
867
  }
796
868
  catch (err) {
797
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
798
- 'importFileRequests',
799
- ]);
869
+ const transformedError = (0, transform_error_1.transformError)(err, {
870
+ spreadPathsToArguments: {},
871
+ explicitPathsToArguments: { importFileRequests: '$[0]' },
872
+ singleArgumentUnchanged: false,
873
+ }, ['importFileRequests']);
800
874
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
801
875
  throw transformedError;
802
876
  }
@@ -804,22 +878,23 @@ function bulkImportFiles(importFileRequests) {
804
878
  }
805
879
  exports.bulkImportFiles = bulkImportFiles;
806
880
  /**
807
- * Imports a bulk of files to the Media Manager using external urls. <br/>
881
+ * Imports a bulk of files to the Media Manager using external urls.
808
882
  *
809
- * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported to.
810
- * If no folder is specified, the file is imported to the `media-root` folder.
883
+ * The `bulkImportFile()` function returns a Promise that resolves to an object containing bulk import metadata and an array of imported files' descriptors and metadata.
811
884
  *
812
- * To import files, you need to provide one of the following:
813
- * 1. Pass each file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, 'image/png'.
814
- * 2. Pass each file's name and extension. For example, 'my-image.png'.
815
- * 3. If you don't know a file's extension or MIME type, pass its media type in the `mediaType` parameter of the request. For example, 'IMAGE'. Note that this option only works if the server hosting the media allows a 'HEAD' request.
885
+ * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
886
+ * If no folder is specified, the file is imported to the `media-root` folder.
816
887
  *
817
- * >**Note:** The `media` property isn't returned in the `files` response object.
888
+ * To import a file, you need to pass one of the following:
889
+ * - The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
890
+ * - The file's name and extension. For example, `'my-image.png'`.
891
+ * - If you don't know the file's extension or MIME type, its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
818
892
  * @param importFileRequests - Information about the files to import.
819
893
  * @public
820
894
  * @documentationMaturity preview
821
895
  * @requiredField importFileRequests
822
896
  * @requiredField importFileRequests.url
897
+ * @param options - Options to include the file descriptor in the response.
823
898
  * @permissionScope Manage Bookings Services and Settings
824
899
  * @permissionScope Manage Media Manager
825
900
  * @applicableIdentity APP
@@ -869,10 +944,14 @@ function bulkImportFile(importFileRequests, options) {
869
944
  return fromJSON(result.data);
870
945
  }
871
946
  catch (err) {
872
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
873
- 'importFileRequests',
874
- 'options',
875
- ]);
947
+ const transformedError = (0, transform_error_1.transformError)(err, {
948
+ spreadPathsToArguments: {},
949
+ explicitPathsToArguments: {
950
+ importFileRequests: '$[0]',
951
+ returnEntity: '$[1].returnEntity',
952
+ },
953
+ singleArgumentUnchanged: false,
954
+ }, ['importFileRequests', 'options']);
876
955
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
877
956
  throw transformedError;
878
957
  }
@@ -882,7 +961,11 @@ exports.bulkImportFile = bulkImportFile;
882
961
  /**
883
962
  * Retrieves a list of files in the Media Manager.
884
963
  *
964
+ * The `listFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
965
+ *
885
966
  * To retrieve a list of files within a specific folder in the Media Manager, pass the folder's ID in the `parentFolderId` parameter. If no folder is specified, the endpoint retrieves only the list of files in the root folder of the Media Manager.
967
+ *
968
+ * To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
886
969
  * @public
887
970
  * @documentationMaturity preview
888
971
  * @param options - Options to use when listing media files.
@@ -938,9 +1021,17 @@ function listFiles(options) {
938
1021
  return fromJSON(result.data);
939
1022
  }
940
1023
  catch (err) {
941
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
942
- 'options',
943
- ]);
1024
+ const transformedError = (0, transform_error_1.transformError)(err, {
1025
+ spreadPathsToArguments: {},
1026
+ explicitPathsToArguments: {
1027
+ parentFolderId: '$[0].parentFolderId',
1028
+ mediaTypes: '$[0].mediaTypes',
1029
+ private: '$[0].private',
1030
+ sort: '$[0].sort',
1031
+ paging: '$[0].paging',
1032
+ },
1033
+ singleArgumentUnchanged: false,
1034
+ }, ['options']);
944
1035
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
945
1036
  throw transformedError;
946
1037
  }
@@ -950,7 +1041,9 @@ exports.listFiles = listFiles;
950
1041
  /**
951
1042
  * Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
952
1043
  *
953
- * If no parameters are specified, the endpoint returns all files in the `MEDIA_ROOT` folder.
1044
+ * The `searchFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
1045
+ *
1046
+ * If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
954
1047
  * @public
955
1048
  * @documentationMaturity preview
956
1049
  * @param options - Options to specify which folders to search.
@@ -1007,9 +1100,18 @@ function searchFiles(options) {
1007
1100
  return fromJSON(result.data);
1008
1101
  }
1009
1102
  catch (err) {
1010
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1011
- 'options',
1012
- ]);
1103
+ const transformedError = (0, transform_error_1.transformError)(err, {
1104
+ spreadPathsToArguments: {},
1105
+ explicitPathsToArguments: {
1106
+ search: '$[0].search',
1107
+ rootFolder: '$[0].rootFolder',
1108
+ mediaTypes: '$[0].mediaTypes',
1109
+ private: '$[0].private',
1110
+ sort: '$[0].sort',
1111
+ paging: '$[0].paging',
1112
+ },
1113
+ singleArgumentUnchanged: false,
1114
+ }, ['options']);
1013
1115
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1014
1116
  throw transformedError;
1015
1117
  }
@@ -1018,6 +1120,11 @@ function searchFiles(options) {
1018
1120
  exports.searchFiles = searchFiles;
1019
1121
  /**
1020
1122
  * Generates a URL for streaming a specific video file in the Media Manager.
1123
+ *
1124
+ *
1125
+ * The `generateVideoStreamingUrl()` function returns a Promise that resolves to a download URL and its asset key.
1126
+ *
1127
+ * To stream different assets of the file, use the `assetKeys` parameter which generates a video streaming URL for each asset. If no asset key is specified, it defaults to `src`, which generates one video streaming URL in the original file's format and quality.
1021
1128
  * @param fileId - File ID.
1022
1129
  * @public
1023
1130
  * @documentationMaturity preview
@@ -1063,10 +1170,11 @@ function generateVideoStreamingUrl(fileId, options) {
1063
1170
  return fromJSON(result.data);
1064
1171
  }
1065
1172
  catch (err) {
1066
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1067
- 'fileId',
1068
- 'options',
1069
- ]);
1173
+ const transformedError = (0, transform_error_1.transformError)(err, {
1174
+ spreadPathsToArguments: {},
1175
+ explicitPathsToArguments: { fileId: '$[0]', format: '$[1].format' },
1176
+ singleArgumentUnchanged: false,
1177
+ }, ['fileId', 'options']);
1070
1178
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1071
1179
  throw transformedError;
1072
1180
  }
@@ -1077,7 +1185,9 @@ exports.generateVideoStreamingUrl = generateVideoStreamingUrl;
1077
1185
  * Deletes the specified files from the Media Manager.
1078
1186
  *
1079
1187
  *
1080
- * The deleted files are moved to the Media Manager's trash bin (`TRASH-ROOT` folder) unless permanently deleted. To permanently delete files, pass the `permanent` parameter with the value `true`. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.
1188
+ * The `bulkDeleteFiles()` function returns a Promise that resolves when the files are deleted.
1189
+ *
1190
+ * The deleted files are moved to the Media Manager's trash bin (`TRASH_ROOT` folder) unless permanently deleted. To permanently delete files, pass the `permanent` parameter with the value `true`. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.
1081
1191
  *
1082
1192
  * >**Notes:**
1083
1193
  * > - The specified files can be from different folders.
@@ -1129,13 +1239,16 @@ function bulkDeleteFiles(fileIds, options) {
1129
1239
  try {
1130
1240
  const result = yield httpClient.request(reqOpts);
1131
1241
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1132
- return fromJSON(result.data);
1133
1242
  }
1134
1243
  catch (err) {
1135
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1136
- 'fileIds',
1137
- 'options',
1138
- ]);
1244
+ const transformedError = (0, transform_error_1.transformError)(err, {
1245
+ spreadPathsToArguments: {},
1246
+ explicitPathsToArguments: {
1247
+ fileIds: '$[0]',
1248
+ permanent: '$[1].permanent',
1249
+ },
1250
+ singleArgumentUnchanged: false,
1251
+ }, ['fileIds', 'options']);
1139
1252
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1140
1253
  throw transformedError;
1141
1254
  }
@@ -1144,6 +1257,8 @@ function bulkDeleteFiles(fileIds, options) {
1144
1257
  exports.bulkDeleteFiles = bulkDeleteFiles;
1145
1258
  /**
1146
1259
  * Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
1260
+ *
1261
+ * The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
1147
1262
  * @param fileIds - IDs of the files to restore from the Media Manager's trash bin.
1148
1263
  * @public
1149
1264
  * @documentationMaturity preview
@@ -1184,12 +1299,13 @@ function bulkRestoreFilesFromTrashBin(fileIds) {
1184
1299
  try {
1185
1300
  const result = yield httpClient.request(reqOpts);
1186
1301
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1187
- return fromJSON(result.data);
1188
1302
  }
1189
1303
  catch (err) {
1190
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1191
- 'fileIds',
1192
- ]);
1304
+ const transformedError = (0, transform_error_1.transformError)(err, {
1305
+ spreadPathsToArguments: {},
1306
+ explicitPathsToArguments: { fileIds: '$[0]' },
1307
+ singleArgumentUnchanged: false,
1308
+ }, ['fileIds']);
1193
1309
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1194
1310
  throw transformedError;
1195
1311
  }
@@ -1199,7 +1315,11 @@ exports.bulkRestoreFilesFromTrashBin = bulkRestoreFilesFromTrashBin;
1199
1315
  /**
1200
1316
  * Retrieves a list of files in the Media Manager's trash bin.
1201
1317
  *
1202
- * >**Note:** The Media Manager's trash bin (`TRASH-ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
1318
+ * The `listDeletedFiles()` function returns a Promise that resolves to an array of the specified deleted files' descriptors and cursor information.
1319
+ *
1320
+ * >**Note:** The Media Manager's trash bin (`TRASH_ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
1321
+ *
1322
+ * To retrieve a list of non-deleted files, use the `listFiles()` function.
1203
1323
  * @public
1204
1324
  * @documentationMaturity preview
1205
1325
  * @param options - Options to use when listing deleted files from the trash bin.
@@ -1255,9 +1375,17 @@ function listDeletedFiles(options) {
1255
1375
  return fromJSON(result.data);
1256
1376
  }
1257
1377
  catch (err) {
1258
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1259
- 'options',
1260
- ]);
1378
+ const transformedError = (0, transform_error_1.transformError)(err, {
1379
+ spreadPathsToArguments: {},
1380
+ explicitPathsToArguments: {
1381
+ parentFolderId: '$[0].parentFolderId',
1382
+ mediaTypes: '$[0].mediaTypes',
1383
+ private: '$[0].private',
1384
+ sort: '$[0].sort',
1385
+ paging: '$[0].paging',
1386
+ },
1387
+ singleArgumentUnchanged: false,
1388
+ }, ['options']);
1261
1389
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1262
1390
  throw transformedError;
1263
1391
  }