@wix/auto_sdk_media_files 1.0.18 → 1.0.20

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 (121) hide show
  1. package/build/cjs/index.d.ts +315 -1
  2. package/build/cjs/index.js +2264 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +2266 -1
  5. package/build/cjs/index.typings.js +1935 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1053 -1
  8. package/build/cjs/meta.js +1326 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/{internal/cjs/src/media-site-media-v1-file-descriptor-files.public.d.ts → es/index.d.mts} +93 -36
  11. package/build/es/index.mjs +2212 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/media-site-media-v1-file-descriptor-files.universal.d.ts → es/index.typings.d.mts} +227 -487
  14. package/build/es/index.typings.mjs +1887 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/{internal/es/src/media-site-media-v1-file-descriptor-files.types.d.ts → es/meta.d.mts} +106 -585
  17. package/build/es/meta.mjs +1287 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +315 -1
  20. package/build/internal/cjs/index.js +2264 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +2266 -1
  23. package/build/internal/cjs/index.typings.js +1935 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +1053 -1
  26. package/build/internal/cjs/meta.js +1326 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/{cjs/src/media-site-media-v1-file-descriptor-files.public.d.ts → internal/es/index.d.mts} +93 -36
  29. package/build/internal/es/index.mjs +2212 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/media-site-media-v1-file-descriptor-files.universal.d.ts → index.typings.d.mts} +227 -487
  32. package/build/internal/es/index.typings.mjs +1887 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/{es/src/media-site-media-v1-file-descriptor-files.types.d.ts → internal/es/meta.d.mts} +106 -585
  35. package/build/internal/es/meta.mjs +1287 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +10 -9
  38. package/build/cjs/src/media-site-media-v1-file-descriptor-files.context.d.ts +0 -45
  39. package/build/cjs/src/media-site-media-v1-file-descriptor-files.context.js +0 -60
  40. package/build/cjs/src/media-site-media-v1-file-descriptor-files.context.js.map +0 -1
  41. package/build/cjs/src/media-site-media-v1-file-descriptor-files.http.d.ts +0 -148
  42. package/build/cjs/src/media-site-media-v1-file-descriptor-files.http.js +0 -1118
  43. package/build/cjs/src/media-site-media-v1-file-descriptor-files.http.js.map +0 -1
  44. package/build/cjs/src/media-site-media-v1-file-descriptor-files.meta.d.ts +0 -28
  45. package/build/cjs/src/media-site-media-v1-file-descriptor-files.meta.js +0 -332
  46. package/build/cjs/src/media-site-media-v1-file-descriptor-files.meta.js.map +0 -1
  47. package/build/cjs/src/media-site-media-v1-file-descriptor-files.public.js +0 -265
  48. package/build/cjs/src/media-site-media-v1-file-descriptor-files.public.js.map +0 -1
  49. package/build/cjs/src/media-site-media-v1-file-descriptor-files.types.d.ts +0 -1532
  50. package/build/cjs/src/media-site-media-v1-file-descriptor-files.types.js +0 -119
  51. package/build/cjs/src/media-site-media-v1-file-descriptor-files.types.js.map +0 -1
  52. package/build/cjs/src/media-site-media-v1-file-descriptor-files.universal.d.ts +0 -2526
  53. package/build/cjs/src/media-site-media-v1-file-descriptor-files.universal.js +0 -1483
  54. package/build/cjs/src/media-site-media-v1-file-descriptor-files.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/src/media-site-media-v1-file-descriptor-files.context.d.ts +0 -45
  65. package/build/es/src/media-site-media-v1-file-descriptor-files.context.js +0 -45
  66. package/build/es/src/media-site-media-v1-file-descriptor-files.context.js.map +0 -1
  67. package/build/es/src/media-site-media-v1-file-descriptor-files.http.d.ts +0 -148
  68. package/build/es/src/media-site-media-v1-file-descriptor-files.http.js +0 -1099
  69. package/build/es/src/media-site-media-v1-file-descriptor-files.http.js.map +0 -1
  70. package/build/es/src/media-site-media-v1-file-descriptor-files.meta.d.ts +0 -28
  71. package/build/es/src/media-site-media-v1-file-descriptor-files.meta.js +0 -290
  72. package/build/es/src/media-site-media-v1-file-descriptor-files.meta.js.map +0 -1
  73. package/build/es/src/media-site-media-v1-file-descriptor-files.public.d.ts +0 -258
  74. package/build/es/src/media-site-media-v1-file-descriptor-files.public.js +0 -234
  75. package/build/es/src/media-site-media-v1-file-descriptor-files.public.js.map +0 -1
  76. package/build/es/src/media-site-media-v1-file-descriptor-files.types.js +0 -116
  77. package/build/es/src/media-site-media-v1-file-descriptor-files.types.js.map +0 -1
  78. package/build/es/src/media-site-media-v1-file-descriptor-files.universal.d.ts +0 -2526
  79. package/build/es/src/media-site-media-v1-file-descriptor-files.universal.js +0 -1441
  80. package/build/es/src/media-site-media-v1-file-descriptor-files.universal.js.map +0 -1
  81. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.context.d.ts +0 -45
  82. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.context.js +0 -60
  83. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.context.js.map +0 -1
  84. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.http.d.ts +0 -148
  85. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.http.js +0 -1118
  86. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.http.js.map +0 -1
  87. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.meta.d.ts +0 -28
  88. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.meta.js +0 -332
  89. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.meta.js.map +0 -1
  90. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.public.js +0 -265
  91. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.public.js.map +0 -1
  92. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.types.d.ts +0 -1532
  93. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.types.js +0 -119
  94. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.types.js.map +0 -1
  95. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.universal.js +0 -1483
  96. package/build/internal/cjs/src/media-site-media-v1-file-descriptor-files.universal.js.map +0 -1
  97. package/build/internal/es/index.d.ts +0 -1
  98. package/build/internal/es/index.js +0 -2
  99. package/build/internal/es/index.js.map +0 -1
  100. package/build/internal/es/index.typings.d.ts +0 -1
  101. package/build/internal/es/index.typings.js +0 -2
  102. package/build/internal/es/index.typings.js.map +0 -1
  103. package/build/internal/es/meta.d.ts +0 -1
  104. package/build/internal/es/meta.js +0 -2
  105. package/build/internal/es/meta.js.map +0 -1
  106. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.context.d.ts +0 -45
  107. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.context.js +0 -45
  108. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.context.js.map +0 -1
  109. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.http.d.ts +0 -148
  110. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.http.js +0 -1099
  111. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.http.js.map +0 -1
  112. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.meta.d.ts +0 -28
  113. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.meta.js +0 -290
  114. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.meta.js.map +0 -1
  115. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.public.d.ts +0 -258
  116. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.public.js +0 -234
  117. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.public.js.map +0 -1
  118. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.types.js +0 -116
  119. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.types.js.map +0 -1
  120. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.universal.js +0 -1441
  121. package/build/internal/es/src/media-site-media-v1-file-descriptor-files.universal.js.map +0 -1
@@ -1,1099 +0,0 @@
1
- import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';
2
- import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';
3
- import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';
4
- import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
5
- import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
6
- import { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';
7
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
8
- import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
9
- function resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
10
- const domainToMappings = {
11
- 'apps._base_domain_': [
12
- {
13
- srcPath: '/_api/wix-privatemedia-proxy-server',
14
- destPath: '/api',
15
- },
16
- {
17
- srcPath: '/_api/wix-privatemedia-proxy-server/v1',
18
- destPath: '/v1',
19
- },
20
- ],
21
- 'manage._base_domain_': [
22
- {
23
- srcPath: '/_api/wix-privatemedia-proxy-server',
24
- destPath: '',
25
- },
26
- ],
27
- 'www.wixapis.com': [
28
- {
29
- srcPath: '/site-media/v1',
30
- destPath: '/v1',
31
- },
32
- ],
33
- '*.dev.wix-code.com': [
34
- {
35
- srcPath: '/_api/wix-privatemedia-proxy-server',
36
- destPath: '',
37
- },
38
- ],
39
- 'api._api_base_domain_': [
40
- {
41
- srcPath: '/wix-privatemedia-proxy-server',
42
- destPath: '',
43
- },
44
- ],
45
- 'bo._base_domain_': [
46
- {
47
- srcPath: '/wix-privatemedia-proxy-server',
48
- destPath: '',
49
- },
50
- ],
51
- 'wixbo.ai': [
52
- {
53
- srcPath: '/wix-privatemedia-proxy-server',
54
- destPath: '',
55
- },
56
- ],
57
- 'wix-bo.com': [
58
- {
59
- srcPath: '/wix-privatemedia-proxy-server',
60
- destPath: '',
61
- },
62
- ],
63
- _: [
64
- {
65
- srcPath: '/wix-privatemedia-proxy-server',
66
- destPath: '',
67
- },
68
- ],
69
- 'editor._base_domain_': [
70
- {
71
- srcPath: '/_api/wix-privatemedia-proxy-server',
72
- destPath: '',
73
- },
74
- ],
75
- 'blocks._base_domain_': [
76
- {
77
- srcPath: '/_api/wix-privatemedia-proxy-server',
78
- destPath: '',
79
- },
80
- ],
81
- 'create.editorx': [
82
- {
83
- srcPath: '/_api/wix-privatemedia-proxy-server',
84
- destPath: '',
85
- },
86
- ],
87
- 'platform.rise.ai': [
88
- {
89
- srcPath: '/_api/wix-privatemedia-proxy-server',
90
- destPath: '',
91
- },
92
- ],
93
- };
94
- return resolveUrl(Object.assign(opts, { domainToMappings }));
95
- }
96
- const PACKAGE_NAME = '@wix/auto_sdk_media_files';
97
- /**
98
- * Generates a URL for downloading a compressed file containing specific files in the Media Manager.
99
- *
100
- * The compressed file can contain up to 1000 files.
101
- *
102
- * To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint.
103
- * Since this is a permanent URL, it is less secure.
104
- * Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
105
- */
106
- export function generateFilesDownloadUrl(payload) {
107
- function __generateFilesDownloadUrl({ host }) {
108
- const metadata = {
109
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
110
- method: 'POST',
111
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFilesDownloadUrl',
112
- packageName: PACKAGE_NAME,
113
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
114
- protoPath: '/v1/files/generate-download-url',
115
- data: payload,
116
- host,
117
- }),
118
- data: payload,
119
- };
120
- return metadata;
121
- }
122
- return __generateFilesDownloadUrl;
123
- }
124
- /**
125
- * Generates one or more temporary URLs for downloading a specific file in the Media Manager.
126
- *
127
- * To download different assets of the file, specify the `assetKeys` parameter which generates a download URL for each asset.
128
- * If no `assetKey` is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
129
- *
130
- * Call this endpoint to grant external clients access to a private media file. Specify the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect url when the URL expires.
131
- *
132
- * To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint.
133
- * Since this is a permanent URL, it is less secure.
134
- * Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
135
- */
136
- export function generateFileDownloadUrl(payload) {
137
- function __generateFileDownloadUrl({ host }) {
138
- const metadata = {
139
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
140
- method: 'POST',
141
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileDownloadUrl',
142
- packageName: PACKAGE_NAME,
143
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
144
- protoPath: '/v1/files/generate-file-download-url',
145
- data: payload,
146
- host,
147
- }),
148
- data: payload,
149
- };
150
- return metadata;
151
- }
152
- return __generateFileDownloadUrl;
153
- }
154
- /** Gets information about a specific file in the Media Manager. */
155
- export function getFileDescriptor(payload) {
156
- function __getFileDescriptor({ host }) {
157
- const metadata = {
158
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
159
- method: 'GET',
160
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptor',
161
- packageName: PACKAGE_NAME,
162
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
163
- protoPath: '/v1/files/get-file-by-id',
164
- data: payload,
165
- host,
166
- }),
167
- params: toURLSearchParams(payload),
168
- transformResponse: (payload) => transformPaths(payload, [
169
- {
170
- transformFn: transformRESTTimestampToSDKTimestamp,
171
- paths: [
172
- { path: 'file.createdDate' },
173
- { path: 'file.updatedDate' },
174
- { path: 'file.lastUsedDate' },
175
- { path: 'file.media.image.image.urlExpirationDate' },
176
- { path: 'file.media.image.previewImage.urlExpirationDate' },
177
- { path: 'file.media.video.urlExpirationDate' },
178
- { path: 'file.media.video.resolutions.urlExpirationDate' },
179
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
180
- { path: 'file.media.video.posters.urlExpirationDate' },
181
- { path: 'file.media.audio.assets.urlExpirationDate' },
182
- { path: 'file.media.document.urlExpirationDate' },
183
- { path: 'file.media.document.thumbnail.urlExpirationDate' },
184
- { path: 'file.media.vector.image.urlExpirationDate' },
185
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
186
- { path: 'file.media.archive.urlExpirationDate' },
187
- { path: 'file.media.model3d.urlExpirationDate' },
188
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
189
- { path: 'file.media.icon.image.urlExpirationDate' },
190
- { path: 'file.media.icon.previewImage.urlExpirationDate' },
191
- ],
192
- },
193
- {
194
- transformFn: transformRESTFloatToSDKFloat,
195
- paths: [
196
- { path: 'file.media.image.image.focalPoint.x' },
197
- { path: 'file.media.image.image.focalPoint.y' },
198
- { path: 'file.media.image.faces.confidence' },
199
- { path: 'file.media.image.previewImage.focalPoint.x' },
200
- { path: 'file.media.image.previewImage.focalPoint.y' },
201
- { path: 'file.media.video.resolutions.poster.focalPoint.x' },
202
- { path: 'file.media.video.resolutions.poster.focalPoint.y' },
203
- { path: 'file.media.video.posters.focalPoint.x' },
204
- { path: 'file.media.video.posters.focalPoint.y' },
205
- { path: 'file.media.document.thumbnail.focalPoint.x' },
206
- { path: 'file.media.document.thumbnail.focalPoint.y' },
207
- { path: 'file.media.vector.image.focalPoint.x' },
208
- { path: 'file.media.vector.image.focalPoint.y' },
209
- { path: 'file.media.vector.faces.confidence' },
210
- { path: 'file.media.vector.previewImage.focalPoint.x' },
211
- { path: 'file.media.vector.previewImage.focalPoint.y' },
212
- { path: 'file.media.model3d.thumbnail.focalPoint.x' },
213
- { path: 'file.media.model3d.thumbnail.focalPoint.y' },
214
- { path: 'file.media.icon.image.focalPoint.x' },
215
- { path: 'file.media.icon.image.focalPoint.y' },
216
- { path: 'file.media.icon.faces.confidence' },
217
- { path: 'file.media.icon.previewImage.focalPoint.x' },
218
- { path: 'file.media.icon.previewImage.focalPoint.y' },
219
- ],
220
- },
221
- ]),
222
- fallback: [
223
- {
224
- method: 'GET',
225
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
226
- protoPath: '/v1/files/get-file-by-id',
227
- data: payload,
228
- host,
229
- }),
230
- params: toURLSearchParams(payload),
231
- },
232
- ],
233
- };
234
- return metadata;
235
- }
236
- return __getFileDescriptor;
237
- }
238
- /** Gets information about specific files in the Media Manager. */
239
- export function getFileDescriptors(payload) {
240
- function __getFileDescriptors({ host }) {
241
- const metadata = {
242
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
243
- method: 'POST',
244
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptors',
245
- packageName: PACKAGE_NAME,
246
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
247
- protoPath: '/v1/files/get-files',
248
- data: payload,
249
- host,
250
- }),
251
- data: payload,
252
- transformResponse: (payload) => transformPaths(payload, [
253
- {
254
- transformFn: transformRESTTimestampToSDKTimestamp,
255
- paths: [
256
- { path: 'files.createdDate' },
257
- { path: 'files.updatedDate' },
258
- { path: 'files.lastUsedDate' },
259
- { path: 'files.media.image.image.urlExpirationDate' },
260
- { path: 'files.media.image.previewImage.urlExpirationDate' },
261
- { path: 'files.media.video.urlExpirationDate' },
262
- { path: 'files.media.video.resolutions.urlExpirationDate' },
263
- {
264
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
265
- },
266
- { path: 'files.media.video.posters.urlExpirationDate' },
267
- { path: 'files.media.audio.assets.urlExpirationDate' },
268
- { path: 'files.media.document.urlExpirationDate' },
269
- { path: 'files.media.document.thumbnail.urlExpirationDate' },
270
- { path: 'files.media.vector.image.urlExpirationDate' },
271
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
272
- { path: 'files.media.archive.urlExpirationDate' },
273
- { path: 'files.media.model3d.urlExpirationDate' },
274
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
275
- { path: 'files.media.icon.image.urlExpirationDate' },
276
- { path: 'files.media.icon.previewImage.urlExpirationDate' },
277
- ],
278
- },
279
- {
280
- transformFn: transformRESTFloatToSDKFloat,
281
- paths: [
282
- { path: 'files.media.image.image.focalPoint.x' },
283
- { path: 'files.media.image.image.focalPoint.y' },
284
- { path: 'files.media.image.faces.confidence' },
285
- { path: 'files.media.image.previewImage.focalPoint.x' },
286
- { path: 'files.media.image.previewImage.focalPoint.y' },
287
- { path: 'files.media.video.resolutions.poster.focalPoint.x' },
288
- { path: 'files.media.video.resolutions.poster.focalPoint.y' },
289
- { path: 'files.media.video.posters.focalPoint.x' },
290
- { path: 'files.media.video.posters.focalPoint.y' },
291
- { path: 'files.media.document.thumbnail.focalPoint.x' },
292
- { path: 'files.media.document.thumbnail.focalPoint.y' },
293
- { path: 'files.media.vector.image.focalPoint.x' },
294
- { path: 'files.media.vector.image.focalPoint.y' },
295
- { path: 'files.media.vector.faces.confidence' },
296
- { path: 'files.media.vector.previewImage.focalPoint.x' },
297
- { path: 'files.media.vector.previewImage.focalPoint.y' },
298
- { path: 'files.media.model3d.thumbnail.focalPoint.x' },
299
- { path: 'files.media.model3d.thumbnail.focalPoint.y' },
300
- { path: 'files.media.icon.image.focalPoint.x' },
301
- { path: 'files.media.icon.image.focalPoint.y' },
302
- { path: 'files.media.icon.faces.confidence' },
303
- { path: 'files.media.icon.previewImage.focalPoint.x' },
304
- { path: 'files.media.icon.previewImage.focalPoint.y' },
305
- ],
306
- },
307
- ]),
308
- };
309
- return metadata;
310
- }
311
- return __getFileDescriptors;
312
- }
313
- /**
314
- * Updates a file. <br />
315
- *
316
- * Specify the `parentFolderId` parameter to move a file from its current folder to a different folder.
317
- */
318
- export function updateFileDescriptor(payload) {
319
- function __updateFileDescriptor({ host }) {
320
- const serializedData = transformPaths(payload, [
321
- {
322
- transformFn: transformSDKFieldMaskToRESTFieldMask,
323
- paths: [{ path: 'fieldMask' }],
324
- },
325
- {
326
- transformFn: transformSDKTimestampToRESTTimestamp,
327
- paths: [
328
- { path: 'file.createdDate' },
329
- { path: 'file.updatedDate' },
330
- { path: 'file.lastUsedDate' },
331
- { path: 'file.media.image.image.urlExpirationDate' },
332
- { path: 'file.media.image.previewImage.urlExpirationDate' },
333
- { path: 'file.media.video.urlExpirationDate' },
334
- { path: 'file.media.video.resolutions.urlExpirationDate' },
335
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
336
- { path: 'file.media.video.posters.urlExpirationDate' },
337
- { path: 'file.media.audio.assets.urlExpirationDate' },
338
- { path: 'file.media.document.urlExpirationDate' },
339
- { path: 'file.media.document.thumbnail.urlExpirationDate' },
340
- { path: 'file.media.vector.image.urlExpirationDate' },
341
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
342
- { path: 'file.media.archive.urlExpirationDate' },
343
- { path: 'file.media.model3d.urlExpirationDate' },
344
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
345
- { path: 'file.media.icon.image.urlExpirationDate' },
346
- { path: 'file.media.icon.previewImage.urlExpirationDate' },
347
- ],
348
- },
349
- {
350
- transformFn: transformSDKFloatToRESTFloat,
351
- paths: [
352
- { path: 'file.media.image.image.focalPoint.x' },
353
- { path: 'file.media.image.image.focalPoint.y' },
354
- { path: 'file.media.image.faces.confidence' },
355
- { path: 'file.media.image.previewImage.focalPoint.x' },
356
- { path: 'file.media.image.previewImage.focalPoint.y' },
357
- { path: 'file.media.video.resolutions.poster.focalPoint.x' },
358
- { path: 'file.media.video.resolutions.poster.focalPoint.y' },
359
- { path: 'file.media.video.posters.focalPoint.x' },
360
- { path: 'file.media.video.posters.focalPoint.y' },
361
- { path: 'file.media.document.thumbnail.focalPoint.x' },
362
- { path: 'file.media.document.thumbnail.focalPoint.y' },
363
- { path: 'file.media.vector.image.focalPoint.x' },
364
- { path: 'file.media.vector.image.focalPoint.y' },
365
- { path: 'file.media.vector.faces.confidence' },
366
- { path: 'file.media.vector.previewImage.focalPoint.x' },
367
- { path: 'file.media.vector.previewImage.focalPoint.y' },
368
- { path: 'file.media.model3d.thumbnail.focalPoint.x' },
369
- { path: 'file.media.model3d.thumbnail.focalPoint.y' },
370
- { path: 'file.media.icon.image.focalPoint.x' },
371
- { path: 'file.media.icon.image.focalPoint.y' },
372
- { path: 'file.media.icon.faces.confidence' },
373
- { path: 'file.media.icon.previewImage.focalPoint.x' },
374
- { path: 'file.media.icon.previewImage.focalPoint.y' },
375
- ],
376
- },
377
- ]);
378
- const metadata = {
379
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
380
- method: 'PATCH',
381
- methodFqn: 'com.wix.media.site_media.v1.FilesService.UpdateFileDescriptor',
382
- packageName: PACKAGE_NAME,
383
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
384
- protoPath: '/v1/files/update-file-descriptor',
385
- data: serializedData,
386
- host,
387
- }),
388
- data: serializedData,
389
- transformResponse: (payload) => transformPaths(payload, [
390
- {
391
- transformFn: transformRESTTimestampToSDKTimestamp,
392
- paths: [
393
- { path: 'file.createdDate' },
394
- { path: 'file.updatedDate' },
395
- { path: 'file.lastUsedDate' },
396
- { path: 'file.media.image.image.urlExpirationDate' },
397
- { path: 'file.media.image.previewImage.urlExpirationDate' },
398
- { path: 'file.media.video.urlExpirationDate' },
399
- { path: 'file.media.video.resolutions.urlExpirationDate' },
400
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
401
- { path: 'file.media.video.posters.urlExpirationDate' },
402
- { path: 'file.media.audio.assets.urlExpirationDate' },
403
- { path: 'file.media.document.urlExpirationDate' },
404
- { path: 'file.media.document.thumbnail.urlExpirationDate' },
405
- { path: 'file.media.vector.image.urlExpirationDate' },
406
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
407
- { path: 'file.media.archive.urlExpirationDate' },
408
- { path: 'file.media.model3d.urlExpirationDate' },
409
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
410
- { path: 'file.media.icon.image.urlExpirationDate' },
411
- { path: 'file.media.icon.previewImage.urlExpirationDate' },
412
- ],
413
- },
414
- {
415
- transformFn: transformRESTFloatToSDKFloat,
416
- paths: [
417
- { path: 'file.media.image.image.focalPoint.x' },
418
- { path: 'file.media.image.image.focalPoint.y' },
419
- { path: 'file.media.image.faces.confidence' },
420
- { path: 'file.media.image.previewImage.focalPoint.x' },
421
- { path: 'file.media.image.previewImage.focalPoint.y' },
422
- { path: 'file.media.video.resolutions.poster.focalPoint.x' },
423
- { path: 'file.media.video.resolutions.poster.focalPoint.y' },
424
- { path: 'file.media.video.posters.focalPoint.x' },
425
- { path: 'file.media.video.posters.focalPoint.y' },
426
- { path: 'file.media.document.thumbnail.focalPoint.x' },
427
- { path: 'file.media.document.thumbnail.focalPoint.y' },
428
- { path: 'file.media.vector.image.focalPoint.x' },
429
- { path: 'file.media.vector.image.focalPoint.y' },
430
- { path: 'file.media.vector.faces.confidence' },
431
- { path: 'file.media.vector.previewImage.focalPoint.x' },
432
- { path: 'file.media.vector.previewImage.focalPoint.y' },
433
- { path: 'file.media.model3d.thumbnail.focalPoint.x' },
434
- { path: 'file.media.model3d.thumbnail.focalPoint.y' },
435
- { path: 'file.media.icon.image.focalPoint.x' },
436
- { path: 'file.media.icon.image.focalPoint.y' },
437
- { path: 'file.media.icon.faces.confidence' },
438
- { path: 'file.media.icon.previewImage.focalPoint.x' },
439
- { path: 'file.media.icon.previewImage.focalPoint.y' },
440
- ],
441
- },
442
- ]),
443
- };
444
- return metadata;
445
- }
446
- return __updateFileDescriptor;
447
- }
448
- /**
449
- * Generates an upload URL to allow external clients to upload a file to the Media Manager. <br/>
450
- *
451
- * To learn how external clients can use the generated upload URL in the response to upload a file to the Media Manager, see Upload API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/upload-api) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/upload-api)).
452
- * > **Notes:**
453
- * > - When you upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
454
- * > - Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, call Generate File Resumable Upload URL 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.
455
- */
456
- export function generateFileUploadUrl(payload) {
457
- function __generateFileUploadUrl({ host }) {
458
- const metadata = {
459
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
460
- method: 'POST',
461
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileUploadUrl',
462
- packageName: PACKAGE_NAME,
463
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
464
- protoPath: '/v1/files/generate-upload-url',
465
- data: payload,
466
- host,
467
- }),
468
- data: payload,
469
- };
470
- return metadata;
471
- }
472
- return __generateFileUploadUrl;
473
- }
474
- /**
475
- * Generates a resumable upload URL to allow external clients to easily upload large files over 10MB to the Media Manager. <br/>
476
- *
477
- * With the resumable upload URL, any interruptions in the upload process pauses the file upload, and resumes the file upload process after the interruption. The resumable upload URL is also helpful when network connection is poor.
478
- * To learn how external clients can use the generated upload URL in the response to upload large files to the Media Manager, see Resumable Upload API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/resumable-upload-api) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/resumable-upload-api)).
479
- *
480
- * > **Note:** When you upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
481
- */
482
- export function generateFileResumableUploadUrl(payload) {
483
- function __generateFileResumableUploadUrl({ host }) {
484
- const metadata = {
485
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
486
- method: 'POST',
487
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileResumableUploadUrl',
488
- packageName: PACKAGE_NAME,
489
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
490
- protoPath: '/v1/files/generate-resumable-upload-url',
491
- data: payload,
492
- host,
493
- }),
494
- data: payload,
495
- };
496
- return metadata;
497
- }
498
- return __generateFileResumableUploadUrl;
499
- }
500
- /**
501
- * Imports a file to the Media Manager using an external url.
502
- *
503
- * Returns information about the imported file.
504
- * Specify the `parentFolderId` and `filePath` parameters to specify which folder you want the file to be imported to.
505
- * If no folder is specified, the file is imported to the `media-root` folder.
506
- *
507
- * >**Notes:**
508
- * > - The `media` property isn't returned in the `files` response object.
509
- * > - When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
510
- *
511
- * To import a file, you need to do one of the following:
512
- * - Specify 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'`.
513
- * - Specify 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`.
514
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
515
- * > **Note:** If you want to validate the media type, specify the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
516
- */
517
- export function importFile(payload) {
518
- function __importFile({ host }) {
519
- const metadata = {
520
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
521
- method: 'POST',
522
- methodFqn: 'com.wix.media.site_media.v1.FilesService.ImportFile',
523
- packageName: PACKAGE_NAME,
524
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
525
- protoPath: '/v1/files/import',
526
- data: payload,
527
- host,
528
- }),
529
- data: payload,
530
- transformResponse: (payload) => transformPaths(payload, [
531
- {
532
- transformFn: transformRESTTimestampToSDKTimestamp,
533
- paths: [
534
- { path: 'file.createdDate' },
535
- { path: 'file.updatedDate' },
536
- { path: 'file.lastUsedDate' },
537
- { path: 'file.media.image.image.urlExpirationDate' },
538
- { path: 'file.media.image.previewImage.urlExpirationDate' },
539
- { path: 'file.media.video.urlExpirationDate' },
540
- { path: 'file.media.video.resolutions.urlExpirationDate' },
541
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
542
- { path: 'file.media.video.posters.urlExpirationDate' },
543
- { path: 'file.media.audio.assets.urlExpirationDate' },
544
- { path: 'file.media.document.urlExpirationDate' },
545
- { path: 'file.media.document.thumbnail.urlExpirationDate' },
546
- { path: 'file.media.vector.image.urlExpirationDate' },
547
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
548
- { path: 'file.media.archive.urlExpirationDate' },
549
- { path: 'file.media.model3d.urlExpirationDate' },
550
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
551
- { path: 'file.media.icon.image.urlExpirationDate' },
552
- { path: 'file.media.icon.previewImage.urlExpirationDate' },
553
- ],
554
- },
555
- {
556
- transformFn: transformRESTFloatToSDKFloat,
557
- paths: [
558
- { path: 'file.media.image.image.focalPoint.x' },
559
- { path: 'file.media.image.image.focalPoint.y' },
560
- { path: 'file.media.image.faces.confidence' },
561
- { path: 'file.media.image.previewImage.focalPoint.x' },
562
- { path: 'file.media.image.previewImage.focalPoint.y' },
563
- { path: 'file.media.video.resolutions.poster.focalPoint.x' },
564
- { path: 'file.media.video.resolutions.poster.focalPoint.y' },
565
- { path: 'file.media.video.posters.focalPoint.x' },
566
- { path: 'file.media.video.posters.focalPoint.y' },
567
- { path: 'file.media.document.thumbnail.focalPoint.x' },
568
- { path: 'file.media.document.thumbnail.focalPoint.y' },
569
- { path: 'file.media.vector.image.focalPoint.x' },
570
- { path: 'file.media.vector.image.focalPoint.y' },
571
- { path: 'file.media.vector.faces.confidence' },
572
- { path: 'file.media.vector.previewImage.focalPoint.x' },
573
- { path: 'file.media.vector.previewImage.focalPoint.y' },
574
- { path: 'file.media.model3d.thumbnail.focalPoint.x' },
575
- { path: 'file.media.model3d.thumbnail.focalPoint.y' },
576
- { path: 'file.media.icon.image.focalPoint.x' },
577
- { path: 'file.media.icon.image.focalPoint.y' },
578
- { path: 'file.media.icon.faces.confidence' },
579
- { path: 'file.media.icon.previewImage.focalPoint.x' },
580
- { path: 'file.media.icon.previewImage.focalPoint.y' },
581
- ],
582
- },
583
- ]),
584
- };
585
- return metadata;
586
- }
587
- return __importFile;
588
- }
589
- /**
590
- * Imports a bulk of files to the Media Manager using external urls. <br/>
591
- *
592
- * Returns information about the imported files.
593
- *
594
- * Use the `parentFolderId` and `filePath` parameters to specify the folder you want each file to be imported to.
595
- * If no folder is specified, the file is imported to the `media-root` folder.
596
- *
597
- * >**Notes:**
598
- * > - The `media` property isn't returned in the `files` response object.
599
- * > - When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
600
- *
601
- * To import files, you need to do one of the following for each file:
602
- * - Specify 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'`.
603
- * - 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`.
604
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
605
- * > **Note:** If you want to validate the media type, specify the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
606
- * @deprecated It has been replaced with com.wix.media.site_media.v1.FilesService.BulkImportFile(), and will be removed on 2024-03-31.
607
- */
608
- export function bulkImportFiles(payload) {
609
- function __bulkImportFiles({ host }) {
610
- const metadata = {
611
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
612
- method: 'POST',
613
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFiles',
614
- packageName: PACKAGE_NAME,
615
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
616
- protoPath: '/v1/bulk/files/import',
617
- data: payload,
618
- host,
619
- }),
620
- data: payload,
621
- transformResponse: (payload) => transformPaths(payload, [
622
- {
623
- transformFn: transformRESTTimestampToSDKTimestamp,
624
- paths: [
625
- { path: 'files.createdDate' },
626
- { path: 'files.updatedDate' },
627
- { path: 'files.lastUsedDate' },
628
- { path: 'files.media.image.image.urlExpirationDate' },
629
- { path: 'files.media.image.previewImage.urlExpirationDate' },
630
- { path: 'files.media.video.urlExpirationDate' },
631
- { path: 'files.media.video.resolutions.urlExpirationDate' },
632
- {
633
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
634
- },
635
- { path: 'files.media.video.posters.urlExpirationDate' },
636
- { path: 'files.media.audio.assets.urlExpirationDate' },
637
- { path: 'files.media.document.urlExpirationDate' },
638
- { path: 'files.media.document.thumbnail.urlExpirationDate' },
639
- { path: 'files.media.vector.image.urlExpirationDate' },
640
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
641
- { path: 'files.media.archive.urlExpirationDate' },
642
- { path: 'files.media.model3d.urlExpirationDate' },
643
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
644
- { path: 'files.media.icon.image.urlExpirationDate' },
645
- { path: 'files.media.icon.previewImage.urlExpirationDate' },
646
- ],
647
- },
648
- {
649
- transformFn: transformRESTFloatToSDKFloat,
650
- paths: [
651
- { path: 'files.media.image.image.focalPoint.x' },
652
- { path: 'files.media.image.image.focalPoint.y' },
653
- { path: 'files.media.image.faces.confidence' },
654
- { path: 'files.media.image.previewImage.focalPoint.x' },
655
- { path: 'files.media.image.previewImage.focalPoint.y' },
656
- { path: 'files.media.video.resolutions.poster.focalPoint.x' },
657
- { path: 'files.media.video.resolutions.poster.focalPoint.y' },
658
- { path: 'files.media.video.posters.focalPoint.x' },
659
- { path: 'files.media.video.posters.focalPoint.y' },
660
- { path: 'files.media.document.thumbnail.focalPoint.x' },
661
- { path: 'files.media.document.thumbnail.focalPoint.y' },
662
- { path: 'files.media.vector.image.focalPoint.x' },
663
- { path: 'files.media.vector.image.focalPoint.y' },
664
- { path: 'files.media.vector.faces.confidence' },
665
- { path: 'files.media.vector.previewImage.focalPoint.x' },
666
- { path: 'files.media.vector.previewImage.focalPoint.y' },
667
- { path: 'files.media.model3d.thumbnail.focalPoint.x' },
668
- { path: 'files.media.model3d.thumbnail.focalPoint.y' },
669
- { path: 'files.media.icon.image.focalPoint.x' },
670
- { path: 'files.media.icon.image.focalPoint.y' },
671
- { path: 'files.media.icon.faces.confidence' },
672
- { path: 'files.media.icon.previewImage.focalPoint.x' },
673
- { path: 'files.media.icon.previewImage.focalPoint.y' },
674
- ],
675
- },
676
- ]),
677
- };
678
- return metadata;
679
- }
680
- return __bulkImportFiles;
681
- }
682
- /**
683
- * Imports a bulk of files to the Media Manager using external urls. <br/>
684
- *
685
- * Returns information about the imported files.
686
- *
687
- * Specify the `parentFolderId` and `filePath` parameters to specify the folder you want each file to be imported to.
688
- * If no folder is specified, the file is imported to the `media-root` folder.
689
- *
690
- * >**Notes:**
691
- * > - The `media` property isn't returned in the `files` response object.
692
- * > - When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
693
- *
694
- * To import files, you need to do one of the following for each file:
695
- * - Specify 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'`.
696
- * - 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`.
697
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
698
- * > **Note:** If you want to validate the media type, specify the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
699
- */
700
- export function bulkImportFile(payload) {
701
- function __bulkImportFile({ host }) {
702
- const metadata = {
703
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
704
- method: 'POST',
705
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFile',
706
- packageName: PACKAGE_NAME,
707
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
708
- protoPath: '/v1/bulk/files/import-v2',
709
- data: payload,
710
- host,
711
- }),
712
- data: payload,
713
- transformResponse: (payload) => transformPaths(payload, [
714
- {
715
- transformFn: transformRESTTimestampToSDKTimestamp,
716
- paths: [
717
- { path: 'results.item.createdDate' },
718
- { path: 'results.item.updatedDate' },
719
- { path: 'results.item.lastUsedDate' },
720
- { path: 'results.item.media.image.image.urlExpirationDate' },
721
- {
722
- path: 'results.item.media.image.previewImage.urlExpirationDate',
723
- },
724
- { path: 'results.item.media.video.urlExpirationDate' },
725
- {
726
- path: 'results.item.media.video.resolutions.urlExpirationDate',
727
- },
728
- {
729
- path: 'results.item.media.video.resolutions.poster.urlExpirationDate',
730
- },
731
- { path: 'results.item.media.video.posters.urlExpirationDate' },
732
- { path: 'results.item.media.audio.assets.urlExpirationDate' },
733
- { path: 'results.item.media.document.urlExpirationDate' },
734
- {
735
- path: 'results.item.media.document.thumbnail.urlExpirationDate',
736
- },
737
- { path: 'results.item.media.vector.image.urlExpirationDate' },
738
- {
739
- path: 'results.item.media.vector.previewImage.urlExpirationDate',
740
- },
741
- { path: 'results.item.media.archive.urlExpirationDate' },
742
- { path: 'results.item.media.model3d.urlExpirationDate' },
743
- {
744
- path: 'results.item.media.model3d.thumbnail.urlExpirationDate',
745
- },
746
- { path: 'results.item.media.icon.image.urlExpirationDate' },
747
- {
748
- path: 'results.item.media.icon.previewImage.urlExpirationDate',
749
- },
750
- ],
751
- },
752
- {
753
- transformFn: transformRESTFloatToSDKFloat,
754
- paths: [
755
- { path: 'results.item.media.image.image.focalPoint.x' },
756
- { path: 'results.item.media.image.image.focalPoint.y' },
757
- { path: 'results.item.media.image.faces.confidence' },
758
- { path: 'results.item.media.image.previewImage.focalPoint.x' },
759
- { path: 'results.item.media.image.previewImage.focalPoint.y' },
760
- {
761
- path: 'results.item.media.video.resolutions.poster.focalPoint.x',
762
- },
763
- {
764
- path: 'results.item.media.video.resolutions.poster.focalPoint.y',
765
- },
766
- { path: 'results.item.media.video.posters.focalPoint.x' },
767
- { path: 'results.item.media.video.posters.focalPoint.y' },
768
- { path: 'results.item.media.document.thumbnail.focalPoint.x' },
769
- { path: 'results.item.media.document.thumbnail.focalPoint.y' },
770
- { path: 'results.item.media.vector.image.focalPoint.x' },
771
- { path: 'results.item.media.vector.image.focalPoint.y' },
772
- { path: 'results.item.media.vector.faces.confidence' },
773
- { path: 'results.item.media.vector.previewImage.focalPoint.x' },
774
- { path: 'results.item.media.vector.previewImage.focalPoint.y' },
775
- { path: 'results.item.media.model3d.thumbnail.focalPoint.x' },
776
- { path: 'results.item.media.model3d.thumbnail.focalPoint.y' },
777
- { path: 'results.item.media.icon.image.focalPoint.x' },
778
- { path: 'results.item.media.icon.image.focalPoint.y' },
779
- { path: 'results.item.media.icon.faces.confidence' },
780
- { path: 'results.item.media.icon.previewImage.focalPoint.x' },
781
- { path: 'results.item.media.icon.previewImage.focalPoint.y' },
782
- ],
783
- },
784
- ]),
785
- };
786
- return metadata;
787
- }
788
- return __bulkImportFile;
789
- }
790
- /**
791
- * Retrieves a list of files in the Media Manager.
792
- *
793
- * To retrieve a list of files within a specific folder in the Media Manager, specify the folder's ID in the `parentFolderId` parameter. If no folder is specified, the method retrieves the list of files in the root folder of the Media Manager.
794
- */
795
- export function listFiles(payload) {
796
- function __listFiles({ host }) {
797
- const metadata = {
798
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
799
- method: 'GET',
800
- methodFqn: 'com.wix.media.site_media.v1.FilesService.ListFiles',
801
- packageName: PACKAGE_NAME,
802
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
803
- protoPath: '/v1/files',
804
- data: payload,
805
- host,
806
- }),
807
- params: toURLSearchParams(payload, true),
808
- transformResponse: (payload) => transformPaths(payload, [
809
- {
810
- transformFn: transformRESTTimestampToSDKTimestamp,
811
- paths: [
812
- { path: 'files.createdDate' },
813
- { path: 'files.updatedDate' },
814
- { path: 'files.lastUsedDate' },
815
- { path: 'files.media.image.image.urlExpirationDate' },
816
- { path: 'files.media.image.previewImage.urlExpirationDate' },
817
- { path: 'files.media.video.urlExpirationDate' },
818
- { path: 'files.media.video.resolutions.urlExpirationDate' },
819
- {
820
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
821
- },
822
- { path: 'files.media.video.posters.urlExpirationDate' },
823
- { path: 'files.media.audio.assets.urlExpirationDate' },
824
- { path: 'files.media.document.urlExpirationDate' },
825
- { path: 'files.media.document.thumbnail.urlExpirationDate' },
826
- { path: 'files.media.vector.image.urlExpirationDate' },
827
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
828
- { path: 'files.media.archive.urlExpirationDate' },
829
- { path: 'files.media.model3d.urlExpirationDate' },
830
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
831
- { path: 'files.media.icon.image.urlExpirationDate' },
832
- { path: 'files.media.icon.previewImage.urlExpirationDate' },
833
- ],
834
- },
835
- {
836
- transformFn: transformRESTFloatToSDKFloat,
837
- paths: [
838
- { path: 'files.media.image.image.focalPoint.x' },
839
- { path: 'files.media.image.image.focalPoint.y' },
840
- { path: 'files.media.image.faces.confidence' },
841
- { path: 'files.media.image.previewImage.focalPoint.x' },
842
- { path: 'files.media.image.previewImage.focalPoint.y' },
843
- { path: 'files.media.video.resolutions.poster.focalPoint.x' },
844
- { path: 'files.media.video.resolutions.poster.focalPoint.y' },
845
- { path: 'files.media.video.posters.focalPoint.x' },
846
- { path: 'files.media.video.posters.focalPoint.y' },
847
- { path: 'files.media.document.thumbnail.focalPoint.x' },
848
- { path: 'files.media.document.thumbnail.focalPoint.y' },
849
- { path: 'files.media.vector.image.focalPoint.x' },
850
- { path: 'files.media.vector.image.focalPoint.y' },
851
- { path: 'files.media.vector.faces.confidence' },
852
- { path: 'files.media.vector.previewImage.focalPoint.x' },
853
- { path: 'files.media.vector.previewImage.focalPoint.y' },
854
- { path: 'files.media.model3d.thumbnail.focalPoint.x' },
855
- { path: 'files.media.model3d.thumbnail.focalPoint.y' },
856
- { path: 'files.media.icon.image.focalPoint.x' },
857
- { path: 'files.media.icon.image.focalPoint.y' },
858
- { path: 'files.media.icon.faces.confidence' },
859
- { path: 'files.media.icon.previewImage.focalPoint.x' },
860
- { path: 'files.media.icon.previewImage.focalPoint.y' },
861
- ],
862
- },
863
- ]),
864
- };
865
- return metadata;
866
- }
867
- return __listFiles;
868
- }
869
- /**
870
- * Searches all folders in the Media Manager and returns a list of files that match the terms specified in the parameters. <br/>
871
- *
872
- * If no parameters are specified, the endpoint returns all files in the `MEDIA_ROOT` folder.
873
- */
874
- export function searchFiles(payload) {
875
- function __searchFiles({ host }) {
876
- const metadata = {
877
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
878
- method: 'POST',
879
- methodFqn: 'com.wix.media.site_media.v1.FilesService.SearchFiles',
880
- packageName: PACKAGE_NAME,
881
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
882
- protoPath: '/v1/files/search',
883
- data: payload,
884
- host,
885
- }),
886
- data: payload,
887
- transformResponse: (payload) => transformPaths(payload, [
888
- {
889
- transformFn: transformRESTTimestampToSDKTimestamp,
890
- paths: [
891
- { path: 'files.createdDate' },
892
- { path: 'files.updatedDate' },
893
- { path: 'files.lastUsedDate' },
894
- { path: 'files.media.image.image.urlExpirationDate' },
895
- { path: 'files.media.image.previewImage.urlExpirationDate' },
896
- { path: 'files.media.video.urlExpirationDate' },
897
- { path: 'files.media.video.resolutions.urlExpirationDate' },
898
- {
899
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
900
- },
901
- { path: 'files.media.video.posters.urlExpirationDate' },
902
- { path: 'files.media.audio.assets.urlExpirationDate' },
903
- { path: 'files.media.document.urlExpirationDate' },
904
- { path: 'files.media.document.thumbnail.urlExpirationDate' },
905
- { path: 'files.media.vector.image.urlExpirationDate' },
906
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
907
- { path: 'files.media.archive.urlExpirationDate' },
908
- { path: 'files.media.model3d.urlExpirationDate' },
909
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
910
- { path: 'files.media.icon.image.urlExpirationDate' },
911
- { path: 'files.media.icon.previewImage.urlExpirationDate' },
912
- ],
913
- },
914
- {
915
- transformFn: transformRESTFloatToSDKFloat,
916
- paths: [
917
- { path: 'files.media.image.image.focalPoint.x' },
918
- { path: 'files.media.image.image.focalPoint.y' },
919
- { path: 'files.media.image.faces.confidence' },
920
- { path: 'files.media.image.previewImage.focalPoint.x' },
921
- { path: 'files.media.image.previewImage.focalPoint.y' },
922
- { path: 'files.media.video.resolutions.poster.focalPoint.x' },
923
- { path: 'files.media.video.resolutions.poster.focalPoint.y' },
924
- { path: 'files.media.video.posters.focalPoint.x' },
925
- { path: 'files.media.video.posters.focalPoint.y' },
926
- { path: 'files.media.document.thumbnail.focalPoint.x' },
927
- { path: 'files.media.document.thumbnail.focalPoint.y' },
928
- { path: 'files.media.vector.image.focalPoint.x' },
929
- { path: 'files.media.vector.image.focalPoint.y' },
930
- { path: 'files.media.vector.faces.confidence' },
931
- { path: 'files.media.vector.previewImage.focalPoint.x' },
932
- { path: 'files.media.vector.previewImage.focalPoint.y' },
933
- { path: 'files.media.model3d.thumbnail.focalPoint.x' },
934
- { path: 'files.media.model3d.thumbnail.focalPoint.y' },
935
- { path: 'files.media.icon.image.focalPoint.x' },
936
- { path: 'files.media.icon.image.focalPoint.y' },
937
- { path: 'files.media.icon.faces.confidence' },
938
- { path: 'files.media.icon.previewImage.focalPoint.x' },
939
- { path: 'files.media.icon.previewImage.focalPoint.y' },
940
- ],
941
- },
942
- ]),
943
- };
944
- return metadata;
945
- }
946
- return __searchFiles;
947
- }
948
- /**
949
- * Generates a URL for streaming a specific video file in the Media Manager. <br/>
950
- *
951
- * To stream different assets of the file, specify the `assetKeys` parameter which generates a video streaming URL for each asset. If no assetKey is specified, it defaults to `src`, which generates one video streaming URL in the original file's format and quality.
952
- */
953
- export function generateVideoStreamingUrl(payload) {
954
- function __generateVideoStreamingUrl({ host }) {
955
- const metadata = {
956
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
957
- method: 'POST',
958
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateVideoStreamingUrl',
959
- packageName: PACKAGE_NAME,
960
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
961
- protoPath: '/v1/files/generate-video-stream-url',
962
- data: payload,
963
- host,
964
- }),
965
- data: payload,
966
- };
967
- return metadata;
968
- }
969
- return __generateVideoStreamingUrl;
970
- }
971
- /**
972
- * Deletes the specified files from the Media Manager. <br/>
973
- *
974
- * The deleted files are moved to the Media Manager's trash bin (`TRASH-ROOT` folder) unless permanently deleted. To permanently delete files, specify 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.
975
- *
976
- * Note the following:
977
- * * The specified files can be from different folders.
978
- * * Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
979
- * * Attempting to delete files that are already in the trash bin doesn't result in an error.
980
- * * If a site contains deleted media files, the deleted media files still appear on the site as the files are still in the Media Manager (in the trash bin).
981
- * * You can use Bulk Restore Files From Trash Bin to restore files from the Media Manager's trash bin.
982
- */
983
- export function bulkDeleteFiles(payload) {
984
- function __bulkDeleteFiles({ host }) {
985
- const metadata = {
986
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
987
- method: 'POST',
988
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkDeleteFiles',
989
- packageName: PACKAGE_NAME,
990
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
991
- protoPath: '/v1/bulk/files/delete',
992
- data: payload,
993
- host,
994
- }),
995
- data: payload,
996
- };
997
- return metadata;
998
- }
999
- return __bulkDeleteFiles;
1000
- }
1001
- /** Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager. */
1002
- export function bulkRestoreFilesFromTrashBin(payload) {
1003
- function __bulkRestoreFilesFromTrashBin({ host }) {
1004
- const metadata = {
1005
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
1006
- method: 'POST',
1007
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkRestoreFilesFromTrashBin',
1008
- packageName: PACKAGE_NAME,
1009
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
1010
- protoPath: '/v1/bulk/trash-bin/files/restore',
1011
- data: payload,
1012
- host,
1013
- }),
1014
- data: payload,
1015
- };
1016
- return metadata;
1017
- }
1018
- return __bulkRestoreFilesFromTrashBin;
1019
- }
1020
- /**
1021
- * Retrieves a list of files in the Media Manager's trash bin. <br/>
1022
- *
1023
- * >**Note:** The Media Manager's trash bin (`TRASH-ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
1024
- */
1025
- export function listDeletedFiles(payload) {
1026
- function __listDeletedFiles({ host }) {
1027
- const metadata = {
1028
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
1029
- method: 'GET',
1030
- methodFqn: 'com.wix.media.site_media.v1.FilesService.ListDeletedFiles',
1031
- packageName: PACKAGE_NAME,
1032
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
1033
- protoPath: '/v1/trash-bin/files',
1034
- data: payload,
1035
- host,
1036
- }),
1037
- params: toURLSearchParams(payload, true),
1038
- transformResponse: (payload) => transformPaths(payload, [
1039
- {
1040
- transformFn: transformRESTTimestampToSDKTimestamp,
1041
- paths: [
1042
- { path: 'files.createdDate' },
1043
- { path: 'files.updatedDate' },
1044
- { path: 'files.lastUsedDate' },
1045
- { path: 'files.media.image.image.urlExpirationDate' },
1046
- { path: 'files.media.image.previewImage.urlExpirationDate' },
1047
- { path: 'files.media.video.urlExpirationDate' },
1048
- { path: 'files.media.video.resolutions.urlExpirationDate' },
1049
- {
1050
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
1051
- },
1052
- { path: 'files.media.video.posters.urlExpirationDate' },
1053
- { path: 'files.media.audio.assets.urlExpirationDate' },
1054
- { path: 'files.media.document.urlExpirationDate' },
1055
- { path: 'files.media.document.thumbnail.urlExpirationDate' },
1056
- { path: 'files.media.vector.image.urlExpirationDate' },
1057
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
1058
- { path: 'files.media.archive.urlExpirationDate' },
1059
- { path: 'files.media.model3d.urlExpirationDate' },
1060
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
1061
- { path: 'files.media.icon.image.urlExpirationDate' },
1062
- { path: 'files.media.icon.previewImage.urlExpirationDate' },
1063
- ],
1064
- },
1065
- {
1066
- transformFn: transformRESTFloatToSDKFloat,
1067
- paths: [
1068
- { path: 'files.media.image.image.focalPoint.x' },
1069
- { path: 'files.media.image.image.focalPoint.y' },
1070
- { path: 'files.media.image.faces.confidence' },
1071
- { path: 'files.media.image.previewImage.focalPoint.x' },
1072
- { path: 'files.media.image.previewImage.focalPoint.y' },
1073
- { path: 'files.media.video.resolutions.poster.focalPoint.x' },
1074
- { path: 'files.media.video.resolutions.poster.focalPoint.y' },
1075
- { path: 'files.media.video.posters.focalPoint.x' },
1076
- { path: 'files.media.video.posters.focalPoint.y' },
1077
- { path: 'files.media.document.thumbnail.focalPoint.x' },
1078
- { path: 'files.media.document.thumbnail.focalPoint.y' },
1079
- { path: 'files.media.vector.image.focalPoint.x' },
1080
- { path: 'files.media.vector.image.focalPoint.y' },
1081
- { path: 'files.media.vector.faces.confidence' },
1082
- { path: 'files.media.vector.previewImage.focalPoint.x' },
1083
- { path: 'files.media.vector.previewImage.focalPoint.y' },
1084
- { path: 'files.media.model3d.thumbnail.focalPoint.x' },
1085
- { path: 'files.media.model3d.thumbnail.focalPoint.y' },
1086
- { path: 'files.media.icon.image.focalPoint.x' },
1087
- { path: 'files.media.icon.image.focalPoint.y' },
1088
- { path: 'files.media.icon.faces.confidence' },
1089
- { path: 'files.media.icon.previewImage.focalPoint.x' },
1090
- { path: 'files.media.icon.previewImage.focalPoint.y' },
1091
- ],
1092
- },
1093
- ]),
1094
- };
1095
- return metadata;
1096
- }
1097
- return __listDeletedFiles;
1098
- }
1099
- //# sourceMappingURL=media-site-media-v1-file-descriptor-files.http.js.map