@wix/media 1.0.59 → 1.0.61
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 -0
- package/build/cjs/context.js +31 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +2 -0
- package/build/cjs/index.js +3 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -0
- package/build/cjs/index.typings.js +3 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +2 -0
- package/build/cjs/meta.js +3 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +8 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js +77 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +16 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js +245 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +24 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js +142 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +26 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js +49 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +221 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js +22 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +315 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js +407 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +13 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js +137 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +29 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js +446 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +33 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js +237 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +59 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js +81 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +949 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js +27 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +1 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +907 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js +748 -0
- package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +1 -0
- package/build/cjs/src/media-site-media-v1-file-descriptor.context.d.ts +18 -0
- package/build/cjs/src/media-site-media-v1-file-descriptor.context.js +197 -0
- package/build/cjs/src/media-site-media-v1-file-descriptor.context.js.map +1 -0
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.d.ts +16 -17
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +6 -4
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +2 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.js +6 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +31 -24
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +6 -30
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.context.d.ts +11 -0
- package/build/cjs/src/media-site-media-v1-folder.context.js +113 -0
- package/build/cjs/src/media-site-media-v1-folder.context.js.map +1 -0
- package/build/cjs/src/media-site-media-v1-folder.http.d.ts +9 -10
- package/build/cjs/src/media-site-media-v1-folder.http.js +6 -4
- package/build/cjs/src/media-site-media-v1-folder.http.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.public.d.ts +2 -1
- package/build/cjs/src/media-site-media-v1-folder.public.js +5 -1
- package/build/cjs/src/media-site-media-v1-folder.public.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +30 -24
- package/build/cjs/src/media-site-media-v1-folder.universal.js +5 -23
- package/build/cjs/src/media-site-media-v1-folder.universal.js.map +1 -1
- package/build/es/context.d.ts +4 -0
- package/build/es/context.js +5 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.d.ts +2 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -1
- package/build/es/index.typings.d.ts +2 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -1
- package/build/es/meta.d.ts +2 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -1
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +8 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js +68 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +16 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js +236 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +24 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js +110 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +26 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js +35 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +221 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js +19 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +315 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js +375 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +13 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js +123 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +29 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js +432 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +33 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js +200 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +59 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js +60 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +949 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js +24 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +1 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +907 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js +711 -0
- package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +1 -0
- package/build/es/src/media-site-media-v1-file-descriptor.context.d.ts +18 -0
- package/build/es/src/media-site-media-v1-file-descriptor.context.js +178 -0
- package/build/es/src/media-site-media-v1-file-descriptor.context.js.map +1 -0
- package/build/es/src/media-site-media-v1-file-descriptor.http.d.ts +16 -17
- package/build/es/src/media-site-media-v1-file-descriptor.http.js +6 -4
- package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +2 -1
- package/build/es/src/media-site-media-v1-file-descriptor.public.js +1 -0
- package/build/es/src/media-site-media-v1-file-descriptor.public.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +31 -24
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js +5 -29
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.context.d.ts +11 -0
- package/build/es/src/media-site-media-v1-folder.context.js +101 -0
- package/build/es/src/media-site-media-v1-folder.context.js.map +1 -0
- package/build/es/src/media-site-media-v1-folder.http.d.ts +9 -10
- package/build/es/src/media-site-media-v1-folder.http.js +6 -4
- package/build/es/src/media-site-media-v1-folder.http.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.public.d.ts +2 -1
- package/build/es/src/media-site-media-v1-folder.public.js +1 -0
- package/build/es/src/media-site-media-v1-folder.public.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.universal.d.ts +30 -24
- package/build/es/src/media-site-media-v1-folder.universal.js +4 -22
- package/build/es/src/media-site-media-v1-folder.universal.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +7 -5
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
|
|
11
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
12
|
+
import { EventDefinition } from '@wix/sdk-types';
|
|
13
|
+
import * as ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem from './media-enterprise-public-media-v1-enterprise-item.http';
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
|
|
16
|
+
const _toVeloEntity = '$';
|
|
17
|
+
const _fromVeloEntity = '$';
|
|
18
|
+
export var MediaType;
|
|
19
|
+
(function (MediaType) {
|
|
20
|
+
MediaType["MIXED"] = "MIXED";
|
|
21
|
+
MediaType["IMAGE"] = "IMAGE";
|
|
22
|
+
MediaType["VIDEO"] = "VIDEO";
|
|
23
|
+
MediaType["AUDIO"] = "AUDIO";
|
|
24
|
+
MediaType["DOCUMENT"] = "DOCUMENT";
|
|
25
|
+
MediaType["VECTOR"] = "VECTOR";
|
|
26
|
+
MediaType["ARCHIVE"] = "ARCHIVE";
|
|
27
|
+
MediaType["MODEL3D"] = "MODEL3D";
|
|
28
|
+
})(MediaType || (MediaType = {}));
|
|
29
|
+
export var PublishStatus;
|
|
30
|
+
(function (PublishStatus) {
|
|
31
|
+
PublishStatus["UNDEFINED"] = "UNDEFINED";
|
|
32
|
+
PublishStatus["UNPUBLISHED"] = "UNPUBLISHED";
|
|
33
|
+
PublishStatus["PUBLISHED"] = "PUBLISHED";
|
|
34
|
+
PublishStatus["WIX_ONLY"] = "WIX_ONLY";
|
|
35
|
+
})(PublishStatus || (PublishStatus = {}));
|
|
36
|
+
export var SortOrder;
|
|
37
|
+
(function (SortOrder) {
|
|
38
|
+
SortOrder["ASC"] = "ASC";
|
|
39
|
+
SortOrder["DESC"] = "DESC";
|
|
40
|
+
})(SortOrder || (SortOrder = {}));
|
|
41
|
+
const _bulkItemUpdateResult = { item: '_enterpriseMediaItem' };
|
|
42
|
+
const _bulkUpdateItemRequest = { updateItemRequests: '_updateItemRequest' };
|
|
43
|
+
const _bulkUpdateItemResponse = { results: '_bulkItemUpdateResult' };
|
|
44
|
+
const _enterpriseMediaItem = { assets: '_itemAssets' };
|
|
45
|
+
const _generateFileUploadUrlRequest = {};
|
|
46
|
+
const _generateFileUploadUrlResponse = {};
|
|
47
|
+
const _getItemRequest = {};
|
|
48
|
+
const _getItemResponse = { item: '_enterpriseMediaItem' };
|
|
49
|
+
const _importFileRequest = {};
|
|
50
|
+
const _importFileResponse = { item: '_enterpriseMediaItem' };
|
|
51
|
+
const _itemAssets = {
|
|
52
|
+
image: 'wix.common.Image',
|
|
53
|
+
video: 'wix.common.VideoV2',
|
|
54
|
+
vector: 'wix.common.Image',
|
|
55
|
+
audio: 'wix.common.Audio',
|
|
56
|
+
document: 'wix.common.Document',
|
|
57
|
+
model3d: '_model3D',
|
|
58
|
+
};
|
|
59
|
+
const _itemUploadCallbackRequest = {};
|
|
60
|
+
const _itemUploadCallbackResponse = {};
|
|
61
|
+
const _linkItemToCategoriesRequest = {};
|
|
62
|
+
const _linkItemToCategoriesResponse = {};
|
|
63
|
+
const _model3D = { thumbnail: 'wix.common.Image' };
|
|
64
|
+
const _overwriteItemCategoriesRequest = {};
|
|
65
|
+
const _overwriteItemCategoriesResponse = {};
|
|
66
|
+
const _queryItemsRequest = {};
|
|
67
|
+
const _queryItemsResponse = { items: '_enterpriseMediaItem' };
|
|
68
|
+
const _searchItemsRequest = {};
|
|
69
|
+
const _searchItemsResponse = { items: '_enterpriseMediaItem' };
|
|
70
|
+
const _unlinkItemFromCategoriesRequest = {};
|
|
71
|
+
const _unlinkItemFromCategoriesResponse = {};
|
|
72
|
+
const _updateItemRequest = { item: '_enterpriseMediaItem' };
|
|
73
|
+
const _updateItemResponse = { item: '_enterpriseMediaItem' };
|
|
74
|
+
export const onEnterpriseItemCreated = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_item_created')();
|
|
75
|
+
export const onEnterpriseItemUpdated = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_item_updated')();
|
|
76
|
+
export const onEnterpriseItemItemCategoriesChanged = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_item_item_categories_changed')();
|
|
77
|
+
export const onEnterpriseItemPublishStatusChanged = EventDefinition('wix.media.enterprise_public_media.v1.enterprise_item_publish_status_changed')();
|
|
78
|
+
/**
|
|
79
|
+
* Internal API called by the public media backend, notify about a file that was created enterprise public media server
|
|
80
|
+
* @public
|
|
81
|
+
* @documentationMaturity preview
|
|
82
|
+
*/
|
|
83
|
+
export function itemUploadCallback(options) {
|
|
84
|
+
var _a, _b, _c;
|
|
85
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
86
|
+
const requestTransformation = {
|
|
87
|
+
itemId: '$[0].itemId',
|
|
88
|
+
callbackToken: '$[0].callbackToken',
|
|
89
|
+
};
|
|
90
|
+
const responseTransformation = '$';
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
93
|
+
const { toAmbassadorRequest } = serializer({
|
|
94
|
+
rootSchema: _itemUploadCallbackRequest,
|
|
95
|
+
depSchemas: {},
|
|
96
|
+
fqdnTransformation: {
|
|
97
|
+
paths: [],
|
|
98
|
+
transformation: _fromVeloEntity,
|
|
99
|
+
},
|
|
100
|
+
customTransformation: requestTransformation,
|
|
101
|
+
});
|
|
102
|
+
const { fromJSON } = serializer({
|
|
103
|
+
rootSchema: _itemUploadCallbackResponse,
|
|
104
|
+
depSchemas: {},
|
|
105
|
+
fqdnTransformation: {
|
|
106
|
+
paths: [],
|
|
107
|
+
transformation: _toVeloEntity,
|
|
108
|
+
},
|
|
109
|
+
customTransformation: responseTransformation,
|
|
110
|
+
});
|
|
111
|
+
const payload = toAmbassadorRequest([options]);
|
|
112
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.itemUploadCallback(payload);
|
|
113
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
114
|
+
try {
|
|
115
|
+
const result = yield httpClient.request(reqOpts);
|
|
116
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
const transformedError = sdkTransformError(err, {
|
|
120
|
+
spreadPathsToArguments: {},
|
|
121
|
+
explicitPathsToArguments: {
|
|
122
|
+
itemId: '$[0].itemId',
|
|
123
|
+
callbackToken: '$[0].callbackToken',
|
|
124
|
+
},
|
|
125
|
+
singleArgumentUnchanged: false,
|
|
126
|
+
}, ['options']);
|
|
127
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
128
|
+
throw transformedError;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Generate an upload url that will make public media to call the enterprise callback endpoint
|
|
134
|
+
* @public
|
|
135
|
+
* @documentationMaturity preview
|
|
136
|
+
*/
|
|
137
|
+
export function generateFileUploadUrl(options) {
|
|
138
|
+
var _a, _b, _c;
|
|
139
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
140
|
+
const requestTransformation = {
|
|
141
|
+
fileName: '$[0].fileName',
|
|
142
|
+
contentType: '$[0].contentType',
|
|
143
|
+
sizeInBytes: '$[0].sizeInBytes',
|
|
144
|
+
categoryIds: '$[0].categoryIds',
|
|
145
|
+
};
|
|
146
|
+
const responseTransformation = '$';
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
149
|
+
const { toAmbassadorRequest } = serializer({
|
|
150
|
+
rootSchema: _generateFileUploadUrlRequest,
|
|
151
|
+
depSchemas: {},
|
|
152
|
+
fqdnTransformation: {
|
|
153
|
+
paths: [],
|
|
154
|
+
transformation: _fromVeloEntity,
|
|
155
|
+
},
|
|
156
|
+
customTransformation: requestTransformation,
|
|
157
|
+
});
|
|
158
|
+
const { fromJSON } = serializer({
|
|
159
|
+
rootSchema: _generateFileUploadUrlResponse,
|
|
160
|
+
depSchemas: {},
|
|
161
|
+
fqdnTransformation: {
|
|
162
|
+
paths: [],
|
|
163
|
+
transformation: _toVeloEntity,
|
|
164
|
+
},
|
|
165
|
+
customTransformation: responseTransformation,
|
|
166
|
+
});
|
|
167
|
+
const payload = toAmbassadorRequest([options]);
|
|
168
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.generateFileUploadUrl(payload);
|
|
169
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
170
|
+
try {
|
|
171
|
+
const result = yield httpClient.request(reqOpts);
|
|
172
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
173
|
+
return fromJSON(result.data);
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
const transformedError = sdkTransformError(err, {
|
|
177
|
+
spreadPathsToArguments: {},
|
|
178
|
+
explicitPathsToArguments: {
|
|
179
|
+
fileName: '$[0].fileName',
|
|
180
|
+
contentType: '$[0].contentType',
|
|
181
|
+
sizeInBytes: '$[0].sizeInBytes',
|
|
182
|
+
categoryIds: '$[0].categoryIds',
|
|
183
|
+
},
|
|
184
|
+
singleArgumentUnchanged: false,
|
|
185
|
+
}, ['options']);
|
|
186
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
187
|
+
throw transformedError;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Import a file using a url
|
|
193
|
+
* @param url - The url to the file to be imported
|
|
194
|
+
* @public
|
|
195
|
+
* @documentationMaturity preview
|
|
196
|
+
* @requiredField url
|
|
197
|
+
*/
|
|
198
|
+
export function importFile(url, options) {
|
|
199
|
+
var _a, _b, _c;
|
|
200
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
201
|
+
const requestTransformation = {
|
|
202
|
+
url: '$[0]',
|
|
203
|
+
fileName: '$[1].fileName',
|
|
204
|
+
contentType: '$[1].contentType',
|
|
205
|
+
sizeInBytes: '$[1].sizeInBytes',
|
|
206
|
+
categoryIds: '$[1].categoryIds',
|
|
207
|
+
mediaType: '$[1].mediaType',
|
|
208
|
+
uploaderSystemTag: '$[1].uploaderSystemTag',
|
|
209
|
+
uploaderInfoSystemTag: '$[1].uploaderInfoSystemTag',
|
|
210
|
+
};
|
|
211
|
+
const responseTransformation = '$';
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
214
|
+
const { toAmbassadorRequest } = serializer({
|
|
215
|
+
rootSchema: _importFileRequest,
|
|
216
|
+
depSchemas: {},
|
|
217
|
+
fqdnTransformation: {
|
|
218
|
+
paths: [],
|
|
219
|
+
transformation: _fromVeloEntity,
|
|
220
|
+
},
|
|
221
|
+
customTransformation: requestTransformation,
|
|
222
|
+
});
|
|
223
|
+
const { fromJSON } = serializer({
|
|
224
|
+
rootSchema: _importFileResponse,
|
|
225
|
+
depSchemas: { _enterpriseMediaItem, _itemAssets, _model3D },
|
|
226
|
+
fqdnTransformation: {
|
|
227
|
+
paths: [...['item']],
|
|
228
|
+
transformation: _toVeloEntity,
|
|
229
|
+
},
|
|
230
|
+
customTransformation: responseTransformation,
|
|
231
|
+
});
|
|
232
|
+
const payload = toAmbassadorRequest([url, options]);
|
|
233
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.importFile(payload);
|
|
234
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
235
|
+
try {
|
|
236
|
+
const result = yield httpClient.request(reqOpts);
|
|
237
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
238
|
+
return fromJSON(result.data);
|
|
239
|
+
}
|
|
240
|
+
catch (err) {
|
|
241
|
+
const transformedError = sdkTransformError(err, {
|
|
242
|
+
spreadPathsToArguments: {},
|
|
243
|
+
explicitPathsToArguments: {
|
|
244
|
+
url: '$[0]',
|
|
245
|
+
fileName: '$[1].fileName',
|
|
246
|
+
contentType: '$[1].contentType',
|
|
247
|
+
sizeInBytes: '$[1].sizeInBytes',
|
|
248
|
+
categoryIds: '$[1].categoryIds',
|
|
249
|
+
mediaType: '$[1].mediaType',
|
|
250
|
+
uploaderSystemTag: '$[1].uploaderSystemTag',
|
|
251
|
+
uploaderInfoSystemTag: '$[1].uploaderInfoSystemTag',
|
|
252
|
+
},
|
|
253
|
+
singleArgumentUnchanged: false,
|
|
254
|
+
}, ['url', 'options']);
|
|
255
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
256
|
+
throw transformedError;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Search items, all filters only support equality
|
|
262
|
+
* Each query must contain a categoryId filter
|
|
263
|
+
* @public
|
|
264
|
+
* @documentationMaturity preview
|
|
265
|
+
*/
|
|
266
|
+
export function searchItems(options) {
|
|
267
|
+
var _a, _b, _c;
|
|
268
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
269
|
+
const requestTransformation = { query: '$[0].query' };
|
|
270
|
+
const responseTransformation = '$';
|
|
271
|
+
// @ts-ignore
|
|
272
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
273
|
+
const { toAmbassadorRequest } = serializer({
|
|
274
|
+
rootSchema: _searchItemsRequest,
|
|
275
|
+
depSchemas: {},
|
|
276
|
+
fqdnTransformation: {
|
|
277
|
+
paths: [],
|
|
278
|
+
transformation: _fromVeloEntity,
|
|
279
|
+
},
|
|
280
|
+
customTransformation: requestTransformation,
|
|
281
|
+
});
|
|
282
|
+
const { fromJSON } = serializer({
|
|
283
|
+
rootSchema: _searchItemsResponse,
|
|
284
|
+
depSchemas: { _enterpriseMediaItem, _itemAssets, _model3D },
|
|
285
|
+
fqdnTransformation: {
|
|
286
|
+
paths: [...['Array#items']],
|
|
287
|
+
transformation: _toVeloEntity,
|
|
288
|
+
},
|
|
289
|
+
customTransformation: responseTransformation,
|
|
290
|
+
});
|
|
291
|
+
const payload = toAmbassadorRequest([options]);
|
|
292
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.searchItems(payload);
|
|
293
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
294
|
+
try {
|
|
295
|
+
const result = yield httpClient.request(reqOpts);
|
|
296
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
297
|
+
return fromJSON(result.data);
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
const transformedError = sdkTransformError(err, {
|
|
301
|
+
spreadPathsToArguments: {},
|
|
302
|
+
explicitPathsToArguments: { query: '$[0].query' },
|
|
303
|
+
singleArgumentUnchanged: false,
|
|
304
|
+
}, ['options']);
|
|
305
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
306
|
+
throw transformedError;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Query items allowing to sort by specified fields, all filters only support equality
|
|
312
|
+
* Each query must contain a categoryId filter
|
|
313
|
+
* @public
|
|
314
|
+
* @documentationMaturity preview
|
|
315
|
+
*/
|
|
316
|
+
export function queryItems() {
|
|
317
|
+
const requestTransformation = { '*': '$[1]', query: '$[0]' };
|
|
318
|
+
const responseTransformation = {
|
|
319
|
+
items: '$.items',
|
|
320
|
+
pagingMetadata: '$.pagingMetadata',
|
|
321
|
+
};
|
|
322
|
+
// @ts-ignore
|
|
323
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
324
|
+
const { toAmbassadorRequest } = serializer({
|
|
325
|
+
rootSchema: _queryItemsRequest,
|
|
326
|
+
depSchemas: {},
|
|
327
|
+
fqdnTransformation: {
|
|
328
|
+
paths: [],
|
|
329
|
+
transformation: _fromVeloEntity,
|
|
330
|
+
},
|
|
331
|
+
customTransformation: requestTransformation,
|
|
332
|
+
});
|
|
333
|
+
const { fromJSON } = serializer({
|
|
334
|
+
rootSchema: _queryItemsResponse,
|
|
335
|
+
depSchemas: { _enterpriseMediaItem, _itemAssets, _model3D },
|
|
336
|
+
fqdnTransformation: {
|
|
337
|
+
paths: [...['Array#items']],
|
|
338
|
+
transformation: _toVeloEntity,
|
|
339
|
+
},
|
|
340
|
+
customTransformation: responseTransformation,
|
|
341
|
+
});
|
|
342
|
+
return wrapWithQueryBuilder({
|
|
343
|
+
func: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
344
|
+
var _a, _b, _c;
|
|
345
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.queryItems(payload);
|
|
346
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
347
|
+
try {
|
|
348
|
+
const result = yield httpClient.request(reqOpts);
|
|
349
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
350
|
+
return result;
|
|
351
|
+
}
|
|
352
|
+
catch (err) {
|
|
353
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
354
|
+
throw err;
|
|
355
|
+
}
|
|
356
|
+
}),
|
|
357
|
+
requestTransformer: (...args) => toAmbassadorRequest(args),
|
|
358
|
+
responseTransformer: ({ data }) => fromJSON(data),
|
|
359
|
+
errorTransformer: (err) => {
|
|
360
|
+
const transformedError = transformError(err, requestTransformation);
|
|
361
|
+
throw transformedError;
|
|
362
|
+
},
|
|
363
|
+
pagingMethod: 'OFFSET',
|
|
364
|
+
transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
|
|
365
|
+
})({ cursorWithEmptyFilterAndSort: true });
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Update an item
|
|
369
|
+
* @param _id - Id of the item in public media
|
|
370
|
+
* @public
|
|
371
|
+
* @documentationMaturity preview
|
|
372
|
+
* @requiredField _id
|
|
373
|
+
* @requiredField item
|
|
374
|
+
* @returns Updated item info
|
|
375
|
+
*/
|
|
376
|
+
export function updateItem(_id, item) {
|
|
377
|
+
var _a, _b, _c;
|
|
378
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
379
|
+
const requestTransformation = { item: { '*': '$[1]', id: '$[0]' } };
|
|
380
|
+
const responseTransformation = '$.item';
|
|
381
|
+
// @ts-ignore
|
|
382
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
383
|
+
const { toAmbassadorRequest } = serializer({
|
|
384
|
+
rootSchema: _updateItemRequest,
|
|
385
|
+
depSchemas: { _enterpriseMediaItem, _itemAssets, _model3D },
|
|
386
|
+
fqdnTransformation: {
|
|
387
|
+
paths: [...['item']],
|
|
388
|
+
transformation: _fromVeloEntity,
|
|
389
|
+
},
|
|
390
|
+
customTransformation: requestTransformation,
|
|
391
|
+
});
|
|
392
|
+
const { fromJSON } = serializer({
|
|
393
|
+
rootSchema: _updateItemResponse,
|
|
394
|
+
depSchemas: { _enterpriseMediaItem, _itemAssets, _model3D },
|
|
395
|
+
fqdnTransformation: {
|
|
396
|
+
paths: [...['item']],
|
|
397
|
+
transformation: _toVeloEntity,
|
|
398
|
+
},
|
|
399
|
+
customTransformation: responseTransformation,
|
|
400
|
+
});
|
|
401
|
+
const payload = toAmbassadorRequest([_id, item]);
|
|
402
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.updateItem(payload);
|
|
403
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
404
|
+
try {
|
|
405
|
+
const result = yield httpClient.request(reqOpts);
|
|
406
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
407
|
+
return fromJSON(result.data);
|
|
408
|
+
}
|
|
409
|
+
catch (err) {
|
|
410
|
+
const transformedError = sdkTransformError(err, {
|
|
411
|
+
spreadPathsToArguments: { item: '$[1]' },
|
|
412
|
+
explicitPathsToArguments: { 'item.id': '$[0]' },
|
|
413
|
+
singleArgumentUnchanged: false,
|
|
414
|
+
}, ['_id', 'item']);
|
|
415
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
416
|
+
throw transformedError;
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Bulk update an item
|
|
422
|
+
* @param updateItemRequests - Requests to update individual item
|
|
423
|
+
* @public
|
|
424
|
+
* @documentationMaturity preview
|
|
425
|
+
* @requiredField updateItemRequests
|
|
426
|
+
* @requiredField updateItemRequests.item._id
|
|
427
|
+
*/
|
|
428
|
+
export function bulkUpdateItem(updateItemRequests, options) {
|
|
429
|
+
var _a, _b, _c;
|
|
430
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
431
|
+
const requestTransformation = {
|
|
432
|
+
updateItemRequests: '$[0]',
|
|
433
|
+
returnEntity: '$[1].returnEntity',
|
|
434
|
+
};
|
|
435
|
+
const responseTransformation = '$';
|
|
436
|
+
// @ts-ignore
|
|
437
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
438
|
+
const { toAmbassadorRequest } = serializer({
|
|
439
|
+
rootSchema: _bulkUpdateItemRequest,
|
|
440
|
+
depSchemas: {
|
|
441
|
+
_enterpriseMediaItem,
|
|
442
|
+
_itemAssets,
|
|
443
|
+
_model3D,
|
|
444
|
+
_updateItemRequest,
|
|
445
|
+
},
|
|
446
|
+
fqdnTransformation: {
|
|
447
|
+
paths: [...['Array#updateItemRequests.item']],
|
|
448
|
+
transformation: _fromVeloEntity,
|
|
449
|
+
},
|
|
450
|
+
customTransformation: requestTransformation,
|
|
451
|
+
});
|
|
452
|
+
const { fromJSON } = serializer({
|
|
453
|
+
rootSchema: _bulkUpdateItemResponse,
|
|
454
|
+
depSchemas: {
|
|
455
|
+
_bulkItemUpdateResult,
|
|
456
|
+
_enterpriseMediaItem,
|
|
457
|
+
_itemAssets,
|
|
458
|
+
_model3D,
|
|
459
|
+
},
|
|
460
|
+
fqdnTransformation: {
|
|
461
|
+
paths: [...['Array#results.item']],
|
|
462
|
+
transformation: _toVeloEntity,
|
|
463
|
+
},
|
|
464
|
+
customTransformation: responseTransformation,
|
|
465
|
+
});
|
|
466
|
+
const payload = toAmbassadorRequest([updateItemRequests, options]);
|
|
467
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.bulkUpdateItem(payload);
|
|
468
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
469
|
+
try {
|
|
470
|
+
const result = yield httpClient.request(reqOpts);
|
|
471
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
472
|
+
return fromJSON(result.data);
|
|
473
|
+
}
|
|
474
|
+
catch (err) {
|
|
475
|
+
const transformedError = sdkTransformError(err, {
|
|
476
|
+
spreadPathsToArguments: {},
|
|
477
|
+
explicitPathsToArguments: {
|
|
478
|
+
updateItemRequests: '$[0]',
|
|
479
|
+
returnEntity: '$[1].returnEntity',
|
|
480
|
+
},
|
|
481
|
+
singleArgumentUnchanged: false,
|
|
482
|
+
}, ['updateItemRequests', 'options']);
|
|
483
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
484
|
+
throw transformedError;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Get item details
|
|
490
|
+
* @param itemId - Item id
|
|
491
|
+
* @public
|
|
492
|
+
* @documentationMaturity preview
|
|
493
|
+
* @requiredField itemId
|
|
494
|
+
* @returns item info
|
|
495
|
+
*/
|
|
496
|
+
export function getItem(itemId) {
|
|
497
|
+
var _a, _b, _c;
|
|
498
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
499
|
+
const requestTransformation = { itemId: '$[0]' };
|
|
500
|
+
const responseTransformation = '$.item';
|
|
501
|
+
// @ts-ignore
|
|
502
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
503
|
+
const { toAmbassadorRequest } = serializer({
|
|
504
|
+
rootSchema: _getItemRequest,
|
|
505
|
+
depSchemas: {},
|
|
506
|
+
fqdnTransformation: {
|
|
507
|
+
paths: [],
|
|
508
|
+
transformation: _fromVeloEntity,
|
|
509
|
+
},
|
|
510
|
+
customTransformation: requestTransformation,
|
|
511
|
+
});
|
|
512
|
+
const { fromJSON } = serializer({
|
|
513
|
+
rootSchema: _getItemResponse,
|
|
514
|
+
depSchemas: { _enterpriseMediaItem, _itemAssets, _model3D },
|
|
515
|
+
fqdnTransformation: {
|
|
516
|
+
paths: [...['item']],
|
|
517
|
+
transformation: _toVeloEntity,
|
|
518
|
+
},
|
|
519
|
+
customTransformation: responseTransformation,
|
|
520
|
+
});
|
|
521
|
+
const payload = toAmbassadorRequest([itemId]);
|
|
522
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.getItem(payload);
|
|
523
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
524
|
+
try {
|
|
525
|
+
const result = yield httpClient.request(reqOpts);
|
|
526
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
527
|
+
return fromJSON(result.data);
|
|
528
|
+
}
|
|
529
|
+
catch (err) {
|
|
530
|
+
const transformedError = sdkTransformError(err, {
|
|
531
|
+
spreadPathsToArguments: {},
|
|
532
|
+
explicitPathsToArguments: { itemId: '$[0]' },
|
|
533
|
+
singleArgumentUnchanged: false,
|
|
534
|
+
}, ['itemId']);
|
|
535
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
536
|
+
throw transformedError;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Link the item to multiple categories
|
|
542
|
+
* @param itemId - The item id
|
|
543
|
+
* @public
|
|
544
|
+
* @documentationMaturity preview
|
|
545
|
+
* @requiredField itemId
|
|
546
|
+
*/
|
|
547
|
+
export function linkItemToCategories(itemId, options) {
|
|
548
|
+
var _a, _b, _c;
|
|
549
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
550
|
+
const requestTransformation = {
|
|
551
|
+
itemId: '$[0]',
|
|
552
|
+
categoryIds: '$[1].categoryIds',
|
|
553
|
+
};
|
|
554
|
+
const responseTransformation = '$';
|
|
555
|
+
// @ts-ignore
|
|
556
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
557
|
+
const { toAmbassadorRequest } = serializer({
|
|
558
|
+
rootSchema: _linkItemToCategoriesRequest,
|
|
559
|
+
depSchemas: {},
|
|
560
|
+
fqdnTransformation: {
|
|
561
|
+
paths: [],
|
|
562
|
+
transformation: _fromVeloEntity,
|
|
563
|
+
},
|
|
564
|
+
customTransformation: requestTransformation,
|
|
565
|
+
});
|
|
566
|
+
const { fromJSON } = serializer({
|
|
567
|
+
rootSchema: _linkItemToCategoriesResponse,
|
|
568
|
+
depSchemas: {},
|
|
569
|
+
fqdnTransformation: {
|
|
570
|
+
paths: [],
|
|
571
|
+
transformation: _toVeloEntity,
|
|
572
|
+
},
|
|
573
|
+
customTransformation: responseTransformation,
|
|
574
|
+
});
|
|
575
|
+
const payload = toAmbassadorRequest([itemId, options]);
|
|
576
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.linkItemToCategories(payload);
|
|
577
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
578
|
+
try {
|
|
579
|
+
const result = yield httpClient.request(reqOpts);
|
|
580
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
581
|
+
return fromJSON(result.data);
|
|
582
|
+
}
|
|
583
|
+
catch (err) {
|
|
584
|
+
const transformedError = sdkTransformError(err, {
|
|
585
|
+
spreadPathsToArguments: {},
|
|
586
|
+
explicitPathsToArguments: {
|
|
587
|
+
itemId: '$[0]',
|
|
588
|
+
categoryIds: '$[1].categoryIds',
|
|
589
|
+
},
|
|
590
|
+
singleArgumentUnchanged: false,
|
|
591
|
+
}, ['itemId', 'options']);
|
|
592
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
593
|
+
throw transformedError;
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Unlink the item from multiple categories
|
|
599
|
+
* @param itemId - The item id
|
|
600
|
+
* @public
|
|
601
|
+
* @documentationMaturity preview
|
|
602
|
+
* @requiredField itemId
|
|
603
|
+
*/
|
|
604
|
+
export function unlinkItemFromCategories(itemId, options) {
|
|
605
|
+
var _a, _b, _c;
|
|
606
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
607
|
+
const requestTransformation = {
|
|
608
|
+
itemId: '$[0]',
|
|
609
|
+
categoryIds: '$[1].categoryIds',
|
|
610
|
+
};
|
|
611
|
+
const responseTransformation = '$';
|
|
612
|
+
// @ts-ignore
|
|
613
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
614
|
+
const { toAmbassadorRequest } = serializer({
|
|
615
|
+
rootSchema: _unlinkItemFromCategoriesRequest,
|
|
616
|
+
depSchemas: {},
|
|
617
|
+
fqdnTransformation: {
|
|
618
|
+
paths: [],
|
|
619
|
+
transformation: _fromVeloEntity,
|
|
620
|
+
},
|
|
621
|
+
customTransformation: requestTransformation,
|
|
622
|
+
});
|
|
623
|
+
const { fromJSON } = serializer({
|
|
624
|
+
rootSchema: _unlinkItemFromCategoriesResponse,
|
|
625
|
+
depSchemas: {},
|
|
626
|
+
fqdnTransformation: {
|
|
627
|
+
paths: [],
|
|
628
|
+
transformation: _toVeloEntity,
|
|
629
|
+
},
|
|
630
|
+
customTransformation: responseTransformation,
|
|
631
|
+
});
|
|
632
|
+
const payload = toAmbassadorRequest([itemId, options]);
|
|
633
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.unlinkItemFromCategories(payload);
|
|
634
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
635
|
+
try {
|
|
636
|
+
const result = yield httpClient.request(reqOpts);
|
|
637
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
638
|
+
return fromJSON(result.data);
|
|
639
|
+
}
|
|
640
|
+
catch (err) {
|
|
641
|
+
const transformedError = sdkTransformError(err, {
|
|
642
|
+
spreadPathsToArguments: {},
|
|
643
|
+
explicitPathsToArguments: {
|
|
644
|
+
itemId: '$[0]',
|
|
645
|
+
categoryIds: '$[1].categoryIds',
|
|
646
|
+
},
|
|
647
|
+
singleArgumentUnchanged: false,
|
|
648
|
+
}, ['itemId', 'options']);
|
|
649
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
650
|
+
throw transformedError;
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Overwrite item categories
|
|
656
|
+
* @param itemId - The item id
|
|
657
|
+
* @public
|
|
658
|
+
* @documentationMaturity preview
|
|
659
|
+
* @requiredField itemId
|
|
660
|
+
*/
|
|
661
|
+
export function overwriteItemCategories(itemId, options) {
|
|
662
|
+
var _a, _b, _c;
|
|
663
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
664
|
+
const requestTransformation = {
|
|
665
|
+
itemId: '$[0]',
|
|
666
|
+
categoryIds: '$[1].categoryIds',
|
|
667
|
+
};
|
|
668
|
+
const responseTransformation = '$';
|
|
669
|
+
// @ts-ignore
|
|
670
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
671
|
+
const { toAmbassadorRequest } = serializer({
|
|
672
|
+
rootSchema: _overwriteItemCategoriesRequest,
|
|
673
|
+
depSchemas: {},
|
|
674
|
+
fqdnTransformation: {
|
|
675
|
+
paths: [],
|
|
676
|
+
transformation: _fromVeloEntity,
|
|
677
|
+
},
|
|
678
|
+
customTransformation: requestTransformation,
|
|
679
|
+
});
|
|
680
|
+
const { fromJSON } = serializer({
|
|
681
|
+
rootSchema: _overwriteItemCategoriesResponse,
|
|
682
|
+
depSchemas: {},
|
|
683
|
+
fqdnTransformation: {
|
|
684
|
+
paths: [],
|
|
685
|
+
transformation: _toVeloEntity,
|
|
686
|
+
},
|
|
687
|
+
customTransformation: responseTransformation,
|
|
688
|
+
});
|
|
689
|
+
const payload = toAmbassadorRequest([itemId, options]);
|
|
690
|
+
const reqOpts = ambassadorWixMediaEnterprisePublicMediaV1EnterpriseItem.overwriteItemCategories(payload);
|
|
691
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
692
|
+
try {
|
|
693
|
+
const result = yield httpClient.request(reqOpts);
|
|
694
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
695
|
+
return fromJSON(result.data);
|
|
696
|
+
}
|
|
697
|
+
catch (err) {
|
|
698
|
+
const transformedError = sdkTransformError(err, {
|
|
699
|
+
spreadPathsToArguments: {},
|
|
700
|
+
explicitPathsToArguments: {
|
|
701
|
+
itemId: '$[0]',
|
|
702
|
+
categoryIds: '$[1].categoryIds',
|
|
703
|
+
},
|
|
704
|
+
singleArgumentUnchanged: false,
|
|
705
|
+
}, ['itemId', 'options']);
|
|
706
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
707
|
+
throw transformedError;
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
//# sourceMappingURL=media-enterprise-public-media-v1-enterprise-item.universal.js.map
|