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