@wix/media 1.0.51 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +5 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +5 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js +5 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +350 -316
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.meta.d.ts +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js +5 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +10 -10
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.d.ts +5 -6
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.js +10 -10
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +5 -6
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +155 -67
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.http.js +84 -89
- package/build/cjs/src/media-site-media-v1-folder.http.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.meta.d.ts +1 -1
- package/build/cjs/src/media-site-media-v1-folder.meta.js +5 -1
- package/build/cjs/src/media-site-media-v1-folder.meta.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.public.d.ts +5 -5
- package/build/cjs/src/media-site-media-v1-folder.types.d.ts +4 -5
- package/build/cjs/src/media-site-media-v1-folder.types.js +4 -4
- package/build/cjs/src/media-site-media-v1-folder.types.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +4 -5
- package/build/cjs/src/media-site-media-v1-folder.universal.js +74 -35
- package/build/cjs/src/media-site-media-v1-folder.universal.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.http.js +350 -316
- package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.meta.d.ts +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +10 -10
- package/build/es/src/media-site-media-v1-file-descriptor.types.d.ts +5 -6
- package/build/es/src/media-site-media-v1-file-descriptor.types.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +5 -6
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js +141 -57
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.http.js +84 -89
- package/build/es/src/media-site-media-v1-folder.http.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.meta.d.ts +1 -1
- package/build/es/src/media-site-media-v1-folder.public.d.ts +5 -5
- package/build/es/src/media-site-media-v1-folder.types.d.ts +4 -5
- package/build/es/src/media-site-media-v1-folder.types.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.universal.d.ts +4 -5
- package/build/es/src/media-site-media-v1-folder.universal.js +66 -31
- package/build/es/src/media-site-media-v1-folder.universal.js.map +1 -1
- package/package.json +7 -3
|
@@ -1,80 +1,11 @@
|
|
|
1
1
|
import { toURLSearchParams } from '@wix/metro-runtime';
|
|
2
|
-
import {
|
|
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';
|
|
3
8
|
import { resolveUrl } from '@wix/metro-runtime';
|
|
4
|
-
const _archive = { urlExpirationDate: 'google.protobuf.Timestamp' };
|
|
5
|
-
const _audio = { urlExpirationDate: 'google.protobuf.Timestamp' };
|
|
6
|
-
const _audioV2 = { assets: '_audio' };
|
|
7
|
-
const _bulkDeleteFilesRequest = {};
|
|
8
|
-
const _bulkDeleteFilesResponse = {};
|
|
9
|
-
const _bulkImportFileRequest = { importFileRequests: '_importFileRequest' };
|
|
10
|
-
const _bulkImportFileResponse = { results: '_bulkImportFileResult' };
|
|
11
|
-
const _bulkImportFileResult = { item: '_fileDescriptor' };
|
|
12
|
-
const _bulkImportFilesRequest = { importFileRequests: '_importFileRequest' };
|
|
13
|
-
const _bulkImportFilesResponse = { files: '_fileDescriptor' };
|
|
14
|
-
const _bulkRestoreFilesFromTrashBinRequest = {};
|
|
15
|
-
const _bulkRestoreFilesFromTrashBinResponse = {};
|
|
16
|
-
const _document = { urlExpirationDate: 'google.protobuf.Timestamp' };
|
|
17
|
-
const _faceRecognition = { confidence: 'DOUBLE' };
|
|
18
|
-
const _fileDescriptor = {
|
|
19
|
-
createdDate: 'google.protobuf.Timestamp',
|
|
20
|
-
updatedDate: 'google.protobuf.Timestamp',
|
|
21
|
-
media: '_fileMedia',
|
|
22
|
-
};
|
|
23
|
-
const _fileMedia = {
|
|
24
|
-
image: '_imageMedia',
|
|
25
|
-
video: '_videoV2',
|
|
26
|
-
audio: '_audioV2',
|
|
27
|
-
document: '_document',
|
|
28
|
-
vector: '_imageMedia',
|
|
29
|
-
archive: '_archive',
|
|
30
|
-
model3d: '_model3D',
|
|
31
|
-
};
|
|
32
|
-
const _generateFileDownloadUrlRequest = {};
|
|
33
|
-
const _generateFileDownloadUrlResponse = {};
|
|
34
|
-
const _generateFileResumableUploadUrlRequest = {};
|
|
35
|
-
const _generateFileResumableUploadUrlResponse = {};
|
|
36
|
-
const _generateFilesDownloadUrlRequest = {};
|
|
37
|
-
const _generateFilesDownloadUrlResponse = {};
|
|
38
|
-
const _generateFileUploadUrlRequest = {};
|
|
39
|
-
const _generateFileUploadUrlResponse = {};
|
|
40
|
-
const _generateVideoStreamingUrlRequest = {};
|
|
41
|
-
const _generateVideoStreamingUrlResponse = {};
|
|
42
|
-
const _getFileDescriptorRequest = {};
|
|
43
|
-
const _getFileDescriptorResponse = { file: '_fileDescriptor' };
|
|
44
|
-
const _getFileDescriptorsRequest = {};
|
|
45
|
-
const _getFileDescriptorsResponse = { files: '_fileDescriptor' };
|
|
46
|
-
const _image = { urlExpirationDate: 'google.protobuf.Timestamp' };
|
|
47
|
-
const _imageMedia = {
|
|
48
|
-
image: '_image',
|
|
49
|
-
faces: '_faceRecognition',
|
|
50
|
-
previewImage: '_image',
|
|
51
|
-
};
|
|
52
|
-
const _importFileRequest = {};
|
|
53
|
-
const _importFileResponse = { file: '_fileDescriptor' };
|
|
54
|
-
const _listDeletedFilesRequest = {};
|
|
55
|
-
const _listDeletedFilesResponse = { files: '_fileDescriptor' };
|
|
56
|
-
const _listFilesRequest = {};
|
|
57
|
-
const _listFilesResponse = { files: '_fileDescriptor' };
|
|
58
|
-
const _model3D = {
|
|
59
|
-
urlExpirationDate: 'google.protobuf.Timestamp',
|
|
60
|
-
thumbnail: '_image',
|
|
61
|
-
};
|
|
62
|
-
const _searchFilesRequest = {};
|
|
63
|
-
const _searchFilesResponse = { files: '_fileDescriptor' };
|
|
64
|
-
const _updateFileDescriptorRequest = {
|
|
65
|
-
fieldMask: 'google.protobuf.FieldMask',
|
|
66
|
-
file: '_fileDescriptor',
|
|
67
|
-
};
|
|
68
|
-
const _updateFileDescriptorResponse = { file: '_fileDescriptor' };
|
|
69
|
-
const _videoResolution = {
|
|
70
|
-
urlExpirationDate: 'google.protobuf.Timestamp',
|
|
71
|
-
poster: '_image',
|
|
72
|
-
};
|
|
73
|
-
const _videoV2 = {
|
|
74
|
-
urlExpirationDate: 'google.protobuf.Timestamp',
|
|
75
|
-
resolutions: '_videoResolution',
|
|
76
|
-
posters: '_image',
|
|
77
|
-
};
|
|
78
9
|
function resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
|
|
79
10
|
const domainToMappings = {
|
|
80
11
|
'apps._base_domain_': [
|
|
@@ -110,25 +41,20 @@ function resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
|
|
|
110
41
|
* The compressed file can contain up to 1000 files.
|
|
111
42
|
*/
|
|
112
43
|
export function generateFilesDownloadUrl(payload) {
|
|
113
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFilesDownloadUrlRequest, {});
|
|
114
|
-
const { fromJSON: fromRes } = serializer(_generateFilesDownloadUrlResponse, {});
|
|
115
44
|
function __generateFilesDownloadUrl({ host }) {
|
|
116
|
-
const serializedData = toReq(payload);
|
|
117
45
|
const metadata = {
|
|
118
46
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
119
47
|
method: 'POST',
|
|
120
48
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFilesDownloadUrl',
|
|
121
49
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
122
50
|
protoPath: '/v1/files/generate-download-url',
|
|
123
|
-
data:
|
|
51
|
+
data: payload,
|
|
124
52
|
host,
|
|
125
53
|
}),
|
|
126
|
-
data:
|
|
127
|
-
transformResponse: fromRes,
|
|
54
|
+
data: payload,
|
|
128
55
|
};
|
|
129
56
|
return metadata;
|
|
130
57
|
}
|
|
131
|
-
__generateFilesDownloadUrl.fromReq = fromReq;
|
|
132
58
|
return __generateFilesDownloadUrl;
|
|
133
59
|
}
|
|
134
60
|
/**
|
|
@@ -142,25 +68,20 @@ export function generateFilesDownloadUrl(payload) {
|
|
|
142
68
|
* Use this endpoint to grant external clients access to a private media file. Use the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect URL when the URL expires.
|
|
143
69
|
*/
|
|
144
70
|
export function generateFileDownloadUrl(payload) {
|
|
145
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFileDownloadUrlRequest, {});
|
|
146
|
-
const { fromJSON: fromRes } = serializer(_generateFileDownloadUrlResponse, {});
|
|
147
71
|
function __generateFileDownloadUrl({ host }) {
|
|
148
|
-
const serializedData = toReq(payload);
|
|
149
72
|
const metadata = {
|
|
150
73
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
151
74
|
method: 'POST',
|
|
152
75
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileDownloadUrl',
|
|
153
76
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
154
77
|
protoPath: '/v1/files/{fileId}/generate-download-url',
|
|
155
|
-
data:
|
|
78
|
+
data: payload,
|
|
156
79
|
host,
|
|
157
80
|
}),
|
|
158
|
-
data:
|
|
159
|
-
transformResponse: fromRes,
|
|
81
|
+
data: payload,
|
|
160
82
|
};
|
|
161
83
|
return metadata;
|
|
162
84
|
}
|
|
163
|
-
__generateFileDownloadUrl.fromReq = fromReq;
|
|
164
85
|
return __generateFileDownloadUrl;
|
|
165
86
|
}
|
|
166
87
|
/**
|
|
@@ -172,38 +93,49 @@ export function generateFileDownloadUrl(payload) {
|
|
|
172
93
|
* Use `getFileDescriptors()` to get multiple file descriptors at once.
|
|
173
94
|
*/
|
|
174
95
|
export function getFileDescriptor(payload) {
|
|
175
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_getFileDescriptorRequest, {});
|
|
176
|
-
const { fromJSON: fromRes } = serializer(_getFileDescriptorResponse, {
|
|
177
|
-
_archive,
|
|
178
|
-
_audio,
|
|
179
|
-
_audioV2,
|
|
180
|
-
_document,
|
|
181
|
-
_faceRecognition,
|
|
182
|
-
_fileDescriptor,
|
|
183
|
-
_fileMedia,
|
|
184
|
-
_image,
|
|
185
|
-
_imageMedia,
|
|
186
|
-
_model3D,
|
|
187
|
-
_videoResolution,
|
|
188
|
-
_videoV2,
|
|
189
|
-
});
|
|
190
96
|
function __getFileDescriptor({ host }) {
|
|
191
|
-
const serializedData = toReq(payload);
|
|
192
97
|
const metadata = {
|
|
193
98
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
194
99
|
method: 'GET',
|
|
195
100
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptor',
|
|
196
101
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
197
102
|
protoPath: '/v1/files/{fileId}',
|
|
198
|
-
data:
|
|
103
|
+
data: payload,
|
|
199
104
|
host,
|
|
200
105
|
}),
|
|
201
|
-
params: toURLSearchParams(
|
|
202
|
-
transformResponse:
|
|
106
|
+
params: toURLSearchParams(payload),
|
|
107
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
108
|
+
{
|
|
109
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
110
|
+
paths: [
|
|
111
|
+
{ path: 'file.createdDate' },
|
|
112
|
+
{ path: 'file.updatedDate' },
|
|
113
|
+
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
114
|
+
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
115
|
+
{ path: 'file.media.video.urlExpirationDate' },
|
|
116
|
+
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
117
|
+
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
118
|
+
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
119
|
+
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
120
|
+
{ path: 'file.media.document.urlExpirationDate' },
|
|
121
|
+
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
122
|
+
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
123
|
+
{ path: 'file.media.archive.urlExpirationDate' },
|
|
124
|
+
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
125
|
+
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
130
|
+
paths: [
|
|
131
|
+
{ path: 'file.media.image.faces.confidence' },
|
|
132
|
+
{ path: 'file.media.vector.faces.confidence' },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
]),
|
|
203
136
|
};
|
|
204
137
|
return metadata;
|
|
205
138
|
}
|
|
206
|
-
__getFileDescriptor.fromReq = fromReq;
|
|
207
139
|
return __getFileDescriptor;
|
|
208
140
|
}
|
|
209
141
|
/**
|
|
@@ -215,38 +147,51 @@ export function getFileDescriptor(payload) {
|
|
|
215
147
|
* Use `getFileDescriptor()` to get a single file descriptor.
|
|
216
148
|
*/
|
|
217
149
|
export function getFileDescriptors(payload) {
|
|
218
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_getFileDescriptorsRequest, {});
|
|
219
|
-
const { fromJSON: fromRes } = serializer(_getFileDescriptorsResponse, {
|
|
220
|
-
_archive,
|
|
221
|
-
_audio,
|
|
222
|
-
_audioV2,
|
|
223
|
-
_document,
|
|
224
|
-
_faceRecognition,
|
|
225
|
-
_fileDescriptor,
|
|
226
|
-
_fileMedia,
|
|
227
|
-
_image,
|
|
228
|
-
_imageMedia,
|
|
229
|
-
_model3D,
|
|
230
|
-
_videoResolution,
|
|
231
|
-
_videoV2,
|
|
232
|
-
});
|
|
233
150
|
function __getFileDescriptors({ host }) {
|
|
234
|
-
const serializedData = toReq(payload);
|
|
235
151
|
const metadata = {
|
|
236
152
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
237
153
|
method: 'POST',
|
|
238
154
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptors',
|
|
239
155
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
240
156
|
protoPath: '/v1/files/get-files',
|
|
241
|
-
data:
|
|
157
|
+
data: payload,
|
|
242
158
|
host,
|
|
243
159
|
}),
|
|
244
|
-
data:
|
|
245
|
-
transformResponse:
|
|
160
|
+
data: payload,
|
|
161
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
162
|
+
{
|
|
163
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
164
|
+
paths: [
|
|
165
|
+
{ path: 'files.createdDate' },
|
|
166
|
+
{ path: 'files.updatedDate' },
|
|
167
|
+
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
168
|
+
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
169
|
+
{ path: 'files.media.video.urlExpirationDate' },
|
|
170
|
+
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
171
|
+
{
|
|
172
|
+
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
173
|
+
},
|
|
174
|
+
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
175
|
+
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
176
|
+
{ path: 'files.media.document.urlExpirationDate' },
|
|
177
|
+
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
178
|
+
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
179
|
+
{ path: 'files.media.archive.urlExpirationDate' },
|
|
180
|
+
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
181
|
+
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
186
|
+
paths: [
|
|
187
|
+
{ path: 'files.media.image.faces.confidence' },
|
|
188
|
+
{ path: 'files.media.vector.faces.confidence' },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
]),
|
|
246
192
|
};
|
|
247
193
|
return metadata;
|
|
248
194
|
}
|
|
249
|
-
__getFileDescriptors.fromReq = fromReq;
|
|
250
195
|
return __getFileDescriptors;
|
|
251
196
|
}
|
|
252
197
|
/**
|
|
@@ -258,36 +203,40 @@ export function getFileDescriptors(payload) {
|
|
|
258
203
|
* You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
|
|
259
204
|
*/
|
|
260
205
|
export function updateFileDescriptor(payload) {
|
|
261
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_updateFileDescriptorRequest, {
|
|
262
|
-
_archive,
|
|
263
|
-
_audio,
|
|
264
|
-
_audioV2,
|
|
265
|
-
_document,
|
|
266
|
-
_faceRecognition,
|
|
267
|
-
_fileDescriptor,
|
|
268
|
-
_fileMedia,
|
|
269
|
-
_image,
|
|
270
|
-
_imageMedia,
|
|
271
|
-
_model3D,
|
|
272
|
-
_videoResolution,
|
|
273
|
-
_videoV2,
|
|
274
|
-
});
|
|
275
|
-
const { fromJSON: fromRes } = serializer(_updateFileDescriptorResponse, {
|
|
276
|
-
_archive,
|
|
277
|
-
_audio,
|
|
278
|
-
_audioV2,
|
|
279
|
-
_document,
|
|
280
|
-
_faceRecognition,
|
|
281
|
-
_fileDescriptor,
|
|
282
|
-
_fileMedia,
|
|
283
|
-
_image,
|
|
284
|
-
_imageMedia,
|
|
285
|
-
_model3D,
|
|
286
|
-
_videoResolution,
|
|
287
|
-
_videoV2,
|
|
288
|
-
});
|
|
289
206
|
function __updateFileDescriptor({ host }) {
|
|
290
|
-
const serializedData =
|
|
207
|
+
const serializedData = transformPaths(payload, [
|
|
208
|
+
{
|
|
209
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
210
|
+
paths: [{ path: 'fieldMask' }],
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
214
|
+
paths: [
|
|
215
|
+
{ path: 'file.createdDate' },
|
|
216
|
+
{ path: 'file.updatedDate' },
|
|
217
|
+
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
218
|
+
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
219
|
+
{ path: 'file.media.video.urlExpirationDate' },
|
|
220
|
+
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
221
|
+
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
222
|
+
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
223
|
+
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
224
|
+
{ path: 'file.media.document.urlExpirationDate' },
|
|
225
|
+
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
226
|
+
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
227
|
+
{ path: 'file.media.archive.urlExpirationDate' },
|
|
228
|
+
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
229
|
+
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
234
|
+
paths: [
|
|
235
|
+
{ path: 'file.media.image.faces.confidence' },
|
|
236
|
+
{ path: 'file.media.vector.faces.confidence' },
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
]);
|
|
291
240
|
const metadata = {
|
|
292
241
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
293
242
|
method: 'PATCH',
|
|
@@ -298,11 +247,38 @@ export function updateFileDescriptor(payload) {
|
|
|
298
247
|
host,
|
|
299
248
|
}),
|
|
300
249
|
data: serializedData,
|
|
301
|
-
transformResponse:
|
|
250
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
251
|
+
{
|
|
252
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
253
|
+
paths: [
|
|
254
|
+
{ path: 'file.createdDate' },
|
|
255
|
+
{ path: 'file.updatedDate' },
|
|
256
|
+
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
257
|
+
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
258
|
+
{ path: 'file.media.video.urlExpirationDate' },
|
|
259
|
+
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
260
|
+
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
261
|
+
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
262
|
+
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
263
|
+
{ path: 'file.media.document.urlExpirationDate' },
|
|
264
|
+
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
265
|
+
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
266
|
+
{ path: 'file.media.archive.urlExpirationDate' },
|
|
267
|
+
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
268
|
+
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
269
|
+
],
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
273
|
+
paths: [
|
|
274
|
+
{ path: 'file.media.image.faces.confidence' },
|
|
275
|
+
{ path: 'file.media.vector.faces.confidence' },
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
]),
|
|
302
279
|
};
|
|
303
280
|
return metadata;
|
|
304
281
|
}
|
|
305
|
-
__updateFileDescriptor.fromReq = fromReq;
|
|
306
282
|
return __updateFileDescriptor;
|
|
307
283
|
}
|
|
308
284
|
/**
|
|
@@ -315,25 +291,20 @@ export function updateFileDescriptor(payload) {
|
|
|
315
291
|
* > **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.
|
|
316
292
|
*/
|
|
317
293
|
export function generateFileUploadUrl(payload) {
|
|
318
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFileUploadUrlRequest, {});
|
|
319
|
-
const { fromJSON: fromRes } = serializer(_generateFileUploadUrlResponse, {});
|
|
320
294
|
function __generateFileUploadUrl({ host }) {
|
|
321
|
-
const serializedData = toReq(payload);
|
|
322
295
|
const metadata = {
|
|
323
296
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
324
297
|
method: 'POST',
|
|
325
298
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileUploadUrl',
|
|
326
299
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
327
300
|
protoPath: '/v1/files/generate-upload-url',
|
|
328
|
-
data:
|
|
301
|
+
data: payload,
|
|
329
302
|
host,
|
|
330
303
|
}),
|
|
331
|
-
data:
|
|
332
|
-
transformResponse: fromRes,
|
|
304
|
+
data: payload,
|
|
333
305
|
};
|
|
334
306
|
return metadata;
|
|
335
307
|
}
|
|
336
|
-
__generateFileUploadUrl.fromReq = fromReq;
|
|
337
308
|
return __generateFileUploadUrl;
|
|
338
309
|
}
|
|
339
310
|
/**
|
|
@@ -346,25 +317,20 @@ export function generateFileUploadUrl(payload) {
|
|
|
346
317
|
* 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.
|
|
347
318
|
*/
|
|
348
319
|
export function generateFileResumableUploadUrl(payload) {
|
|
349
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFileResumableUploadUrlRequest, {});
|
|
350
|
-
const { fromJSON: fromRes } = serializer(_generateFileResumableUploadUrlResponse, {});
|
|
351
320
|
function __generateFileResumableUploadUrl({ host }) {
|
|
352
|
-
const serializedData = toReq(payload);
|
|
353
321
|
const metadata = {
|
|
354
322
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
355
323
|
method: 'POST',
|
|
356
324
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileResumableUploadUrl',
|
|
357
325
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
358
326
|
protoPath: '/v1/files/generate-resumable-upload-url',
|
|
359
|
-
data:
|
|
327
|
+
data: payload,
|
|
360
328
|
host,
|
|
361
329
|
}),
|
|
362
|
-
data:
|
|
363
|
-
transformResponse: fromRes,
|
|
330
|
+
data: payload,
|
|
364
331
|
};
|
|
365
332
|
return metadata;
|
|
366
333
|
}
|
|
367
|
-
__generateFileResumableUploadUrl.fromReq = fromReq;
|
|
368
334
|
return __generateFileResumableUploadUrl;
|
|
369
335
|
}
|
|
370
336
|
/**
|
|
@@ -382,38 +348,49 @@ export function generateFileResumableUploadUrl(payload) {
|
|
|
382
348
|
* - If you don't know the file's extension or MIME type, its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
|
|
383
349
|
*/
|
|
384
350
|
export function importFile(payload) {
|
|
385
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_importFileRequest, {});
|
|
386
|
-
const { fromJSON: fromRes } = serializer(_importFileResponse, {
|
|
387
|
-
_archive,
|
|
388
|
-
_audio,
|
|
389
|
-
_audioV2,
|
|
390
|
-
_document,
|
|
391
|
-
_faceRecognition,
|
|
392
|
-
_fileDescriptor,
|
|
393
|
-
_fileMedia,
|
|
394
|
-
_image,
|
|
395
|
-
_imageMedia,
|
|
396
|
-
_model3D,
|
|
397
|
-
_videoResolution,
|
|
398
|
-
_videoV2,
|
|
399
|
-
});
|
|
400
351
|
function __importFile({ host }) {
|
|
401
|
-
const serializedData = toReq(payload);
|
|
402
352
|
const metadata = {
|
|
403
353
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
404
354
|
method: 'POST',
|
|
405
355
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.ImportFile',
|
|
406
356
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
407
357
|
protoPath: '/v1/files/import',
|
|
408
|
-
data:
|
|
358
|
+
data: payload,
|
|
409
359
|
host,
|
|
410
360
|
}),
|
|
411
|
-
data:
|
|
412
|
-
transformResponse:
|
|
361
|
+
data: payload,
|
|
362
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
363
|
+
{
|
|
364
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
365
|
+
paths: [
|
|
366
|
+
{ path: 'file.createdDate' },
|
|
367
|
+
{ path: 'file.updatedDate' },
|
|
368
|
+
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
369
|
+
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
370
|
+
{ path: 'file.media.video.urlExpirationDate' },
|
|
371
|
+
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
372
|
+
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
373
|
+
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
374
|
+
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
375
|
+
{ path: 'file.media.document.urlExpirationDate' },
|
|
376
|
+
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
377
|
+
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
378
|
+
{ path: 'file.media.archive.urlExpirationDate' },
|
|
379
|
+
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
380
|
+
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
381
|
+
],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
385
|
+
paths: [
|
|
386
|
+
{ path: 'file.media.image.faces.confidence' },
|
|
387
|
+
{ path: 'file.media.vector.faces.confidence' },
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
]),
|
|
413
391
|
};
|
|
414
392
|
return metadata;
|
|
415
393
|
}
|
|
416
|
-
__importFile.fromReq = fromReq;
|
|
417
394
|
return __importFile;
|
|
418
395
|
}
|
|
419
396
|
/**
|
|
@@ -436,38 +413,51 @@ export function importFile(payload) {
|
|
|
436
413
|
* >**Note:** The `media` property isn't returned in the `files` response object.
|
|
437
414
|
*/
|
|
438
415
|
export function bulkImportFiles(payload) {
|
|
439
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkImportFilesRequest, { _importFileRequest });
|
|
440
|
-
const { fromJSON: fromRes } = serializer(_bulkImportFilesResponse, {
|
|
441
|
-
_archive,
|
|
442
|
-
_audio,
|
|
443
|
-
_audioV2,
|
|
444
|
-
_document,
|
|
445
|
-
_faceRecognition,
|
|
446
|
-
_fileDescriptor,
|
|
447
|
-
_fileMedia,
|
|
448
|
-
_image,
|
|
449
|
-
_imageMedia,
|
|
450
|
-
_model3D,
|
|
451
|
-
_videoResolution,
|
|
452
|
-
_videoV2,
|
|
453
|
-
});
|
|
454
416
|
function __bulkImportFiles({ host }) {
|
|
455
|
-
const serializedData = toReq(payload);
|
|
456
417
|
const metadata = {
|
|
457
418
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
458
419
|
method: 'POST',
|
|
459
420
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFiles',
|
|
460
421
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
461
422
|
protoPath: '/v1/bulk/files/import',
|
|
462
|
-
data:
|
|
423
|
+
data: payload,
|
|
463
424
|
host,
|
|
464
425
|
}),
|
|
465
|
-
data:
|
|
466
|
-
transformResponse:
|
|
426
|
+
data: payload,
|
|
427
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
428
|
+
{
|
|
429
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
430
|
+
paths: [
|
|
431
|
+
{ path: 'files.createdDate' },
|
|
432
|
+
{ path: 'files.updatedDate' },
|
|
433
|
+
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
434
|
+
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
435
|
+
{ path: 'files.media.video.urlExpirationDate' },
|
|
436
|
+
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
437
|
+
{
|
|
438
|
+
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
439
|
+
},
|
|
440
|
+
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
441
|
+
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
442
|
+
{ path: 'files.media.document.urlExpirationDate' },
|
|
443
|
+
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
444
|
+
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
445
|
+
{ path: 'files.media.archive.urlExpirationDate' },
|
|
446
|
+
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
447
|
+
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
448
|
+
],
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
452
|
+
paths: [
|
|
453
|
+
{ path: 'files.media.image.faces.confidence' },
|
|
454
|
+
{ path: 'files.media.vector.faces.confidence' },
|
|
455
|
+
],
|
|
456
|
+
},
|
|
457
|
+
]),
|
|
467
458
|
};
|
|
468
459
|
return metadata;
|
|
469
460
|
}
|
|
470
|
-
__bulkImportFiles.fromReq = fromReq;
|
|
471
461
|
return __bulkImportFiles;
|
|
472
462
|
}
|
|
473
463
|
/**
|
|
@@ -484,39 +474,59 @@ export function bulkImportFiles(payload) {
|
|
|
484
474
|
* - If you don't know the file's extension or MIME type, its [media type](https://support.wix.com/en/article/wix-media-supported-media-file-types-and-file-sizes) in the `mediaType` parameter of the request. For example, `'IMAGE'`. Note that this option only works if the server hosting the media allows a 'HEAD' request.
|
|
485
475
|
*/
|
|
486
476
|
export function bulkImportFile(payload) {
|
|
487
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkImportFileRequest, { _importFileRequest });
|
|
488
|
-
const { fromJSON: fromRes } = serializer(_bulkImportFileResponse, {
|
|
489
|
-
_archive,
|
|
490
|
-
_audio,
|
|
491
|
-
_audioV2,
|
|
492
|
-
_bulkImportFileResult,
|
|
493
|
-
_document,
|
|
494
|
-
_faceRecognition,
|
|
495
|
-
_fileDescriptor,
|
|
496
|
-
_fileMedia,
|
|
497
|
-
_image,
|
|
498
|
-
_imageMedia,
|
|
499
|
-
_model3D,
|
|
500
|
-
_videoResolution,
|
|
501
|
-
_videoV2,
|
|
502
|
-
});
|
|
503
477
|
function __bulkImportFile({ host }) {
|
|
504
|
-
const serializedData = toReq(payload);
|
|
505
478
|
const metadata = {
|
|
506
479
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
507
480
|
method: 'POST',
|
|
508
481
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFile',
|
|
509
482
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
510
483
|
protoPath: '/v1/bulk/files/import-v2',
|
|
511
|
-
data:
|
|
484
|
+
data: payload,
|
|
512
485
|
host,
|
|
513
486
|
}),
|
|
514
|
-
data:
|
|
515
|
-
transformResponse:
|
|
487
|
+
data: payload,
|
|
488
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
489
|
+
{
|
|
490
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
491
|
+
paths: [
|
|
492
|
+
{ path: 'results.item.createdDate' },
|
|
493
|
+
{ path: 'results.item.updatedDate' },
|
|
494
|
+
{ path: 'results.item.media.image.image.urlExpirationDate' },
|
|
495
|
+
{
|
|
496
|
+
path: 'results.item.media.image.previewImage.urlExpirationDate',
|
|
497
|
+
},
|
|
498
|
+
{ path: 'results.item.media.video.urlExpirationDate' },
|
|
499
|
+
{
|
|
500
|
+
path: 'results.item.media.video.resolutions.urlExpirationDate',
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
path: 'results.item.media.video.resolutions.poster.urlExpirationDate',
|
|
504
|
+
},
|
|
505
|
+
{ path: 'results.item.media.video.posters.urlExpirationDate' },
|
|
506
|
+
{ path: 'results.item.media.audio.assets.urlExpirationDate' },
|
|
507
|
+
{ path: 'results.item.media.document.urlExpirationDate' },
|
|
508
|
+
{ path: 'results.item.media.vector.image.urlExpirationDate' },
|
|
509
|
+
{
|
|
510
|
+
path: 'results.item.media.vector.previewImage.urlExpirationDate',
|
|
511
|
+
},
|
|
512
|
+
{ path: 'results.item.media.archive.urlExpirationDate' },
|
|
513
|
+
{ path: 'results.item.media.model3d.urlExpirationDate' },
|
|
514
|
+
{
|
|
515
|
+
path: 'results.item.media.model3d.thumbnail.urlExpirationDate',
|
|
516
|
+
},
|
|
517
|
+
],
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
521
|
+
paths: [
|
|
522
|
+
{ path: 'results.item.media.image.faces.confidence' },
|
|
523
|
+
{ path: 'results.item.media.vector.faces.confidence' },
|
|
524
|
+
],
|
|
525
|
+
},
|
|
526
|
+
]),
|
|
516
527
|
};
|
|
517
528
|
return metadata;
|
|
518
529
|
}
|
|
519
|
-
__bulkImportFile.fromReq = fromReq;
|
|
520
530
|
return __bulkImportFile;
|
|
521
531
|
}
|
|
522
532
|
/**
|
|
@@ -529,38 +539,51 @@ export function bulkImportFile(payload) {
|
|
|
529
539
|
* To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
|
|
530
540
|
*/
|
|
531
541
|
export function listFiles(payload) {
|
|
532
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_listFilesRequest, {});
|
|
533
|
-
const { fromJSON: fromRes } = serializer(_listFilesResponse, {
|
|
534
|
-
_archive,
|
|
535
|
-
_audio,
|
|
536
|
-
_audioV2,
|
|
537
|
-
_document,
|
|
538
|
-
_faceRecognition,
|
|
539
|
-
_fileDescriptor,
|
|
540
|
-
_fileMedia,
|
|
541
|
-
_image,
|
|
542
|
-
_imageMedia,
|
|
543
|
-
_model3D,
|
|
544
|
-
_videoResolution,
|
|
545
|
-
_videoV2,
|
|
546
|
-
});
|
|
547
542
|
function __listFiles({ host }) {
|
|
548
|
-
const serializedData = toReq(payload);
|
|
549
543
|
const metadata = {
|
|
550
544
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
551
545
|
method: 'GET',
|
|
552
546
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.ListFiles',
|
|
553
547
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
554
548
|
protoPath: '/v1/files',
|
|
555
|
-
data:
|
|
549
|
+
data: payload,
|
|
556
550
|
host,
|
|
557
551
|
}),
|
|
558
|
-
params: toURLSearchParams(
|
|
559
|
-
transformResponse:
|
|
552
|
+
params: toURLSearchParams(payload),
|
|
553
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
554
|
+
{
|
|
555
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
556
|
+
paths: [
|
|
557
|
+
{ path: 'files.createdDate' },
|
|
558
|
+
{ path: 'files.updatedDate' },
|
|
559
|
+
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
560
|
+
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
561
|
+
{ path: 'files.media.video.urlExpirationDate' },
|
|
562
|
+
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
563
|
+
{
|
|
564
|
+
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
565
|
+
},
|
|
566
|
+
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
567
|
+
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
568
|
+
{ path: 'files.media.document.urlExpirationDate' },
|
|
569
|
+
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
570
|
+
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
571
|
+
{ path: 'files.media.archive.urlExpirationDate' },
|
|
572
|
+
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
573
|
+
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
574
|
+
],
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
578
|
+
paths: [
|
|
579
|
+
{ path: 'files.media.image.faces.confidence' },
|
|
580
|
+
{ path: 'files.media.vector.faces.confidence' },
|
|
581
|
+
],
|
|
582
|
+
},
|
|
583
|
+
]),
|
|
560
584
|
};
|
|
561
585
|
return metadata;
|
|
562
586
|
}
|
|
563
|
-
__listFiles.fromReq = fromReq;
|
|
564
587
|
return __listFiles;
|
|
565
588
|
}
|
|
566
589
|
/**
|
|
@@ -571,38 +594,51 @@ export function listFiles(payload) {
|
|
|
571
594
|
* If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
|
|
572
595
|
*/
|
|
573
596
|
export function searchFiles(payload) {
|
|
574
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_searchFilesRequest, {});
|
|
575
|
-
const { fromJSON: fromRes } = serializer(_searchFilesResponse, {
|
|
576
|
-
_archive,
|
|
577
|
-
_audio,
|
|
578
|
-
_audioV2,
|
|
579
|
-
_document,
|
|
580
|
-
_faceRecognition,
|
|
581
|
-
_fileDescriptor,
|
|
582
|
-
_fileMedia,
|
|
583
|
-
_image,
|
|
584
|
-
_imageMedia,
|
|
585
|
-
_model3D,
|
|
586
|
-
_videoResolution,
|
|
587
|
-
_videoV2,
|
|
588
|
-
});
|
|
589
597
|
function __searchFiles({ host }) {
|
|
590
|
-
const serializedData = toReq(payload);
|
|
591
598
|
const metadata = {
|
|
592
599
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
593
600
|
method: 'POST',
|
|
594
601
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.SearchFiles',
|
|
595
602
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
596
603
|
protoPath: '/v1/files/search',
|
|
597
|
-
data:
|
|
604
|
+
data: payload,
|
|
598
605
|
host,
|
|
599
606
|
}),
|
|
600
|
-
data:
|
|
601
|
-
transformResponse:
|
|
607
|
+
data: payload,
|
|
608
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
609
|
+
{
|
|
610
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
611
|
+
paths: [
|
|
612
|
+
{ path: 'files.createdDate' },
|
|
613
|
+
{ path: 'files.updatedDate' },
|
|
614
|
+
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
615
|
+
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
616
|
+
{ path: 'files.media.video.urlExpirationDate' },
|
|
617
|
+
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
618
|
+
{
|
|
619
|
+
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
620
|
+
},
|
|
621
|
+
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
622
|
+
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
623
|
+
{ path: 'files.media.document.urlExpirationDate' },
|
|
624
|
+
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
625
|
+
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
626
|
+
{ path: 'files.media.archive.urlExpirationDate' },
|
|
627
|
+
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
628
|
+
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
629
|
+
],
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
633
|
+
paths: [
|
|
634
|
+
{ path: 'files.media.image.faces.confidence' },
|
|
635
|
+
{ path: 'files.media.vector.faces.confidence' },
|
|
636
|
+
],
|
|
637
|
+
},
|
|
638
|
+
]),
|
|
602
639
|
};
|
|
603
640
|
return metadata;
|
|
604
641
|
}
|
|
605
|
-
__searchFiles.fromReq = fromReq;
|
|
606
642
|
return __searchFiles;
|
|
607
643
|
}
|
|
608
644
|
/**
|
|
@@ -614,25 +650,20 @@ export function searchFiles(payload) {
|
|
|
614
650
|
* 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.
|
|
615
651
|
*/
|
|
616
652
|
export function generateVideoStreamingUrl(payload) {
|
|
617
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateVideoStreamingUrlRequest, {});
|
|
618
|
-
const { fromJSON: fromRes } = serializer(_generateVideoStreamingUrlResponse, {});
|
|
619
653
|
function __generateVideoStreamingUrl({ host }) {
|
|
620
|
-
const serializedData = toReq(payload);
|
|
621
654
|
const metadata = {
|
|
622
655
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
623
656
|
method: 'POST',
|
|
624
657
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateVideoStreamingUrl',
|
|
625
658
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
626
659
|
protoPath: '/v1/files/video/{fileId}/generate-stream-url',
|
|
627
|
-
data:
|
|
660
|
+
data: payload,
|
|
628
661
|
host,
|
|
629
662
|
}),
|
|
630
|
-
data:
|
|
631
|
-
transformResponse: fromRes,
|
|
663
|
+
data: payload,
|
|
632
664
|
};
|
|
633
665
|
return metadata;
|
|
634
666
|
}
|
|
635
|
-
__generateVideoStreamingUrl.fromReq = fromReq;
|
|
636
667
|
return __generateVideoStreamingUrl;
|
|
637
668
|
}
|
|
638
669
|
/**
|
|
@@ -651,25 +682,20 @@ export function generateVideoStreamingUrl(payload) {
|
|
|
651
682
|
* > - You can use `bulkRestoreFilesFromTrashBin()` to restore files from the Media Manager's trash bin.
|
|
652
683
|
*/
|
|
653
684
|
export function bulkDeleteFiles(payload) {
|
|
654
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkDeleteFilesRequest, {});
|
|
655
|
-
const { fromJSON: fromRes } = serializer(_bulkDeleteFilesResponse, {});
|
|
656
685
|
function __bulkDeleteFiles({ host }) {
|
|
657
|
-
const serializedData = toReq(payload);
|
|
658
686
|
const metadata = {
|
|
659
687
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
660
688
|
method: 'POST',
|
|
661
689
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkDeleteFiles',
|
|
662
690
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
663
691
|
protoPath: '/v1/bulk/files/delete',
|
|
664
|
-
data:
|
|
692
|
+
data: payload,
|
|
665
693
|
host,
|
|
666
694
|
}),
|
|
667
|
-
data:
|
|
668
|
-
transformResponse: fromRes,
|
|
695
|
+
data: payload,
|
|
669
696
|
};
|
|
670
697
|
return metadata;
|
|
671
698
|
}
|
|
672
|
-
__bulkDeleteFiles.fromReq = fromReq;
|
|
673
699
|
return __bulkDeleteFiles;
|
|
674
700
|
}
|
|
675
701
|
/**
|
|
@@ -678,25 +704,20 @@ export function bulkDeleteFiles(payload) {
|
|
|
678
704
|
* The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
|
|
679
705
|
*/
|
|
680
706
|
export function bulkRestoreFilesFromTrashBin(payload) {
|
|
681
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkRestoreFilesFromTrashBinRequest, {});
|
|
682
|
-
const { fromJSON: fromRes } = serializer(_bulkRestoreFilesFromTrashBinResponse, {});
|
|
683
707
|
function __bulkRestoreFilesFromTrashBin({ host }) {
|
|
684
|
-
const serializedData = toReq(payload);
|
|
685
708
|
const metadata = {
|
|
686
709
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
687
710
|
method: 'POST',
|
|
688
711
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkRestoreFilesFromTrashBin',
|
|
689
712
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
690
713
|
protoPath: '/v1/bulk/trash-bin/files/restore',
|
|
691
|
-
data:
|
|
714
|
+
data: payload,
|
|
692
715
|
host,
|
|
693
716
|
}),
|
|
694
|
-
data:
|
|
695
|
-
transformResponse: fromRes,
|
|
717
|
+
data: payload,
|
|
696
718
|
};
|
|
697
719
|
return metadata;
|
|
698
720
|
}
|
|
699
|
-
__bulkRestoreFilesFromTrashBin.fromReq = fromReq;
|
|
700
721
|
return __bulkRestoreFilesFromTrashBin;
|
|
701
722
|
}
|
|
702
723
|
/**
|
|
@@ -709,38 +730,51 @@ export function bulkRestoreFilesFromTrashBin(payload) {
|
|
|
709
730
|
* To retrieve a list of non-deleted files, use the `listFiles()` function.
|
|
710
731
|
*/
|
|
711
732
|
export function listDeletedFiles(payload) {
|
|
712
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_listDeletedFilesRequest, {});
|
|
713
|
-
const { fromJSON: fromRes } = serializer(_listDeletedFilesResponse, {
|
|
714
|
-
_archive,
|
|
715
|
-
_audio,
|
|
716
|
-
_audioV2,
|
|
717
|
-
_document,
|
|
718
|
-
_faceRecognition,
|
|
719
|
-
_fileDescriptor,
|
|
720
|
-
_fileMedia,
|
|
721
|
-
_image,
|
|
722
|
-
_imageMedia,
|
|
723
|
-
_model3D,
|
|
724
|
-
_videoResolution,
|
|
725
|
-
_videoV2,
|
|
726
|
-
});
|
|
727
733
|
function __listDeletedFiles({ host }) {
|
|
728
|
-
const serializedData = toReq(payload);
|
|
729
734
|
const metadata = {
|
|
730
735
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
731
736
|
method: 'GET',
|
|
732
737
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.ListDeletedFiles',
|
|
733
738
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
734
739
|
protoPath: '/v1/trash-bin/files',
|
|
735
|
-
data:
|
|
740
|
+
data: payload,
|
|
736
741
|
host,
|
|
737
742
|
}),
|
|
738
|
-
params: toURLSearchParams(
|
|
739
|
-
transformResponse:
|
|
743
|
+
params: toURLSearchParams(payload),
|
|
744
|
+
transformResponse: (payload) => transformPaths(payload, [
|
|
745
|
+
{
|
|
746
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
747
|
+
paths: [
|
|
748
|
+
{ path: 'files.createdDate' },
|
|
749
|
+
{ path: 'files.updatedDate' },
|
|
750
|
+
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
751
|
+
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
752
|
+
{ path: 'files.media.video.urlExpirationDate' },
|
|
753
|
+
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
754
|
+
{
|
|
755
|
+
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
756
|
+
},
|
|
757
|
+
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
758
|
+
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
759
|
+
{ path: 'files.media.document.urlExpirationDate' },
|
|
760
|
+
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
761
|
+
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
762
|
+
{ path: 'files.media.archive.urlExpirationDate' },
|
|
763
|
+
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
764
|
+
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
765
|
+
],
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
769
|
+
paths: [
|
|
770
|
+
{ path: 'files.media.image.faces.confidence' },
|
|
771
|
+
{ path: 'files.media.vector.faces.confidence' },
|
|
772
|
+
],
|
|
773
|
+
},
|
|
774
|
+
]),
|
|
740
775
|
};
|
|
741
776
|
return metadata;
|
|
742
777
|
}
|
|
743
|
-
__listDeletedFiles.fromReq = fromReq;
|
|
744
778
|
return __listDeletedFiles;
|
|
745
779
|
}
|
|
746
780
|
//# sourceMappingURL=media-site-media-v1-file-descriptor.http.js.map
|