@wix/events 1.0.150 → 1.0.152

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