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