@wix/media 1.0.63 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context.d.ts +4 -4
- package/build/cjs/context.js +4 -4
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +4 -4
- package/build/cjs/index.js +4 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +4 -4
- package/build/cjs/meta.js +4 -4
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +4 -4
- package/build/es/context.js +4 -4
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +4 -4
- package/build/es/index.js +4 -4
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +4 -4
- package/build/es/meta.js +4 -4
- package/build/es/meta.js.map +1 -1
- package/package.json +14 -9
- package/build/cjs/index.typings.d.ts +0 -4
- package/build/cjs/index.typings.js +0 -31
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +0 -8
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js +0 -107
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +0 -16
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js +0 -245
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +0 -24
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js +0 -142
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +0 -26
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js +0 -49
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +0 -221
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js +0 -22
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +0 -315
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js +0 -421
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +0 -13
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js +0 -192
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +0 -29
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js +0 -446
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +0 -33
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js +0 -237
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +0 -59
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js +0 -81
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +0 -949
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js +0 -27
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +0 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +0 -907
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js +0 -763
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.context.d.ts +0 -18
- package/build/cjs/src/media-site-media-v1-file-descriptor.context.js +0 -277
- package/build/cjs/src/media-site-media-v1-file-descriptor.context.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.d.ts +0 -185
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +0 -839
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.meta.d.ts +0 -36
- package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js +0 -332
- package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +0 -136
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.js +0 -118
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.d.ts +0 -2017
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.js +0 -99
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +0 -2105
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +0 -1442
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-folder.context.d.ts +0 -11
- package/build/cjs/src/media-site-media-v1-folder.context.js +0 -158
- package/build/cjs/src/media-site-media-v1-folder.context.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-folder.http.d.ts +0 -81
- package/build/cjs/src/media-site-media-v1-folder.http.js +0 -364
- package/build/cjs/src/media-site-media-v1-folder.http.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-folder.meta.d.ts +0 -27
- package/build/cjs/src/media-site-media-v1-folder.meta.js +0 -199
- package/build/cjs/src/media-site-media-v1-folder.meta.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-folder.public.d.ts +0 -27
- package/build/cjs/src/media-site-media-v1-folder.public.js +0 -69
- package/build/cjs/src/media-site-media-v1-folder.public.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-folder.types.d.ts +0 -335
- package/build/cjs/src/media-site-media-v1-folder.types.js +0 -50
- package/build/cjs/src/media-site-media-v1-folder.types.js.map +0 -1
- package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +0 -603
- package/build/cjs/src/media-site-media-v1-folder.universal.js +0 -718
- package/build/cjs/src/media-site-media-v1-folder.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -4
- package/build/es/index.typings.js +0 -5
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +0 -8
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js +0 -98
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +0 -16
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js +0 -236
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +0 -24
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js +0 -110
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +0 -26
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js +0 -35
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +0 -221
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js +0 -19
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +0 -315
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js +0 -389
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +0 -13
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js +0 -178
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +0 -29
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js +0 -432
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +0 -33
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js +0 -200
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +0 -59
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js +0 -60
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +0 -949
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js +0 -24
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +0 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +0 -907
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js +0 -726
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +0 -1
- package/build/es/src/media-site-media-v1-file-descriptor.context.d.ts +0 -18
- package/build/es/src/media-site-media-v1-file-descriptor.context.js +0 -258
- package/build/es/src/media-site-media-v1-file-descriptor.context.js.map +0 -1
- package/build/es/src/media-site-media-v1-file-descriptor.http.d.ts +0 -185
- package/build/es/src/media-site-media-v1-file-descriptor.http.js +0 -820
- package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +0 -1
- package/build/es/src/media-site-media-v1-file-descriptor.meta.d.ts +0 -36
- package/build/es/src/media-site-media-v1-file-descriptor.meta.js +0 -290
- package/build/es/src/media-site-media-v1-file-descriptor.meta.js.map +0 -1
- package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +0 -136
- package/build/es/src/media-site-media-v1-file-descriptor.public.js +0 -85
- package/build/es/src/media-site-media-v1-file-descriptor.public.js.map +0 -1
- package/build/es/src/media-site-media-v1-file-descriptor.types.d.ts +0 -2017
- package/build/es/src/media-site-media-v1-file-descriptor.types.js +0 -96
- package/build/es/src/media-site-media-v1-file-descriptor.types.js.map +0 -1
- package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +0 -2105
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js +0 -1400
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +0 -1
- package/build/es/src/media-site-media-v1-folder.context.d.ts +0 -11
- package/build/es/src/media-site-media-v1-folder.context.js +0 -146
- package/build/es/src/media-site-media-v1-folder.context.js.map +0 -1
- package/build/es/src/media-site-media-v1-folder.http.d.ts +0 -81
- package/build/es/src/media-site-media-v1-folder.http.js +0 -352
- package/build/es/src/media-site-media-v1-folder.http.js.map +0 -1
- package/build/es/src/media-site-media-v1-folder.meta.d.ts +0 -27
- package/build/es/src/media-site-media-v1-folder.meta.js +0 -164
- package/build/es/src/media-site-media-v1-folder.meta.js.map +0 -1
- package/build/es/src/media-site-media-v1-folder.public.d.ts +0 -27
- package/build/es/src/media-site-media-v1-folder.public.js +0 -50
- package/build/es/src/media-site-media-v1-folder.public.js.map +0 -1
- package/build/es/src/media-site-media-v1-folder.types.d.ts +0 -335
- package/build/es/src/media-site-media-v1-folder.types.js +0 -47
- package/build/es/src/media-site-media-v1-folder.types.js.map +0 -1
- package/build/es/src/media-site-media-v1-folder.universal.d.ts +0 -603
- package/build/es/src/media-site-media-v1-folder.universal.js +0 -683
- package/build/es/src/media-site-media-v1-folder.universal.js.map +0 -1
|
@@ -1,839 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
-
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
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");
|
|
11
|
-
const metro_runtime_2 = require("@wix/metro-runtime");
|
|
12
|
-
function resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
|
|
13
|
-
const domainToMappings = {
|
|
14
|
-
'apps._base_domain_': [
|
|
15
|
-
{
|
|
16
|
-
srcPath: '/_api/wix-privatemedia-proxy-server',
|
|
17
|
-
destPath: '/api',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
srcPath: '/_api/wix-privatemedia-proxy-server/v1',
|
|
21
|
-
destPath: '/v1',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
'manage._base_domain_': [
|
|
25
|
-
{
|
|
26
|
-
srcPath: '/_api/wix-privatemedia-proxy-server',
|
|
27
|
-
destPath: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
'www.wixapis.com': [
|
|
31
|
-
{
|
|
32
|
-
srcPath: '/site-media/v1',
|
|
33
|
-
destPath: '/v1',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
'*.dev.wix-code.com': [
|
|
37
|
-
{
|
|
38
|
-
srcPath: '/_api/wix-privatemedia-proxy-server',
|
|
39
|
-
destPath: '',
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
'api._api_base_domain_': [
|
|
43
|
-
{
|
|
44
|
-
srcPath: '/wix-privatemedia-proxy-server',
|
|
45
|
-
destPath: '',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
'bo._base_domain_': [
|
|
49
|
-
{
|
|
50
|
-
srcPath: '/wix-privatemedia-proxy-server',
|
|
51
|
-
destPath: '',
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
'wixbo.ai': [
|
|
55
|
-
{
|
|
56
|
-
srcPath: '/wix-privatemedia-proxy-server',
|
|
57
|
-
destPath: '',
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
_: [
|
|
61
|
-
{
|
|
62
|
-
srcPath: '/wix-privatemedia-proxy-server',
|
|
63
|
-
destPath: '',
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
};
|
|
67
|
-
return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Generates a URL for downloading a compressed file containing specific files in the Media Manager.
|
|
71
|
-
*
|
|
72
|
-
* The `generateFilesDownloadUrl()` function returns a Promise that resolves to a download URL.
|
|
73
|
-
*
|
|
74
|
-
* The compressed file can contain up to 1000 files.
|
|
75
|
-
*
|
|
76
|
-
* To generate one or more temporary URLs for downloading a specific file in the Media Manager, use the `generateFileDownloadUrl()` function.
|
|
77
|
-
* You can use the `expirationInMinutes` parameter to set the URL expiration time, making it more secure than the `generateFilesDownloadUrl()` function.
|
|
78
|
-
* Therefore, to download private files, use the `generateFileDownloadUrl` function for each private file that you want to generate a download URL for.
|
|
79
|
-
*/
|
|
80
|
-
function generateFilesDownloadUrl(payload) {
|
|
81
|
-
function __generateFilesDownloadUrl({ host }) {
|
|
82
|
-
const metadata = {
|
|
83
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
84
|
-
method: 'POST',
|
|
85
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFilesDownloadUrl',
|
|
86
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
87
|
-
protoPath: '/v1/files/generate-download-url',
|
|
88
|
-
data: payload,
|
|
89
|
-
host,
|
|
90
|
-
}),
|
|
91
|
-
data: payload,
|
|
92
|
-
};
|
|
93
|
-
return metadata;
|
|
94
|
-
}
|
|
95
|
-
return __generateFilesDownloadUrl;
|
|
96
|
-
}
|
|
97
|
-
exports.generateFilesDownloadUrl = generateFilesDownloadUrl;
|
|
98
|
-
/**
|
|
99
|
-
* Generates one or more temporary URLs for downloading a specific file in the Media Manager.
|
|
100
|
-
*
|
|
101
|
-
* The `generateFileDownloadUrl()` function returns a Promise that resolves to an array containing download URLs for the assets specified in the options parameter.
|
|
102
|
-
*
|
|
103
|
-
* To download different assets of the file, use the `assetKeys` parameter which generates a download URL for each asset.
|
|
104
|
-
* If no asset key is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
|
|
105
|
-
*
|
|
106
|
-
* Use this function to grant external clients access to a private media file. Use the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect URL when the URL expires.
|
|
107
|
-
*
|
|
108
|
-
* To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, use the `generateFilesDownloadUrl()` function.
|
|
109
|
-
* Since this is a permanent URL, it is less secure. Therefore, to download private files, use the `generateFileDownloadUrl()` function for each private file that you want to generate a download URL for.
|
|
110
|
-
*/
|
|
111
|
-
function generateFileDownloadUrl(payload) {
|
|
112
|
-
function __generateFileDownloadUrl({ host }) {
|
|
113
|
-
const metadata = {
|
|
114
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
115
|
-
method: 'POST',
|
|
116
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileDownloadUrl',
|
|
117
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
118
|
-
protoPath: '/v1/files/{fileId}/generate-download-url',
|
|
119
|
-
data: payload,
|
|
120
|
-
host,
|
|
121
|
-
}),
|
|
122
|
-
data: payload,
|
|
123
|
-
};
|
|
124
|
-
return metadata;
|
|
125
|
-
}
|
|
126
|
-
return __generateFileDownloadUrl;
|
|
127
|
-
}
|
|
128
|
-
exports.generateFileDownloadUrl = generateFileDownloadUrl;
|
|
129
|
-
/**
|
|
130
|
-
* Gets information about the specified file in the Media Manager.
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* The `getFileDescriptor()` function returns a Promise that resolves to the specified file's descriptor.
|
|
134
|
-
*
|
|
135
|
-
* Use `getFileDescriptors()` to get multiple file descriptors at once.
|
|
136
|
-
*/
|
|
137
|
-
function getFileDescriptor(payload) {
|
|
138
|
-
function __getFileDescriptor({ host }) {
|
|
139
|
-
const metadata = {
|
|
140
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
141
|
-
method: 'GET',
|
|
142
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptor',
|
|
143
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
144
|
-
protoPath: '/v1/files/{fileId}',
|
|
145
|
-
data: payload,
|
|
146
|
-
host,
|
|
147
|
-
}),
|
|
148
|
-
params: (0, metro_runtime_1.toURLSearchParams)(payload),
|
|
149
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
150
|
-
{
|
|
151
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
152
|
-
paths: [
|
|
153
|
-
{ path: 'file.createdDate' },
|
|
154
|
-
{ path: 'file.updatedDate' },
|
|
155
|
-
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
156
|
-
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
157
|
-
{ path: 'file.media.video.urlExpirationDate' },
|
|
158
|
-
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
159
|
-
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
160
|
-
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
161
|
-
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
162
|
-
{ path: 'file.media.document.urlExpirationDate' },
|
|
163
|
-
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
164
|
-
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
165
|
-
{ path: 'file.media.archive.urlExpirationDate' },
|
|
166
|
-
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
167
|
-
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
172
|
-
paths: [
|
|
173
|
-
{ path: 'file.media.image.faces.confidence' },
|
|
174
|
-
{ path: 'file.media.vector.faces.confidence' },
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
]),
|
|
178
|
-
};
|
|
179
|
-
return metadata;
|
|
180
|
-
}
|
|
181
|
-
return __getFileDescriptor;
|
|
182
|
-
}
|
|
183
|
-
exports.getFileDescriptor = getFileDescriptor;
|
|
184
|
-
/**
|
|
185
|
-
* Gets information about the specified files in the Media Manager.
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* The `getFileDescriptors()` function returns a Promise that resolves to an array containing the specified files' descriptors.
|
|
189
|
-
*
|
|
190
|
-
* Use `getFileDescriptor()` to get a single file descriptor.
|
|
191
|
-
*/
|
|
192
|
-
function getFileDescriptors(payload) {
|
|
193
|
-
function __getFileDescriptors({ host }) {
|
|
194
|
-
const metadata = {
|
|
195
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
196
|
-
method: 'POST',
|
|
197
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptors',
|
|
198
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
199
|
-
protoPath: '/v1/files/get-files',
|
|
200
|
-
data: payload,
|
|
201
|
-
host,
|
|
202
|
-
}),
|
|
203
|
-
data: payload,
|
|
204
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
205
|
-
{
|
|
206
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
207
|
-
paths: [
|
|
208
|
-
{ path: 'files.createdDate' },
|
|
209
|
-
{ path: 'files.updatedDate' },
|
|
210
|
-
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
211
|
-
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
212
|
-
{ path: 'files.media.video.urlExpirationDate' },
|
|
213
|
-
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
214
|
-
{
|
|
215
|
-
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
216
|
-
},
|
|
217
|
-
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
218
|
-
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
219
|
-
{ path: 'files.media.document.urlExpirationDate' },
|
|
220
|
-
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
221
|
-
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
222
|
-
{ path: 'files.media.archive.urlExpirationDate' },
|
|
223
|
-
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
224
|
-
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
225
|
-
],
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
229
|
-
paths: [
|
|
230
|
-
{ path: 'files.media.image.faces.confidence' },
|
|
231
|
-
{ path: 'files.media.vector.faces.confidence' },
|
|
232
|
-
],
|
|
233
|
-
},
|
|
234
|
-
]),
|
|
235
|
-
};
|
|
236
|
-
return metadata;
|
|
237
|
-
}
|
|
238
|
-
return __getFileDescriptors;
|
|
239
|
-
}
|
|
240
|
-
exports.getFileDescriptors = getFileDescriptors;
|
|
241
|
-
/**
|
|
242
|
-
* Updates a file.
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* The `updateFileDescriptor()` function returns a Promise that resolves to the updated file's descriptor.
|
|
246
|
-
*
|
|
247
|
-
* You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
|
|
248
|
-
*/
|
|
249
|
-
function updateFileDescriptor(payload) {
|
|
250
|
-
function __updateFileDescriptor({ host }) {
|
|
251
|
-
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
252
|
-
{
|
|
253
|
-
transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
|
|
254
|
-
paths: [{ path: 'fieldMask' }],
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
258
|
-
paths: [
|
|
259
|
-
{ path: 'file.createdDate' },
|
|
260
|
-
{ path: 'file.updatedDate' },
|
|
261
|
-
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
262
|
-
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
263
|
-
{ path: 'file.media.video.urlExpirationDate' },
|
|
264
|
-
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
265
|
-
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
266
|
-
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
267
|
-
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
268
|
-
{ path: 'file.media.document.urlExpirationDate' },
|
|
269
|
-
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
270
|
-
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
271
|
-
{ path: 'file.media.archive.urlExpirationDate' },
|
|
272
|
-
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
273
|
-
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
274
|
-
],
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
278
|
-
paths: [
|
|
279
|
-
{ path: 'file.media.image.faces.confidence' },
|
|
280
|
-
{ path: 'file.media.vector.faces.confidence' },
|
|
281
|
-
],
|
|
282
|
-
},
|
|
283
|
-
]);
|
|
284
|
-
const metadata = {
|
|
285
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
286
|
-
method: 'PATCH',
|
|
287
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.UpdateFileDescriptor',
|
|
288
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
289
|
-
protoPath: '/v1/files/{file.id}/update',
|
|
290
|
-
data: serializedData,
|
|
291
|
-
host,
|
|
292
|
-
}),
|
|
293
|
-
data: serializedData,
|
|
294
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
295
|
-
{
|
|
296
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
297
|
-
paths: [
|
|
298
|
-
{ path: 'file.createdDate' },
|
|
299
|
-
{ path: 'file.updatedDate' },
|
|
300
|
-
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
301
|
-
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
302
|
-
{ path: 'file.media.video.urlExpirationDate' },
|
|
303
|
-
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
304
|
-
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
305
|
-
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
306
|
-
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
307
|
-
{ path: 'file.media.document.urlExpirationDate' },
|
|
308
|
-
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
309
|
-
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
310
|
-
{ path: 'file.media.archive.urlExpirationDate' },
|
|
311
|
-
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
312
|
-
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
313
|
-
],
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
317
|
-
paths: [
|
|
318
|
-
{ path: 'file.media.image.faces.confidence' },
|
|
319
|
-
{ path: 'file.media.vector.faces.confidence' },
|
|
320
|
-
],
|
|
321
|
-
},
|
|
322
|
-
]),
|
|
323
|
-
};
|
|
324
|
-
return metadata;
|
|
325
|
-
}
|
|
326
|
-
return __updateFileDescriptor;
|
|
327
|
-
}
|
|
328
|
-
exports.updateFileDescriptor = updateFileDescriptor;
|
|
329
|
-
/**
|
|
330
|
-
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
331
|
-
*
|
|
332
|
-
* The `generateFileUploadUrl()` function returns a Promise that resolves to an upload URL.
|
|
333
|
-
*
|
|
334
|
-
* 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.
|
|
335
|
-
*
|
|
336
|
-
* > **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.
|
|
337
|
-
*/
|
|
338
|
-
function generateFileUploadUrl(payload) {
|
|
339
|
-
function __generateFileUploadUrl({ host }) {
|
|
340
|
-
const metadata = {
|
|
341
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
342
|
-
method: 'POST',
|
|
343
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileUploadUrl',
|
|
344
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
345
|
-
protoPath: '/v1/files/generate-upload-url',
|
|
346
|
-
data: payload,
|
|
347
|
-
host,
|
|
348
|
-
}),
|
|
349
|
-
data: payload,
|
|
350
|
-
};
|
|
351
|
-
return metadata;
|
|
352
|
-
}
|
|
353
|
-
return __generateFileUploadUrl;
|
|
354
|
-
}
|
|
355
|
-
exports.generateFileUploadUrl = generateFileUploadUrl;
|
|
356
|
-
/**
|
|
357
|
-
* Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
|
|
358
|
-
*
|
|
359
|
-
* The `generateFileResumableUploadUrl()` function returns a Promise that resolves to an upload URL, token, and protocol.
|
|
360
|
-
*
|
|
361
|
-
* 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.
|
|
362
|
-
*
|
|
363
|
-
* 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.
|
|
364
|
-
*/
|
|
365
|
-
function generateFileResumableUploadUrl(payload) {
|
|
366
|
-
function __generateFileResumableUploadUrl({ host }) {
|
|
367
|
-
const metadata = {
|
|
368
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
369
|
-
method: 'POST',
|
|
370
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileResumableUploadUrl',
|
|
371
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
372
|
-
protoPath: '/v1/files/generate-resumable-upload-url',
|
|
373
|
-
data: payload,
|
|
374
|
-
host,
|
|
375
|
-
}),
|
|
376
|
-
data: payload,
|
|
377
|
-
};
|
|
378
|
-
return metadata;
|
|
379
|
-
}
|
|
380
|
-
return __generateFileResumableUploadUrl;
|
|
381
|
-
}
|
|
382
|
-
exports.generateFileResumableUploadUrl = generateFileResumableUploadUrl;
|
|
383
|
-
/**
|
|
384
|
-
* Imports a file to the Media Manager using an external URL.
|
|
385
|
-
*
|
|
386
|
-
* The `importFile()` function returns a Promise that resolves to the imported file's descriptor.
|
|
387
|
-
*
|
|
388
|
-
* This function returns information about the imported file. Importing a file is the method through which you can add files to the Media Manager.
|
|
389
|
-
* Use the `parentFolderId` parameter to specify which folder you want the file to be imported to.
|
|
390
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
391
|
-
*
|
|
392
|
-
* To import a file, you need to do one of the following:
|
|
393
|
-
* - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
|
|
394
|
-
* - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
|
|
395
|
-
* - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
|
|
396
|
-
* > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
|
|
397
|
-
*/
|
|
398
|
-
function importFile(payload) {
|
|
399
|
-
function __importFile({ host }) {
|
|
400
|
-
const metadata = {
|
|
401
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
402
|
-
method: 'POST',
|
|
403
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.ImportFile',
|
|
404
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
405
|
-
protoPath: '/v1/files/import',
|
|
406
|
-
data: payload,
|
|
407
|
-
host,
|
|
408
|
-
}),
|
|
409
|
-
data: payload,
|
|
410
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
411
|
-
{
|
|
412
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
413
|
-
paths: [
|
|
414
|
-
{ path: 'file.createdDate' },
|
|
415
|
-
{ path: 'file.updatedDate' },
|
|
416
|
-
{ path: 'file.media.image.image.urlExpirationDate' },
|
|
417
|
-
{ path: 'file.media.image.previewImage.urlExpirationDate' },
|
|
418
|
-
{ path: 'file.media.video.urlExpirationDate' },
|
|
419
|
-
{ path: 'file.media.video.resolutions.urlExpirationDate' },
|
|
420
|
-
{ path: 'file.media.video.resolutions.poster.urlExpirationDate' },
|
|
421
|
-
{ path: 'file.media.video.posters.urlExpirationDate' },
|
|
422
|
-
{ path: 'file.media.audio.assets.urlExpirationDate' },
|
|
423
|
-
{ path: 'file.media.document.urlExpirationDate' },
|
|
424
|
-
{ path: 'file.media.vector.image.urlExpirationDate' },
|
|
425
|
-
{ path: 'file.media.vector.previewImage.urlExpirationDate' },
|
|
426
|
-
{ path: 'file.media.archive.urlExpirationDate' },
|
|
427
|
-
{ path: 'file.media.model3d.urlExpirationDate' },
|
|
428
|
-
{ path: 'file.media.model3d.thumbnail.urlExpirationDate' },
|
|
429
|
-
],
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
433
|
-
paths: [
|
|
434
|
-
{ path: 'file.media.image.faces.confidence' },
|
|
435
|
-
{ path: 'file.media.vector.faces.confidence' },
|
|
436
|
-
],
|
|
437
|
-
},
|
|
438
|
-
]),
|
|
439
|
-
};
|
|
440
|
-
return metadata;
|
|
441
|
-
}
|
|
442
|
-
return __importFile;
|
|
443
|
-
}
|
|
444
|
-
exports.importFile = importFile;
|
|
445
|
-
/**
|
|
446
|
-
* > **Deprecated.**
|
|
447
|
-
* > This function has been replaced with `bulkImportFile()`, and will be removed on March 31, 2024.
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
* The `bulkImportFiles()` function returns a Promise that resolves to an array of the imported files' descriptors.
|
|
451
|
-
*
|
|
452
|
-
* Imports a bulk of files to the Media Manager using external urls.
|
|
453
|
-
*
|
|
454
|
-
* Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
|
|
455
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
456
|
-
*
|
|
457
|
-
* >**Note:** The `media` property isn't returned in the `files` response object.
|
|
458
|
-
*
|
|
459
|
-
* To import files, you need to do one of the following for each file:
|
|
460
|
-
* - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
|
|
461
|
-
* - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
|
|
462
|
-
* - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
|
|
463
|
-
* > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
|
|
464
|
-
*/
|
|
465
|
-
function bulkImportFiles(payload) {
|
|
466
|
-
function __bulkImportFiles({ host }) {
|
|
467
|
-
const metadata = {
|
|
468
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
469
|
-
method: 'POST',
|
|
470
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFiles',
|
|
471
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
472
|
-
protoPath: '/v1/bulk/files/import',
|
|
473
|
-
data: payload,
|
|
474
|
-
host,
|
|
475
|
-
}),
|
|
476
|
-
data: payload,
|
|
477
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
478
|
-
{
|
|
479
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
480
|
-
paths: [
|
|
481
|
-
{ path: 'files.createdDate' },
|
|
482
|
-
{ path: 'files.updatedDate' },
|
|
483
|
-
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
484
|
-
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
485
|
-
{ path: 'files.media.video.urlExpirationDate' },
|
|
486
|
-
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
487
|
-
{
|
|
488
|
-
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
489
|
-
},
|
|
490
|
-
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
491
|
-
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
492
|
-
{ path: 'files.media.document.urlExpirationDate' },
|
|
493
|
-
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
494
|
-
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
495
|
-
{ path: 'files.media.archive.urlExpirationDate' },
|
|
496
|
-
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
497
|
-
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
498
|
-
],
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
502
|
-
paths: [
|
|
503
|
-
{ path: 'files.media.image.faces.confidence' },
|
|
504
|
-
{ path: 'files.media.vector.faces.confidence' },
|
|
505
|
-
],
|
|
506
|
-
},
|
|
507
|
-
]),
|
|
508
|
-
};
|
|
509
|
-
return metadata;
|
|
510
|
-
}
|
|
511
|
-
return __bulkImportFiles;
|
|
512
|
-
}
|
|
513
|
-
exports.bulkImportFiles = bulkImportFiles;
|
|
514
|
-
/**
|
|
515
|
-
* Imports a bulk of files to the Media Manager using external urls.
|
|
516
|
-
*
|
|
517
|
-
* The `bulkImportFile()` function returns a Promise that resolves to an object containing bulk import metadata and an array of imported files' descriptors and metadata.
|
|
518
|
-
*
|
|
519
|
-
* Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
|
|
520
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
521
|
-
*
|
|
522
|
-
* To import files, you need to do one of the following for each file:
|
|
523
|
-
* - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
|
|
524
|
-
* - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
|
|
525
|
-
* - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
|
|
526
|
-
* > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
|
|
527
|
-
*/
|
|
528
|
-
function bulkImportFile(payload) {
|
|
529
|
-
function __bulkImportFile({ host }) {
|
|
530
|
-
const metadata = {
|
|
531
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
532
|
-
method: 'POST',
|
|
533
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFile',
|
|
534
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
535
|
-
protoPath: '/v1/bulk/files/import-v2',
|
|
536
|
-
data: payload,
|
|
537
|
-
host,
|
|
538
|
-
}),
|
|
539
|
-
data: payload,
|
|
540
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
541
|
-
{
|
|
542
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
543
|
-
paths: [
|
|
544
|
-
{ path: 'results.item.createdDate' },
|
|
545
|
-
{ path: 'results.item.updatedDate' },
|
|
546
|
-
{ path: 'results.item.media.image.image.urlExpirationDate' },
|
|
547
|
-
{
|
|
548
|
-
path: 'results.item.media.image.previewImage.urlExpirationDate',
|
|
549
|
-
},
|
|
550
|
-
{ path: 'results.item.media.video.urlExpirationDate' },
|
|
551
|
-
{
|
|
552
|
-
path: 'results.item.media.video.resolutions.urlExpirationDate',
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
path: 'results.item.media.video.resolutions.poster.urlExpirationDate',
|
|
556
|
-
},
|
|
557
|
-
{ path: 'results.item.media.video.posters.urlExpirationDate' },
|
|
558
|
-
{ path: 'results.item.media.audio.assets.urlExpirationDate' },
|
|
559
|
-
{ path: 'results.item.media.document.urlExpirationDate' },
|
|
560
|
-
{ path: 'results.item.media.vector.image.urlExpirationDate' },
|
|
561
|
-
{
|
|
562
|
-
path: 'results.item.media.vector.previewImage.urlExpirationDate',
|
|
563
|
-
},
|
|
564
|
-
{ path: 'results.item.media.archive.urlExpirationDate' },
|
|
565
|
-
{ path: 'results.item.media.model3d.urlExpirationDate' },
|
|
566
|
-
{
|
|
567
|
-
path: 'results.item.media.model3d.thumbnail.urlExpirationDate',
|
|
568
|
-
},
|
|
569
|
-
],
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
573
|
-
paths: [
|
|
574
|
-
{ path: 'results.item.media.image.faces.confidence' },
|
|
575
|
-
{ path: 'results.item.media.vector.faces.confidence' },
|
|
576
|
-
],
|
|
577
|
-
},
|
|
578
|
-
]),
|
|
579
|
-
};
|
|
580
|
-
return metadata;
|
|
581
|
-
}
|
|
582
|
-
return __bulkImportFile;
|
|
583
|
-
}
|
|
584
|
-
exports.bulkImportFile = bulkImportFile;
|
|
585
|
-
/**
|
|
586
|
-
* Retrieves a list of files in the Media Manager.
|
|
587
|
-
*
|
|
588
|
-
* The `listFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
|
|
589
|
-
*
|
|
590
|
-
* To retrieve a list of files within a specific folder in the Media Manager, pass the folder's ID in the `parentFolderId` parameter. If no folder is specified, the function retrieves only the list of files in the root folder of the Media Manager.
|
|
591
|
-
*
|
|
592
|
-
* To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
|
|
593
|
-
*/
|
|
594
|
-
function listFiles(payload) {
|
|
595
|
-
function __listFiles({ host }) {
|
|
596
|
-
const metadata = {
|
|
597
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
598
|
-
method: 'GET',
|
|
599
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.ListFiles',
|
|
600
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
601
|
-
protoPath: '/v1/files',
|
|
602
|
-
data: payload,
|
|
603
|
-
host,
|
|
604
|
-
}),
|
|
605
|
-
params: (0, metro_runtime_1.toURLSearchParams)(payload),
|
|
606
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
607
|
-
{
|
|
608
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
609
|
-
paths: [
|
|
610
|
-
{ path: 'files.createdDate' },
|
|
611
|
-
{ path: 'files.updatedDate' },
|
|
612
|
-
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
613
|
-
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
614
|
-
{ path: 'files.media.video.urlExpirationDate' },
|
|
615
|
-
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
616
|
-
{
|
|
617
|
-
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
618
|
-
},
|
|
619
|
-
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
620
|
-
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
621
|
-
{ path: 'files.media.document.urlExpirationDate' },
|
|
622
|
-
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
623
|
-
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
624
|
-
{ path: 'files.media.archive.urlExpirationDate' },
|
|
625
|
-
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
626
|
-
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
627
|
-
],
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
631
|
-
paths: [
|
|
632
|
-
{ path: 'files.media.image.faces.confidence' },
|
|
633
|
-
{ path: 'files.media.vector.faces.confidence' },
|
|
634
|
-
],
|
|
635
|
-
},
|
|
636
|
-
]),
|
|
637
|
-
};
|
|
638
|
-
return metadata;
|
|
639
|
-
}
|
|
640
|
-
return __listFiles;
|
|
641
|
-
}
|
|
642
|
-
exports.listFiles = listFiles;
|
|
643
|
-
/**
|
|
644
|
-
* Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
|
|
645
|
-
*
|
|
646
|
-
* The `searchFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
|
|
647
|
-
*
|
|
648
|
-
* If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
|
|
649
|
-
*/
|
|
650
|
-
function searchFiles(payload) {
|
|
651
|
-
function __searchFiles({ host }) {
|
|
652
|
-
const metadata = {
|
|
653
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
654
|
-
method: 'POST',
|
|
655
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.SearchFiles',
|
|
656
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
657
|
-
protoPath: '/v1/files/search',
|
|
658
|
-
data: payload,
|
|
659
|
-
host,
|
|
660
|
-
}),
|
|
661
|
-
data: payload,
|
|
662
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
663
|
-
{
|
|
664
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
665
|
-
paths: [
|
|
666
|
-
{ path: 'files.createdDate' },
|
|
667
|
-
{ path: 'files.updatedDate' },
|
|
668
|
-
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
669
|
-
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
670
|
-
{ path: 'files.media.video.urlExpirationDate' },
|
|
671
|
-
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
672
|
-
{
|
|
673
|
-
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
674
|
-
},
|
|
675
|
-
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
676
|
-
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
677
|
-
{ path: 'files.media.document.urlExpirationDate' },
|
|
678
|
-
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
679
|
-
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
680
|
-
{ path: 'files.media.archive.urlExpirationDate' },
|
|
681
|
-
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
682
|
-
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
683
|
-
],
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
687
|
-
paths: [
|
|
688
|
-
{ path: 'files.media.image.faces.confidence' },
|
|
689
|
-
{ path: 'files.media.vector.faces.confidence' },
|
|
690
|
-
],
|
|
691
|
-
},
|
|
692
|
-
]),
|
|
693
|
-
};
|
|
694
|
-
return metadata;
|
|
695
|
-
}
|
|
696
|
-
return __searchFiles;
|
|
697
|
-
}
|
|
698
|
-
exports.searchFiles = searchFiles;
|
|
699
|
-
/**
|
|
700
|
-
* Generates a URL for streaming a specific video file in the Media Manager.
|
|
701
|
-
*
|
|
702
|
-
*
|
|
703
|
-
* The `generateVideoStreamingUrl()` function returns a Promise that resolves to a download URL and its asset key.
|
|
704
|
-
*
|
|
705
|
-
* 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.
|
|
706
|
-
*/
|
|
707
|
-
function generateVideoStreamingUrl(payload) {
|
|
708
|
-
function __generateVideoStreamingUrl({ host }) {
|
|
709
|
-
const metadata = {
|
|
710
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
711
|
-
method: 'POST',
|
|
712
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateVideoStreamingUrl',
|
|
713
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
714
|
-
protoPath: '/v1/files/video/{fileId}/generate-stream-url',
|
|
715
|
-
data: payload,
|
|
716
|
-
host,
|
|
717
|
-
}),
|
|
718
|
-
data: payload,
|
|
719
|
-
};
|
|
720
|
-
return metadata;
|
|
721
|
-
}
|
|
722
|
-
return __generateVideoStreamingUrl;
|
|
723
|
-
}
|
|
724
|
-
exports.generateVideoStreamingUrl = generateVideoStreamingUrl;
|
|
725
|
-
/**
|
|
726
|
-
* Deletes the specified files from the Media Manager.
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
* The `bulkDeleteFiles()` function returns a Promise that resolves when the files are deleted.
|
|
730
|
-
*
|
|
731
|
-
* 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.
|
|
732
|
-
*
|
|
733
|
-
* >**Notes:**
|
|
734
|
-
* > - The specified files can be from different folders.
|
|
735
|
-
* > - Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
|
|
736
|
-
* > - Attempting to delete files that are already in the trash bin doesn't result in an error.
|
|
737
|
-
* > - If your site contains deleted media files, the deleted media files still appear on your site as the files are still in the Media Manager (in the trash bin).
|
|
738
|
-
* > - You can use `bulkRestoreFilesFromTrashBin()` to restore files from the Media Manager's trash bin.
|
|
739
|
-
*/
|
|
740
|
-
function bulkDeleteFiles(payload) {
|
|
741
|
-
function __bulkDeleteFiles({ host }) {
|
|
742
|
-
const metadata = {
|
|
743
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
744
|
-
method: 'POST',
|
|
745
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkDeleteFiles',
|
|
746
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
747
|
-
protoPath: '/v1/bulk/files/delete',
|
|
748
|
-
data: payload,
|
|
749
|
-
host,
|
|
750
|
-
}),
|
|
751
|
-
data: payload,
|
|
752
|
-
};
|
|
753
|
-
return metadata;
|
|
754
|
-
}
|
|
755
|
-
return __bulkDeleteFiles;
|
|
756
|
-
}
|
|
757
|
-
exports.bulkDeleteFiles = bulkDeleteFiles;
|
|
758
|
-
/**
|
|
759
|
-
* Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
|
|
760
|
-
*
|
|
761
|
-
* The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
|
|
762
|
-
*/
|
|
763
|
-
function bulkRestoreFilesFromTrashBin(payload) {
|
|
764
|
-
function __bulkRestoreFilesFromTrashBin({ host }) {
|
|
765
|
-
const metadata = {
|
|
766
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
767
|
-
method: 'POST',
|
|
768
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkRestoreFilesFromTrashBin',
|
|
769
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
770
|
-
protoPath: '/v1/bulk/trash-bin/files/restore',
|
|
771
|
-
data: payload,
|
|
772
|
-
host,
|
|
773
|
-
}),
|
|
774
|
-
data: payload,
|
|
775
|
-
};
|
|
776
|
-
return metadata;
|
|
777
|
-
}
|
|
778
|
-
return __bulkRestoreFilesFromTrashBin;
|
|
779
|
-
}
|
|
780
|
-
exports.bulkRestoreFilesFromTrashBin = bulkRestoreFilesFromTrashBin;
|
|
781
|
-
/**
|
|
782
|
-
* Retrieves a list of files in the Media Manager's trash bin.
|
|
783
|
-
*
|
|
784
|
-
* The `listDeletedFiles()` function returns a Promise that resolves to an array of the specified deleted files' descriptors and cursor information.
|
|
785
|
-
*
|
|
786
|
-
* >**Note:** The Media Manager's trash bin (`TRASH_ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
|
|
787
|
-
*
|
|
788
|
-
* To retrieve a list of non-deleted files, use the `listFiles()` function.
|
|
789
|
-
*/
|
|
790
|
-
function listDeletedFiles(payload) {
|
|
791
|
-
function __listDeletedFiles({ host }) {
|
|
792
|
-
const metadata = {
|
|
793
|
-
entityFqdn: 'wix.media.site_media.v1.file_descriptor',
|
|
794
|
-
method: 'GET',
|
|
795
|
-
methodFqn: 'com.wix.media.site_media.v1.FilesService.ListDeletedFiles',
|
|
796
|
-
url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
|
|
797
|
-
protoPath: '/v1/trash-bin/files',
|
|
798
|
-
data: payload,
|
|
799
|
-
host,
|
|
800
|
-
}),
|
|
801
|
-
params: (0, metro_runtime_1.toURLSearchParams)(payload),
|
|
802
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
803
|
-
{
|
|
804
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
805
|
-
paths: [
|
|
806
|
-
{ path: 'files.createdDate' },
|
|
807
|
-
{ path: 'files.updatedDate' },
|
|
808
|
-
{ path: 'files.media.image.image.urlExpirationDate' },
|
|
809
|
-
{ path: 'files.media.image.previewImage.urlExpirationDate' },
|
|
810
|
-
{ path: 'files.media.video.urlExpirationDate' },
|
|
811
|
-
{ path: 'files.media.video.resolutions.urlExpirationDate' },
|
|
812
|
-
{
|
|
813
|
-
path: 'files.media.video.resolutions.poster.urlExpirationDate',
|
|
814
|
-
},
|
|
815
|
-
{ path: 'files.media.video.posters.urlExpirationDate' },
|
|
816
|
-
{ path: 'files.media.audio.assets.urlExpirationDate' },
|
|
817
|
-
{ path: 'files.media.document.urlExpirationDate' },
|
|
818
|
-
{ path: 'files.media.vector.image.urlExpirationDate' },
|
|
819
|
-
{ path: 'files.media.vector.previewImage.urlExpirationDate' },
|
|
820
|
-
{ path: 'files.media.archive.urlExpirationDate' },
|
|
821
|
-
{ path: 'files.media.model3d.urlExpirationDate' },
|
|
822
|
-
{ path: 'files.media.model3d.thumbnail.urlExpirationDate' },
|
|
823
|
-
],
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
827
|
-
paths: [
|
|
828
|
-
{ path: 'files.media.image.faces.confidence' },
|
|
829
|
-
{ path: 'files.media.vector.faces.confidence' },
|
|
830
|
-
],
|
|
831
|
-
},
|
|
832
|
-
]),
|
|
833
|
-
};
|
|
834
|
-
return metadata;
|
|
835
|
-
}
|
|
836
|
-
return __listDeletedFiles;
|
|
837
|
-
}
|
|
838
|
-
exports.listDeletedFiles = listDeletedFiles;
|
|
839
|
-
//# sourceMappingURL=media-site-media-v1-file-descriptor.http.js.map
|