@wix/media 1.0.50 → 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.d.ts +83 -34
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +433 -350
- 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 +126 -69
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +227 -99
- 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 -37
- 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.d.ts +83 -34
- package/build/es/src/media-site-media-v1-file-descriptor.http.js +433 -350
- 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 +126 -69
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js +213 -89
- 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 -33
- 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_': [
|
|
@@ -105,168 +36,207 @@ function resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
|
|
|
105
36
|
/**
|
|
106
37
|
* Generates a URL for downloading a compressed file containing specific files in the Media Manager.
|
|
107
38
|
*
|
|
39
|
+
* The `generateFilesDownloadUrl()` function returns a Promise that resolves to a download URL.
|
|
40
|
+
*
|
|
108
41
|
* The compressed file can contain up to 1000 files.
|
|
109
42
|
*/
|
|
110
43
|
export function generateFilesDownloadUrl(payload) {
|
|
111
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFilesDownloadUrlRequest, {});
|
|
112
|
-
const { fromJSON: fromRes } = serializer(_generateFilesDownloadUrlResponse, {});
|
|
113
44
|
function __generateFilesDownloadUrl({ host }) {
|
|
114
|
-
const serializedData = toReq(payload);
|
|
115
45
|
const metadata = {
|
|
116
46
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
117
47
|
method: 'POST',
|
|
118
48
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFilesDownloadUrl',
|
|
119
49
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
120
50
|
protoPath: '/v1/files/generate-download-url',
|
|
121
|
-
data:
|
|
51
|
+
data: payload,
|
|
122
52
|
host,
|
|
123
53
|
}),
|
|
124
|
-
data:
|
|
125
|
-
transformResponse: fromRes,
|
|
54
|
+
data: payload,
|
|
126
55
|
};
|
|
127
56
|
return metadata;
|
|
128
57
|
}
|
|
129
|
-
__generateFilesDownloadUrl.fromReq = fromReq;
|
|
130
58
|
return __generateFilesDownloadUrl;
|
|
131
59
|
}
|
|
132
60
|
/**
|
|
133
61
|
* Generates one or more temporary URLs for downloading a specific file in the Media Manager.
|
|
134
62
|
*
|
|
63
|
+
* The `generateFileDownloadUrl()` function returns a Promise that resolves to an array containing download URLs for the assets specified in the options parameter.
|
|
64
|
+
*
|
|
135
65
|
* To download different assets of the file, use the `assetKeys` parameter which generates a download URL for each asset.
|
|
136
|
-
* If no
|
|
66
|
+
* If no asset key is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
|
|
137
67
|
*
|
|
138
|
-
* 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
|
|
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.
|
|
139
69
|
*/
|
|
140
70
|
export function generateFileDownloadUrl(payload) {
|
|
141
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFileDownloadUrlRequest, {});
|
|
142
|
-
const { fromJSON: fromRes } = serializer(_generateFileDownloadUrlResponse, {});
|
|
143
71
|
function __generateFileDownloadUrl({ host }) {
|
|
144
|
-
const serializedData = toReq(payload);
|
|
145
72
|
const metadata = {
|
|
146
73
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
147
74
|
method: 'POST',
|
|
148
75
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileDownloadUrl',
|
|
149
76
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
150
77
|
protoPath: '/v1/files/{fileId}/generate-download-url',
|
|
151
|
-
data:
|
|
78
|
+
data: payload,
|
|
152
79
|
host,
|
|
153
80
|
}),
|
|
154
|
-
data:
|
|
155
|
-
transformResponse: fromRes,
|
|
81
|
+
data: payload,
|
|
156
82
|
};
|
|
157
83
|
return metadata;
|
|
158
84
|
}
|
|
159
|
-
__generateFileDownloadUrl.fromReq = fromReq;
|
|
160
85
|
return __generateFileDownloadUrl;
|
|
161
86
|
}
|
|
162
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Gets information about the specified file in the Media Manager.
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
* The `getFileDescriptor()` function returns a Promise that resolves to the specified file's descriptor.
|
|
92
|
+
*
|
|
93
|
+
* Use `getFileDescriptors()` to get multiple file descriptors at once.
|
|
94
|
+
*/
|
|
163
95
|
export function getFileDescriptor(payload) {
|
|
164
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_getFileDescriptorRequest, {});
|
|
165
|
-
const { fromJSON: fromRes } = serializer(_getFileDescriptorResponse, {
|
|
166
|
-
_archive,
|
|
167
|
-
_audio,
|
|
168
|
-
_audioV2,
|
|
169
|
-
_document,
|
|
170
|
-
_faceRecognition,
|
|
171
|
-
_fileDescriptor,
|
|
172
|
-
_fileMedia,
|
|
173
|
-
_image,
|
|
174
|
-
_imageMedia,
|
|
175
|
-
_model3D,
|
|
176
|
-
_videoResolution,
|
|
177
|
-
_videoV2,
|
|
178
|
-
});
|
|
179
96
|
function __getFileDescriptor({ host }) {
|
|
180
|
-
const serializedData = toReq(payload);
|
|
181
97
|
const metadata = {
|
|
182
98
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
183
99
|
method: 'GET',
|
|
184
100
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptor',
|
|
185
101
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
186
102
|
protoPath: '/v1/files/{fileId}',
|
|
187
|
-
data:
|
|
103
|
+
data: payload,
|
|
188
104
|
host,
|
|
189
105
|
}),
|
|
190
|
-
params: toURLSearchParams(
|
|
191
|
-
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
|
+
]),
|
|
192
136
|
};
|
|
193
137
|
return metadata;
|
|
194
138
|
}
|
|
195
|
-
__getFileDescriptor.fromReq = fromReq;
|
|
196
139
|
return __getFileDescriptor;
|
|
197
140
|
}
|
|
198
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Gets information about the specified files in the Media Manager.
|
|
143
|
+
*
|
|
144
|
+
*
|
|
145
|
+
* The `getFileDescriptors()` function returns a Promise that resolves to an array containing the specified files' descriptors.
|
|
146
|
+
*
|
|
147
|
+
* Use `getFileDescriptor()` to get a single file descriptor.
|
|
148
|
+
*/
|
|
199
149
|
export function getFileDescriptors(payload) {
|
|
200
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_getFileDescriptorsRequest, {});
|
|
201
|
-
const { fromJSON: fromRes } = serializer(_getFileDescriptorsResponse, {
|
|
202
|
-
_archive,
|
|
203
|
-
_audio,
|
|
204
|
-
_audioV2,
|
|
205
|
-
_document,
|
|
206
|
-
_faceRecognition,
|
|
207
|
-
_fileDescriptor,
|
|
208
|
-
_fileMedia,
|
|
209
|
-
_image,
|
|
210
|
-
_imageMedia,
|
|
211
|
-
_model3D,
|
|
212
|
-
_videoResolution,
|
|
213
|
-
_videoV2,
|
|
214
|
-
});
|
|
215
150
|
function __getFileDescriptors({ host }) {
|
|
216
|
-
const serializedData = toReq(payload);
|
|
217
151
|
const metadata = {
|
|
218
152
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
219
153
|
method: 'POST',
|
|
220
154
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptors',
|
|
221
155
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
222
156
|
protoPath: '/v1/files/get-files',
|
|
223
|
-
data:
|
|
157
|
+
data: payload,
|
|
224
158
|
host,
|
|
225
159
|
}),
|
|
226
|
-
data:
|
|
227
|
-
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
|
+
]),
|
|
228
192
|
};
|
|
229
193
|
return metadata;
|
|
230
194
|
}
|
|
231
|
-
__getFileDescriptors.fromReq = fromReq;
|
|
232
195
|
return __getFileDescriptors;
|
|
233
196
|
}
|
|
234
197
|
/**
|
|
235
|
-
* Updates a file.
|
|
198
|
+
* Updates a file.
|
|
199
|
+
*
|
|
200
|
+
*
|
|
201
|
+
* The `updateFileDescriptor()` function returns a Promise that resolves to the updated file's descriptor.
|
|
236
202
|
*
|
|
237
203
|
* You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
|
|
238
204
|
*/
|
|
239
205
|
export function updateFileDescriptor(payload) {
|
|
240
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_updateFileDescriptorRequest, {
|
|
241
|
-
_archive,
|
|
242
|
-
_audio,
|
|
243
|
-
_audioV2,
|
|
244
|
-
_document,
|
|
245
|
-
_faceRecognition,
|
|
246
|
-
_fileDescriptor,
|
|
247
|
-
_fileMedia,
|
|
248
|
-
_image,
|
|
249
|
-
_imageMedia,
|
|
250
|
-
_model3D,
|
|
251
|
-
_videoResolution,
|
|
252
|
-
_videoV2,
|
|
253
|
-
});
|
|
254
|
-
const { fromJSON: fromRes } = serializer(_updateFileDescriptorResponse, {
|
|
255
|
-
_archive,
|
|
256
|
-
_audio,
|
|
257
|
-
_audioV2,
|
|
258
|
-
_document,
|
|
259
|
-
_faceRecognition,
|
|
260
|
-
_fileDescriptor,
|
|
261
|
-
_fileMedia,
|
|
262
|
-
_image,
|
|
263
|
-
_imageMedia,
|
|
264
|
-
_model3D,
|
|
265
|
-
_videoResolution,
|
|
266
|
-
_videoV2,
|
|
267
|
-
});
|
|
268
206
|
function __updateFileDescriptor({ host }) {
|
|
269
|
-
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
|
+
]);
|
|
270
240
|
const metadata = {
|
|
271
241
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
272
242
|
method: 'PATCH',
|
|
@@ -277,119 +247,150 @@ export function updateFileDescriptor(payload) {
|
|
|
277
247
|
host,
|
|
278
248
|
}),
|
|
279
249
|
data: serializedData,
|
|
280
|
-
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
|
+
]),
|
|
281
279
|
};
|
|
282
280
|
return metadata;
|
|
283
281
|
}
|
|
284
|
-
__updateFileDescriptor.fromReq = fromReq;
|
|
285
282
|
return __updateFileDescriptor;
|
|
286
283
|
}
|
|
287
284
|
/**
|
|
288
285
|
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
289
286
|
*
|
|
287
|
+
* The `generateFileUploadUrl()` function returns a Promise that resolves to an upload URL.
|
|
288
|
+
*
|
|
290
289
|
* To learn how external clients can use the generated upload URL in the response to upload a file to the Media Manager, see the Upload API article.
|
|
291
290
|
*
|
|
292
|
-
* > **Note:** Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, use
|
|
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.
|
|
293
292
|
*/
|
|
294
293
|
export function generateFileUploadUrl(payload) {
|
|
295
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFileUploadUrlRequest, {});
|
|
296
|
-
const { fromJSON: fromRes } = serializer(_generateFileUploadUrlResponse, {});
|
|
297
294
|
function __generateFileUploadUrl({ host }) {
|
|
298
|
-
const serializedData = toReq(payload);
|
|
299
295
|
const metadata = {
|
|
300
296
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
301
297
|
method: 'POST',
|
|
302
298
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileUploadUrl',
|
|
303
299
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
304
300
|
protoPath: '/v1/files/generate-upload-url',
|
|
305
|
-
data:
|
|
301
|
+
data: payload,
|
|
306
302
|
host,
|
|
307
303
|
}),
|
|
308
|
-
data:
|
|
309
|
-
transformResponse: fromRes,
|
|
304
|
+
data: payload,
|
|
310
305
|
};
|
|
311
306
|
return metadata;
|
|
312
307
|
}
|
|
313
|
-
__generateFileUploadUrl.fromReq = fromReq;
|
|
314
308
|
return __generateFileUploadUrl;
|
|
315
309
|
}
|
|
316
310
|
/**
|
|
317
|
-
* Generates a resumable upload URL to allow external clients to
|
|
311
|
+
* Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
|
|
312
|
+
*
|
|
313
|
+
* The `generateFileResumableUploadUrl()` function returns a Promise that resolves to an upload URL, token, and protocol.
|
|
318
314
|
*
|
|
319
|
-
*
|
|
315
|
+
* When using the resumable upload URL, any interruptions will pause the file upload process, which automatically resumes once the interruption is resolved. The resumable upload URL is also helpful when network connection is poor.
|
|
320
316
|
*
|
|
321
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.
|
|
322
318
|
*/
|
|
323
319
|
export function generateFileResumableUploadUrl(payload) {
|
|
324
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateFileResumableUploadUrlRequest, {});
|
|
325
|
-
const { fromJSON: fromRes } = serializer(_generateFileResumableUploadUrlResponse, {});
|
|
326
320
|
function __generateFileResumableUploadUrl({ host }) {
|
|
327
|
-
const serializedData = toReq(payload);
|
|
328
321
|
const metadata = {
|
|
329
322
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
330
323
|
method: 'POST',
|
|
331
324
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileResumableUploadUrl',
|
|
332
325
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
333
326
|
protoPath: '/v1/files/generate-resumable-upload-url',
|
|
334
|
-
data:
|
|
327
|
+
data: payload,
|
|
335
328
|
host,
|
|
336
329
|
}),
|
|
337
|
-
data:
|
|
338
|
-
transformResponse: fromRes,
|
|
330
|
+
data: payload,
|
|
339
331
|
};
|
|
340
332
|
return metadata;
|
|
341
333
|
}
|
|
342
|
-
__generateFileResumableUploadUrl.fromReq = fromReq;
|
|
343
334
|
return __generateFileResumableUploadUrl;
|
|
344
335
|
}
|
|
345
336
|
/**
|
|
346
|
-
* Imports a file to the Media Manager using an external
|
|
337
|
+
* Imports a file to the Media Manager using an external URL.
|
|
347
338
|
*
|
|
348
|
-
*
|
|
339
|
+
* The `importFile()` function returns a Promise that resolves to the imported file's descriptor.
|
|
340
|
+
*
|
|
341
|
+
* This function returns information about the imported file. Importing a file is the method through which you can add files to the Media Manager.
|
|
349
342
|
* Use the `parentFolderId` parameter to specify which folder you want the file to be imported to.
|
|
350
343
|
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
351
344
|
*
|
|
352
|
-
* To import a file, you need to
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* >**Note:** The `media` property isn't returned in the `files` response object.
|
|
358
|
-
*
|
|
345
|
+
* To import a file, you need to pass one of the following:
|
|
346
|
+
* - The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
|
|
347
|
+
* - The file's name and extension. For example, `'my-image.png'`.
|
|
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.
|
|
359
349
|
*/
|
|
360
350
|
export function importFile(payload) {
|
|
361
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_importFileRequest, {});
|
|
362
|
-
const { fromJSON: fromRes } = serializer(_importFileResponse, {
|
|
363
|
-
_archive,
|
|
364
|
-
_audio,
|
|
365
|
-
_audioV2,
|
|
366
|
-
_document,
|
|
367
|
-
_faceRecognition,
|
|
368
|
-
_fileDescriptor,
|
|
369
|
-
_fileMedia,
|
|
370
|
-
_image,
|
|
371
|
-
_imageMedia,
|
|
372
|
-
_model3D,
|
|
373
|
-
_videoResolution,
|
|
374
|
-
_videoV2,
|
|
375
|
-
});
|
|
376
351
|
function __importFile({ host }) {
|
|
377
|
-
const serializedData = toReq(payload);
|
|
378
352
|
const metadata = {
|
|
379
353
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
380
354
|
method: 'POST',
|
|
381
355
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.ImportFile',
|
|
382
356
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
383
357
|
protoPath: '/v1/files/import',
|
|
384
|
-
data:
|
|
358
|
+
data: payload,
|
|
385
359
|
host,
|
|
386
360
|
}),
|
|
387
|
-
data:
|
|
388
|
-
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
|
+
]),
|
|
389
391
|
};
|
|
390
392
|
return metadata;
|
|
391
393
|
}
|
|
392
|
-
__importFile.fromReq = fromReq;
|
|
393
394
|
return __importFile;
|
|
394
395
|
}
|
|
395
396
|
/**
|
|
@@ -397,210 +398,281 @@ export function importFile(payload) {
|
|
|
397
398
|
* > This function has been replaced with `bulkImportFile()`, and will be removed on March 31, 2024.
|
|
398
399
|
*
|
|
399
400
|
*
|
|
401
|
+
* The `bulkImportFiles()` function returns a Promise that resolves to an array of the imported files' descriptors.
|
|
402
|
+
*
|
|
400
403
|
* Imports a bulk of files to the Media Manager using external urls.
|
|
401
404
|
*
|
|
402
405
|
* Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
|
|
403
406
|
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
404
407
|
*
|
|
405
|
-
* To import
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
408
|
+
* To import a file, you need to pass one of the following:
|
|
409
|
+
* - The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
|
|
410
|
+
* - The file's name and extension. For example, `'my-image.png'`.
|
|
411
|
+
* - 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.
|
|
409
412
|
*
|
|
410
413
|
* >**Note:** The `media` property isn't returned in the `files` response object.
|
|
411
414
|
*/
|
|
412
415
|
export function bulkImportFiles(payload) {
|
|
413
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkImportFilesRequest, { _importFileRequest });
|
|
414
|
-
const { fromJSON: fromRes } = serializer(_bulkImportFilesResponse, {
|
|
415
|
-
_archive,
|
|
416
|
-
_audio,
|
|
417
|
-
_audioV2,
|
|
418
|
-
_document,
|
|
419
|
-
_faceRecognition,
|
|
420
|
-
_fileDescriptor,
|
|
421
|
-
_fileMedia,
|
|
422
|
-
_image,
|
|
423
|
-
_imageMedia,
|
|
424
|
-
_model3D,
|
|
425
|
-
_videoResolution,
|
|
426
|
-
_videoV2,
|
|
427
|
-
});
|
|
428
416
|
function __bulkImportFiles({ host }) {
|
|
429
|
-
const serializedData = toReq(payload);
|
|
430
417
|
const metadata = {
|
|
431
418
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
432
419
|
method: 'POST',
|
|
433
420
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFiles',
|
|
434
421
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
435
422
|
protoPath: '/v1/bulk/files/import',
|
|
436
|
-
data:
|
|
423
|
+
data: payload,
|
|
437
424
|
host,
|
|
438
425
|
}),
|
|
439
|
-
data:
|
|
440
|
-
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
|
+
]),
|
|
441
458
|
};
|
|
442
459
|
return metadata;
|
|
443
460
|
}
|
|
444
|
-
__bulkImportFiles.fromReq = fromReq;
|
|
445
461
|
return __bulkImportFiles;
|
|
446
462
|
}
|
|
447
463
|
/**
|
|
448
|
-
* Imports a bulk of files to the Media Manager using external urls.
|
|
464
|
+
* Imports a bulk of files to the Media Manager using external urls.
|
|
449
465
|
*
|
|
450
|
-
*
|
|
451
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
466
|
+
* The `bulkImportFile()` function returns a Promise that resolves to an object containing bulk import metadata and an array of imported files' descriptors and metadata.
|
|
452
467
|
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
* 2. Pass each file's name and extension. For example, 'my-image.png'.
|
|
456
|
-
* 3. If you don't know a file's extension or MIME type, pass its media type 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.
|
|
468
|
+
* Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
|
|
469
|
+
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
457
470
|
*
|
|
458
|
-
*
|
|
471
|
+
* To import a file, you need to pass one of the following:
|
|
472
|
+
* - The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` parameter of the request. For example, `'image/png'`.
|
|
473
|
+
* - The file's name and extension. For example, `'my-image.png'`.
|
|
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.
|
|
459
475
|
*/
|
|
460
476
|
export function bulkImportFile(payload) {
|
|
461
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkImportFileRequest, { _importFileRequest });
|
|
462
|
-
const { fromJSON: fromRes } = serializer(_bulkImportFileResponse, {
|
|
463
|
-
_archive,
|
|
464
|
-
_audio,
|
|
465
|
-
_audioV2,
|
|
466
|
-
_bulkImportFileResult,
|
|
467
|
-
_document,
|
|
468
|
-
_faceRecognition,
|
|
469
|
-
_fileDescriptor,
|
|
470
|
-
_fileMedia,
|
|
471
|
-
_image,
|
|
472
|
-
_imageMedia,
|
|
473
|
-
_model3D,
|
|
474
|
-
_videoResolution,
|
|
475
|
-
_videoV2,
|
|
476
|
-
});
|
|
477
477
|
function __bulkImportFile({ host }) {
|
|
478
|
-
const serializedData = toReq(payload);
|
|
479
478
|
const metadata = {
|
|
480
479
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
481
480
|
method: 'POST',
|
|
482
481
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFile',
|
|
483
482
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
484
483
|
protoPath: '/v1/bulk/files/import-v2',
|
|
485
|
-
data:
|
|
484
|
+
data: payload,
|
|
486
485
|
host,
|
|
487
486
|
}),
|
|
488
|
-
data:
|
|
489
|
-
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
|
+
]),
|
|
490
527
|
};
|
|
491
528
|
return metadata;
|
|
492
529
|
}
|
|
493
|
-
__bulkImportFile.fromReq = fromReq;
|
|
494
530
|
return __bulkImportFile;
|
|
495
531
|
}
|
|
496
532
|
/**
|
|
497
533
|
* Retrieves a list of files in the Media Manager.
|
|
498
534
|
*
|
|
535
|
+
* The `listFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
|
|
536
|
+
*
|
|
499
537
|
* To retrieve a list of files within a specific folder in the Media Manager, pass the folder's ID in the `parentFolderId` parameter. If no folder is specified, the endpoint retrieves only the list of files in the root folder of the Media Manager.
|
|
538
|
+
*
|
|
539
|
+
* To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
|
|
500
540
|
*/
|
|
501
541
|
export function listFiles(payload) {
|
|
502
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_listFilesRequest, {});
|
|
503
|
-
const { fromJSON: fromRes } = serializer(_listFilesResponse, {
|
|
504
|
-
_archive,
|
|
505
|
-
_audio,
|
|
506
|
-
_audioV2,
|
|
507
|
-
_document,
|
|
508
|
-
_faceRecognition,
|
|
509
|
-
_fileDescriptor,
|
|
510
|
-
_fileMedia,
|
|
511
|
-
_image,
|
|
512
|
-
_imageMedia,
|
|
513
|
-
_model3D,
|
|
514
|
-
_videoResolution,
|
|
515
|
-
_videoV2,
|
|
516
|
-
});
|
|
517
542
|
function __listFiles({ host }) {
|
|
518
|
-
const serializedData = toReq(payload);
|
|
519
543
|
const metadata = {
|
|
520
544
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
521
545
|
method: 'GET',
|
|
522
546
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.ListFiles',
|
|
523
547
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
524
548
|
protoPath: '/v1/files',
|
|
525
|
-
data:
|
|
549
|
+
data: payload,
|
|
526
550
|
host,
|
|
527
551
|
}),
|
|
528
|
-
params: toURLSearchParams(
|
|
529
|
-
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
|
+
]),
|
|
530
584
|
};
|
|
531
585
|
return metadata;
|
|
532
586
|
}
|
|
533
|
-
__listFiles.fromReq = fromReq;
|
|
534
587
|
return __listFiles;
|
|
535
588
|
}
|
|
536
589
|
/**
|
|
537
590
|
* Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
|
|
538
591
|
*
|
|
539
|
-
*
|
|
592
|
+
* The `searchFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
|
|
593
|
+
*
|
|
594
|
+
* If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
|
|
540
595
|
*/
|
|
541
596
|
export function searchFiles(payload) {
|
|
542
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_searchFilesRequest, {});
|
|
543
|
-
const { fromJSON: fromRes } = serializer(_searchFilesResponse, {
|
|
544
|
-
_archive,
|
|
545
|
-
_audio,
|
|
546
|
-
_audioV2,
|
|
547
|
-
_document,
|
|
548
|
-
_faceRecognition,
|
|
549
|
-
_fileDescriptor,
|
|
550
|
-
_fileMedia,
|
|
551
|
-
_image,
|
|
552
|
-
_imageMedia,
|
|
553
|
-
_model3D,
|
|
554
|
-
_videoResolution,
|
|
555
|
-
_videoV2,
|
|
556
|
-
});
|
|
557
597
|
function __searchFiles({ host }) {
|
|
558
|
-
const serializedData = toReq(payload);
|
|
559
598
|
const metadata = {
|
|
560
599
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
561
600
|
method: 'POST',
|
|
562
601
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.SearchFiles',
|
|
563
602
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
564
603
|
protoPath: '/v1/files/search',
|
|
565
|
-
data:
|
|
604
|
+
data: payload,
|
|
566
605
|
host,
|
|
567
606
|
}),
|
|
568
|
-
data:
|
|
569
|
-
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
|
+
]),
|
|
570
639
|
};
|
|
571
640
|
return metadata;
|
|
572
641
|
}
|
|
573
|
-
__searchFiles.fromReq = fromReq;
|
|
574
642
|
return __searchFiles;
|
|
575
643
|
}
|
|
576
|
-
/**
|
|
644
|
+
/**
|
|
645
|
+
* Generates a URL for streaming a specific video file in the Media Manager.
|
|
646
|
+
*
|
|
647
|
+
*
|
|
648
|
+
* The `generateVideoStreamingUrl()` function returns a Promise that resolves to a download URL and its asset key.
|
|
649
|
+
*
|
|
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.
|
|
651
|
+
*/
|
|
577
652
|
export function generateVideoStreamingUrl(payload) {
|
|
578
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_generateVideoStreamingUrlRequest, {});
|
|
579
|
-
const { fromJSON: fromRes } = serializer(_generateVideoStreamingUrlResponse, {});
|
|
580
653
|
function __generateVideoStreamingUrl({ host }) {
|
|
581
|
-
const serializedData = toReq(payload);
|
|
582
654
|
const metadata = {
|
|
583
655
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
584
656
|
method: 'POST',
|
|
585
657
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateVideoStreamingUrl',
|
|
586
658
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
587
659
|
protoPath: '/v1/files/video/{fileId}/generate-stream-url',
|
|
588
|
-
data:
|
|
660
|
+
data: payload,
|
|
589
661
|
host,
|
|
590
662
|
}),
|
|
591
|
-
data:
|
|
592
|
-
transformResponse: fromRes,
|
|
663
|
+
data: payload,
|
|
593
664
|
};
|
|
594
665
|
return metadata;
|
|
595
666
|
}
|
|
596
|
-
__generateVideoStreamingUrl.fromReq = fromReq;
|
|
597
667
|
return __generateVideoStreamingUrl;
|
|
598
668
|
}
|
|
599
669
|
/**
|
|
600
670
|
* Deletes the specified files from the Media Manager.
|
|
601
671
|
*
|
|
602
672
|
*
|
|
603
|
-
* The
|
|
673
|
+
* The `bulkDeleteFiles()` function returns a Promise that resolves when the files are deleted.
|
|
674
|
+
*
|
|
675
|
+
* The deleted files are moved to the Media Manager's trash bin (`TRASH_ROOT` folder) unless permanently deleted. To permanently delete files, pass the `permanent` parameter with the value `true`. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.
|
|
604
676
|
*
|
|
605
677
|
* >**Notes:**
|
|
606
678
|
* > - The specified files can be from different folders.
|
|
@@ -610,88 +682,99 @@ export function generateVideoStreamingUrl(payload) {
|
|
|
610
682
|
* > - You can use `bulkRestoreFilesFromTrashBin()` to restore files from the Media Manager's trash bin.
|
|
611
683
|
*/
|
|
612
684
|
export function bulkDeleteFiles(payload) {
|
|
613
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkDeleteFilesRequest, {});
|
|
614
|
-
const { fromJSON: fromRes } = serializer(_bulkDeleteFilesResponse, {});
|
|
615
685
|
function __bulkDeleteFiles({ host }) {
|
|
616
|
-
const serializedData = toReq(payload);
|
|
617
686
|
const metadata = {
|
|
618
687
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
619
688
|
method: 'POST',
|
|
620
689
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkDeleteFiles',
|
|
621
690
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
622
691
|
protoPath: '/v1/bulk/files/delete',
|
|
623
|
-
data:
|
|
692
|
+
data: payload,
|
|
624
693
|
host,
|
|
625
694
|
}),
|
|
626
|
-
data:
|
|
627
|
-
transformResponse: fromRes,
|
|
695
|
+
data: payload,
|
|
628
696
|
};
|
|
629
697
|
return metadata;
|
|
630
698
|
}
|
|
631
|
-
__bulkDeleteFiles.fromReq = fromReq;
|
|
632
699
|
return __bulkDeleteFiles;
|
|
633
700
|
}
|
|
634
|
-
/**
|
|
701
|
+
/**
|
|
702
|
+
* Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
|
|
703
|
+
*
|
|
704
|
+
* The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
|
|
705
|
+
*/
|
|
635
706
|
export function bulkRestoreFilesFromTrashBin(payload) {
|
|
636
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_bulkRestoreFilesFromTrashBinRequest, {});
|
|
637
|
-
const { fromJSON: fromRes } = serializer(_bulkRestoreFilesFromTrashBinResponse, {});
|
|
638
707
|
function __bulkRestoreFilesFromTrashBin({ host }) {
|
|
639
|
-
const serializedData = toReq(payload);
|
|
640
708
|
const metadata = {
|
|
641
709
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
642
710
|
method: 'POST',
|
|
643
711
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkRestoreFilesFromTrashBin',
|
|
644
712
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
645
713
|
protoPath: '/v1/bulk/trash-bin/files/restore',
|
|
646
|
-
data:
|
|
714
|
+
data: payload,
|
|
647
715
|
host,
|
|
648
716
|
}),
|
|
649
|
-
data:
|
|
650
|
-
transformResponse: fromRes,
|
|
717
|
+
data: payload,
|
|
651
718
|
};
|
|
652
719
|
return metadata;
|
|
653
720
|
}
|
|
654
|
-
__bulkRestoreFilesFromTrashBin.fromReq = fromReq;
|
|
655
721
|
return __bulkRestoreFilesFromTrashBin;
|
|
656
722
|
}
|
|
657
723
|
/**
|
|
658
724
|
* Retrieves a list of files in the Media Manager's trash bin.
|
|
659
725
|
*
|
|
660
|
-
*
|
|
726
|
+
* The `listDeletedFiles()` function returns a Promise that resolves to an array of the specified deleted files' descriptors and cursor information.
|
|
727
|
+
*
|
|
728
|
+
* >**Note:** The Media Manager's trash bin (`TRASH_ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
|
|
729
|
+
*
|
|
730
|
+
* To retrieve a list of non-deleted files, use the `listFiles()` function.
|
|
661
731
|
*/
|
|
662
732
|
export function listDeletedFiles(payload) {
|
|
663
|
-
const { toJSON: toReq, fromJSON: fromReq } = serializer(_listDeletedFilesRequest, {});
|
|
664
|
-
const { fromJSON: fromRes } = serializer(_listDeletedFilesResponse, {
|
|
665
|
-
_archive,
|
|
666
|
-
_audio,
|
|
667
|
-
_audioV2,
|
|
668
|
-
_document,
|
|
669
|
-
_faceRecognition,
|
|
670
|
-
_fileDescriptor,
|
|
671
|
-
_fileMedia,
|
|
672
|
-
_image,
|
|
673
|
-
_imageMedia,
|
|
674
|
-
_model3D,
|
|
675
|
-
_videoResolution,
|
|
676
|
-
_videoV2,
|
|
677
|
-
});
|
|
678
733
|
function __listDeletedFiles({ host }) {
|
|
679
|
-
const serializedData = toReq(payload);
|
|
680
734
|
const metadata = {
|
|
681
735
|
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
682
736
|
method: 'GET',
|
|
683
737
|
methodFqn: 'com.wix.media.site_media.v1.FilesService.ListDeletedFiles',
|
|
684
738
|
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
685
739
|
protoPath: '/v1/trash-bin/files',
|
|
686
|
-
data:
|
|
740
|
+
data: payload,
|
|
687
741
|
host,
|
|
688
742
|
}),
|
|
689
|
-
params: toURLSearchParams(
|
|
690
|
-
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
|
+
]),
|
|
691
775
|
};
|
|
692
776
|
return metadata;
|
|
693
777
|
}
|
|
694
|
-
__listDeletedFiles.fromReq = fromReq;
|
|
695
778
|
return __listDeletedFiles;
|
|
696
779
|
}
|
|
697
780
|
//# sourceMappingURL=media-site-media-v1-file-descriptor.http.js.map
|