@wix/events 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +5 -0
- package/build/cjs/index.js +6 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.d.ts +6 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js +27 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js.map +1 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.d.ts +353 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js +237 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js.map +1 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule.public.d.ts +13 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule.public.js +63 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule.public.js.map +1 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule.universal.d.ts +490 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule.universal.js +600 -0
- package/build/cjs/src/events-schedule-v1-schedule-item-schedule.universal.js.map +1 -0
- package/build/cjs/src/events-schedule-v1-schedule-item.http.d.ts +49 -0
- package/build/cjs/src/events-schedule-v1-schedule-item.http.js +485 -0
- package/build/cjs/src/events-schedule-v1-schedule-item.http.js.map +1 -0
- package/build/cjs/src/events-schedule-v1-schedule-item.types.d.ts +318 -0
- package/build/cjs/src/events-schedule-v1-schedule-item.types.js +27 -0
- package/build/cjs/src/events-schedule-v1-schedule-item.types.js.map +1 -0
- package/build/cjs/src/events-v1-category.http.d.ts +35 -0
- package/build/cjs/src/events-v1-category.http.js +592 -0
- package/build/cjs/src/events-v1-category.http.js.map +1 -0
- package/build/cjs/src/events-v1-category.public.d.ts +17 -0
- package/build/cjs/src/events-v1-category.public.js +87 -0
- package/build/cjs/src/events-v1-category.public.js.map +1 -0
- package/build/cjs/src/events-v1-category.types.d.ts +234 -0
- package/build/cjs/src/events-v1-category.types.js +27 -0
- package/build/cjs/src/events-v1-category.types.js.map +1 -0
- package/build/cjs/src/events-v1-category.universal.d.ts +399 -0
- package/build/cjs/src/events-v1-category.universal.js +778 -0
- package/build/cjs/src/events-v1-category.universal.js.map +1 -0
- package/build/cjs/src/events-v1-event.http.d.ts +90 -0
- package/build/cjs/src/events-v1-event.http.js +932 -0
- package/build/cjs/src/events-v1-event.http.js.map +1 -0
- package/build/cjs/src/events-v1-event.public.d.ts +19 -0
- package/build/cjs/src/events-v1-event.public.js +112 -0
- package/build/cjs/src/events-v1-event.public.js.map +1 -0
- package/build/cjs/src/events-v1-event.types.d.ts +1473 -0
- package/build/cjs/src/events-v1-event.types.js +198 -0
- package/build/cjs/src/events-v1-event.types.js.map +1 -0
- package/build/cjs/src/events-v1-event.universal.d.ts +1784 -0
- package/build/cjs/src/events-v1-event.universal.js +1130 -0
- package/build/cjs/src/events-v1-event.universal.js.map +1 -0
- package/build/cjs/src/events-v1-form.http.d.ts +25 -0
- package/build/cjs/src/events-v1-form.http.js +431 -0
- package/build/cjs/src/events-v1-form.http.js.map +1 -0
- package/build/cjs/src/events-v1-form.public.d.ts +11 -0
- package/build/cjs/src/events-v1-form.public.js +53 -0
- package/build/cjs/src/events-v1-form.public.js.map +1 -0
- package/build/cjs/src/events-v1-form.types.d.ts +657 -0
- package/build/cjs/src/events-v1-form.types.js +69 -0
- package/build/cjs/src/events-v1-form.types.js.map +1 -0
- package/build/cjs/src/events-v1-form.universal.d.ts +778 -0
- package/build/cjs/src/events-v1-form.universal.js +528 -0
- package/build/cjs/src/events-v1-form.universal.js.map +1 -0
- package/build/cjs/src/events-v2-policy.universal.d.ts +8 -1
- package/build/cjs/src/events-v2-policy.universal.js +8 -1
- package/build/cjs/src/events-v2-policy.universal.js.map +1 -1
- package/build/es/index.d.ts +5 -0
- package/build/es/index.js +5 -0
- package/build/es/index.js.map +1 -1
- package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.d.ts +6 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js +18 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.public.js.map +1 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.d.ts +353 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js +212 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule-bookmarks.universal.js.map +1 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule.public.d.ts +13 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule.public.js +48 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule.public.js.map +1 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule.universal.d.ts +490 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule.universal.js +569 -0
- package/build/es/src/events-schedule-v1-schedule-item-schedule.universal.js.map +1 -0
- package/build/es/src/events-schedule-v1-schedule-item.http.d.ts +49 -0
- package/build/es/src/events-schedule-v1-schedule-item.http.js +470 -0
- package/build/es/src/events-schedule-v1-schedule-item.http.js.map +1 -0
- package/build/es/src/events-schedule-v1-schedule-item.types.d.ts +318 -0
- package/build/es/src/events-schedule-v1-schedule-item.types.js +24 -0
- package/build/es/src/events-schedule-v1-schedule-item.types.js.map +1 -0
- package/build/es/src/events-v1-category.http.d.ts +35 -0
- package/build/es/src/events-v1-category.http.js +576 -0
- package/build/es/src/events-v1-category.http.js.map +1 -0
- package/build/es/src/events-v1-category.public.d.ts +17 -0
- package/build/es/src/events-v1-category.public.js +68 -0
- package/build/es/src/events-v1-category.public.js.map +1 -0
- package/build/es/src/events-v1-category.types.d.ts +234 -0
- package/build/es/src/events-v1-category.types.js +24 -0
- package/build/es/src/events-v1-category.types.js.map +1 -0
- package/build/es/src/events-v1-category.universal.d.ts +399 -0
- package/build/es/src/events-v1-category.universal.js +743 -0
- package/build/es/src/events-v1-category.universal.js.map +1 -0
- package/build/es/src/events-v1-event.http.d.ts +90 -0
- package/build/es/src/events-v1-event.http.js +914 -0
- package/build/es/src/events-v1-event.http.js.map +1 -0
- package/build/es/src/events-v1-event.public.d.ts +19 -0
- package/build/es/src/events-v1-event.public.js +78 -0
- package/build/es/src/events-v1-event.public.js.map +1 -0
- package/build/es/src/events-v1-event.types.d.ts +1473 -0
- package/build/es/src/events-v1-event.types.js +195 -0
- package/build/es/src/events-v1-event.types.js.map +1 -0
- package/build/es/src/events-v1-event.universal.d.ts +1784 -0
- package/build/es/src/events-v1-event.universal.js +1093 -0
- package/build/es/src/events-v1-event.universal.js.map +1 -0
- package/build/es/src/events-v1-form.http.d.ts +25 -0
- package/build/es/src/events-v1-form.http.js +421 -0
- package/build/es/src/events-v1-form.http.js.map +1 -0
- package/build/es/src/events-v1-form.public.d.ts +11 -0
- package/build/es/src/events-v1-form.public.js +38 -0
- package/build/es/src/events-v1-form.public.js.map +1 -0
- package/build/es/src/events-v1-form.types.d.ts +657 -0
- package/build/es/src/events-v1-form.types.js +66 -0
- package/build/es/src/events-v1-form.types.js.map +1 -0
- package/build/es/src/events-v1-form.universal.d.ts +778 -0
- package/build/es/src/events-v1-form.universal.js +499 -0
- package/build/es/src/events-v1-form.universal.js.map +1 -0
- package/build/es/src/events-v2-policy.universal.d.ts +8 -1
- package/build/es/src/events-v2-policy.universal.js +8 -1
- package/build/es/src/events-v2-policy.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,743 @@
|
|
|
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 } from '@wix/metro-runtime/velo';
|
|
11
|
+
import * as ambassadorWixEventsV1Category from './events-v1-category.http';
|
|
12
|
+
let __verbose = false;
|
|
13
|
+
function __log(...args) {
|
|
14
|
+
__verbose && console.log(...args);
|
|
15
|
+
}
|
|
16
|
+
function __inspect(obj) {
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
export const __debug = {
|
|
20
|
+
verboseLogging: {
|
|
21
|
+
on: () => (__verbose = true),
|
|
22
|
+
off: () => (__verbose = false),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const _toVeloEntity = '$';
|
|
26
|
+
const _fromVeloEntity = '$';
|
|
27
|
+
export var State;
|
|
28
|
+
(function (State) {
|
|
29
|
+
/** Created manually by the user. */
|
|
30
|
+
State["MANUAL"] = "MANUAL";
|
|
31
|
+
/** Created automatically. */
|
|
32
|
+
State["AUTO"] = "AUTO";
|
|
33
|
+
/** Created when publishing recurring events. */
|
|
34
|
+
State["RECURRING_EVENT"] = "RECURRING_EVENT";
|
|
35
|
+
/** Category is hidden. */
|
|
36
|
+
State["HIDDEN"] = "HIDDEN";
|
|
37
|
+
/** Category is used to store component events. */
|
|
38
|
+
State["COMPONENT"] = "COMPONENT";
|
|
39
|
+
})(State || (State = {}));
|
|
40
|
+
export var SortOrder;
|
|
41
|
+
(function (SortOrder) {
|
|
42
|
+
SortOrder["ASC"] = "ASC";
|
|
43
|
+
SortOrder["DESC"] = "DESC";
|
|
44
|
+
})(SortOrder || (SortOrder = {}));
|
|
45
|
+
export var CategoryFieldset;
|
|
46
|
+
(function (CategoryFieldset) {
|
|
47
|
+
/** Include `assignedEventsCount` in the response. */
|
|
48
|
+
CategoryFieldset["COUNTS"] = "COUNTS";
|
|
49
|
+
})(CategoryFieldset || (CategoryFieldset = {}));
|
|
50
|
+
const _assignEventsRequest = {};
|
|
51
|
+
const _assignEventsResponse = {};
|
|
52
|
+
const _bulkAssignEventsAsyncRequest = {};
|
|
53
|
+
const _bulkAssignEventsAsyncResponse = {};
|
|
54
|
+
const _bulkAssignEventsRequest = {};
|
|
55
|
+
const _bulkAssignEventsResponse = {};
|
|
56
|
+
const _bulkCreateCategoryRequest = {};
|
|
57
|
+
const _bulkCreateCategoryResponse = {};
|
|
58
|
+
const _bulkUnassignEventsAsyncRequest = {};
|
|
59
|
+
const _bulkUnassignEventsAsyncResponse = {};
|
|
60
|
+
const _bulkUnassignEventsRequest = {};
|
|
61
|
+
const _bulkUnassignEventsResponse = {};
|
|
62
|
+
const _createCategoryRequest = {};
|
|
63
|
+
const _createCategoryResponse = {};
|
|
64
|
+
const _deleteCategoryRequest = {};
|
|
65
|
+
const _deleteCategoryResponse = {};
|
|
66
|
+
const _listEventCategoriesRequest = {};
|
|
67
|
+
const _listEventCategoriesResponse = {};
|
|
68
|
+
const _queryCategoriesRequest = {};
|
|
69
|
+
const _queryCategoriesResponse = {};
|
|
70
|
+
const _reorderCategoryEventsRequest = {};
|
|
71
|
+
const _reorderCategoryEventsResponse = {};
|
|
72
|
+
const _unassignEventsRequest = {};
|
|
73
|
+
const _unassignEventsResponse = {};
|
|
74
|
+
const _updateCategoryRequest = {};
|
|
75
|
+
const _updateCategoryResponse = {};
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new category.
|
|
78
|
+
* @public
|
|
79
|
+
* @documentationMaturity preview
|
|
80
|
+
* @requiredField category
|
|
81
|
+
*/
|
|
82
|
+
export function createCategory(category) {
|
|
83
|
+
var _a, _b, _c;
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
85
|
+
const requestTransformation = { category: '$[0]' };
|
|
86
|
+
const responseTransformation = '$';
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
89
|
+
const { toAmbassadorRequest } = serializer({
|
|
90
|
+
rootSchema: _createCategoryRequest,
|
|
91
|
+
depSchemas: {},
|
|
92
|
+
fqdnTransformation: {
|
|
93
|
+
paths: [...['category']],
|
|
94
|
+
transformation: _fromVeloEntity,
|
|
95
|
+
},
|
|
96
|
+
customTransformation: requestTransformation,
|
|
97
|
+
});
|
|
98
|
+
const { fromJSON } = serializer({
|
|
99
|
+
rootSchema: _createCategoryResponse,
|
|
100
|
+
depSchemas: {},
|
|
101
|
+
fqdnTransformation: {
|
|
102
|
+
paths: [...['category']],
|
|
103
|
+
transformation: _toVeloEntity,
|
|
104
|
+
},
|
|
105
|
+
customTransformation: responseTransformation,
|
|
106
|
+
});
|
|
107
|
+
const payload = toAmbassadorRequest([category]);
|
|
108
|
+
const reqOpts = ambassadorWixEventsV1Category.createCategory(payload);
|
|
109
|
+
__log(`"CreateCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
110
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
111
|
+
try {
|
|
112
|
+
const result = yield httpClient.request(reqOpts);
|
|
113
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
114
|
+
return fromJSON(result.data);
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
118
|
+
'category',
|
|
119
|
+
]);
|
|
120
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
121
|
+
throw transformedError;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Creates new categories.
|
|
127
|
+
* @public
|
|
128
|
+
* @documentationMaturity preview
|
|
129
|
+
* @requiredField categories
|
|
130
|
+
*/
|
|
131
|
+
export function bulkCreateCategory(categories) {
|
|
132
|
+
var _a, _b, _c;
|
|
133
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
134
|
+
const requestTransformation = { categories: '$[0]' };
|
|
135
|
+
const responseTransformation = '$';
|
|
136
|
+
// @ts-ignore
|
|
137
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
138
|
+
const { toAmbassadorRequest } = serializer({
|
|
139
|
+
rootSchema: _bulkCreateCategoryRequest,
|
|
140
|
+
depSchemas: {},
|
|
141
|
+
fqdnTransformation: {
|
|
142
|
+
paths: [...['Array#categories']],
|
|
143
|
+
transformation: _fromVeloEntity,
|
|
144
|
+
},
|
|
145
|
+
customTransformation: requestTransformation,
|
|
146
|
+
});
|
|
147
|
+
const { fromJSON } = serializer({
|
|
148
|
+
rootSchema: _bulkCreateCategoryResponse,
|
|
149
|
+
depSchemas: {},
|
|
150
|
+
fqdnTransformation: {
|
|
151
|
+
paths: [...['Array#results.item']],
|
|
152
|
+
transformation: _toVeloEntity,
|
|
153
|
+
},
|
|
154
|
+
customTransformation: responseTransformation,
|
|
155
|
+
});
|
|
156
|
+
const payload = toAmbassadorRequest([categories]);
|
|
157
|
+
const reqOpts = ambassadorWixEventsV1Category.bulkCreateCategory(payload);
|
|
158
|
+
__log(`"BulkCreateCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
159
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
160
|
+
try {
|
|
161
|
+
const result = yield httpClient.request(reqOpts);
|
|
162
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
163
|
+
return fromJSON(result.data);
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
167
|
+
'categories',
|
|
168
|
+
]);
|
|
169
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
170
|
+
throw transformedError;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Updates an existing category.
|
|
176
|
+
* @param _id - Category ID.
|
|
177
|
+
* @public
|
|
178
|
+
* @documentationMaturity preview
|
|
179
|
+
* @requiredField _id
|
|
180
|
+
* @requiredField category
|
|
181
|
+
*/
|
|
182
|
+
export function updateCategory(_id, category) {
|
|
183
|
+
var _a, _b, _c;
|
|
184
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
185
|
+
const requestTransformation = { category: { '*': '$[1]', id: '$[0]' } };
|
|
186
|
+
const responseTransformation = '$';
|
|
187
|
+
// @ts-ignore
|
|
188
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
189
|
+
const { toAmbassadorRequest } = serializer({
|
|
190
|
+
rootSchema: _updateCategoryRequest,
|
|
191
|
+
depSchemas: {},
|
|
192
|
+
fqdnTransformation: {
|
|
193
|
+
paths: [...['category']],
|
|
194
|
+
transformation: _fromVeloEntity,
|
|
195
|
+
},
|
|
196
|
+
customTransformation: requestTransformation,
|
|
197
|
+
});
|
|
198
|
+
const { fromJSON } = serializer({
|
|
199
|
+
rootSchema: _updateCategoryResponse,
|
|
200
|
+
depSchemas: {},
|
|
201
|
+
fqdnTransformation: {
|
|
202
|
+
paths: [...['category']],
|
|
203
|
+
transformation: _toVeloEntity,
|
|
204
|
+
},
|
|
205
|
+
customTransformation: responseTransformation,
|
|
206
|
+
});
|
|
207
|
+
const payload = toAmbassadorRequest([_id, category]);
|
|
208
|
+
const reqOpts = ambassadorWixEventsV1Category.updateCategory(payload);
|
|
209
|
+
__log(`"UpdateCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
210
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
211
|
+
try {
|
|
212
|
+
const result = yield httpClient.request(reqOpts);
|
|
213
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
214
|
+
return fromJSON(result.data);
|
|
215
|
+
}
|
|
216
|
+
catch (err) {
|
|
217
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
218
|
+
'_id',
|
|
219
|
+
'category',
|
|
220
|
+
]);
|
|
221
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
222
|
+
throw transformedError;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Deletes existing category.
|
|
228
|
+
* @public
|
|
229
|
+
* @documentationMaturity preview
|
|
230
|
+
* @requiredField categoryId
|
|
231
|
+
*/
|
|
232
|
+
export function deleteCategory(categoryId) {
|
|
233
|
+
var _a, _b, _c;
|
|
234
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
235
|
+
const requestTransformation = { categoryId: '$[0]' };
|
|
236
|
+
const responseTransformation = '$';
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
239
|
+
const { toAmbassadorRequest } = serializer({
|
|
240
|
+
rootSchema: _deleteCategoryRequest,
|
|
241
|
+
depSchemas: {},
|
|
242
|
+
fqdnTransformation: {
|
|
243
|
+
paths: [],
|
|
244
|
+
transformation: _fromVeloEntity,
|
|
245
|
+
},
|
|
246
|
+
customTransformation: requestTransformation,
|
|
247
|
+
});
|
|
248
|
+
const { fromJSON } = serializer({
|
|
249
|
+
rootSchema: _deleteCategoryResponse,
|
|
250
|
+
depSchemas: {},
|
|
251
|
+
fqdnTransformation: {
|
|
252
|
+
paths: [],
|
|
253
|
+
transformation: _toVeloEntity,
|
|
254
|
+
},
|
|
255
|
+
customTransformation: responseTransformation,
|
|
256
|
+
});
|
|
257
|
+
const payload = toAmbassadorRequest([categoryId]);
|
|
258
|
+
const reqOpts = ambassadorWixEventsV1Category.deleteCategory(payload);
|
|
259
|
+
__log(`"DeleteCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
260
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
261
|
+
try {
|
|
262
|
+
const result = yield httpClient.request(reqOpts);
|
|
263
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
264
|
+
return fromJSON(result.data);
|
|
265
|
+
}
|
|
266
|
+
catch (err) {
|
|
267
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
268
|
+
'categoryId',
|
|
269
|
+
]);
|
|
270
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
271
|
+
throw transformedError;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* - `filter` - supported for `name`, `id` and `states` fields.
|
|
277
|
+
* - `sort` - supported for `created` and `name` fields.
|
|
278
|
+
* - `paging` - supported, see [paging](https://dev.wix.com/api/rest/getting-started/pagination).
|
|
279
|
+
* - `fields` - not supported.
|
|
280
|
+
* - `fieldsets` - not supported.
|
|
281
|
+
* - `cursorPaging` - not supported, use offset pagination instead.
|
|
282
|
+
* @public
|
|
283
|
+
* @documentationMaturity preview
|
|
284
|
+
* @requiredField query
|
|
285
|
+
*/
|
|
286
|
+
export function queryCategories(query, options) {
|
|
287
|
+
var _a, _b, _c;
|
|
288
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
289
|
+
const requestTransformation = { query: '$[0]', fieldset: '$[1].fieldset' };
|
|
290
|
+
const responseTransformation = '$';
|
|
291
|
+
// @ts-ignore
|
|
292
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
293
|
+
const { toAmbassadorRequest } = serializer({
|
|
294
|
+
rootSchema: _queryCategoriesRequest,
|
|
295
|
+
depSchemas: {},
|
|
296
|
+
fqdnTransformation: {
|
|
297
|
+
paths: [],
|
|
298
|
+
transformation: _fromVeloEntity,
|
|
299
|
+
},
|
|
300
|
+
customTransformation: requestTransformation,
|
|
301
|
+
});
|
|
302
|
+
const { fromJSON } = serializer({
|
|
303
|
+
rootSchema: _queryCategoriesResponse,
|
|
304
|
+
depSchemas: {},
|
|
305
|
+
fqdnTransformation: {
|
|
306
|
+
paths: [...['Array#categories']],
|
|
307
|
+
transformation: _toVeloEntity,
|
|
308
|
+
},
|
|
309
|
+
customTransformation: responseTransformation,
|
|
310
|
+
});
|
|
311
|
+
const payload = toAmbassadorRequest([query, options]);
|
|
312
|
+
const reqOpts = ambassadorWixEventsV1Category.queryCategories(payload);
|
|
313
|
+
__log(`"QueryCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
314
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
315
|
+
try {
|
|
316
|
+
const result = yield httpClient.request(reqOpts);
|
|
317
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
318
|
+
return fromJSON(result.data);
|
|
319
|
+
}
|
|
320
|
+
catch (err) {
|
|
321
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
322
|
+
'query',
|
|
323
|
+
'options',
|
|
324
|
+
]);
|
|
325
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
326
|
+
throw transformedError;
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Assigns events to a single category.
|
|
332
|
+
* @public
|
|
333
|
+
* @documentationMaturity preview
|
|
334
|
+
* @requiredField categoryId
|
|
335
|
+
* @requiredField eventId
|
|
336
|
+
*/
|
|
337
|
+
export function assignEvents(categoryId, eventId) {
|
|
338
|
+
var _a, _b, _c;
|
|
339
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
340
|
+
const requestTransformation = { categoryId: '$[0]', eventId: '$[1]' };
|
|
341
|
+
const responseTransformation = '$';
|
|
342
|
+
// @ts-ignore
|
|
343
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
344
|
+
const { toAmbassadorRequest } = serializer({
|
|
345
|
+
rootSchema: _assignEventsRequest,
|
|
346
|
+
depSchemas: {},
|
|
347
|
+
fqdnTransformation: {
|
|
348
|
+
paths: [],
|
|
349
|
+
transformation: _fromVeloEntity,
|
|
350
|
+
},
|
|
351
|
+
customTransformation: requestTransformation,
|
|
352
|
+
});
|
|
353
|
+
const { fromJSON } = serializer({
|
|
354
|
+
rootSchema: _assignEventsResponse,
|
|
355
|
+
depSchemas: {},
|
|
356
|
+
fqdnTransformation: {
|
|
357
|
+
paths: [],
|
|
358
|
+
transformation: _toVeloEntity,
|
|
359
|
+
},
|
|
360
|
+
customTransformation: responseTransformation,
|
|
361
|
+
});
|
|
362
|
+
const payload = toAmbassadorRequest([categoryId, eventId]);
|
|
363
|
+
const reqOpts = ambassadorWixEventsV1Category.assignEvents(payload);
|
|
364
|
+
__log(`"AssignEvents" sending request with: ${__inspect(reqOpts)}`);
|
|
365
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
366
|
+
try {
|
|
367
|
+
const result = yield httpClient.request(reqOpts);
|
|
368
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
369
|
+
return fromJSON(result.data);
|
|
370
|
+
}
|
|
371
|
+
catch (err) {
|
|
372
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
373
|
+
'categoryId',
|
|
374
|
+
'eventId',
|
|
375
|
+
]);
|
|
376
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
377
|
+
throw transformedError;
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Assigns events to multiple categories.
|
|
383
|
+
* @public
|
|
384
|
+
* @documentationMaturity preview
|
|
385
|
+
* @requiredField categoryId
|
|
386
|
+
* @requiredField options
|
|
387
|
+
* @requiredField options.eventId
|
|
388
|
+
*/
|
|
389
|
+
export function bulkAssignEvents(categoryId, options) {
|
|
390
|
+
var _a, _b, _c;
|
|
391
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
392
|
+
const requestTransformation = { categoryId: '$[0]', eventId: '$[1].eventId' };
|
|
393
|
+
const responseTransformation = '$';
|
|
394
|
+
// @ts-ignore
|
|
395
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
396
|
+
const { toAmbassadorRequest } = serializer({
|
|
397
|
+
rootSchema: _bulkAssignEventsRequest,
|
|
398
|
+
depSchemas: {},
|
|
399
|
+
fqdnTransformation: {
|
|
400
|
+
paths: [],
|
|
401
|
+
transformation: _fromVeloEntity,
|
|
402
|
+
},
|
|
403
|
+
customTransformation: requestTransformation,
|
|
404
|
+
});
|
|
405
|
+
const { fromJSON } = serializer({
|
|
406
|
+
rootSchema: _bulkAssignEventsResponse,
|
|
407
|
+
depSchemas: {},
|
|
408
|
+
fqdnTransformation: {
|
|
409
|
+
paths: [...['Array#results.item']],
|
|
410
|
+
transformation: _toVeloEntity,
|
|
411
|
+
},
|
|
412
|
+
customTransformation: responseTransformation,
|
|
413
|
+
});
|
|
414
|
+
const payload = toAmbassadorRequest([categoryId, options]);
|
|
415
|
+
const reqOpts = ambassadorWixEventsV1Category.bulkAssignEvents(payload);
|
|
416
|
+
__log(`"BulkAssignEvents" sending request with: ${__inspect(reqOpts)}`);
|
|
417
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
418
|
+
try {
|
|
419
|
+
const result = yield httpClient.request(reqOpts);
|
|
420
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
421
|
+
return fromJSON(result.data);
|
|
422
|
+
}
|
|
423
|
+
catch (err) {
|
|
424
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
425
|
+
'categoryId',
|
|
426
|
+
'options',
|
|
427
|
+
]);
|
|
428
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
429
|
+
throw transformedError;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Assigns filtered events to multiple categories.
|
|
435
|
+
* @public
|
|
436
|
+
* @documentationMaturity preview
|
|
437
|
+
* @requiredField categoryId
|
|
438
|
+
* @requiredField options
|
|
439
|
+
* @requiredField options.filter
|
|
440
|
+
*/
|
|
441
|
+
export function bulkAssignEventsAsync(categoryId, options) {
|
|
442
|
+
var _a, _b, _c;
|
|
443
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
444
|
+
const requestTransformation = { categoryId: '$[0]', filter: '$[1].filter' };
|
|
445
|
+
const responseTransformation = '$';
|
|
446
|
+
// @ts-ignore
|
|
447
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
448
|
+
const { toAmbassadorRequest } = serializer({
|
|
449
|
+
rootSchema: _bulkAssignEventsAsyncRequest,
|
|
450
|
+
depSchemas: {},
|
|
451
|
+
fqdnTransformation: {
|
|
452
|
+
paths: [],
|
|
453
|
+
transformation: _fromVeloEntity,
|
|
454
|
+
},
|
|
455
|
+
customTransformation: requestTransformation,
|
|
456
|
+
});
|
|
457
|
+
const { fromJSON } = serializer({
|
|
458
|
+
rootSchema: _bulkAssignEventsAsyncResponse,
|
|
459
|
+
depSchemas: {},
|
|
460
|
+
fqdnTransformation: {
|
|
461
|
+
paths: [],
|
|
462
|
+
transformation: _toVeloEntity,
|
|
463
|
+
},
|
|
464
|
+
customTransformation: responseTransformation,
|
|
465
|
+
});
|
|
466
|
+
const payload = toAmbassadorRequest([categoryId, options]);
|
|
467
|
+
const reqOpts = ambassadorWixEventsV1Category.bulkAssignEventsAsync(payload);
|
|
468
|
+
__log(`"BulkAssignEventsAsync" sending request with: ${__inspect(reqOpts)}`);
|
|
469
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
470
|
+
try {
|
|
471
|
+
const result = yield httpClient.request(reqOpts);
|
|
472
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
473
|
+
return fromJSON(result.data);
|
|
474
|
+
}
|
|
475
|
+
catch (err) {
|
|
476
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
477
|
+
'categoryId',
|
|
478
|
+
'options',
|
|
479
|
+
]);
|
|
480
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
481
|
+
throw transformedError;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Unassigns events from a single category.
|
|
487
|
+
* @public
|
|
488
|
+
* @documentationMaturity preview
|
|
489
|
+
* @requiredField categoryId
|
|
490
|
+
* @requiredField eventId
|
|
491
|
+
*/
|
|
492
|
+
export function unassignEvents(categoryId, eventId) {
|
|
493
|
+
var _a, _b, _c;
|
|
494
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
495
|
+
const requestTransformation = { categoryId: '$[0]', eventId: '$[1]' };
|
|
496
|
+
const responseTransformation = '$';
|
|
497
|
+
// @ts-ignore
|
|
498
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
499
|
+
const { toAmbassadorRequest } = serializer({
|
|
500
|
+
rootSchema: _unassignEventsRequest,
|
|
501
|
+
depSchemas: {},
|
|
502
|
+
fqdnTransformation: {
|
|
503
|
+
paths: [],
|
|
504
|
+
transformation: _fromVeloEntity,
|
|
505
|
+
},
|
|
506
|
+
customTransformation: requestTransformation,
|
|
507
|
+
});
|
|
508
|
+
const { fromJSON } = serializer({
|
|
509
|
+
rootSchema: _unassignEventsResponse,
|
|
510
|
+
depSchemas: {},
|
|
511
|
+
fqdnTransformation: {
|
|
512
|
+
paths: [],
|
|
513
|
+
transformation: _toVeloEntity,
|
|
514
|
+
},
|
|
515
|
+
customTransformation: responseTransformation,
|
|
516
|
+
});
|
|
517
|
+
const payload = toAmbassadorRequest([categoryId, eventId]);
|
|
518
|
+
const reqOpts = ambassadorWixEventsV1Category.unassignEvents(payload);
|
|
519
|
+
__log(`"UnassignEvents" sending request with: ${__inspect(reqOpts)}`);
|
|
520
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
521
|
+
try {
|
|
522
|
+
const result = yield httpClient.request(reqOpts);
|
|
523
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
524
|
+
return fromJSON(result.data);
|
|
525
|
+
}
|
|
526
|
+
catch (err) {
|
|
527
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
528
|
+
'categoryId',
|
|
529
|
+
'eventId',
|
|
530
|
+
]);
|
|
531
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
532
|
+
throw transformedError;
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Unassigns events from multiple categories.
|
|
538
|
+
* @public
|
|
539
|
+
* @documentationMaturity preview
|
|
540
|
+
* @requiredField categoryId
|
|
541
|
+
*/
|
|
542
|
+
export function bulkUnassignEvents(categoryId, options) {
|
|
543
|
+
var _a, _b, _c;
|
|
544
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
545
|
+
const requestTransformation = { categoryId: '$[0]', eventId: '$[1].eventId' };
|
|
546
|
+
const responseTransformation = '$';
|
|
547
|
+
// @ts-ignore
|
|
548
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
549
|
+
const { toAmbassadorRequest } = serializer({
|
|
550
|
+
rootSchema: _bulkUnassignEventsRequest,
|
|
551
|
+
depSchemas: {},
|
|
552
|
+
fqdnTransformation: {
|
|
553
|
+
paths: [],
|
|
554
|
+
transformation: _fromVeloEntity,
|
|
555
|
+
},
|
|
556
|
+
customTransformation: requestTransformation,
|
|
557
|
+
});
|
|
558
|
+
const { fromJSON } = serializer({
|
|
559
|
+
rootSchema: _bulkUnassignEventsResponse,
|
|
560
|
+
depSchemas: {},
|
|
561
|
+
fqdnTransformation: {
|
|
562
|
+
paths: [...['Array#results.item']],
|
|
563
|
+
transformation: _toVeloEntity,
|
|
564
|
+
},
|
|
565
|
+
customTransformation: responseTransformation,
|
|
566
|
+
});
|
|
567
|
+
const payload = toAmbassadorRequest([categoryId, options]);
|
|
568
|
+
const reqOpts = ambassadorWixEventsV1Category.bulkUnassignEvents(payload);
|
|
569
|
+
__log(`"BulkUnassignEvents" sending request with: ${__inspect(reqOpts)}`);
|
|
570
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
571
|
+
try {
|
|
572
|
+
const result = yield httpClient.request(reqOpts);
|
|
573
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
574
|
+
return fromJSON(result.data);
|
|
575
|
+
}
|
|
576
|
+
catch (err) {
|
|
577
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
578
|
+
'categoryId',
|
|
579
|
+
'options',
|
|
580
|
+
]);
|
|
581
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
582
|
+
throw transformedError;
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Unassigns filtered events from multiple categories.
|
|
588
|
+
* @public
|
|
589
|
+
* @documentationMaturity preview
|
|
590
|
+
* @requiredField categoryId
|
|
591
|
+
* @requiredField options
|
|
592
|
+
* @requiredField options.filter
|
|
593
|
+
*/
|
|
594
|
+
export function bulkUnassignEventsAsync(categoryId, options) {
|
|
595
|
+
var _a, _b, _c;
|
|
596
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
597
|
+
const requestTransformation = { categoryId: '$[0]', filter: '$[1].filter' };
|
|
598
|
+
const responseTransformation = '$';
|
|
599
|
+
// @ts-ignore
|
|
600
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
601
|
+
const { toAmbassadorRequest } = serializer({
|
|
602
|
+
rootSchema: _bulkUnassignEventsAsyncRequest,
|
|
603
|
+
depSchemas: {},
|
|
604
|
+
fqdnTransformation: {
|
|
605
|
+
paths: [],
|
|
606
|
+
transformation: _fromVeloEntity,
|
|
607
|
+
},
|
|
608
|
+
customTransformation: requestTransformation,
|
|
609
|
+
});
|
|
610
|
+
const { fromJSON } = serializer({
|
|
611
|
+
rootSchema: _bulkUnassignEventsAsyncResponse,
|
|
612
|
+
depSchemas: {},
|
|
613
|
+
fqdnTransformation: {
|
|
614
|
+
paths: [],
|
|
615
|
+
transformation: _toVeloEntity,
|
|
616
|
+
},
|
|
617
|
+
customTransformation: responseTransformation,
|
|
618
|
+
});
|
|
619
|
+
const payload = toAmbassadorRequest([categoryId, options]);
|
|
620
|
+
const reqOpts = ambassadorWixEventsV1Category.bulkUnassignEventsAsync(payload);
|
|
621
|
+
__log(`"BulkUnassignEventsAsync" sending request with: ${__inspect(reqOpts)}`);
|
|
622
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
623
|
+
try {
|
|
624
|
+
const result = yield httpClient.request(reqOpts);
|
|
625
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
626
|
+
return fromJSON(result.data);
|
|
627
|
+
}
|
|
628
|
+
catch (err) {
|
|
629
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
630
|
+
'categoryId',
|
|
631
|
+
'options',
|
|
632
|
+
]);
|
|
633
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
634
|
+
throw transformedError;
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Lists visible event categories.
|
|
640
|
+
* @public
|
|
641
|
+
* @documentationMaturity preview
|
|
642
|
+
* @requiredField eventId
|
|
643
|
+
*/
|
|
644
|
+
export function listEventCategories(eventId) {
|
|
645
|
+
var _a, _b, _c;
|
|
646
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
647
|
+
const requestTransformation = { eventId: '$[0]' };
|
|
648
|
+
const responseTransformation = '$';
|
|
649
|
+
// @ts-ignore
|
|
650
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
651
|
+
const { toAmbassadorRequest } = serializer({
|
|
652
|
+
rootSchema: _listEventCategoriesRequest,
|
|
653
|
+
depSchemas: {},
|
|
654
|
+
fqdnTransformation: {
|
|
655
|
+
paths: [],
|
|
656
|
+
transformation: _fromVeloEntity,
|
|
657
|
+
},
|
|
658
|
+
customTransformation: requestTransformation,
|
|
659
|
+
});
|
|
660
|
+
const { fromJSON } = serializer({
|
|
661
|
+
rootSchema: _listEventCategoriesResponse,
|
|
662
|
+
depSchemas: {},
|
|
663
|
+
fqdnTransformation: {
|
|
664
|
+
paths: [...['Array#categories']],
|
|
665
|
+
transformation: _toVeloEntity,
|
|
666
|
+
},
|
|
667
|
+
customTransformation: responseTransformation,
|
|
668
|
+
});
|
|
669
|
+
const payload = toAmbassadorRequest([eventId]);
|
|
670
|
+
const reqOpts = ambassadorWixEventsV1Category.listEventCategories(payload);
|
|
671
|
+
__log(`"ListEventCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
672
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
673
|
+
try {
|
|
674
|
+
const result = yield httpClient.request(reqOpts);
|
|
675
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
676
|
+
return fromJSON(result.data);
|
|
677
|
+
}
|
|
678
|
+
catch (err) {
|
|
679
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
680
|
+
'eventId',
|
|
681
|
+
]);
|
|
682
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
683
|
+
throw transformedError;
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Change the order of category events.
|
|
689
|
+
* @param categoryId - Category ID
|
|
690
|
+
* @public
|
|
691
|
+
* @documentationMaturity preview
|
|
692
|
+
* @requiredField categoryId
|
|
693
|
+
*/
|
|
694
|
+
export function reorderCategoryEvents(categoryId, options) {
|
|
695
|
+
var _a, _b, _c;
|
|
696
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
697
|
+
const requestTransformation = {
|
|
698
|
+
categoryId: '$[0]',
|
|
699
|
+
eventId: '$[1].eventId',
|
|
700
|
+
beforeEventId: '$[1].beforeEventId',
|
|
701
|
+
afterEventId: '$[1].afterEventId',
|
|
702
|
+
};
|
|
703
|
+
const responseTransformation = '$';
|
|
704
|
+
// @ts-ignore
|
|
705
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
706
|
+
const { toAmbassadorRequest } = serializer({
|
|
707
|
+
rootSchema: _reorderCategoryEventsRequest,
|
|
708
|
+
depSchemas: {},
|
|
709
|
+
fqdnTransformation: {
|
|
710
|
+
paths: [],
|
|
711
|
+
transformation: _fromVeloEntity,
|
|
712
|
+
},
|
|
713
|
+
customTransformation: requestTransformation,
|
|
714
|
+
});
|
|
715
|
+
const { fromJSON } = serializer({
|
|
716
|
+
rootSchema: _reorderCategoryEventsResponse,
|
|
717
|
+
depSchemas: {},
|
|
718
|
+
fqdnTransformation: {
|
|
719
|
+
paths: [],
|
|
720
|
+
transformation: _toVeloEntity,
|
|
721
|
+
},
|
|
722
|
+
customTransformation: responseTransformation,
|
|
723
|
+
});
|
|
724
|
+
const payload = toAmbassadorRequest([categoryId, options]);
|
|
725
|
+
const reqOpts = ambassadorWixEventsV1Category.reorderCategoryEvents(payload);
|
|
726
|
+
__log(`"ReorderCategoryEvents" sending request with: ${__inspect(reqOpts)}`);
|
|
727
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
728
|
+
try {
|
|
729
|
+
const result = yield httpClient.request(reqOpts);
|
|
730
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
731
|
+
return fromJSON(result.data);
|
|
732
|
+
}
|
|
733
|
+
catch (err) {
|
|
734
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
735
|
+
'categoryId',
|
|
736
|
+
'options',
|
|
737
|
+
]);
|
|
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
|
+
//# sourceMappingURL=events-v1-category.universal.js.map
|