@wix/media 1.0.63 → 1.0.65
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,1442 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
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 = exports.onFileDescriptorFileFailed = exports.onFileDescriptorFileReady = exports.onFileDescriptorDeleted = exports.onFileDescriptorUpdated = exports.StreamFormat = exports.RootFolder = exports.SortOrder = exports.UploadProtocol = exports.ContentDisposition = exports.IdentityType = exports.Namespace = exports.State = exports.OperationStatus = exports.MediaType = void 0;
|
|
36
|
-
const velo_1 = require("@wix/metro-runtime/velo");
|
|
37
|
-
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
38
|
-
const sdk_types_1 = require("@wix/sdk-types");
|
|
39
|
-
const ambassadorWixMediaSiteMediaV1FileDescriptor = __importStar(require("./media-site-media-v1-file-descriptor.http"));
|
|
40
|
-
const _toVeloEntity = '$';
|
|
41
|
-
const _fromVeloEntity = '$';
|
|
42
|
-
var MediaType;
|
|
43
|
-
(function (MediaType) {
|
|
44
|
-
MediaType["UNKNOWN"] = "UNKNOWN";
|
|
45
|
-
MediaType["IMAGE"] = "IMAGE";
|
|
46
|
-
MediaType["VIDEO"] = "VIDEO";
|
|
47
|
-
MediaType["AUDIO"] = "AUDIO";
|
|
48
|
-
MediaType["DOCUMENT"] = "DOCUMENT";
|
|
49
|
-
MediaType["VECTOR"] = "VECTOR";
|
|
50
|
-
MediaType["ARCHIVE"] = "ARCHIVE";
|
|
51
|
-
MediaType["MODEL3D"] = "MODEL3D";
|
|
52
|
-
MediaType["OTHER"] = "OTHER";
|
|
53
|
-
})(MediaType || (exports.MediaType = MediaType = {}));
|
|
54
|
-
var OperationStatus;
|
|
55
|
-
(function (OperationStatus) {
|
|
56
|
-
/** File upload or processing failed */
|
|
57
|
-
OperationStatus["FAILED"] = "FAILED";
|
|
58
|
-
/** File is ready for consumption */
|
|
59
|
-
OperationStatus["READY"] = "READY";
|
|
60
|
-
/** File is waiting for processing or currently being processed */
|
|
61
|
-
OperationStatus["PENDING"] = "PENDING";
|
|
62
|
-
})(OperationStatus || (exports.OperationStatus = OperationStatus = {}));
|
|
63
|
-
var State;
|
|
64
|
-
(function (State) {
|
|
65
|
-
/** File is ready for consumption */
|
|
66
|
-
State["OK"] = "OK";
|
|
67
|
-
/** Deleted file */
|
|
68
|
-
State["DELETED"] = "DELETED";
|
|
69
|
-
})(State || (exports.State = State = {}));
|
|
70
|
-
var Namespace;
|
|
71
|
-
(function (Namespace) {
|
|
72
|
-
Namespace["NO_NAMESPACE"] = "NO_NAMESPACE";
|
|
73
|
-
Namespace["OTHERS"] = "OTHERS";
|
|
74
|
-
/** ANY = 2; */
|
|
75
|
-
Namespace["WIX_VIDEO"] = "WIX_VIDEO";
|
|
76
|
-
/** _nsWixMusic */
|
|
77
|
-
Namespace["WIX_MUSIC"] = "WIX_MUSIC";
|
|
78
|
-
/** _nsArtStore */
|
|
79
|
-
Namespace["ALBUMS_AND_ART_STORE"] = "ALBUMS_AND_ART_STORE";
|
|
80
|
-
/** _nsDigitalProduct */
|
|
81
|
-
Namespace["WIX_ECOM"] = "WIX_ECOM";
|
|
82
|
-
/** _nsPhotoShareApp */
|
|
83
|
-
Namespace["PHOTO_SHARE_APP"] = "PHOTO_SHARE_APP";
|
|
84
|
-
/** _nsSharingApp, */
|
|
85
|
-
Namespace["SHARING_APP"] = "SHARING_APP";
|
|
86
|
-
/** engage */
|
|
87
|
-
Namespace["CHAT"] = "CHAT";
|
|
88
|
-
/** logobuilder */
|
|
89
|
-
Namespace["LOGO_BUILDER"] = "LOGO_BUILDER";
|
|
90
|
-
/** WixExposure */
|
|
91
|
-
Namespace["ALBUMS_OLD"] = "ALBUMS_OLD";
|
|
92
|
-
/** chat-mobile-uploads */
|
|
93
|
-
Namespace["CHAT_MOBILE"] = "CHAT_MOBILE";
|
|
94
|
-
/** _nsWixForms */
|
|
95
|
-
Namespace["WIX_FORMS"] = "WIX_FORMS";
|
|
96
|
-
})(Namespace || (exports.Namespace = Namespace = {}));
|
|
97
|
-
var IdentityType;
|
|
98
|
-
(function (IdentityType) {
|
|
99
|
-
IdentityType["UNKNOWN"] = "UNKNOWN";
|
|
100
|
-
IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
101
|
-
IdentityType["MEMBER"] = "MEMBER";
|
|
102
|
-
IdentityType["WIX_USER"] = "WIX_USER";
|
|
103
|
-
IdentityType["APP"] = "APP";
|
|
104
|
-
})(IdentityType || (exports.IdentityType = IdentityType = {}));
|
|
105
|
-
var ContentDisposition;
|
|
106
|
-
(function (ContentDisposition) {
|
|
107
|
-
/** Using the link in the browser will download the file */
|
|
108
|
-
ContentDisposition["ATTACHMENT"] = "ATTACHMENT";
|
|
109
|
-
/** Using the link in the browser will open the file in the browser */
|
|
110
|
-
ContentDisposition["INLINE"] = "INLINE";
|
|
111
|
-
})(ContentDisposition || (exports.ContentDisposition = ContentDisposition = {}));
|
|
112
|
-
var UploadProtocol;
|
|
113
|
-
(function (UploadProtocol) {
|
|
114
|
-
/** The upload protocol to use for implementing the resumable upload. */
|
|
115
|
-
UploadProtocol["TUS"] = "TUS";
|
|
116
|
-
})(UploadProtocol || (exports.UploadProtocol = UploadProtocol = {}));
|
|
117
|
-
var SortOrder;
|
|
118
|
-
(function (SortOrder) {
|
|
119
|
-
SortOrder["ASC"] = "ASC";
|
|
120
|
-
SortOrder["DESC"] = "DESC";
|
|
121
|
-
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
122
|
-
var RootFolder;
|
|
123
|
-
(function (RootFolder) {
|
|
124
|
-
/** Root of all site media */
|
|
125
|
-
RootFolder["MEDIA_ROOT"] = "MEDIA_ROOT";
|
|
126
|
-
/** Root of the trash system folder */
|
|
127
|
-
RootFolder["TRASH_ROOT"] = "TRASH_ROOT";
|
|
128
|
-
/** Root of all visitor uploads */
|
|
129
|
-
RootFolder["VISITOR_UPLOADS_ROOT"] = "VISITOR_UPLOADS_ROOT";
|
|
130
|
-
})(RootFolder || (exports.RootFolder = RootFolder = {}));
|
|
131
|
-
var StreamFormat;
|
|
132
|
-
(function (StreamFormat) {
|
|
133
|
-
StreamFormat["UNKNOWN"] = "UNKNOWN";
|
|
134
|
-
StreamFormat["HLS"] = "HLS";
|
|
135
|
-
StreamFormat["DASH"] = "DASH";
|
|
136
|
-
})(StreamFormat || (exports.StreamFormat = StreamFormat = {}));
|
|
137
|
-
const _audioV2 = { assets: 'wix.common.Audio' };
|
|
138
|
-
const _bulkDeleteFilesRequest = {};
|
|
139
|
-
const _bulkDeleteFilesResponse = {};
|
|
140
|
-
const _bulkImportFileRequest = { importFileRequests: '_importFileRequest' };
|
|
141
|
-
const _bulkImportFileResponse = { results: '_bulkImportFileResult' };
|
|
142
|
-
const _bulkImportFileResult = { item: '_fileDescriptor' };
|
|
143
|
-
const _bulkImportFilesRequest = { importFileRequests: '_importFileRequest' };
|
|
144
|
-
const _bulkImportFilesResponse = { files: '_fileDescriptor' };
|
|
145
|
-
const _bulkRestoreFilesFromTrashBinRequest = {};
|
|
146
|
-
const _bulkRestoreFilesFromTrashBinResponse = {};
|
|
147
|
-
const _fileDescriptor = { media: '_fileMedia' };
|
|
148
|
-
const _fileMedia = {
|
|
149
|
-
video: 'wix.common.VideoV2',
|
|
150
|
-
document: 'wix.common.Document',
|
|
151
|
-
image: '_imageMedia',
|
|
152
|
-
audio: '_audioV2',
|
|
153
|
-
vector: '_imageMedia',
|
|
154
|
-
model3d: '_model3D',
|
|
155
|
-
};
|
|
156
|
-
const _fileReady = { file: '_fileDescriptor' };
|
|
157
|
-
const _generateFileDownloadUrlRequest = {};
|
|
158
|
-
const _generateFileDownloadUrlResponse = {};
|
|
159
|
-
const _generateFileResumableUploadUrlRequest = {};
|
|
160
|
-
const _generateFileResumableUploadUrlResponse = {};
|
|
161
|
-
const _generateFilesDownloadUrlRequest = {};
|
|
162
|
-
const _generateFilesDownloadUrlResponse = {};
|
|
163
|
-
const _generateFileUploadUrlRequest = {};
|
|
164
|
-
const _generateFileUploadUrlResponse = {};
|
|
165
|
-
const _generateVideoStreamingUrlRequest = {};
|
|
166
|
-
const _generateVideoStreamingUrlResponse = {};
|
|
167
|
-
const _getFileDescriptorRequest = {};
|
|
168
|
-
const _getFileDescriptorResponse = { file: '_fileDescriptor' };
|
|
169
|
-
const _getFileDescriptorsRequest = {};
|
|
170
|
-
const _getFileDescriptorsResponse = { files: '_fileDescriptor' };
|
|
171
|
-
const _imageMedia = {
|
|
172
|
-
image: 'wix.common.Image',
|
|
173
|
-
previewImage: 'wix.common.Image',
|
|
174
|
-
};
|
|
175
|
-
const _importFileRequest = {};
|
|
176
|
-
const _importFileResponse = { file: '_fileDescriptor' };
|
|
177
|
-
const _listDeletedFilesRequest = {};
|
|
178
|
-
const _listDeletedFilesResponse = { files: '_fileDescriptor' };
|
|
179
|
-
const _listFilesRequest = {};
|
|
180
|
-
const _listFilesResponse = { files: '_fileDescriptor' };
|
|
181
|
-
const _model3D = { thumbnail: 'wix.common.Image' };
|
|
182
|
-
const _searchFilesRequest = {};
|
|
183
|
-
const _searchFilesResponse = { files: '_fileDescriptor' };
|
|
184
|
-
const _updateFileDescriptorRequest = { file: '_fileDescriptor' };
|
|
185
|
-
const _updateFileDescriptorResponse = { file: '_fileDescriptor' };
|
|
186
|
-
const _archive = { urlExpirationDate: 'google.protobuf.Timestamp' };
|
|
187
|
-
const _faceRecognition = { confidence: 'DOUBLE' };
|
|
188
|
-
const _fileFailed = {};
|
|
189
|
-
exports.onFileDescriptorUpdated = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_updated', true, {
|
|
190
|
-
rootSchema: _fileDescriptor,
|
|
191
|
-
depSchemas: {
|
|
192
|
-
_archive,
|
|
193
|
-
_audioV2,
|
|
194
|
-
_faceRecognition,
|
|
195
|
-
_fileMedia,
|
|
196
|
-
_imageMedia,
|
|
197
|
-
_model3D,
|
|
198
|
-
},
|
|
199
|
-
})();
|
|
200
|
-
exports.onFileDescriptorDeleted = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_deleted', true, {
|
|
201
|
-
rootSchema: _fileDescriptor,
|
|
202
|
-
depSchemas: {
|
|
203
|
-
_archive,
|
|
204
|
-
_audioV2,
|
|
205
|
-
_faceRecognition,
|
|
206
|
-
_fileMedia,
|
|
207
|
-
_imageMedia,
|
|
208
|
-
_model3D,
|
|
209
|
-
},
|
|
210
|
-
})();
|
|
211
|
-
exports.onFileDescriptorFileReady = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_file_ready', true, {
|
|
212
|
-
rootSchema: _fileReady,
|
|
213
|
-
depSchemas: {
|
|
214
|
-
_archive,
|
|
215
|
-
_audioV2,
|
|
216
|
-
_faceRecognition,
|
|
217
|
-
_fileDescriptor,
|
|
218
|
-
_fileMedia,
|
|
219
|
-
_imageMedia,
|
|
220
|
-
_model3D,
|
|
221
|
-
},
|
|
222
|
-
})();
|
|
223
|
-
exports.onFileDescriptorFileFailed = (0, sdk_types_1.EventDefinition)('wix.media.site_media.v1.file_descriptor_file_failed', true, {
|
|
224
|
-
rootSchema: _fileFailed,
|
|
225
|
-
depSchemas: {},
|
|
226
|
-
})();
|
|
227
|
-
/**
|
|
228
|
-
* Generates a URL for downloading a compressed file containing specific files in the Media Manager.
|
|
229
|
-
*
|
|
230
|
-
* The `generateFilesDownloadUrl()` function returns a Promise that resolves to a download URL.
|
|
231
|
-
*
|
|
232
|
-
* The compressed file can contain up to 1000 files.
|
|
233
|
-
*
|
|
234
|
-
* To generate one or more temporary URLs for downloading a specific file in the Media Manager, use the `generateFileDownloadUrl()` function.
|
|
235
|
-
* You can use the `expirationInMinutes` parameter to set the URL expiration time, making it more secure than the `generateFilesDownloadUrl()` function.
|
|
236
|
-
* Therefore, to download private files, use the `generateFileDownloadUrl` function for each private file that you want to generate a download URL for.
|
|
237
|
-
* @param fileIds - IDs of the files to download.
|
|
238
|
-
* @public
|
|
239
|
-
* @requiredField fileIds
|
|
240
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
241
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
242
|
-
* @permissionScope Manage Media Manager
|
|
243
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
244
|
-
* @applicableIdentity APP
|
|
245
|
-
*/
|
|
246
|
-
function generateFilesDownloadUrl(fileIds) {
|
|
247
|
-
var _a, _b, _c;
|
|
248
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
249
|
-
const requestTransformation = { fileIds: '$[0]' };
|
|
250
|
-
const responseTransformation = '$';
|
|
251
|
-
// @ts-ignore
|
|
252
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
253
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
254
|
-
rootSchema: _generateFilesDownloadUrlRequest,
|
|
255
|
-
depSchemas: {},
|
|
256
|
-
fqdnTransformation: {
|
|
257
|
-
paths: [],
|
|
258
|
-
transformation: _fromVeloEntity,
|
|
259
|
-
},
|
|
260
|
-
customTransformation: requestTransformation,
|
|
261
|
-
});
|
|
262
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
263
|
-
rootSchema: _generateFilesDownloadUrlResponse,
|
|
264
|
-
depSchemas: {},
|
|
265
|
-
fqdnTransformation: {
|
|
266
|
-
paths: [],
|
|
267
|
-
transformation: _toVeloEntity,
|
|
268
|
-
},
|
|
269
|
-
customTransformation: responseTransformation,
|
|
270
|
-
});
|
|
271
|
-
const payload = toAmbassadorRequest([fileIds]);
|
|
272
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFilesDownloadUrl(payload);
|
|
273
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
274
|
-
try {
|
|
275
|
-
const result = yield httpClient.request(reqOpts);
|
|
276
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
277
|
-
return fromJSON(result.data);
|
|
278
|
-
}
|
|
279
|
-
catch (err) {
|
|
280
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
281
|
-
spreadPathsToArguments: {},
|
|
282
|
-
explicitPathsToArguments: { fileIds: '$[0]' },
|
|
283
|
-
singleArgumentUnchanged: false,
|
|
284
|
-
}, ['fileIds']);
|
|
285
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
286
|
-
throw transformedError;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
exports.generateFilesDownloadUrl = generateFilesDownloadUrl;
|
|
291
|
-
/**
|
|
292
|
-
* Generates one or more temporary URLs for downloading a specific file in the Media Manager.
|
|
293
|
-
*
|
|
294
|
-
* The `generateFileDownloadUrl()` function returns a Promise that resolves to an array containing download URLs for the assets specified in the options parameter.
|
|
295
|
-
*
|
|
296
|
-
* To download different assets of the file, use the `assetKeys` parameter which generates a download URL for each asset.
|
|
297
|
-
* If no asset key is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
|
|
298
|
-
*
|
|
299
|
-
* 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.
|
|
300
|
-
*
|
|
301
|
-
* To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, use the `generateFilesDownloadUrl()` function.
|
|
302
|
-
* 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.
|
|
303
|
-
* @param fileId - File ID.
|
|
304
|
-
* @public
|
|
305
|
-
* @requiredField fileId
|
|
306
|
-
* @param options - Options to use when generating a file's download URL.
|
|
307
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
308
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
309
|
-
* @permissionScope Manage Media Manager
|
|
310
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
311
|
-
* @applicableIdentity APP
|
|
312
|
-
*/
|
|
313
|
-
function generateFileDownloadUrl(fileId, options) {
|
|
314
|
-
var _a, _b, _c;
|
|
315
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
316
|
-
const requestTransformation = {
|
|
317
|
-
fileId: '$[0]',
|
|
318
|
-
downloadFileName: '$[1].downloadFileName',
|
|
319
|
-
expirationInMinutes: '$[1].expirationInMinutes',
|
|
320
|
-
expirationRedirectUrl: '$[1].expirationRedirectUrl',
|
|
321
|
-
assetKeys: '$[1].assetKeys',
|
|
322
|
-
contentDisposition: '$[1].contentDisposition',
|
|
323
|
-
};
|
|
324
|
-
const responseTransformation = '$';
|
|
325
|
-
// @ts-ignore
|
|
326
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
327
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
328
|
-
rootSchema: _generateFileDownloadUrlRequest,
|
|
329
|
-
depSchemas: {},
|
|
330
|
-
fqdnTransformation: {
|
|
331
|
-
paths: [],
|
|
332
|
-
transformation: _fromVeloEntity,
|
|
333
|
-
},
|
|
334
|
-
customTransformation: requestTransformation,
|
|
335
|
-
});
|
|
336
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
337
|
-
rootSchema: _generateFileDownloadUrlResponse,
|
|
338
|
-
depSchemas: {},
|
|
339
|
-
fqdnTransformation: {
|
|
340
|
-
paths: [],
|
|
341
|
-
transformation: _toVeloEntity,
|
|
342
|
-
},
|
|
343
|
-
customTransformation: responseTransformation,
|
|
344
|
-
});
|
|
345
|
-
const payload = toAmbassadorRequest([fileId, options]);
|
|
346
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFileDownloadUrl(payload);
|
|
347
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
348
|
-
try {
|
|
349
|
-
const result = yield httpClient.request(reqOpts);
|
|
350
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
351
|
-
return fromJSON(result.data);
|
|
352
|
-
}
|
|
353
|
-
catch (err) {
|
|
354
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
355
|
-
spreadPathsToArguments: {},
|
|
356
|
-
explicitPathsToArguments: {
|
|
357
|
-
fileId: '$[0]',
|
|
358
|
-
downloadFileName: '$[1].downloadFileName',
|
|
359
|
-
expirationInMinutes: '$[1].expirationInMinutes',
|
|
360
|
-
expirationRedirectUrl: '$[1].expirationRedirectUrl',
|
|
361
|
-
assetKeys: '$[1].assetKeys',
|
|
362
|
-
contentDisposition: '$[1].contentDisposition',
|
|
363
|
-
},
|
|
364
|
-
singleArgumentUnchanged: false,
|
|
365
|
-
}, ['fileId', 'options']);
|
|
366
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
367
|
-
throw transformedError;
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
exports.generateFileDownloadUrl = generateFileDownloadUrl;
|
|
372
|
-
/**
|
|
373
|
-
* Gets information about the specified file in the Media Manager.
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* The `getFileDescriptor()` function returns a Promise that resolves to the specified file's descriptor.
|
|
377
|
-
*
|
|
378
|
-
* Use `getFileDescriptors()` to get multiple file descriptors at once.
|
|
379
|
-
* @param fileId - File ID.
|
|
380
|
-
* @public
|
|
381
|
-
* @requiredField fileId
|
|
382
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
383
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
384
|
-
* @permissionScope Read Media Manager
|
|
385
|
-
* @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
|
|
386
|
-
* @permissionScope Manage Media Manager
|
|
387
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
388
|
-
* @applicableIdentity APP
|
|
389
|
-
* @returns Information about the file.
|
|
390
|
-
*/
|
|
391
|
-
function getFileDescriptor(fileId) {
|
|
392
|
-
var _a, _b, _c;
|
|
393
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
394
|
-
const requestTransformation = { fileId: '$[0]' };
|
|
395
|
-
const responseTransformation = '$.file';
|
|
396
|
-
// @ts-ignore
|
|
397
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
398
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
399
|
-
rootSchema: _getFileDescriptorRequest,
|
|
400
|
-
depSchemas: {},
|
|
401
|
-
fqdnTransformation: {
|
|
402
|
-
paths: [],
|
|
403
|
-
transformation: _fromVeloEntity,
|
|
404
|
-
},
|
|
405
|
-
customTransformation: requestTransformation,
|
|
406
|
-
});
|
|
407
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
408
|
-
rootSchema: _getFileDescriptorResponse,
|
|
409
|
-
depSchemas: {
|
|
410
|
-
_audioV2,
|
|
411
|
-
_fileDescriptor,
|
|
412
|
-
_fileMedia,
|
|
413
|
-
_imageMedia,
|
|
414
|
-
_model3D,
|
|
415
|
-
},
|
|
416
|
-
fqdnTransformation: {
|
|
417
|
-
paths: [...['file']],
|
|
418
|
-
transformation: _toVeloEntity,
|
|
419
|
-
},
|
|
420
|
-
customTransformation: responseTransformation,
|
|
421
|
-
});
|
|
422
|
-
const payload = toAmbassadorRequest([fileId]);
|
|
423
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.getFileDescriptor(payload);
|
|
424
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
425
|
-
try {
|
|
426
|
-
const result = yield httpClient.request(reqOpts);
|
|
427
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
428
|
-
return fromJSON(result.data);
|
|
429
|
-
}
|
|
430
|
-
catch (err) {
|
|
431
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
432
|
-
spreadPathsToArguments: {},
|
|
433
|
-
explicitPathsToArguments: { fileId: '$[0]' },
|
|
434
|
-
singleArgumentUnchanged: false,
|
|
435
|
-
}, ['fileId']);
|
|
436
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
437
|
-
throw transformedError;
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
exports.getFileDescriptor = getFileDescriptor;
|
|
442
|
-
/**
|
|
443
|
-
* Gets information about the specified files in the Media Manager.
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* The `getFileDescriptors()` function returns a Promise that resolves to an array containing the specified files' descriptors.
|
|
447
|
-
*
|
|
448
|
-
* Use `getFileDescriptor()` to get a single file descriptor.
|
|
449
|
-
* @param fileIds - File IDs.
|
|
450
|
-
* @public
|
|
451
|
-
* @requiredField fileIds
|
|
452
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
453
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
454
|
-
* @permissionScope Read Media Manager
|
|
455
|
-
* @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
|
|
456
|
-
* @permissionScope Manage Media Manager
|
|
457
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
458
|
-
* @applicableIdentity APP
|
|
459
|
-
*/
|
|
460
|
-
function getFileDescriptors(fileIds) {
|
|
461
|
-
var _a, _b, _c;
|
|
462
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
463
|
-
const requestTransformation = { fileIds: '$[0]' };
|
|
464
|
-
const responseTransformation = '$';
|
|
465
|
-
// @ts-ignore
|
|
466
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
467
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
468
|
-
rootSchema: _getFileDescriptorsRequest,
|
|
469
|
-
depSchemas: {},
|
|
470
|
-
fqdnTransformation: {
|
|
471
|
-
paths: [],
|
|
472
|
-
transformation: _fromVeloEntity,
|
|
473
|
-
},
|
|
474
|
-
customTransformation: requestTransformation,
|
|
475
|
-
});
|
|
476
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
477
|
-
rootSchema: _getFileDescriptorsResponse,
|
|
478
|
-
depSchemas: {
|
|
479
|
-
_audioV2,
|
|
480
|
-
_fileDescriptor,
|
|
481
|
-
_fileMedia,
|
|
482
|
-
_imageMedia,
|
|
483
|
-
_model3D,
|
|
484
|
-
},
|
|
485
|
-
fqdnTransformation: {
|
|
486
|
-
paths: [...['Array#files']],
|
|
487
|
-
transformation: _toVeloEntity,
|
|
488
|
-
},
|
|
489
|
-
customTransformation: responseTransformation,
|
|
490
|
-
});
|
|
491
|
-
const payload = toAmbassadorRequest([fileIds]);
|
|
492
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.getFileDescriptors(payload);
|
|
493
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
494
|
-
try {
|
|
495
|
-
const result = yield httpClient.request(reqOpts);
|
|
496
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
497
|
-
return fromJSON(result.data);
|
|
498
|
-
}
|
|
499
|
-
catch (err) {
|
|
500
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
501
|
-
spreadPathsToArguments: {},
|
|
502
|
-
explicitPathsToArguments: { fileIds: '$[0]' },
|
|
503
|
-
singleArgumentUnchanged: false,
|
|
504
|
-
}, ['fileIds']);
|
|
505
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
506
|
-
throw transformedError;
|
|
507
|
-
}
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
exports.getFileDescriptors = getFileDescriptors;
|
|
511
|
-
/**
|
|
512
|
-
* Updates a file.
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
* The `updateFileDescriptor()` function returns a Promise that resolves to the updated file's descriptor.
|
|
516
|
-
*
|
|
517
|
-
* You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
|
|
518
|
-
* @param _id - File ID. Generated when a file is uploaded to the Media Manager.
|
|
519
|
-
* @public
|
|
520
|
-
* @requiredField _id
|
|
521
|
-
* @requiredField file
|
|
522
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
523
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
524
|
-
* @permissionScope Manage Media Manager
|
|
525
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
526
|
-
* @applicableIdentity APP
|
|
527
|
-
* @returns Information about the updated file.
|
|
528
|
-
*/
|
|
529
|
-
function updateFileDescriptor(_id, file) {
|
|
530
|
-
var _a, _b, _c;
|
|
531
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
532
|
-
const requestTransformation = { file: { '*': '$[1]', id: '$[0]' } };
|
|
533
|
-
const responseTransformation = '$.file';
|
|
534
|
-
// @ts-ignore
|
|
535
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
536
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
537
|
-
rootSchema: _updateFileDescriptorRequest,
|
|
538
|
-
depSchemas: {
|
|
539
|
-
_audioV2,
|
|
540
|
-
_fileDescriptor,
|
|
541
|
-
_fileMedia,
|
|
542
|
-
_imageMedia,
|
|
543
|
-
_model3D,
|
|
544
|
-
},
|
|
545
|
-
fqdnTransformation: {
|
|
546
|
-
paths: [...['file']],
|
|
547
|
-
transformation: _fromVeloEntity,
|
|
548
|
-
},
|
|
549
|
-
customTransformation: requestTransformation,
|
|
550
|
-
});
|
|
551
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
552
|
-
rootSchema: _updateFileDescriptorResponse,
|
|
553
|
-
depSchemas: {
|
|
554
|
-
_audioV2,
|
|
555
|
-
_fileDescriptor,
|
|
556
|
-
_fileMedia,
|
|
557
|
-
_imageMedia,
|
|
558
|
-
_model3D,
|
|
559
|
-
},
|
|
560
|
-
fqdnTransformation: {
|
|
561
|
-
paths: [...['file']],
|
|
562
|
-
transformation: _toVeloEntity,
|
|
563
|
-
},
|
|
564
|
-
customTransformation: responseTransformation,
|
|
565
|
-
});
|
|
566
|
-
const payload = toAmbassadorRequest([_id, file]);
|
|
567
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.updateFileDescriptor(payload);
|
|
568
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
569
|
-
try {
|
|
570
|
-
const result = yield httpClient.request(reqOpts);
|
|
571
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
572
|
-
return fromJSON(result.data);
|
|
573
|
-
}
|
|
574
|
-
catch (err) {
|
|
575
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
576
|
-
spreadPathsToArguments: { file: '$[1]' },
|
|
577
|
-
explicitPathsToArguments: { 'file.id': '$[0]' },
|
|
578
|
-
singleArgumentUnchanged: false,
|
|
579
|
-
}, ['_id', 'file']);
|
|
580
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
581
|
-
throw transformedError;
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
exports.updateFileDescriptor = updateFileDescriptor;
|
|
586
|
-
/**
|
|
587
|
-
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
588
|
-
*
|
|
589
|
-
* The `generateFileUploadUrl()` function returns a Promise that resolves to an upload URL.
|
|
590
|
-
*
|
|
591
|
-
* 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.
|
|
592
|
-
*
|
|
593
|
-
* > **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.
|
|
594
|
-
* @param mimeType - File mime type.
|
|
595
|
-
* @public
|
|
596
|
-
* @requiredField mimeType
|
|
597
|
-
* @param options - Options to use when generating a file's upload URL.
|
|
598
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
599
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
600
|
-
* @permissionScope Manage Media Manager
|
|
601
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
602
|
-
* @applicableIdentity APP
|
|
603
|
-
*/
|
|
604
|
-
function generateFileUploadUrl(mimeType, options) {
|
|
605
|
-
var _a, _b, _c;
|
|
606
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
607
|
-
const requestTransformation = {
|
|
608
|
-
mimeType: '$[0]',
|
|
609
|
-
fileName: '$[1].fileName',
|
|
610
|
-
sizeInBytes: '$[1].sizeInBytes',
|
|
611
|
-
parentFolderId: '$[1].parentFolderId',
|
|
612
|
-
private: '$[1].private',
|
|
613
|
-
labels: '$[1].labels',
|
|
614
|
-
externalInfo: '$[1].externalInfo',
|
|
615
|
-
};
|
|
616
|
-
const responseTransformation = '$';
|
|
617
|
-
// @ts-ignore
|
|
618
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
619
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
620
|
-
rootSchema: _generateFileUploadUrlRequest,
|
|
621
|
-
depSchemas: {},
|
|
622
|
-
fqdnTransformation: {
|
|
623
|
-
paths: [],
|
|
624
|
-
transformation: _fromVeloEntity,
|
|
625
|
-
},
|
|
626
|
-
customTransformation: requestTransformation,
|
|
627
|
-
});
|
|
628
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
629
|
-
rootSchema: _generateFileUploadUrlResponse,
|
|
630
|
-
depSchemas: {},
|
|
631
|
-
fqdnTransformation: {
|
|
632
|
-
paths: [],
|
|
633
|
-
transformation: _toVeloEntity,
|
|
634
|
-
},
|
|
635
|
-
customTransformation: responseTransformation,
|
|
636
|
-
});
|
|
637
|
-
const payload = toAmbassadorRequest([mimeType, options]);
|
|
638
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFileUploadUrl(payload);
|
|
639
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
640
|
-
try {
|
|
641
|
-
const result = yield httpClient.request(reqOpts);
|
|
642
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
643
|
-
return fromJSON(result.data);
|
|
644
|
-
}
|
|
645
|
-
catch (err) {
|
|
646
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
647
|
-
spreadPathsToArguments: {},
|
|
648
|
-
explicitPathsToArguments: {
|
|
649
|
-
mimeType: '$[0]',
|
|
650
|
-
fileName: '$[1].fileName',
|
|
651
|
-
sizeInBytes: '$[1].sizeInBytes',
|
|
652
|
-
parentFolderId: '$[1].parentFolderId',
|
|
653
|
-
private: '$[1].private',
|
|
654
|
-
labels: '$[1].labels',
|
|
655
|
-
externalInfo: '$[1].externalInfo',
|
|
656
|
-
},
|
|
657
|
-
singleArgumentUnchanged: false,
|
|
658
|
-
}, ['mimeType', 'options']);
|
|
659
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
660
|
-
throw transformedError;
|
|
661
|
-
}
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
exports.generateFileUploadUrl = generateFileUploadUrl;
|
|
665
|
-
/**
|
|
666
|
-
* Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
|
|
667
|
-
*
|
|
668
|
-
* The `generateFileResumableUploadUrl()` function returns a Promise that resolves to an upload URL, token, and protocol.
|
|
669
|
-
*
|
|
670
|
-
* 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.
|
|
671
|
-
*
|
|
672
|
-
* 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.
|
|
673
|
-
* @param mimeType - File mime type.
|
|
674
|
-
* @public
|
|
675
|
-
* @requiredField mimeType
|
|
676
|
-
* @param options - Options to use when generating a resumable upload URL.
|
|
677
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
678
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
679
|
-
* @permissionScope Manage Media Manager
|
|
680
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
681
|
-
* @applicableIdentity APP
|
|
682
|
-
*/
|
|
683
|
-
function generateFileResumableUploadUrl(mimeType, options) {
|
|
684
|
-
var _a, _b, _c;
|
|
685
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
686
|
-
const requestTransformation = {
|
|
687
|
-
mimeType: '$[0]',
|
|
688
|
-
fileName: '$[1].fileName',
|
|
689
|
-
sizeInBytes: '$[1].sizeInBytes',
|
|
690
|
-
parentFolderId: '$[1].parentFolderId',
|
|
691
|
-
private: '$[1].private',
|
|
692
|
-
labels: '$[1].labels',
|
|
693
|
-
uploadProtocol: '$[1].uploadProtocol',
|
|
694
|
-
};
|
|
695
|
-
const responseTransformation = '$';
|
|
696
|
-
// @ts-ignore
|
|
697
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
698
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
699
|
-
rootSchema: _generateFileResumableUploadUrlRequest,
|
|
700
|
-
depSchemas: {},
|
|
701
|
-
fqdnTransformation: {
|
|
702
|
-
paths: [],
|
|
703
|
-
transformation: _fromVeloEntity,
|
|
704
|
-
},
|
|
705
|
-
customTransformation: requestTransformation,
|
|
706
|
-
});
|
|
707
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
708
|
-
rootSchema: _generateFileResumableUploadUrlResponse,
|
|
709
|
-
depSchemas: {},
|
|
710
|
-
fqdnTransformation: {
|
|
711
|
-
paths: [],
|
|
712
|
-
transformation: _toVeloEntity,
|
|
713
|
-
},
|
|
714
|
-
customTransformation: responseTransformation,
|
|
715
|
-
});
|
|
716
|
-
const payload = toAmbassadorRequest([mimeType, options]);
|
|
717
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateFileResumableUploadUrl(payload);
|
|
718
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
719
|
-
try {
|
|
720
|
-
const result = yield httpClient.request(reqOpts);
|
|
721
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
722
|
-
return fromJSON(result.data);
|
|
723
|
-
}
|
|
724
|
-
catch (err) {
|
|
725
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
726
|
-
spreadPathsToArguments: {},
|
|
727
|
-
explicitPathsToArguments: {
|
|
728
|
-
mimeType: '$[0]',
|
|
729
|
-
fileName: '$[1].fileName',
|
|
730
|
-
sizeInBytes: '$[1].sizeInBytes',
|
|
731
|
-
parentFolderId: '$[1].parentFolderId',
|
|
732
|
-
private: '$[1].private',
|
|
733
|
-
labels: '$[1].labels',
|
|
734
|
-
uploadProtocol: '$[1].uploadProtocol',
|
|
735
|
-
},
|
|
736
|
-
singleArgumentUnchanged: false,
|
|
737
|
-
}, ['mimeType', 'options']);
|
|
738
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
739
|
-
throw transformedError;
|
|
740
|
-
}
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
exports.generateFileResumableUploadUrl = generateFileResumableUploadUrl;
|
|
744
|
-
/**
|
|
745
|
-
* Imports a file to the Media Manager using an external URL.
|
|
746
|
-
*
|
|
747
|
-
* The `importFile()` function returns a Promise that resolves to the imported file's descriptor.
|
|
748
|
-
*
|
|
749
|
-
* This function returns information about the imported file. Importing a file is the method through which you can add files to the Media Manager.
|
|
750
|
-
* Use the `parentFolderId` parameter to specify which folder you want the file to be imported to.
|
|
751
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
752
|
-
*
|
|
753
|
-
* To import a file, you need to do one of the following:
|
|
754
|
-
* - 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'`.
|
|
755
|
-
* - 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`.
|
|
756
|
-
* - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
|
|
757
|
-
* > **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'`.
|
|
758
|
-
* @param url - Publicly accessible external file URL.
|
|
759
|
-
* @public
|
|
760
|
-
* @requiredField url
|
|
761
|
-
* @param options - Options to use when importing a single file.
|
|
762
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
763
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
764
|
-
* @permissionScope Manage Media Manager
|
|
765
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
766
|
-
* @applicableIdentity APP
|
|
767
|
-
*/
|
|
768
|
-
function importFile(url, options) {
|
|
769
|
-
var _a, _b, _c;
|
|
770
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
771
|
-
const requestTransformation = {
|
|
772
|
-
url: '$[0]',
|
|
773
|
-
mediaType: '$[1].mediaType',
|
|
774
|
-
displayName: '$[1].displayName',
|
|
775
|
-
parentFolderId: '$[1].parentFolderId',
|
|
776
|
-
private: '$[1].private',
|
|
777
|
-
labels: '$[1].labels',
|
|
778
|
-
mimeType: '$[1].mimeType',
|
|
779
|
-
externalInfo: '$[1].externalInfo',
|
|
780
|
-
urlParams: '$[1].urlParams',
|
|
781
|
-
urlHeaders: '$[1].urlHeaders',
|
|
782
|
-
};
|
|
783
|
-
const responseTransformation = '$';
|
|
784
|
-
// @ts-ignore
|
|
785
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
786
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
787
|
-
rootSchema: _importFileRequest,
|
|
788
|
-
depSchemas: {},
|
|
789
|
-
fqdnTransformation: {
|
|
790
|
-
paths: [],
|
|
791
|
-
transformation: _fromVeloEntity,
|
|
792
|
-
},
|
|
793
|
-
customTransformation: requestTransformation,
|
|
794
|
-
});
|
|
795
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
796
|
-
rootSchema: _importFileResponse,
|
|
797
|
-
depSchemas: {
|
|
798
|
-
_audioV2,
|
|
799
|
-
_fileDescriptor,
|
|
800
|
-
_fileMedia,
|
|
801
|
-
_imageMedia,
|
|
802
|
-
_model3D,
|
|
803
|
-
},
|
|
804
|
-
fqdnTransformation: {
|
|
805
|
-
paths: [...['file']],
|
|
806
|
-
transformation: _toVeloEntity,
|
|
807
|
-
},
|
|
808
|
-
customTransformation: responseTransformation,
|
|
809
|
-
});
|
|
810
|
-
const payload = toAmbassadorRequest([url, options]);
|
|
811
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.importFile(payload);
|
|
812
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
813
|
-
try {
|
|
814
|
-
const result = yield httpClient.request(reqOpts);
|
|
815
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
816
|
-
return fromJSON(result.data);
|
|
817
|
-
}
|
|
818
|
-
catch (err) {
|
|
819
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
820
|
-
spreadPathsToArguments: {},
|
|
821
|
-
explicitPathsToArguments: {
|
|
822
|
-
url: '$[0]',
|
|
823
|
-
mediaType: '$[1].mediaType',
|
|
824
|
-
displayName: '$[1].displayName',
|
|
825
|
-
parentFolderId: '$[1].parentFolderId',
|
|
826
|
-
private: '$[1].private',
|
|
827
|
-
labels: '$[1].labels',
|
|
828
|
-
mimeType: '$[1].mimeType',
|
|
829
|
-
externalInfo: '$[1].externalInfo',
|
|
830
|
-
urlParams: '$[1].urlParams',
|
|
831
|
-
urlHeaders: '$[1].urlHeaders',
|
|
832
|
-
},
|
|
833
|
-
singleArgumentUnchanged: false,
|
|
834
|
-
}, ['url', 'options']);
|
|
835
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
836
|
-
throw transformedError;
|
|
837
|
-
}
|
|
838
|
-
});
|
|
839
|
-
}
|
|
840
|
-
exports.importFile = importFile;
|
|
841
|
-
/**
|
|
842
|
-
* > **Deprecated.**
|
|
843
|
-
* > This function has been replaced with `bulkImportFile()`, and will be removed on March 31, 2024.
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
* The `bulkImportFiles()` function returns a Promise that resolves to an array of the imported files' descriptors.
|
|
847
|
-
*
|
|
848
|
-
* Imports a bulk of files to the Media Manager using external urls.
|
|
849
|
-
*
|
|
850
|
-
* Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
|
|
851
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
852
|
-
*
|
|
853
|
-
* >**Note:** The `media` property isn't returned in the `files` response object.
|
|
854
|
-
*
|
|
855
|
-
* To import files, you need to do one of the following for each file:
|
|
856
|
-
* - 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'`.
|
|
857
|
-
* - 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`.
|
|
858
|
-
* - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
|
|
859
|
-
* > **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'`.
|
|
860
|
-
* @param importFileRequests - Information about the files to import.
|
|
861
|
-
* @public
|
|
862
|
-
* @requiredField importFileRequests
|
|
863
|
-
* @requiredField importFileRequests.url
|
|
864
|
-
* @param options - Options to use when uploading multiple files.
|
|
865
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
866
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
867
|
-
* @permissionScope Manage Media Manager
|
|
868
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
869
|
-
* @applicableIdentity APP
|
|
870
|
-
*/
|
|
871
|
-
function bulkImportFiles(importFileRequests) {
|
|
872
|
-
var _a, _b, _c;
|
|
873
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
874
|
-
const requestTransformation = { importFileRequests: '$[0]' };
|
|
875
|
-
const responseTransformation = '$';
|
|
876
|
-
// @ts-ignore
|
|
877
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
878
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
879
|
-
rootSchema: _bulkImportFilesRequest,
|
|
880
|
-
depSchemas: { _importFileRequest },
|
|
881
|
-
fqdnTransformation: {
|
|
882
|
-
paths: [],
|
|
883
|
-
transformation: _fromVeloEntity,
|
|
884
|
-
},
|
|
885
|
-
customTransformation: requestTransformation,
|
|
886
|
-
});
|
|
887
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
888
|
-
rootSchema: _bulkImportFilesResponse,
|
|
889
|
-
depSchemas: {
|
|
890
|
-
_audioV2,
|
|
891
|
-
_fileDescriptor,
|
|
892
|
-
_fileMedia,
|
|
893
|
-
_imageMedia,
|
|
894
|
-
_model3D,
|
|
895
|
-
},
|
|
896
|
-
fqdnTransformation: {
|
|
897
|
-
paths: [...['Array#files']],
|
|
898
|
-
transformation: _toVeloEntity,
|
|
899
|
-
},
|
|
900
|
-
customTransformation: responseTransformation,
|
|
901
|
-
});
|
|
902
|
-
const payload = toAmbassadorRequest([importFileRequests]);
|
|
903
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkImportFiles(payload);
|
|
904
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
905
|
-
try {
|
|
906
|
-
const result = yield httpClient.request(reqOpts);
|
|
907
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
908
|
-
return fromJSON(result.data);
|
|
909
|
-
}
|
|
910
|
-
catch (err) {
|
|
911
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
912
|
-
spreadPathsToArguments: {},
|
|
913
|
-
explicitPathsToArguments: { importFileRequests: '$[0]' },
|
|
914
|
-
singleArgumentUnchanged: false,
|
|
915
|
-
}, ['importFileRequests']);
|
|
916
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
917
|
-
throw transformedError;
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
exports.bulkImportFiles = bulkImportFiles;
|
|
922
|
-
/**
|
|
923
|
-
* Imports a bulk of files to the Media Manager using external urls.
|
|
924
|
-
*
|
|
925
|
-
* The `bulkImportFile()` function returns a Promise that resolves to an object containing bulk import metadata and an array of imported files' descriptors and metadata.
|
|
926
|
-
*
|
|
927
|
-
* Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
|
|
928
|
-
* If no folder is specified, the file is imported to the `media-root` folder.
|
|
929
|
-
*
|
|
930
|
-
* To import files, you need to do one of the following for each file:
|
|
931
|
-
* - 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'`.
|
|
932
|
-
* - 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`.
|
|
933
|
-
* - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
|
|
934
|
-
* > **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'`.
|
|
935
|
-
* @param importFileRequests - Information about the files to import.
|
|
936
|
-
* @public
|
|
937
|
-
* @requiredField importFileRequests
|
|
938
|
-
* @requiredField importFileRequests.url
|
|
939
|
-
* @param options - Options to include the file descriptor in the response.
|
|
940
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
941
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
942
|
-
* @permissionScope Manage Media Manager
|
|
943
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
944
|
-
* @applicableIdentity APP
|
|
945
|
-
*/
|
|
946
|
-
function bulkImportFile(importFileRequests, options) {
|
|
947
|
-
var _a, _b, _c;
|
|
948
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
949
|
-
const requestTransformation = {
|
|
950
|
-
importFileRequests: '$[0]',
|
|
951
|
-
returnEntity: '$[1].returnEntity',
|
|
952
|
-
};
|
|
953
|
-
const responseTransformation = '$';
|
|
954
|
-
// @ts-ignore
|
|
955
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
956
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
957
|
-
rootSchema: _bulkImportFileRequest,
|
|
958
|
-
depSchemas: { _importFileRequest },
|
|
959
|
-
fqdnTransformation: {
|
|
960
|
-
paths: [],
|
|
961
|
-
transformation: _fromVeloEntity,
|
|
962
|
-
},
|
|
963
|
-
customTransformation: requestTransformation,
|
|
964
|
-
});
|
|
965
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
966
|
-
rootSchema: _bulkImportFileResponse,
|
|
967
|
-
depSchemas: {
|
|
968
|
-
_audioV2,
|
|
969
|
-
_bulkImportFileResult,
|
|
970
|
-
_fileDescriptor,
|
|
971
|
-
_fileMedia,
|
|
972
|
-
_imageMedia,
|
|
973
|
-
_model3D,
|
|
974
|
-
},
|
|
975
|
-
fqdnTransformation: {
|
|
976
|
-
paths: [...['Array#results.item']],
|
|
977
|
-
transformation: _toVeloEntity,
|
|
978
|
-
},
|
|
979
|
-
customTransformation: responseTransformation,
|
|
980
|
-
});
|
|
981
|
-
const payload = toAmbassadorRequest([importFileRequests, options]);
|
|
982
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkImportFile(payload);
|
|
983
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
984
|
-
try {
|
|
985
|
-
const result = yield httpClient.request(reqOpts);
|
|
986
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
987
|
-
return fromJSON(result.data);
|
|
988
|
-
}
|
|
989
|
-
catch (err) {
|
|
990
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
991
|
-
spreadPathsToArguments: {},
|
|
992
|
-
explicitPathsToArguments: {
|
|
993
|
-
importFileRequests: '$[0]',
|
|
994
|
-
returnEntity: '$[1].returnEntity',
|
|
995
|
-
},
|
|
996
|
-
singleArgumentUnchanged: false,
|
|
997
|
-
}, ['importFileRequests', 'options']);
|
|
998
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
999
|
-
throw transformedError;
|
|
1000
|
-
}
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
exports.bulkImportFile = bulkImportFile;
|
|
1004
|
-
/**
|
|
1005
|
-
* Retrieves a list of files in the Media Manager.
|
|
1006
|
-
*
|
|
1007
|
-
* The `listFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
|
|
1008
|
-
*
|
|
1009
|
-
* 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.
|
|
1010
|
-
*
|
|
1011
|
-
* To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
|
|
1012
|
-
* @public
|
|
1013
|
-
* @param options - Options to use when listing media files.
|
|
1014
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1015
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1016
|
-
* @permissionScope Read Media Manager
|
|
1017
|
-
* @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
|
|
1018
|
-
* @permissionScope Manage Media Manager
|
|
1019
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
1020
|
-
* @applicableIdentity APP
|
|
1021
|
-
*/
|
|
1022
|
-
function listFiles(options) {
|
|
1023
|
-
var _a, _b, _c;
|
|
1024
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1025
|
-
const requestTransformation = {
|
|
1026
|
-
parentFolderId: '$[0].parentFolderId',
|
|
1027
|
-
mediaTypes: '$[0].mediaTypes',
|
|
1028
|
-
private: '$[0].private',
|
|
1029
|
-
sort: '$[0].sort',
|
|
1030
|
-
paging: '$[0].paging',
|
|
1031
|
-
};
|
|
1032
|
-
const responseTransformation = '$';
|
|
1033
|
-
// @ts-ignore
|
|
1034
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1035
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
1036
|
-
rootSchema: _listFilesRequest,
|
|
1037
|
-
depSchemas: {},
|
|
1038
|
-
fqdnTransformation: {
|
|
1039
|
-
paths: [],
|
|
1040
|
-
transformation: _fromVeloEntity,
|
|
1041
|
-
},
|
|
1042
|
-
customTransformation: requestTransformation,
|
|
1043
|
-
});
|
|
1044
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
1045
|
-
rootSchema: _listFilesResponse,
|
|
1046
|
-
depSchemas: {
|
|
1047
|
-
_audioV2,
|
|
1048
|
-
_fileDescriptor,
|
|
1049
|
-
_fileMedia,
|
|
1050
|
-
_imageMedia,
|
|
1051
|
-
_model3D,
|
|
1052
|
-
},
|
|
1053
|
-
fqdnTransformation: {
|
|
1054
|
-
paths: [...['Array#files']],
|
|
1055
|
-
transformation: _toVeloEntity,
|
|
1056
|
-
},
|
|
1057
|
-
customTransformation: responseTransformation,
|
|
1058
|
-
});
|
|
1059
|
-
const payload = toAmbassadorRequest([options]);
|
|
1060
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.listFiles(payload);
|
|
1061
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1062
|
-
try {
|
|
1063
|
-
const result = yield httpClient.request(reqOpts);
|
|
1064
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1065
|
-
return fromJSON(result.data);
|
|
1066
|
-
}
|
|
1067
|
-
catch (err) {
|
|
1068
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1069
|
-
spreadPathsToArguments: {},
|
|
1070
|
-
explicitPathsToArguments: {
|
|
1071
|
-
parentFolderId: '$[0].parentFolderId',
|
|
1072
|
-
mediaTypes: '$[0].mediaTypes',
|
|
1073
|
-
private: '$[0].private',
|
|
1074
|
-
sort: '$[0].sort',
|
|
1075
|
-
paging: '$[0].paging',
|
|
1076
|
-
},
|
|
1077
|
-
singleArgumentUnchanged: false,
|
|
1078
|
-
}, ['options']);
|
|
1079
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1080
|
-
throw transformedError;
|
|
1081
|
-
}
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
exports.listFiles = listFiles;
|
|
1085
|
-
/**
|
|
1086
|
-
* Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
|
|
1087
|
-
*
|
|
1088
|
-
* The `searchFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
|
|
1089
|
-
*
|
|
1090
|
-
* If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
|
|
1091
|
-
* @public
|
|
1092
|
-
* @param options - Options to specify which folders to search.
|
|
1093
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1094
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1095
|
-
* @permissionScope Read Media Manager
|
|
1096
|
-
* @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
|
|
1097
|
-
* @permissionScope Manage Media Manager
|
|
1098
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
1099
|
-
* @applicableIdentity APP
|
|
1100
|
-
*/
|
|
1101
|
-
function searchFiles(options) {
|
|
1102
|
-
var _a, _b, _c;
|
|
1103
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1104
|
-
const requestTransformation = {
|
|
1105
|
-
search: '$[0].search',
|
|
1106
|
-
rootFolder: '$[0].rootFolder',
|
|
1107
|
-
mediaTypes: '$[0].mediaTypes',
|
|
1108
|
-
private: '$[0].private',
|
|
1109
|
-
sort: '$[0].sort',
|
|
1110
|
-
paging: '$[0].paging',
|
|
1111
|
-
};
|
|
1112
|
-
const responseTransformation = '$';
|
|
1113
|
-
// @ts-ignore
|
|
1114
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1115
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
1116
|
-
rootSchema: _searchFilesRequest,
|
|
1117
|
-
depSchemas: {},
|
|
1118
|
-
fqdnTransformation: {
|
|
1119
|
-
paths: [],
|
|
1120
|
-
transformation: _fromVeloEntity,
|
|
1121
|
-
},
|
|
1122
|
-
customTransformation: requestTransformation,
|
|
1123
|
-
});
|
|
1124
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
1125
|
-
rootSchema: _searchFilesResponse,
|
|
1126
|
-
depSchemas: {
|
|
1127
|
-
_audioV2,
|
|
1128
|
-
_fileDescriptor,
|
|
1129
|
-
_fileMedia,
|
|
1130
|
-
_imageMedia,
|
|
1131
|
-
_model3D,
|
|
1132
|
-
},
|
|
1133
|
-
fqdnTransformation: {
|
|
1134
|
-
paths: [...['Array#files']],
|
|
1135
|
-
transformation: _toVeloEntity,
|
|
1136
|
-
},
|
|
1137
|
-
customTransformation: responseTransformation,
|
|
1138
|
-
});
|
|
1139
|
-
const payload = toAmbassadorRequest([options]);
|
|
1140
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.searchFiles(payload);
|
|
1141
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1142
|
-
try {
|
|
1143
|
-
const result = yield httpClient.request(reqOpts);
|
|
1144
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1145
|
-
return fromJSON(result.data);
|
|
1146
|
-
}
|
|
1147
|
-
catch (err) {
|
|
1148
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1149
|
-
spreadPathsToArguments: {},
|
|
1150
|
-
explicitPathsToArguments: {
|
|
1151
|
-
search: '$[0].search',
|
|
1152
|
-
rootFolder: '$[0].rootFolder',
|
|
1153
|
-
mediaTypes: '$[0].mediaTypes',
|
|
1154
|
-
private: '$[0].private',
|
|
1155
|
-
sort: '$[0].sort',
|
|
1156
|
-
paging: '$[0].paging',
|
|
1157
|
-
},
|
|
1158
|
-
singleArgumentUnchanged: false,
|
|
1159
|
-
}, ['options']);
|
|
1160
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1161
|
-
throw transformedError;
|
|
1162
|
-
}
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
exports.searchFiles = searchFiles;
|
|
1166
|
-
/**
|
|
1167
|
-
* Generates a URL for streaming a specific video file in the Media Manager.
|
|
1168
|
-
*
|
|
1169
|
-
*
|
|
1170
|
-
* The `generateVideoStreamingUrl()` function returns a Promise that resolves to a download URL and its asset key.
|
|
1171
|
-
*
|
|
1172
|
-
* 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.
|
|
1173
|
-
* @param fileId - File ID.
|
|
1174
|
-
* @public
|
|
1175
|
-
* @requiredField fileId
|
|
1176
|
-
* @param options - Options to use when generating a video file's streaming URL.
|
|
1177
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1178
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1179
|
-
* @permissionScope Read Media Manager
|
|
1180
|
-
* @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
|
|
1181
|
-
* @permissionScope Manage Media Manager
|
|
1182
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
1183
|
-
* @applicableIdentity APP
|
|
1184
|
-
*/
|
|
1185
|
-
function generateVideoStreamingUrl(fileId, options) {
|
|
1186
|
-
var _a, _b, _c;
|
|
1187
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1188
|
-
const requestTransformation = { fileId: '$[0]', format: '$[1].format' };
|
|
1189
|
-
const responseTransformation = '$';
|
|
1190
|
-
// @ts-ignore
|
|
1191
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1192
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
1193
|
-
rootSchema: _generateVideoStreamingUrlRequest,
|
|
1194
|
-
depSchemas: {},
|
|
1195
|
-
fqdnTransformation: {
|
|
1196
|
-
paths: [],
|
|
1197
|
-
transformation: _fromVeloEntity,
|
|
1198
|
-
},
|
|
1199
|
-
customTransformation: requestTransformation,
|
|
1200
|
-
});
|
|
1201
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
1202
|
-
rootSchema: _generateVideoStreamingUrlResponse,
|
|
1203
|
-
depSchemas: {},
|
|
1204
|
-
fqdnTransformation: {
|
|
1205
|
-
paths: [],
|
|
1206
|
-
transformation: _toVeloEntity,
|
|
1207
|
-
},
|
|
1208
|
-
customTransformation: responseTransformation,
|
|
1209
|
-
});
|
|
1210
|
-
const payload = toAmbassadorRequest([fileId, options]);
|
|
1211
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.generateVideoStreamingUrl(payload);
|
|
1212
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1213
|
-
try {
|
|
1214
|
-
const result = yield httpClient.request(reqOpts);
|
|
1215
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1216
|
-
return fromJSON(result.data);
|
|
1217
|
-
}
|
|
1218
|
-
catch (err) {
|
|
1219
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1220
|
-
spreadPathsToArguments: {},
|
|
1221
|
-
explicitPathsToArguments: { fileId: '$[0]', format: '$[1].format' },
|
|
1222
|
-
singleArgumentUnchanged: false,
|
|
1223
|
-
}, ['fileId', 'options']);
|
|
1224
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1225
|
-
throw transformedError;
|
|
1226
|
-
}
|
|
1227
|
-
});
|
|
1228
|
-
}
|
|
1229
|
-
exports.generateVideoStreamingUrl = generateVideoStreamingUrl;
|
|
1230
|
-
/**
|
|
1231
|
-
* Deletes the specified files from the Media Manager.
|
|
1232
|
-
*
|
|
1233
|
-
*
|
|
1234
|
-
* The `bulkDeleteFiles()` function returns a Promise that resolves when the files are deleted.
|
|
1235
|
-
*
|
|
1236
|
-
* 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.
|
|
1237
|
-
*
|
|
1238
|
-
* >**Notes:**
|
|
1239
|
-
* > - The specified files can be from different folders.
|
|
1240
|
-
* > - Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
|
|
1241
|
-
* > - Attempting to delete files that are already in the trash bin doesn't result in an error.
|
|
1242
|
-
* > - 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).
|
|
1243
|
-
* > - You can use `bulkRestoreFilesFromTrashBin()` to restore files from the Media Manager's trash bin.
|
|
1244
|
-
* @param fileIds - IDs of the files to move to the Media Manager's trash bin.
|
|
1245
|
-
* @public
|
|
1246
|
-
* @requiredField fileIds
|
|
1247
|
-
* @param options - Options to use when deleting files.
|
|
1248
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1249
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1250
|
-
* @permissionScope Manage Media Manager
|
|
1251
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
1252
|
-
* @applicableIdentity APP
|
|
1253
|
-
*/
|
|
1254
|
-
function bulkDeleteFiles(fileIds, options) {
|
|
1255
|
-
var _a, _b, _c;
|
|
1256
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1257
|
-
const requestTransformation = {
|
|
1258
|
-
fileIds: '$[0]',
|
|
1259
|
-
permanent: '$[1].permanent',
|
|
1260
|
-
};
|
|
1261
|
-
const responseTransformation = '$';
|
|
1262
|
-
// @ts-ignore
|
|
1263
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1264
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
1265
|
-
rootSchema: _bulkDeleteFilesRequest,
|
|
1266
|
-
depSchemas: {},
|
|
1267
|
-
fqdnTransformation: {
|
|
1268
|
-
paths: [],
|
|
1269
|
-
transformation: _fromVeloEntity,
|
|
1270
|
-
},
|
|
1271
|
-
customTransformation: requestTransformation,
|
|
1272
|
-
});
|
|
1273
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
1274
|
-
rootSchema: _bulkDeleteFilesResponse,
|
|
1275
|
-
depSchemas: {},
|
|
1276
|
-
fqdnTransformation: {
|
|
1277
|
-
paths: [],
|
|
1278
|
-
transformation: _toVeloEntity,
|
|
1279
|
-
},
|
|
1280
|
-
customTransformation: responseTransformation,
|
|
1281
|
-
});
|
|
1282
|
-
const payload = toAmbassadorRequest([fileIds, options]);
|
|
1283
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkDeleteFiles(payload);
|
|
1284
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1285
|
-
try {
|
|
1286
|
-
const result = yield httpClient.request(reqOpts);
|
|
1287
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1288
|
-
}
|
|
1289
|
-
catch (err) {
|
|
1290
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1291
|
-
spreadPathsToArguments: {},
|
|
1292
|
-
explicitPathsToArguments: {
|
|
1293
|
-
fileIds: '$[0]',
|
|
1294
|
-
permanent: '$[1].permanent',
|
|
1295
|
-
},
|
|
1296
|
-
singleArgumentUnchanged: false,
|
|
1297
|
-
}, ['fileIds', 'options']);
|
|
1298
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1299
|
-
throw transformedError;
|
|
1300
|
-
}
|
|
1301
|
-
});
|
|
1302
|
-
}
|
|
1303
|
-
exports.bulkDeleteFiles = bulkDeleteFiles;
|
|
1304
|
-
/**
|
|
1305
|
-
* Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
|
|
1306
|
-
*
|
|
1307
|
-
* The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
|
|
1308
|
-
* @param fileIds - IDs of the files to restore from the Media Manager's trash bin.
|
|
1309
|
-
* @public
|
|
1310
|
-
* @requiredField fileIds
|
|
1311
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1312
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1313
|
-
* @permissionScope Manage Media Manager
|
|
1314
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
1315
|
-
* @applicableIdentity APP
|
|
1316
|
-
*/
|
|
1317
|
-
function bulkRestoreFilesFromTrashBin(fileIds) {
|
|
1318
|
-
var _a, _b, _c;
|
|
1319
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1320
|
-
const requestTransformation = { fileIds: '$[0]' };
|
|
1321
|
-
const responseTransformation = '$';
|
|
1322
|
-
// @ts-ignore
|
|
1323
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1324
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
1325
|
-
rootSchema: _bulkRestoreFilesFromTrashBinRequest,
|
|
1326
|
-
depSchemas: {},
|
|
1327
|
-
fqdnTransformation: {
|
|
1328
|
-
paths: [],
|
|
1329
|
-
transformation: _fromVeloEntity,
|
|
1330
|
-
},
|
|
1331
|
-
customTransformation: requestTransformation,
|
|
1332
|
-
});
|
|
1333
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
1334
|
-
rootSchema: _bulkRestoreFilesFromTrashBinResponse,
|
|
1335
|
-
depSchemas: {},
|
|
1336
|
-
fqdnTransformation: {
|
|
1337
|
-
paths: [],
|
|
1338
|
-
transformation: _toVeloEntity,
|
|
1339
|
-
},
|
|
1340
|
-
customTransformation: responseTransformation,
|
|
1341
|
-
});
|
|
1342
|
-
const payload = toAmbassadorRequest([fileIds]);
|
|
1343
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkRestoreFilesFromTrashBin(payload);
|
|
1344
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1345
|
-
try {
|
|
1346
|
-
const result = yield httpClient.request(reqOpts);
|
|
1347
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1348
|
-
}
|
|
1349
|
-
catch (err) {
|
|
1350
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1351
|
-
spreadPathsToArguments: {},
|
|
1352
|
-
explicitPathsToArguments: { fileIds: '$[0]' },
|
|
1353
|
-
singleArgumentUnchanged: false,
|
|
1354
|
-
}, ['fileIds']);
|
|
1355
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1356
|
-
throw transformedError;
|
|
1357
|
-
}
|
|
1358
|
-
});
|
|
1359
|
-
}
|
|
1360
|
-
exports.bulkRestoreFilesFromTrashBin = bulkRestoreFilesFromTrashBin;
|
|
1361
|
-
/**
|
|
1362
|
-
* Retrieves a list of files in the Media Manager's trash bin.
|
|
1363
|
-
*
|
|
1364
|
-
* The `listDeletedFiles()` function returns a Promise that resolves to an array of the specified deleted files' descriptors and cursor information.
|
|
1365
|
-
*
|
|
1366
|
-
* >**Note:** The Media Manager's trash bin (`TRASH_ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
|
|
1367
|
-
*
|
|
1368
|
-
* To retrieve a list of non-deleted files, use the `listFiles()` function.
|
|
1369
|
-
* @public
|
|
1370
|
-
* @param options - Options to use when listing deleted files from the trash bin.
|
|
1371
|
-
* @permissionScope Manage Bookings Services and Settings
|
|
1372
|
-
* @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
|
|
1373
|
-
* @permissionScope Read Media Manager
|
|
1374
|
-
* @permissionScopeId SCOPE.DC-MEDIA.READ-MEDIAMANAGER
|
|
1375
|
-
* @permissionScope Manage Media Manager
|
|
1376
|
-
* @permissionScopeId SCOPE.DC-MEDIA.MANAGE-MEDIAMANAGER
|
|
1377
|
-
* @applicableIdentity APP
|
|
1378
|
-
*/
|
|
1379
|
-
function listDeletedFiles(options) {
|
|
1380
|
-
var _a, _b, _c;
|
|
1381
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1382
|
-
const requestTransformation = {
|
|
1383
|
-
parentFolderId: '$[0].parentFolderId',
|
|
1384
|
-
mediaTypes: '$[0].mediaTypes',
|
|
1385
|
-
private: '$[0].private',
|
|
1386
|
-
sort: '$[0].sort',
|
|
1387
|
-
paging: '$[0].paging',
|
|
1388
|
-
};
|
|
1389
|
-
const responseTransformation = '$';
|
|
1390
|
-
// @ts-ignore
|
|
1391
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1392
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
1393
|
-
rootSchema: _listDeletedFilesRequest,
|
|
1394
|
-
depSchemas: {},
|
|
1395
|
-
fqdnTransformation: {
|
|
1396
|
-
paths: [],
|
|
1397
|
-
transformation: _fromVeloEntity,
|
|
1398
|
-
},
|
|
1399
|
-
customTransformation: requestTransformation,
|
|
1400
|
-
});
|
|
1401
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
1402
|
-
rootSchema: _listDeletedFilesResponse,
|
|
1403
|
-
depSchemas: {
|
|
1404
|
-
_audioV2,
|
|
1405
|
-
_fileDescriptor,
|
|
1406
|
-
_fileMedia,
|
|
1407
|
-
_imageMedia,
|
|
1408
|
-
_model3D,
|
|
1409
|
-
},
|
|
1410
|
-
fqdnTransformation: {
|
|
1411
|
-
paths: [...['Array#files']],
|
|
1412
|
-
transformation: _toVeloEntity,
|
|
1413
|
-
},
|
|
1414
|
-
customTransformation: responseTransformation,
|
|
1415
|
-
});
|
|
1416
|
-
const payload = toAmbassadorRequest([options]);
|
|
1417
|
-
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.listDeletedFiles(payload);
|
|
1418
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1419
|
-
try {
|
|
1420
|
-
const result = yield httpClient.request(reqOpts);
|
|
1421
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1422
|
-
return fromJSON(result.data);
|
|
1423
|
-
}
|
|
1424
|
-
catch (err) {
|
|
1425
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1426
|
-
spreadPathsToArguments: {},
|
|
1427
|
-
explicitPathsToArguments: {
|
|
1428
|
-
parentFolderId: '$[0].parentFolderId',
|
|
1429
|
-
mediaTypes: '$[0].mediaTypes',
|
|
1430
|
-
private: '$[0].private',
|
|
1431
|
-
sort: '$[0].sort',
|
|
1432
|
-
paging: '$[0].paging',
|
|
1433
|
-
},
|
|
1434
|
-
singleArgumentUnchanged: false,
|
|
1435
|
-
}, ['options']);
|
|
1436
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1437
|
-
throw transformedError;
|
|
1438
|
-
}
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
exports.listDeletedFiles = listDeletedFiles;
|
|
1442
|
-
//# sourceMappingURL=media-site-media-v1-file-descriptor.universal.js.map
|