@wix/media 1.0.62 → 1.0.64

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 (169) hide show
  1. package/build/cjs/context.d.ts +4 -4
  2. package/build/cjs/context.js +4 -4
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +4 -4
  5. package/build/cjs/index.js +4 -4
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +4 -4
  8. package/build/cjs/meta.js +4 -4
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +4 -4
  11. package/build/es/context.js +4 -4
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +4 -4
  14. package/build/es/index.js +4 -4
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +4 -4
  17. package/build/es/meta.js +4 -4
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +14 -9
  20. package/build/cjs/index.typings.d.ts +0 -4
  21. package/build/cjs/index.typings.js +0 -31
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +0 -8
  24. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js +0 -77
  25. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +0 -1
  26. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +0 -16
  27. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js +0 -245
  28. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +0 -1
  29. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +0 -24
  30. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js +0 -142
  31. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +0 -1
  32. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +0 -26
  33. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js +0 -49
  34. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +0 -1
  35. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +0 -221
  36. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js +0 -22
  37. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +0 -1
  38. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +0 -315
  39. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js +0 -407
  40. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +0 -1
  41. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +0 -13
  42. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js +0 -137
  43. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +0 -1
  44. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +0 -29
  45. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js +0 -446
  46. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +0 -1
  47. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +0 -33
  48. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js +0 -237
  49. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +0 -1
  50. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +0 -59
  51. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js +0 -81
  52. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +0 -1
  53. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +0 -949
  54. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js +0 -27
  55. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +0 -1
  56. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +0 -907
  57. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js +0 -748
  58. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +0 -1
  59. package/build/cjs/src/media-site-media-v1-file-descriptor.context.d.ts +0 -18
  60. package/build/cjs/src/media-site-media-v1-file-descriptor.context.js +0 -197
  61. package/build/cjs/src/media-site-media-v1-file-descriptor.context.js.map +0 -1
  62. package/build/cjs/src/media-site-media-v1-file-descriptor.http.d.ts +0 -185
  63. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +0 -839
  64. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +0 -1
  65. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.d.ts +0 -36
  66. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js +0 -332
  67. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js.map +0 -1
  68. package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +0 -136
  69. package/build/cjs/src/media-site-media-v1-file-descriptor.public.js +0 -118
  70. package/build/cjs/src/media-site-media-v1-file-descriptor.public.js.map +0 -1
  71. package/build/cjs/src/media-site-media-v1-file-descriptor.types.d.ts +0 -2017
  72. package/build/cjs/src/media-site-media-v1-file-descriptor.types.js +0 -99
  73. package/build/cjs/src/media-site-media-v1-file-descriptor.types.js.map +0 -1
  74. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +0 -2105
  75. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +0 -1404
  76. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +0 -1
  77. package/build/cjs/src/media-site-media-v1-folder.context.d.ts +0 -11
  78. package/build/cjs/src/media-site-media-v1-folder.context.js +0 -113
  79. package/build/cjs/src/media-site-media-v1-folder.context.js.map +0 -1
  80. package/build/cjs/src/media-site-media-v1-folder.http.d.ts +0 -81
  81. package/build/cjs/src/media-site-media-v1-folder.http.js +0 -364
  82. package/build/cjs/src/media-site-media-v1-folder.http.js.map +0 -1
  83. package/build/cjs/src/media-site-media-v1-folder.meta.d.ts +0 -27
  84. package/build/cjs/src/media-site-media-v1-folder.meta.js +0 -199
  85. package/build/cjs/src/media-site-media-v1-folder.meta.js.map +0 -1
  86. package/build/cjs/src/media-site-media-v1-folder.public.d.ts +0 -27
  87. package/build/cjs/src/media-site-media-v1-folder.public.js +0 -69
  88. package/build/cjs/src/media-site-media-v1-folder.public.js.map +0 -1
  89. package/build/cjs/src/media-site-media-v1-folder.types.d.ts +0 -335
  90. package/build/cjs/src/media-site-media-v1-folder.types.js +0 -50
  91. package/build/cjs/src/media-site-media-v1-folder.types.js.map +0 -1
  92. package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +0 -603
  93. package/build/cjs/src/media-site-media-v1-folder.universal.js +0 -705
  94. package/build/cjs/src/media-site-media-v1-folder.universal.js.map +0 -1
  95. package/build/es/index.typings.d.ts +0 -4
  96. package/build/es/index.typings.js +0 -5
  97. package/build/es/index.typings.js.map +0 -1
  98. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +0 -8
  99. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js +0 -68
  100. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +0 -1
  101. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +0 -16
  102. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js +0 -236
  103. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +0 -1
  104. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +0 -24
  105. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js +0 -110
  106. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +0 -1
  107. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +0 -26
  108. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js +0 -35
  109. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +0 -1
  110. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +0 -221
  111. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js +0 -19
  112. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +0 -1
  113. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +0 -315
  114. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js +0 -375
  115. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +0 -1
  116. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +0 -13
  117. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js +0 -123
  118. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +0 -1
  119. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +0 -29
  120. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js +0 -432
  121. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +0 -1
  122. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +0 -33
  123. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js +0 -200
  124. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +0 -1
  125. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +0 -59
  126. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js +0 -60
  127. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +0 -1
  128. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +0 -949
  129. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js +0 -24
  130. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +0 -1
  131. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +0 -907
  132. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js +0 -711
  133. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +0 -1
  134. package/build/es/src/media-site-media-v1-file-descriptor.context.d.ts +0 -18
  135. package/build/es/src/media-site-media-v1-file-descriptor.context.js +0 -178
  136. package/build/es/src/media-site-media-v1-file-descriptor.context.js.map +0 -1
  137. package/build/es/src/media-site-media-v1-file-descriptor.http.d.ts +0 -185
  138. package/build/es/src/media-site-media-v1-file-descriptor.http.js +0 -820
  139. package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +0 -1
  140. package/build/es/src/media-site-media-v1-file-descriptor.meta.d.ts +0 -36
  141. package/build/es/src/media-site-media-v1-file-descriptor.meta.js +0 -290
  142. package/build/es/src/media-site-media-v1-file-descriptor.meta.js.map +0 -1
  143. package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +0 -136
  144. package/build/es/src/media-site-media-v1-file-descriptor.public.js +0 -85
  145. package/build/es/src/media-site-media-v1-file-descriptor.public.js.map +0 -1
  146. package/build/es/src/media-site-media-v1-file-descriptor.types.d.ts +0 -2017
  147. package/build/es/src/media-site-media-v1-file-descriptor.types.js +0 -96
  148. package/build/es/src/media-site-media-v1-file-descriptor.types.js.map +0 -1
  149. package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +0 -2105
  150. package/build/es/src/media-site-media-v1-file-descriptor.universal.js +0 -1362
  151. package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +0 -1
  152. package/build/es/src/media-site-media-v1-folder.context.d.ts +0 -11
  153. package/build/es/src/media-site-media-v1-folder.context.js +0 -101
  154. package/build/es/src/media-site-media-v1-folder.context.js.map +0 -1
  155. package/build/es/src/media-site-media-v1-folder.http.d.ts +0 -81
  156. package/build/es/src/media-site-media-v1-folder.http.js +0 -352
  157. package/build/es/src/media-site-media-v1-folder.http.js.map +0 -1
  158. package/build/es/src/media-site-media-v1-folder.meta.d.ts +0 -27
  159. package/build/es/src/media-site-media-v1-folder.meta.js +0 -164
  160. package/build/es/src/media-site-media-v1-folder.meta.js.map +0 -1
  161. package/build/es/src/media-site-media-v1-folder.public.d.ts +0 -27
  162. package/build/es/src/media-site-media-v1-folder.public.js +0 -50
  163. package/build/es/src/media-site-media-v1-folder.public.js.map +0 -1
  164. package/build/es/src/media-site-media-v1-folder.types.d.ts +0 -335
  165. package/build/es/src/media-site-media-v1-folder.types.js +0 -47
  166. package/build/es/src/media-site-media-v1-folder.types.js.map +0 -1
  167. package/build/es/src/media-site-media-v1-folder.universal.d.ts +0 -603
  168. package/build/es/src/media-site-media-v1-folder.universal.js +0 -670
  169. package/build/es/src/media-site-media-v1-folder.universal.js.map +0 -1
@@ -1,1404 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = 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);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
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.onFileDescriptorFileFailed = exports.onFileDescriptorFileReady = exports.onFileDescriptorDeleted = exports.onFileDescriptorUpdated = exports.StreamFormat = exports.RootFolder = exports.SortOrder = exports.UploadProtocol = exports.ContentDisposition = exports.IdentityType = exports.Namespace = exports.State = exports.OperationStatus = exports.MediaType = void 0;
36
- const velo_1 = require("@wix/metro-runtime/velo");
37
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
38
- const sdk_types_1 = require("@wix/sdk-types");
39
- const ambassadorWixMediaSiteMediaV1FileDescriptor = __importStar(require("./media-site-media-v1-file-descriptor.http"));
40
- const _toVeloEntity = '$';
41
- const _fromVeloEntity = '$';
42
- var MediaType;
43
- (function (MediaType) {
44
- MediaType["UNKNOWN"] = "UNKNOWN";
45
- MediaType["IMAGE"] = "IMAGE";
46
- MediaType["VIDEO"] = "VIDEO";
47
- MediaType["AUDIO"] = "AUDIO";
48
- MediaType["DOCUMENT"] = "DOCUMENT";
49
- MediaType["VECTOR"] = "VECTOR";
50
- MediaType["ARCHIVE"] = "ARCHIVE";
51
- MediaType["MODEL3D"] = "MODEL3D";
52
- MediaType["OTHER"] = "OTHER";
53
- })(MediaType || (exports.MediaType = MediaType = {}));
54
- var OperationStatus;
55
- (function (OperationStatus) {
56
- /** File upload or processing failed */
57
- OperationStatus["FAILED"] = "FAILED";
58
- /** File is ready for consumption */
59
- OperationStatus["READY"] = "READY";
60
- /** File is waiting for processing or currently being processed */
61
- OperationStatus["PENDING"] = "PENDING";
62
- })(OperationStatus || (exports.OperationStatus = OperationStatus = {}));
63
- var State;
64
- (function (State) {
65
- /** File is ready for consumption */
66
- State["OK"] = "OK";
67
- /** Deleted file */
68
- State["DELETED"] = "DELETED";
69
- })(State || (exports.State = State = {}));
70
- var Namespace;
71
- (function (Namespace) {
72
- Namespace["NO_NAMESPACE"] = "NO_NAMESPACE";
73
- Namespace["OTHERS"] = "OTHERS";
74
- /** ANY = 2; */
75
- Namespace["WIX_VIDEO"] = "WIX_VIDEO";
76
- /** _nsWixMusic */
77
- Namespace["WIX_MUSIC"] = "WIX_MUSIC";
78
- /** _nsArtStore */
79
- Namespace["ALBUMS_AND_ART_STORE"] = "ALBUMS_AND_ART_STORE";
80
- /** _nsDigitalProduct */
81
- Namespace["WIX_ECOM"] = "WIX_ECOM";
82
- /** _nsPhotoShareApp */
83
- Namespace["PHOTO_SHARE_APP"] = "PHOTO_SHARE_APP";
84
- /** _nsSharingApp, */
85
- Namespace["SHARING_APP"] = "SHARING_APP";
86
- /** engage */
87
- Namespace["CHAT"] = "CHAT";
88
- /** logobuilder */
89
- Namespace["LOGO_BUILDER"] = "LOGO_BUILDER";
90
- /** WixExposure */
91
- Namespace["ALBUMS_OLD"] = "ALBUMS_OLD";
92
- /** chat-mobile-uploads */
93
- Namespace["CHAT_MOBILE"] = "CHAT_MOBILE";
94
- /** _nsWixForms */
95
- Namespace["WIX_FORMS"] = "WIX_FORMS";
96
- })(Namespace || (exports.Namespace = Namespace = {}));
97
- var IdentityType;
98
- (function (IdentityType) {
99
- IdentityType["UNKNOWN"] = "UNKNOWN";
100
- IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
101
- IdentityType["MEMBER"] = "MEMBER";
102
- IdentityType["WIX_USER"] = "WIX_USER";
103
- IdentityType["APP"] = "APP";
104
- })(IdentityType || (exports.IdentityType = IdentityType = {}));
105
- var ContentDisposition;
106
- (function (ContentDisposition) {
107
- /** Using the link in the browser will download the file */
108
- ContentDisposition["ATTACHMENT"] = "ATTACHMENT";
109
- /** Using the link in the browser will open the file in the browser */
110
- ContentDisposition["INLINE"] = "INLINE";
111
- })(ContentDisposition || (exports.ContentDisposition = ContentDisposition = {}));
112
- var UploadProtocol;
113
- (function (UploadProtocol) {
114
- /** The upload protocol to use for implementing the resumable upload. */
115
- UploadProtocol["TUS"] = "TUS";
116
- })(UploadProtocol || (exports.UploadProtocol = UploadProtocol = {}));
117
- var SortOrder;
118
- (function (SortOrder) {
119
- SortOrder["ASC"] = "ASC";
120
- SortOrder["DESC"] = "DESC";
121
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
122
- var RootFolder;
123
- (function (RootFolder) {
124
- /** Root of all site media */
125
- RootFolder["MEDIA_ROOT"] = "MEDIA_ROOT";
126
- /** Root of the trash system folder */
127
- RootFolder["TRASH_ROOT"] = "TRASH_ROOT";
128
- /** Root of all visitor uploads */
129
- RootFolder["VISITOR_UPLOADS_ROOT"] = "VISITOR_UPLOADS_ROOT";
130
- })(RootFolder || (exports.RootFolder = RootFolder = {}));
131
- var StreamFormat;
132
- (function (StreamFormat) {
133
- StreamFormat["UNKNOWN"] = "UNKNOWN";
134
- StreamFormat["HLS"] = "HLS";
135
- StreamFormat["DASH"] = "DASH";
136
- })(StreamFormat || (exports.StreamFormat = StreamFormat = {}));
137
- const _audioV2 = { assets: 'wix.common.Audio' };
138
- const _bulkDeleteFilesRequest = {};
139
- const _bulkDeleteFilesResponse = {};
140
- const _bulkImportFileRequest = { importFileRequests: '_importFileRequest' };
141
- const _bulkImportFileResponse = { results: '_bulkImportFileResult' };
142
- const _bulkImportFileResult = { item: '_fileDescriptor' };
143
- const _bulkImportFilesRequest = { importFileRequests: '_importFileRequest' };
144
- const _bulkImportFilesResponse = { files: '_fileDescriptor' };
145
- const _bulkRestoreFilesFromTrashBinRequest = {};
146
- const _bulkRestoreFilesFromTrashBinResponse = {};
147
- const _fileDescriptor = { media: '_fileMedia' };
148
- const _fileMedia = {
149
- video: 'wix.common.VideoV2',
150
- document: 'wix.common.Document',
151
- image: '_imageMedia',
152
- audio: '_audioV2',
153
- vector: '_imageMedia',
154
- model3d: '_model3D',
155
- };
156
- const _generateFileDownloadUrlRequest = {};
157
- const _generateFileDownloadUrlResponse = {};
158
- const _generateFileResumableUploadUrlRequest = {};
159
- const _generateFileResumableUploadUrlResponse = {};
160
- const _generateFilesDownloadUrlRequest = {};
161
- const _generateFilesDownloadUrlResponse = {};
162
- const _generateFileUploadUrlRequest = {};
163
- const _generateFileUploadUrlResponse = {};
164
- const _generateVideoStreamingUrlRequest = {};
165
- const _generateVideoStreamingUrlResponse = {};
166
- const _getFileDescriptorRequest = {};
167
- const _getFileDescriptorResponse = { file: '_fileDescriptor' };
168
- const _getFileDescriptorsRequest = {};
169
- const _getFileDescriptorsResponse = { files: '_fileDescriptor' };
170
- const _imageMedia = {
171
- image: 'wix.common.Image',
172
- previewImage: 'wix.common.Image',
173
- };
174
- const _importFileRequest = {};
175
- const _importFileResponse = { file: '_fileDescriptor' };
176
- const _listDeletedFilesRequest = {};
177
- const _listDeletedFilesResponse = { files: '_fileDescriptor' };
178
- const _listFilesRequest = {};
179
- const _listFilesResponse = { files: '_fileDescriptor' };
180
- const _model3D = { thumbnail: 'wix.common.Image' };
181
- const _searchFilesRequest = {};
182
- const _searchFilesResponse = { files: '_fileDescriptor' };
183
- const _updateFileDescriptorRequest = { file: '_fileDescriptor' };
184
- const _updateFileDescriptorResponse = { file: '_fileDescriptor' };
185
- exports.onFileDescriptorUpdated = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_updated')();
186
- exports.onFileDescriptorDeleted = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_deleted')();
187
- exports.onFileDescriptorFileReady = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_file_ready')();
188
- exports.onFileDescriptorFileFailed = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_file_failed')();
189
- /**
190
- * Generates a URL for downloading a compressed file containing specific files in the Media Manager.
191
- *
192
- * The `generateFilesDownloadUrl()` function returns a Promise that resolves to a download URL.
193
- *
194
- * The compressed file can contain up to 1000 files.
195
- *
196
- * To generate one or more temporary URLs for downloading a specific file in the Media Manager, use the `generateFileDownloadUrl()` function.
197
- * You can use the `expirationInMinutes` parameter to set the URL expiration time, making it more secure than the `generateFilesDownloadUrl()` function.
198
- * Therefore, to download private files, use the `generateFileDownloadUrl` function for each private file that you want to generate a download URL for.
199
- * @param fileIds - IDs of the files to download.
200
- * @public
201
- * @requiredField fileIds
202
- * @permissionScope Manage Bookings Services and Settings
203
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
204
- * @permissionScope Manage Media Manager
205
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
206
- * @applicableIdentity APP
207
- */
208
- function generateFilesDownloadUrl(fileIds) {
209
- var _a, _b, _c;
210
- return __awaiter(this, arguments, void 0, function* () {
211
- const requestTransformation = { fileIds: '$[0]' };
212
- const responseTransformation = '$';
213
- // @ts-ignore
214
- const { httpClient, sideEffects } = arguments[1];
215
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
216
- rootSchema: _generateFilesDownloadUrlRequest,
217
- depSchemas: {},
218
- fqdnTransformation: {
219
- paths: [],
220
- transformation: _fromVeloEntity,
221
- },
222
- customTransformation: requestTransformation,
223
- });
224
- const { fromJSON } = (0, velo_1.serializer)({
225
- rootSchema: _generateFilesDownloadUrlResponse,
226
- depSchemas: {},
227
- fqdnTransformation: {
228
- paths: [],
229
- transformation: _toVeloEntity,
230
- },
231
- customTransformation: responseTransformation,
232
- });
233
- const payload = toAmbassadorRequest([fileIds]);
234
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFilesDownloadUrl(payload);
235
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
236
- try {
237
- const result = yield httpClient.request(reqOpts);
238
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
239
- return fromJSON(result.data);
240
- }
241
- catch (err) {
242
- const transformedError = (0, transform_error_1.transformError)(err, {
243
- spreadPathsToArguments: {},
244
- explicitPathsToArguments: { fileIds: '$[0]' },
245
- singleArgumentUnchanged: false,
246
- }, ['fileIds']);
247
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
248
- throw transformedError;
249
- }
250
- });
251
- }
252
- exports.generateFilesDownloadUrl = generateFilesDownloadUrl;
253
- /**
254
- * Generates one or more temporary URLs for downloading a specific file in the Media Manager.
255
- *
256
- * The `generateFileDownloadUrl()` function returns a Promise that resolves to an array containing download URLs for the assets specified in the options parameter.
257
- *
258
- * To download different assets of the file, use the `assetKeys` parameter which generates a download URL for each asset.
259
- * If no asset key is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
260
- *
261
- * Use this function 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.
262
- *
263
- * To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, use the `generateFilesDownloadUrl()` function.
264
- * Since this is a permanent URL, it is less secure. Therefore, to download private files, use the `generateFileDownloadUrl()` function for each private file that you want to generate a download URL for.
265
- * @param fileId - File ID.
266
- * @public
267
- * @requiredField fileId
268
- * @param options - Options to use when generating a file's download URL.
269
- * @permissionScope Manage Bookings Services and Settings
270
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
271
- * @permissionScope Manage Media Manager
272
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
273
- * @applicableIdentity APP
274
- */
275
- function generateFileDownloadUrl(fileId, options) {
276
- var _a, _b, _c;
277
- return __awaiter(this, arguments, void 0, function* () {
278
- const requestTransformation = {
279
- fileId: '$[0]',
280
- downloadFileName: '$[1].downloadFileName',
281
- expirationInMinutes: '$[1].expirationInMinutes',
282
- expirationRedirectUrl: '$[1].expirationRedirectUrl',
283
- assetKeys: '$[1].assetKeys',
284
- contentDisposition: '$[1].contentDisposition',
285
- };
286
- const responseTransformation = '$';
287
- // @ts-ignore
288
- const { httpClient, sideEffects } = arguments[2];
289
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
290
- rootSchema: _generateFileDownloadUrlRequest,
291
- depSchemas: {},
292
- fqdnTransformation: {
293
- paths: [],
294
- transformation: _fromVeloEntity,
295
- },
296
- customTransformation: requestTransformation,
297
- });
298
- const { fromJSON } = (0, velo_1.serializer)({
299
- rootSchema: _generateFileDownloadUrlResponse,
300
- depSchemas: {},
301
- fqdnTransformation: {
302
- paths: [],
303
- transformation: _toVeloEntity,
304
- },
305
- customTransformation: responseTransformation,
306
- });
307
- const payload = toAmbassadorRequest([fileId, options]);
308
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFileDownloadUrl(payload);
309
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
310
- try {
311
- const result = yield httpClient.request(reqOpts);
312
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
313
- return fromJSON(result.data);
314
- }
315
- catch (err) {
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']);
328
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
329
- throw transformedError;
330
- }
331
- });
332
- }
333
- exports.generateFileDownloadUrl = generateFileDownloadUrl;
334
- /**
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.
341
- * @param fileId - File ID.
342
- * @public
343
- * @requiredField fileId
344
- * @permissionScope Manage Bookings Services and Settings
345
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
346
- * @permissionScope Read Media Manager
347
- * @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
348
- * @permissionScope Manage Media Manager
349
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
350
- * @applicableIdentity APP
351
- * @returns Information about the file.
352
- */
353
- function getFileDescriptor(fileId) {
354
- var _a, _b, _c;
355
- return __awaiter(this, arguments, void 0, function* () {
356
- const requestTransformation = { fileId: '$[0]' };
357
- const responseTransformation = '$.file';
358
- // @ts-ignore
359
- const { httpClient, sideEffects } = arguments[1];
360
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
361
- rootSchema: _getFileDescriptorRequest,
362
- depSchemas: {},
363
- fqdnTransformation: {
364
- paths: [],
365
- transformation: _fromVeloEntity,
366
- },
367
- customTransformation: requestTransformation,
368
- });
369
- const { fromJSON } = (0, velo_1.serializer)({
370
- rootSchema: _getFileDescriptorResponse,
371
- depSchemas: {
372
- _audioV2,
373
- _fileDescriptor,
374
- _fileMedia,
375
- _imageMedia,
376
- _model3D,
377
- },
378
- fqdnTransformation: {
379
- paths: [...['file']],
380
- transformation: _toVeloEntity,
381
- },
382
- customTransformation: responseTransformation,
383
- });
384
- const payload = toAmbassadorRequest([fileId]);
385
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.getFileDescriptor(payload);
386
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
387
- try {
388
- const result = yield httpClient.request(reqOpts);
389
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
390
- return fromJSON(result.data);
391
- }
392
- catch (err) {
393
- const transformedError = (0, transform_error_1.transformError)(err, {
394
- spreadPathsToArguments: {},
395
- explicitPathsToArguments: { fileId: '$[0]' },
396
- singleArgumentUnchanged: false,
397
- }, ['fileId']);
398
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
399
- throw transformedError;
400
- }
401
- });
402
- }
403
- exports.getFileDescriptor = getFileDescriptor;
404
- /**
405
- * Gets information about the specified files in the Media Manager.
406
- *
407
- *
408
- * The `getFileDescriptors()` function returns a Promise that resolves to an array containing the specified files' descriptors.
409
- *
410
- * Use `getFileDescriptor()` to get a single file descriptor.
411
- * @param fileIds - File IDs.
412
- * @public
413
- * @requiredField fileIds
414
- * @permissionScope Manage Bookings Services and Settings
415
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
416
- * @permissionScope Read Media Manager
417
- * @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
418
- * @permissionScope Manage Media Manager
419
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
420
- * @applicableIdentity APP
421
- */
422
- function getFileDescriptors(fileIds) {
423
- var _a, _b, _c;
424
- return __awaiter(this, arguments, void 0, function* () {
425
- const requestTransformation = { fileIds: '$[0]' };
426
- const responseTransformation = '$';
427
- // @ts-ignore
428
- const { httpClient, sideEffects } = arguments[1];
429
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
430
- rootSchema: _getFileDescriptorsRequest,
431
- depSchemas: {},
432
- fqdnTransformation: {
433
- paths: [],
434
- transformation: _fromVeloEntity,
435
- },
436
- customTransformation: requestTransformation,
437
- });
438
- const { fromJSON } = (0, velo_1.serializer)({
439
- rootSchema: _getFileDescriptorsResponse,
440
- depSchemas: {
441
- _audioV2,
442
- _fileDescriptor,
443
- _fileMedia,
444
- _imageMedia,
445
- _model3D,
446
- },
447
- fqdnTransformation: {
448
- paths: [...['Array#files']],
449
- transformation: _toVeloEntity,
450
- },
451
- customTransformation: responseTransformation,
452
- });
453
- const payload = toAmbassadorRequest([fileIds]);
454
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.getFileDescriptors(payload);
455
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
456
- try {
457
- const result = yield httpClient.request(reqOpts);
458
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
459
- return fromJSON(result.data);
460
- }
461
- catch (err) {
462
- const transformedError = (0, transform_error_1.transformError)(err, {
463
- spreadPathsToArguments: {},
464
- explicitPathsToArguments: { fileIds: '$[0]' },
465
- singleArgumentUnchanged: false,
466
- }, ['fileIds']);
467
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
468
- throw transformedError;
469
- }
470
- });
471
- }
472
- exports.getFileDescriptors = getFileDescriptors;
473
- /**
474
- * Updates a file.
475
- *
476
- *
477
- * The `updateFileDescriptor()` function returns a Promise that resolves to the updated file's descriptor.
478
- *
479
- * You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
480
- * @param _id - File ID. Generated when a file is uploaded to the Media Manager.
481
- * @public
482
- * @requiredField _id
483
- * @requiredField file
484
- * @permissionScope Manage Bookings Services and Settings
485
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
486
- * @permissionScope Manage Media Manager
487
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
488
- * @applicableIdentity APP
489
- * @returns Information about the updated file.
490
- */
491
- function updateFileDescriptor(_id, file) {
492
- var _a, _b, _c;
493
- return __awaiter(this, arguments, void 0, function* () {
494
- const requestTransformation = { file: { '*': '$[1]', id: '$[0]' } };
495
- const responseTransformation = '$.file';
496
- // @ts-ignore
497
- const { httpClient, sideEffects } = arguments[2];
498
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
499
- rootSchema: _updateFileDescriptorRequest,
500
- depSchemas: {
501
- _audioV2,
502
- _fileDescriptor,
503
- _fileMedia,
504
- _imageMedia,
505
- _model3D,
506
- },
507
- fqdnTransformation: {
508
- paths: [...['file']],
509
- transformation: _fromVeloEntity,
510
- },
511
- customTransformation: requestTransformation,
512
- });
513
- const { fromJSON } = (0, velo_1.serializer)({
514
- rootSchema: _updateFileDescriptorResponse,
515
- depSchemas: {
516
- _audioV2,
517
- _fileDescriptor,
518
- _fileMedia,
519
- _imageMedia,
520
- _model3D,
521
- },
522
- fqdnTransformation: {
523
- paths: [...['file']],
524
- transformation: _toVeloEntity,
525
- },
526
- customTransformation: responseTransformation,
527
- });
528
- const payload = toAmbassadorRequest([_id, file]);
529
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.updateFileDescriptor(payload);
530
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
531
- try {
532
- const result = yield httpClient.request(reqOpts);
533
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
534
- return fromJSON(result.data);
535
- }
536
- catch (err) {
537
- const transformedError = (0, transform_error_1.transformError)(err, {
538
- spreadPathsToArguments: { file: '$[1]' },
539
- explicitPathsToArguments: { 'file.id': '$[0]' },
540
- singleArgumentUnchanged: false,
541
- }, ['_id', 'file']);
542
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
543
- throw transformedError;
544
- }
545
- });
546
- }
547
- exports.updateFileDescriptor = updateFileDescriptor;
548
- /**
549
- * Generates an upload URL to allow external clients to upload a file to the Media Manager.
550
- *
551
- * The `generateFileUploadUrl()` function returns a Promise that resolves to an upload URL.
552
- *
553
- * 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.
554
- *
555
- * > **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.
556
- * @param mimeType - File mime type.
557
- * @public
558
- * @requiredField mimeType
559
- * @param options - Options to use when generating a file's upload URL.
560
- * @permissionScope Manage Bookings Services and Settings
561
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
562
- * @permissionScope Manage Media Manager
563
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
564
- * @applicableIdentity APP
565
- */
566
- function generateFileUploadUrl(mimeType, options) {
567
- var _a, _b, _c;
568
- return __awaiter(this, arguments, void 0, function* () {
569
- const requestTransformation = {
570
- mimeType: '$[0]',
571
- fileName: '$[1].fileName',
572
- sizeInBytes: '$[1].sizeInBytes',
573
- parentFolderId: '$[1].parentFolderId',
574
- private: '$[1].private',
575
- labels: '$[1].labels',
576
- externalInfo: '$[1].externalInfo',
577
- };
578
- const responseTransformation = '$';
579
- // @ts-ignore
580
- const { httpClient, sideEffects } = arguments[2];
581
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
582
- rootSchema: _generateFileUploadUrlRequest,
583
- depSchemas: {},
584
- fqdnTransformation: {
585
- paths: [],
586
- transformation: _fromVeloEntity,
587
- },
588
- customTransformation: requestTransformation,
589
- });
590
- const { fromJSON } = (0, velo_1.serializer)({
591
- rootSchema: _generateFileUploadUrlResponse,
592
- depSchemas: {},
593
- fqdnTransformation: {
594
- paths: [],
595
- transformation: _toVeloEntity,
596
- },
597
- customTransformation: responseTransformation,
598
- });
599
- const payload = toAmbassadorRequest([mimeType, options]);
600
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFileUploadUrl(payload);
601
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
602
- try {
603
- const result = yield httpClient.request(reqOpts);
604
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
605
- return fromJSON(result.data);
606
- }
607
- catch (err) {
608
- const transformedError = (0, transform_error_1.transformError)(err, {
609
- spreadPathsToArguments: {},
610
- explicitPathsToArguments: {
611
- mimeType: '$[0]',
612
- fileName: '$[1].fileName',
613
- sizeInBytes: '$[1].sizeInBytes',
614
- parentFolderId: '$[1].parentFolderId',
615
- private: '$[1].private',
616
- labels: '$[1].labels',
617
- externalInfo: '$[1].externalInfo',
618
- },
619
- singleArgumentUnchanged: false,
620
- }, ['mimeType', 'options']);
621
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
622
- throw transformedError;
623
- }
624
- });
625
- }
626
- exports.generateFileUploadUrl = generateFileUploadUrl;
627
- /**
628
- * Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
629
- *
630
- * The `generateFileResumableUploadUrl()` function returns a Promise that resolves to an upload URL, token, and protocol.
631
- *
632
- * 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.
633
- *
634
- * 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.
635
- * @param mimeType - File mime type.
636
- * @public
637
- * @requiredField mimeType
638
- * @param options - Options to use when generating a resumable upload URL.
639
- * @permissionScope Manage Bookings Services and Settings
640
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
641
- * @permissionScope Manage Media Manager
642
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
643
- * @applicableIdentity APP
644
- */
645
- function generateFileResumableUploadUrl(mimeType, options) {
646
- var _a, _b, _c;
647
- return __awaiter(this, arguments, void 0, function* () {
648
- const requestTransformation = {
649
- mimeType: '$[0]',
650
- fileName: '$[1].fileName',
651
- sizeInBytes: '$[1].sizeInBytes',
652
- parentFolderId: '$[1].parentFolderId',
653
- private: '$[1].private',
654
- labels: '$[1].labels',
655
- uploadProtocol: '$[1].uploadProtocol',
656
- };
657
- const responseTransformation = '$';
658
- // @ts-ignore
659
- const { httpClient, sideEffects } = arguments[2];
660
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
661
- rootSchema: _generateFileResumableUploadUrlRequest,
662
- depSchemas: {},
663
- fqdnTransformation: {
664
- paths: [],
665
- transformation: _fromVeloEntity,
666
- },
667
- customTransformation: requestTransformation,
668
- });
669
- const { fromJSON } = (0, velo_1.serializer)({
670
- rootSchema: _generateFileResumableUploadUrlResponse,
671
- depSchemas: {},
672
- fqdnTransformation: {
673
- paths: [],
674
- transformation: _toVeloEntity,
675
- },
676
- customTransformation: responseTransformation,
677
- });
678
- const payload = toAmbassadorRequest([mimeType, options]);
679
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFileResumableUploadUrl(payload);
680
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
681
- try {
682
- const result = yield httpClient.request(reqOpts);
683
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
684
- return fromJSON(result.data);
685
- }
686
- catch (err) {
687
- const transformedError = (0, transform_error_1.transformError)(err, {
688
- spreadPathsToArguments: {},
689
- explicitPathsToArguments: {
690
- mimeType: '$[0]',
691
- fileName: '$[1].fileName',
692
- sizeInBytes: '$[1].sizeInBytes',
693
- parentFolderId: '$[1].parentFolderId',
694
- private: '$[1].private',
695
- labels: '$[1].labels',
696
- uploadProtocol: '$[1].uploadProtocol',
697
- },
698
- singleArgumentUnchanged: false,
699
- }, ['mimeType', 'options']);
700
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
701
- throw transformedError;
702
- }
703
- });
704
- }
705
- exports.generateFileResumableUploadUrl = generateFileResumableUploadUrl;
706
- /**
707
- * Imports a file to the Media Manager using an external URL.
708
- *
709
- * The `importFile()` function returns a Promise that resolves to the imported file's descriptor.
710
- *
711
- * This function returns information about the imported file. Importing a file is the method through which you can add files to the Media Manager.
712
- * Use the `parentFolderId` parameter to specify which folder you want the file to be imported to.
713
- * If no folder is specified, the file is imported to the `media-root` folder.
714
- *
715
- * To import a file, you need to do one of the following:
716
- * - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
717
- * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
718
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
719
- * > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
720
- * @param url - Publicly accessible external file URL.
721
- * @public
722
- * @requiredField url
723
- * @param options - Options to use when importing a single file.
724
- * @permissionScope Manage Bookings Services and Settings
725
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
726
- * @permissionScope Manage Media Manager
727
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
728
- * @applicableIdentity APP
729
- */
730
- function importFile(url, options) {
731
- var _a, _b, _c;
732
- return __awaiter(this, arguments, void 0, function* () {
733
- const requestTransformation = {
734
- url: '$[0]',
735
- mediaType: '$[1].mediaType',
736
- displayName: '$[1].displayName',
737
- parentFolderId: '$[1].parentFolderId',
738
- private: '$[1].private',
739
- labels: '$[1].labels',
740
- mimeType: '$[1].mimeType',
741
- externalInfo: '$[1].externalInfo',
742
- urlParams: '$[1].urlParams',
743
- urlHeaders: '$[1].urlHeaders',
744
- };
745
- const responseTransformation = '$';
746
- // @ts-ignore
747
- const { httpClient, sideEffects } = arguments[2];
748
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
749
- rootSchema: _importFileRequest,
750
- depSchemas: {},
751
- fqdnTransformation: {
752
- paths: [],
753
- transformation: _fromVeloEntity,
754
- },
755
- customTransformation: requestTransformation,
756
- });
757
- const { fromJSON } = (0, velo_1.serializer)({
758
- rootSchema: _importFileResponse,
759
- depSchemas: {
760
- _audioV2,
761
- _fileDescriptor,
762
- _fileMedia,
763
- _imageMedia,
764
- _model3D,
765
- },
766
- fqdnTransformation: {
767
- paths: [...['file']],
768
- transformation: _toVeloEntity,
769
- },
770
- customTransformation: responseTransformation,
771
- });
772
- const payload = toAmbassadorRequest([url, options]);
773
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.importFile(payload);
774
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
775
- try {
776
- const result = yield httpClient.request(reqOpts);
777
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
778
- return fromJSON(result.data);
779
- }
780
- catch (err) {
781
- const transformedError = (0, transform_error_1.transformError)(err, {
782
- spreadPathsToArguments: {},
783
- explicitPathsToArguments: {
784
- url: '$[0]',
785
- mediaType: '$[1].mediaType',
786
- displayName: '$[1].displayName',
787
- parentFolderId: '$[1].parentFolderId',
788
- private: '$[1].private',
789
- labels: '$[1].labels',
790
- mimeType: '$[1].mimeType',
791
- externalInfo: '$[1].externalInfo',
792
- urlParams: '$[1].urlParams',
793
- urlHeaders: '$[1].urlHeaders',
794
- },
795
- singleArgumentUnchanged: false,
796
- }, ['url', 'options']);
797
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
798
- throw transformedError;
799
- }
800
- });
801
- }
802
- exports.importFile = importFile;
803
- /**
804
- * > **Deprecated.**
805
- * > This function has been replaced with `bulkImportFile()`, and will be removed on March 31, 2024.
806
- *
807
- *
808
- * The `bulkImportFiles()` function returns a Promise that resolves to an array of the imported files' descriptors.
809
- *
810
- * Imports a bulk of files to the Media Manager using external urls.
811
- *
812
- * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
813
- * If no folder is specified, the file is imported to the `media-root` folder.
814
- *
815
- * >**Note:** The `media` property isn't returned in the `files` response object.
816
- *
817
- * To import files, you need to do one of the following for each file:
818
- * - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
819
- * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
820
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
821
- * > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
822
- * @param importFileRequests - Information about the files to import.
823
- * @public
824
- * @requiredField importFileRequests
825
- * @requiredField importFileRequests.url
826
- * @param options - Options to use when uploading multiple files.
827
- * @permissionScope Manage Bookings Services and Settings
828
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
829
- * @permissionScope Manage Media Manager
830
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
831
- * @applicableIdentity APP
832
- */
833
- function bulkImportFiles(importFileRequests) {
834
- var _a, _b, _c;
835
- return __awaiter(this, arguments, void 0, function* () {
836
- const requestTransformation = { importFileRequests: '$[0]' };
837
- const responseTransformation = '$';
838
- // @ts-ignore
839
- const { httpClient, sideEffects } = arguments[1];
840
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
841
- rootSchema: _bulkImportFilesRequest,
842
- depSchemas: { _importFileRequest },
843
- fqdnTransformation: {
844
- paths: [],
845
- transformation: _fromVeloEntity,
846
- },
847
- customTransformation: requestTransformation,
848
- });
849
- const { fromJSON } = (0, velo_1.serializer)({
850
- rootSchema: _bulkImportFilesResponse,
851
- depSchemas: {
852
- _audioV2,
853
- _fileDescriptor,
854
- _fileMedia,
855
- _imageMedia,
856
- _model3D,
857
- },
858
- fqdnTransformation: {
859
- paths: [...['Array#files']],
860
- transformation: _toVeloEntity,
861
- },
862
- customTransformation: responseTransformation,
863
- });
864
- const payload = toAmbassadorRequest([importFileRequests]);
865
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkImportFiles(payload);
866
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
867
- try {
868
- const result = yield httpClient.request(reqOpts);
869
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
870
- return fromJSON(result.data);
871
- }
872
- catch (err) {
873
- const transformedError = (0, transform_error_1.transformError)(err, {
874
- spreadPathsToArguments: {},
875
- explicitPathsToArguments: { importFileRequests: '$[0]' },
876
- singleArgumentUnchanged: false,
877
- }, ['importFileRequests']);
878
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
879
- throw transformedError;
880
- }
881
- });
882
- }
883
- exports.bulkImportFiles = bulkImportFiles;
884
- /**
885
- * Imports a bulk of files to the Media Manager using external urls.
886
- *
887
- * The `bulkImportFile()` function returns a Promise that resolves to an object containing bulk import metadata and an array of imported files' descriptors and metadata.
888
- *
889
- * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
890
- * If no folder is specified, the file is imported to the `media-root` folder.
891
- *
892
- * To import files, you need to do one of the following for each file:
893
- * - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
894
- * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
895
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
896
- * > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
897
- * @param importFileRequests - Information about the files to import.
898
- * @public
899
- * @requiredField importFileRequests
900
- * @requiredField importFileRequests.url
901
- * @param options - Options to include the file descriptor in the response.
902
- * @permissionScope Manage Bookings Services and Settings
903
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
904
- * @permissionScope Manage Media Manager
905
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
906
- * @applicableIdentity APP
907
- */
908
- function bulkImportFile(importFileRequests, options) {
909
- var _a, _b, _c;
910
- return __awaiter(this, arguments, void 0, function* () {
911
- const requestTransformation = {
912
- importFileRequests: '$[0]',
913
- returnEntity: '$[1].returnEntity',
914
- };
915
- const responseTransformation = '$';
916
- // @ts-ignore
917
- const { httpClient, sideEffects } = arguments[2];
918
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
919
- rootSchema: _bulkImportFileRequest,
920
- depSchemas: { _importFileRequest },
921
- fqdnTransformation: {
922
- paths: [],
923
- transformation: _fromVeloEntity,
924
- },
925
- customTransformation: requestTransformation,
926
- });
927
- const { fromJSON } = (0, velo_1.serializer)({
928
- rootSchema: _bulkImportFileResponse,
929
- depSchemas: {
930
- _audioV2,
931
- _bulkImportFileResult,
932
- _fileDescriptor,
933
- _fileMedia,
934
- _imageMedia,
935
- _model3D,
936
- },
937
- fqdnTransformation: {
938
- paths: [...['Array#results.item']],
939
- transformation: _toVeloEntity,
940
- },
941
- customTransformation: responseTransformation,
942
- });
943
- const payload = toAmbassadorRequest([importFileRequests, options]);
944
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkImportFile(payload);
945
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
946
- try {
947
- const result = yield httpClient.request(reqOpts);
948
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
949
- return fromJSON(result.data);
950
- }
951
- catch (err) {
952
- const transformedError = (0, transform_error_1.transformError)(err, {
953
- spreadPathsToArguments: {},
954
- explicitPathsToArguments: {
955
- importFileRequests: '$[0]',
956
- returnEntity: '$[1].returnEntity',
957
- },
958
- singleArgumentUnchanged: false,
959
- }, ['importFileRequests', 'options']);
960
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
961
- throw transformedError;
962
- }
963
- });
964
- }
965
- exports.bulkImportFile = bulkImportFile;
966
- /**
967
- * Retrieves a list of files in the Media Manager.
968
- *
969
- * The `listFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
970
- *
971
- * 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 function retrieves only the list of files in the root folder of the Media Manager.
972
- *
973
- * To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
974
- * @public
975
- * @param options - Options to use when listing media files.
976
- * @permissionScope Manage Bookings Services and Settings
977
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
978
- * @permissionScope Read Media Manager
979
- * @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
980
- * @permissionScope Manage Media Manager
981
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
982
- * @applicableIdentity APP
983
- */
984
- function listFiles(options) {
985
- var _a, _b, _c;
986
- return __awaiter(this, arguments, void 0, function* () {
987
- const requestTransformation = {
988
- parentFolderId: '$[0].parentFolderId',
989
- mediaTypes: '$[0].mediaTypes',
990
- private: '$[0].private',
991
- sort: '$[0].sort',
992
- paging: '$[0].paging',
993
- };
994
- const responseTransformation = '$';
995
- // @ts-ignore
996
- const { httpClient, sideEffects } = arguments[1];
997
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
998
- rootSchema: _listFilesRequest,
999
- depSchemas: {},
1000
- fqdnTransformation: {
1001
- paths: [],
1002
- transformation: _fromVeloEntity,
1003
- },
1004
- customTransformation: requestTransformation,
1005
- });
1006
- const { fromJSON } = (0, velo_1.serializer)({
1007
- rootSchema: _listFilesResponse,
1008
- depSchemas: {
1009
- _audioV2,
1010
- _fileDescriptor,
1011
- _fileMedia,
1012
- _imageMedia,
1013
- _model3D,
1014
- },
1015
- fqdnTransformation: {
1016
- paths: [...['Array#files']],
1017
- transformation: _toVeloEntity,
1018
- },
1019
- customTransformation: responseTransformation,
1020
- });
1021
- const payload = toAmbassadorRequest([options]);
1022
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.listFiles(payload);
1023
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1024
- try {
1025
- const result = yield httpClient.request(reqOpts);
1026
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1027
- return fromJSON(result.data);
1028
- }
1029
- catch (err) {
1030
- const transformedError = (0, transform_error_1.transformError)(err, {
1031
- spreadPathsToArguments: {},
1032
- explicitPathsToArguments: {
1033
- parentFolderId: '$[0].parentFolderId',
1034
- mediaTypes: '$[0].mediaTypes',
1035
- private: '$[0].private',
1036
- sort: '$[0].sort',
1037
- paging: '$[0].paging',
1038
- },
1039
- singleArgumentUnchanged: false,
1040
- }, ['options']);
1041
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1042
- throw transformedError;
1043
- }
1044
- });
1045
- }
1046
- exports.listFiles = listFiles;
1047
- /**
1048
- * Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
1049
- *
1050
- * The `searchFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
1051
- *
1052
- * If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
1053
- * @public
1054
- * @param options - Options to specify which folders to search.
1055
- * @permissionScope Manage Bookings Services and Settings
1056
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1057
- * @permissionScope Read Media Manager
1058
- * @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
1059
- * @permissionScope Manage Media Manager
1060
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
1061
- * @applicableIdentity APP
1062
- */
1063
- function searchFiles(options) {
1064
- var _a, _b, _c;
1065
- return __awaiter(this, arguments, void 0, function* () {
1066
- const requestTransformation = {
1067
- search: '$[0].search',
1068
- rootFolder: '$[0].rootFolder',
1069
- mediaTypes: '$[0].mediaTypes',
1070
- private: '$[0].private',
1071
- sort: '$[0].sort',
1072
- paging: '$[0].paging',
1073
- };
1074
- const responseTransformation = '$';
1075
- // @ts-ignore
1076
- const { httpClient, sideEffects } = arguments[1];
1077
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1078
- rootSchema: _searchFilesRequest,
1079
- depSchemas: {},
1080
- fqdnTransformation: {
1081
- paths: [],
1082
- transformation: _fromVeloEntity,
1083
- },
1084
- customTransformation: requestTransformation,
1085
- });
1086
- const { fromJSON } = (0, velo_1.serializer)({
1087
- rootSchema: _searchFilesResponse,
1088
- depSchemas: {
1089
- _audioV2,
1090
- _fileDescriptor,
1091
- _fileMedia,
1092
- _imageMedia,
1093
- _model3D,
1094
- },
1095
- fqdnTransformation: {
1096
- paths: [...['Array#files']],
1097
- transformation: _toVeloEntity,
1098
- },
1099
- customTransformation: responseTransformation,
1100
- });
1101
- const payload = toAmbassadorRequest([options]);
1102
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.searchFiles(payload);
1103
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1104
- try {
1105
- const result = yield httpClient.request(reqOpts);
1106
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1107
- return fromJSON(result.data);
1108
- }
1109
- catch (err) {
1110
- const transformedError = (0, transform_error_1.transformError)(err, {
1111
- spreadPathsToArguments: {},
1112
- explicitPathsToArguments: {
1113
- search: '$[0].search',
1114
- rootFolder: '$[0].rootFolder',
1115
- mediaTypes: '$[0].mediaTypes',
1116
- private: '$[0].private',
1117
- sort: '$[0].sort',
1118
- paging: '$[0].paging',
1119
- },
1120
- singleArgumentUnchanged: false,
1121
- }, ['options']);
1122
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1123
- throw transformedError;
1124
- }
1125
- });
1126
- }
1127
- exports.searchFiles = searchFiles;
1128
- /**
1129
- * Generates a URL for streaming a specific video file in the Media Manager.
1130
- *
1131
- *
1132
- * The `generateVideoStreamingUrl()` function returns a Promise that resolves to a download URL and its asset key.
1133
- *
1134
- * 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.
1135
- * @param fileId - File ID.
1136
- * @public
1137
- * @requiredField fileId
1138
- * @param options - Options to use when generating a video file's streaming URL.
1139
- * @permissionScope Manage Bookings Services and Settings
1140
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1141
- * @permissionScope Read Media Manager
1142
- * @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
1143
- * @permissionScope Manage Media Manager
1144
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
1145
- * @applicableIdentity APP
1146
- */
1147
- function generateVideoStreamingUrl(fileId, options) {
1148
- var _a, _b, _c;
1149
- return __awaiter(this, arguments, void 0, function* () {
1150
- const requestTransformation = { fileId: '$[0]', format: '$[1].format' };
1151
- const responseTransformation = '$';
1152
- // @ts-ignore
1153
- const { httpClient, sideEffects } = arguments[2];
1154
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1155
- rootSchema: _generateVideoStreamingUrlRequest,
1156
- depSchemas: {},
1157
- fqdnTransformation: {
1158
- paths: [],
1159
- transformation: _fromVeloEntity,
1160
- },
1161
- customTransformation: requestTransformation,
1162
- });
1163
- const { fromJSON } = (0, velo_1.serializer)({
1164
- rootSchema: _generateVideoStreamingUrlResponse,
1165
- depSchemas: {},
1166
- fqdnTransformation: {
1167
- paths: [],
1168
- transformation: _toVeloEntity,
1169
- },
1170
- customTransformation: responseTransformation,
1171
- });
1172
- const payload = toAmbassadorRequest([fileId, options]);
1173
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateVideoStreamingUrl(payload);
1174
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1175
- try {
1176
- const result = yield httpClient.request(reqOpts);
1177
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1178
- return fromJSON(result.data);
1179
- }
1180
- catch (err) {
1181
- const transformedError = (0, transform_error_1.transformError)(err, {
1182
- spreadPathsToArguments: {},
1183
- explicitPathsToArguments: { fileId: '$[0]', format: '$[1].format' },
1184
- singleArgumentUnchanged: false,
1185
- }, ['fileId', 'options']);
1186
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1187
- throw transformedError;
1188
- }
1189
- });
1190
- }
1191
- exports.generateVideoStreamingUrl = generateVideoStreamingUrl;
1192
- /**
1193
- * Deletes the specified files from the Media Manager.
1194
- *
1195
- *
1196
- * The `bulkDeleteFiles()` function returns a Promise that resolves when the files are deleted.
1197
- *
1198
- * 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.
1199
- *
1200
- * >**Notes:**
1201
- * > - The specified files can be from different folders.
1202
- * > - Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
1203
- * > - Attempting to delete files that are already in the trash bin doesn't result in an error.
1204
- * > - If your site contains deleted media files, the deleted media files still appear on your site as the files are still in the Media Manager (in the trash bin).
1205
- * > - You can use `bulkRestoreFilesFromTrashBin()` to restore files from the Media Manager's trash bin.
1206
- * @param fileIds - IDs of the files to move to the Media Manager's trash bin.
1207
- * @public
1208
- * @requiredField fileIds
1209
- * @param options - Options to use when deleting files.
1210
- * @permissionScope Manage Bookings Services and Settings
1211
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1212
- * @permissionScope Manage Media Manager
1213
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
1214
- * @applicableIdentity APP
1215
- */
1216
- function bulkDeleteFiles(fileIds, options) {
1217
- var _a, _b, _c;
1218
- return __awaiter(this, arguments, void 0, function* () {
1219
- const requestTransformation = {
1220
- fileIds: '$[0]',
1221
- permanent: '$[1].permanent',
1222
- };
1223
- const responseTransformation = '$';
1224
- // @ts-ignore
1225
- const { httpClient, sideEffects } = arguments[2];
1226
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1227
- rootSchema: _bulkDeleteFilesRequest,
1228
- depSchemas: {},
1229
- fqdnTransformation: {
1230
- paths: [],
1231
- transformation: _fromVeloEntity,
1232
- },
1233
- customTransformation: requestTransformation,
1234
- });
1235
- const { fromJSON } = (0, velo_1.serializer)({
1236
- rootSchema: _bulkDeleteFilesResponse,
1237
- depSchemas: {},
1238
- fqdnTransformation: {
1239
- paths: [],
1240
- transformation: _toVeloEntity,
1241
- },
1242
- customTransformation: responseTransformation,
1243
- });
1244
- const payload = toAmbassadorRequest([fileIds, options]);
1245
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkDeleteFiles(payload);
1246
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1247
- try {
1248
- const result = yield httpClient.request(reqOpts);
1249
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1250
- }
1251
- catch (err) {
1252
- const transformedError = (0, transform_error_1.transformError)(err, {
1253
- spreadPathsToArguments: {},
1254
- explicitPathsToArguments: {
1255
- fileIds: '$[0]',
1256
- permanent: '$[1].permanent',
1257
- },
1258
- singleArgumentUnchanged: false,
1259
- }, ['fileIds', 'options']);
1260
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1261
- throw transformedError;
1262
- }
1263
- });
1264
- }
1265
- exports.bulkDeleteFiles = bulkDeleteFiles;
1266
- /**
1267
- * Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
1268
- *
1269
- * The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
1270
- * @param fileIds - IDs of the files to restore from the Media Manager's trash bin.
1271
- * @public
1272
- * @requiredField fileIds
1273
- * @permissionScope Manage Bookings Services and Settings
1274
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1275
- * @permissionScope Manage Media Manager
1276
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
1277
- * @applicableIdentity APP
1278
- */
1279
- function bulkRestoreFilesFromTrashBin(fileIds) {
1280
- var _a, _b, _c;
1281
- return __awaiter(this, arguments, void 0, function* () {
1282
- const requestTransformation = { fileIds: '$[0]' };
1283
- const responseTransformation = '$';
1284
- // @ts-ignore
1285
- const { httpClient, sideEffects } = arguments[1];
1286
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1287
- rootSchema: _bulkRestoreFilesFromTrashBinRequest,
1288
- depSchemas: {},
1289
- fqdnTransformation: {
1290
- paths: [],
1291
- transformation: _fromVeloEntity,
1292
- },
1293
- customTransformation: requestTransformation,
1294
- });
1295
- const { fromJSON } = (0, velo_1.serializer)({
1296
- rootSchema: _bulkRestoreFilesFromTrashBinResponse,
1297
- depSchemas: {},
1298
- fqdnTransformation: {
1299
- paths: [],
1300
- transformation: _toVeloEntity,
1301
- },
1302
- customTransformation: responseTransformation,
1303
- });
1304
- const payload = toAmbassadorRequest([fileIds]);
1305
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkRestoreFilesFromTrashBin(payload);
1306
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1307
- try {
1308
- const result = yield httpClient.request(reqOpts);
1309
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1310
- }
1311
- catch (err) {
1312
- const transformedError = (0, transform_error_1.transformError)(err, {
1313
- spreadPathsToArguments: {},
1314
- explicitPathsToArguments: { fileIds: '$[0]' },
1315
- singleArgumentUnchanged: false,
1316
- }, ['fileIds']);
1317
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1318
- throw transformedError;
1319
- }
1320
- });
1321
- }
1322
- exports.bulkRestoreFilesFromTrashBin = bulkRestoreFilesFromTrashBin;
1323
- /**
1324
- * Retrieves a list of files in the Media Manager's trash bin.
1325
- *
1326
- * The `listDeletedFiles()` function returns a Promise that resolves to an array of the specified deleted files' descriptors and cursor information.
1327
- *
1328
- * >**Note:** The Media Manager's trash bin (`TRASH_ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
1329
- *
1330
- * To retrieve a list of non-deleted files, use the `listFiles()` function.
1331
- * @public
1332
- * @param options - Options to use when listing deleted files from the trash bin.
1333
- * @permissionScope Manage Bookings Services and Settings
1334
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
1335
- * @permissionScope Read Media Manager
1336
- * @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
1337
- * @permissionScope Manage Media Manager
1338
- * @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
1339
- * @applicableIdentity APP
1340
- */
1341
- function listDeletedFiles(options) {
1342
- var _a, _b, _c;
1343
- return __awaiter(this, arguments, void 0, function* () {
1344
- const requestTransformation = {
1345
- parentFolderId: '$[0].parentFolderId',
1346
- mediaTypes: '$[0].mediaTypes',
1347
- private: '$[0].private',
1348
- sort: '$[0].sort',
1349
- paging: '$[0].paging',
1350
- };
1351
- const responseTransformation = '$';
1352
- // @ts-ignore
1353
- const { httpClient, sideEffects } = arguments[1];
1354
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1355
- rootSchema: _listDeletedFilesRequest,
1356
- depSchemas: {},
1357
- fqdnTransformation: {
1358
- paths: [],
1359
- transformation: _fromVeloEntity,
1360
- },
1361
- customTransformation: requestTransformation,
1362
- });
1363
- const { fromJSON } = (0, velo_1.serializer)({
1364
- rootSchema: _listDeletedFilesResponse,
1365
- depSchemas: {
1366
- _audioV2,
1367
- _fileDescriptor,
1368
- _fileMedia,
1369
- _imageMedia,
1370
- _model3D,
1371
- },
1372
- fqdnTransformation: {
1373
- paths: [...['Array#files']],
1374
- transformation: _toVeloEntity,
1375
- },
1376
- customTransformation: responseTransformation,
1377
- });
1378
- const payload = toAmbassadorRequest([options]);
1379
- const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.listDeletedFiles(payload);
1380
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1381
- try {
1382
- const result = yield httpClient.request(reqOpts);
1383
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1384
- return fromJSON(result.data);
1385
- }
1386
- catch (err) {
1387
- const transformedError = (0, transform_error_1.transformError)(err, {
1388
- spreadPathsToArguments: {},
1389
- explicitPathsToArguments: {
1390
- parentFolderId: '$[0].parentFolderId',
1391
- mediaTypes: '$[0].mediaTypes',
1392
- private: '$[0].private',
1393
- sort: '$[0].sort',
1394
- paging: '$[0].paging',
1395
- },
1396
- singleArgumentUnchanged: false,
1397
- }, ['options']);
1398
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1399
- throw transformedError;
1400
- }
1401
- });
1402
- }
1403
- exports.listDeletedFiles = listDeletedFiles;
1404
- //# sourceMappingURL=media-site-media-v1-file-descriptor.universal.js.map