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