@wix/auto_sdk_bookings_service-options-and-variants 1.0.30 → 1.0.32
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 +18 -9
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{bookings-catalog-v1-service-options-and-variants-service-options-and-variants.universal-Ctu6ajbD.d.ts → index.typings.d.ts} +310 -1
- package/build/cjs/index.typings.js +570 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +18 -9
- package/build/es/index.mjs.map +1 -1
- package/build/es/{bookings-catalog-v1-service-options-and-variants-service-options-and-variants.universal-Ctu6ajbD.d.mts → index.typings.d.mts} +310 -1
- package/build/es/index.typings.mjs +534 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +18 -9
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{bookings-catalog-v1-service-options-and-variants-service-options-and-variants.universal-Ctu6ajbD.d.ts → index.typings.d.ts} +310 -1
- package/build/internal/cjs/index.typings.js +570 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +18 -9
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{bookings-catalog-v1-service-options-and-variants-service-options-and-variants.universal-Ctu6ajbD.d.mts → index.typings.d.mts} +310 -1
- package/build/internal/es/index.typings.mjs +534 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
DayOfWeek: () => DayOfWeek,
|
|
24
|
+
PlacementType: () => PlacementType,
|
|
25
|
+
ResolutionMethod: () => ResolutionMethod,
|
|
26
|
+
ServiceOptionType: () => ServiceOptionType,
|
|
27
|
+
SortOrder: () => SortOrder,
|
|
28
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
29
|
+
cloneServiceOptionsAndVariants: () => cloneServiceOptionsAndVariants2,
|
|
30
|
+
createServiceOptionsAndVariants: () => createServiceOptionsAndVariants2,
|
|
31
|
+
deleteServiceOptionsAndVariants: () => deleteServiceOptionsAndVariants2,
|
|
32
|
+
getServiceOptionsAndVariants: () => getServiceOptionsAndVariants2,
|
|
33
|
+
getServiceOptionsAndVariantsByServiceId: () => getServiceOptionsAndVariantsByServiceId2,
|
|
34
|
+
queryServiceOptionsAndVariants: () => queryServiceOptionsAndVariants2,
|
|
35
|
+
updateServiceOptionsAndVariants: () => updateServiceOptionsAndVariants2
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
38
|
+
|
|
39
|
+
// src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.universal.ts
|
|
40
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
41
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
42
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
43
|
+
|
|
44
|
+
// src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.http.ts
|
|
45
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
46
|
+
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
47
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
48
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
49
|
+
function resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl(opts) {
|
|
50
|
+
const domainToMappings = {
|
|
51
|
+
"manage._base_domain_": [
|
|
52
|
+
{
|
|
53
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
54
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
srcPath: "/_api/v1/serviceOptionsAndVariants",
|
|
58
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
srcPath: "/_api/bookings/v1/service-options-and-variants",
|
|
62
|
+
destPath: ""
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
_: [
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
68
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
srcPath: "/_api/v1/serviceOptionsAndVariants",
|
|
72
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"*.dev.wix-code.com": [
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
78
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"editor._base_domain_": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
84
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
srcPath: "/_api/bookings/v1/service-options-and-variants",
|
|
88
|
+
destPath: "/api"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"blocks._base_domain_": [
|
|
92
|
+
{
|
|
93
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
94
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
srcPath: "/_api/bookings/v1/service-options-and-variants",
|
|
98
|
+
destPath: "/api"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"create.editorx": [
|
|
102
|
+
{
|
|
103
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
104
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/_api/bookings/v1/service-options-and-variants",
|
|
108
|
+
destPath: "/api"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"www.wixapis.com": [
|
|
112
|
+
{
|
|
113
|
+
srcPath: "/bookings/v1/serviceOptionsAndVariants",
|
|
114
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"bo._base_domain_": [
|
|
118
|
+
{
|
|
119
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
120
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"wixbo.ai": [
|
|
124
|
+
{
|
|
125
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
126
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"wix-bo.com": [
|
|
130
|
+
{
|
|
131
|
+
srcPath: "/_api/v1/service-options-and-variants",
|
|
132
|
+
destPath: "/v1/serviceOptionsAndVariants"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
};
|
|
136
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
137
|
+
}
|
|
138
|
+
var PACKAGE_NAME = "@wix/auto_sdk_bookings_service-options-and-variants";
|
|
139
|
+
function createServiceOptionsAndVariants(payload) {
|
|
140
|
+
function __createServiceOptionsAndVariants({ host }) {
|
|
141
|
+
const metadata = {
|
|
142
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
143
|
+
method: "POST",
|
|
144
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.CreateServiceOptionsAndVariants",
|
|
145
|
+
packageName: PACKAGE_NAME,
|
|
146
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
147
|
+
protoPath: "/v1/serviceOptionsAndVariants",
|
|
148
|
+
data: payload,
|
|
149
|
+
host
|
|
150
|
+
}),
|
|
151
|
+
data: payload
|
|
152
|
+
};
|
|
153
|
+
return metadata;
|
|
154
|
+
}
|
|
155
|
+
return __createServiceOptionsAndVariants;
|
|
156
|
+
}
|
|
157
|
+
function cloneServiceOptionsAndVariants(payload) {
|
|
158
|
+
function __cloneServiceOptionsAndVariants({ host }) {
|
|
159
|
+
const metadata = {
|
|
160
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
161
|
+
method: "POST",
|
|
162
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.CloneServiceOptionsAndVariants",
|
|
163
|
+
packageName: PACKAGE_NAME,
|
|
164
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
165
|
+
protoPath: "/v1/serviceOptionsAndVariants/{cloneFromId}/clone",
|
|
166
|
+
data: payload,
|
|
167
|
+
host
|
|
168
|
+
}),
|
|
169
|
+
data: payload
|
|
170
|
+
};
|
|
171
|
+
return metadata;
|
|
172
|
+
}
|
|
173
|
+
return __cloneServiceOptionsAndVariants;
|
|
174
|
+
}
|
|
175
|
+
function getServiceOptionsAndVariants(payload) {
|
|
176
|
+
function __getServiceOptionsAndVariants({ host }) {
|
|
177
|
+
const metadata = {
|
|
178
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
179
|
+
method: "GET",
|
|
180
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.GetServiceOptionsAndVariants",
|
|
181
|
+
packageName: PACKAGE_NAME,
|
|
182
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
183
|
+
protoPath: "/v1/serviceOptionsAndVariants/{serviceOptionsAndVariantsId}",
|
|
184
|
+
data: payload,
|
|
185
|
+
host
|
|
186
|
+
}),
|
|
187
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
188
|
+
fallback: [
|
|
189
|
+
{
|
|
190
|
+
method: "GET",
|
|
191
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
192
|
+
protoPath: "/v1/serviceOptionsAndVariants/{serviceOptionsAndVariantsId}",
|
|
193
|
+
data: payload,
|
|
194
|
+
host
|
|
195
|
+
}),
|
|
196
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
};
|
|
200
|
+
return metadata;
|
|
201
|
+
}
|
|
202
|
+
return __getServiceOptionsAndVariants;
|
|
203
|
+
}
|
|
204
|
+
function getServiceOptionsAndVariantsByServiceId(payload) {
|
|
205
|
+
function __getServiceOptionsAndVariantsByServiceId({ host }) {
|
|
206
|
+
const metadata = {
|
|
207
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
208
|
+
method: "GET",
|
|
209
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.GetServiceOptionsAndVariantsByServiceId",
|
|
210
|
+
packageName: PACKAGE_NAME,
|
|
211
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
212
|
+
protoPath: "/v1/serviceOptionsAndVariants/service_id/{serviceId}",
|
|
213
|
+
data: payload,
|
|
214
|
+
host
|
|
215
|
+
}),
|
|
216
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
217
|
+
fallback: [
|
|
218
|
+
{
|
|
219
|
+
method: "GET",
|
|
220
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
221
|
+
protoPath: "/v1/serviceOptionsAndVariants/service_id/{serviceId}",
|
|
222
|
+
data: payload,
|
|
223
|
+
host
|
|
224
|
+
}),
|
|
225
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
return metadata;
|
|
230
|
+
}
|
|
231
|
+
return __getServiceOptionsAndVariantsByServiceId;
|
|
232
|
+
}
|
|
233
|
+
function updateServiceOptionsAndVariants(payload) {
|
|
234
|
+
function __updateServiceOptionsAndVariants({ host }) {
|
|
235
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
236
|
+
{
|
|
237
|
+
transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
|
|
238
|
+
paths: [{ path: "mask" }]
|
|
239
|
+
}
|
|
240
|
+
]);
|
|
241
|
+
const metadata = {
|
|
242
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
243
|
+
method: "PATCH",
|
|
244
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.UpdateServiceOptionsAndVariants",
|
|
245
|
+
packageName: PACKAGE_NAME,
|
|
246
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
247
|
+
protoPath: "/v1/serviceOptionsAndVariants/{serviceOptionsAndVariants.id}",
|
|
248
|
+
data: serializedData,
|
|
249
|
+
host
|
|
250
|
+
}),
|
|
251
|
+
data: serializedData
|
|
252
|
+
};
|
|
253
|
+
return metadata;
|
|
254
|
+
}
|
|
255
|
+
return __updateServiceOptionsAndVariants;
|
|
256
|
+
}
|
|
257
|
+
function deleteServiceOptionsAndVariants(payload) {
|
|
258
|
+
function __deleteServiceOptionsAndVariants({ host }) {
|
|
259
|
+
const metadata = {
|
|
260
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
261
|
+
method: "DELETE",
|
|
262
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.DeleteServiceOptionsAndVariants",
|
|
263
|
+
packageName: PACKAGE_NAME,
|
|
264
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
265
|
+
protoPath: "/v1/serviceOptionsAndVariants/{serviceOptionsAndVariantsId}",
|
|
266
|
+
data: payload,
|
|
267
|
+
host
|
|
268
|
+
}),
|
|
269
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
270
|
+
};
|
|
271
|
+
return metadata;
|
|
272
|
+
}
|
|
273
|
+
return __deleteServiceOptionsAndVariants;
|
|
274
|
+
}
|
|
275
|
+
function queryServiceOptionsAndVariants(payload) {
|
|
276
|
+
function __queryServiceOptionsAndVariants({ host }) {
|
|
277
|
+
const metadata = {
|
|
278
|
+
entityFqdn: "wix.bookings.catalog.v1.service_options_and_variants",
|
|
279
|
+
method: "POST",
|
|
280
|
+
methodFqn: "wix.bookings.catalog.v1.ServiceOptionsAndVariantsService.QueryServiceOptionsAndVariants",
|
|
281
|
+
packageName: PACKAGE_NAME,
|
|
282
|
+
url: resolveWixBookingsCatalogV1ServiceOptionsAndVariantsServiceUrl({
|
|
283
|
+
protoPath: "/v1/serviceOptionsAndVariants/query",
|
|
284
|
+
data: payload,
|
|
285
|
+
host
|
|
286
|
+
}),
|
|
287
|
+
data: payload
|
|
288
|
+
};
|
|
289
|
+
return metadata;
|
|
290
|
+
}
|
|
291
|
+
return __queryServiceOptionsAndVariants;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// src/bookings-catalog-v1-service-options-and-variants-service-options-and-variants.universal.ts
|
|
295
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
296
|
+
var ServiceOptionType = /* @__PURE__ */ ((ServiceOptionType2) => {
|
|
297
|
+
ServiceOptionType2["UNKNOWN"] = "UNKNOWN";
|
|
298
|
+
ServiceOptionType2["CUSTOM"] = "CUSTOM";
|
|
299
|
+
ServiceOptionType2["STAFF_MEMBER"] = "STAFF_MEMBER";
|
|
300
|
+
ServiceOptionType2["DURATION"] = "DURATION";
|
|
301
|
+
return ServiceOptionType2;
|
|
302
|
+
})(ServiceOptionType || {});
|
|
303
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
304
|
+
SortOrder2["ASC"] = "ASC";
|
|
305
|
+
SortOrder2["DESC"] = "DESC";
|
|
306
|
+
return SortOrder2;
|
|
307
|
+
})(SortOrder || {});
|
|
308
|
+
var PlacementType = /* @__PURE__ */ ((PlacementType2) => {
|
|
309
|
+
PlacementType2["BEFORE"] = "BEFORE";
|
|
310
|
+
PlacementType2["AFTER"] = "AFTER";
|
|
311
|
+
PlacementType2["REPLACE"] = "REPLACE";
|
|
312
|
+
return PlacementType2;
|
|
313
|
+
})(PlacementType || {});
|
|
314
|
+
var DayOfWeek = /* @__PURE__ */ ((DayOfWeek2) => {
|
|
315
|
+
DayOfWeek2["MONDAY"] = "MONDAY";
|
|
316
|
+
DayOfWeek2["TUESDAY"] = "TUESDAY";
|
|
317
|
+
DayOfWeek2["WEDNESDAY"] = "WEDNESDAY";
|
|
318
|
+
DayOfWeek2["THURSDAY"] = "THURSDAY";
|
|
319
|
+
DayOfWeek2["FRIDAY"] = "FRIDAY";
|
|
320
|
+
DayOfWeek2["SATURDAY"] = "SATURDAY";
|
|
321
|
+
DayOfWeek2["SUNDAY"] = "SUNDAY";
|
|
322
|
+
return DayOfWeek2;
|
|
323
|
+
})(DayOfWeek || {});
|
|
324
|
+
var ResolutionMethod = /* @__PURE__ */ ((ResolutionMethod2) => {
|
|
325
|
+
ResolutionMethod2["QUERY_PARAM"] = "QUERY_PARAM";
|
|
326
|
+
ResolutionMethod2["SUBDOMAIN"] = "SUBDOMAIN";
|
|
327
|
+
ResolutionMethod2["SUBDIRECTORY"] = "SUBDIRECTORY";
|
|
328
|
+
return ResolutionMethod2;
|
|
329
|
+
})(ResolutionMethod || {});
|
|
330
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
331
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
332
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
333
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
334
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
335
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
336
|
+
return WebhookIdentityType2;
|
|
337
|
+
})(WebhookIdentityType || {});
|
|
338
|
+
async function createServiceOptionsAndVariants2(serviceOptionsAndVariants) {
|
|
339
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
340
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
341
|
+
serviceOptionsAndVariants
|
|
342
|
+
});
|
|
343
|
+
const reqOpts = createServiceOptionsAndVariants(
|
|
344
|
+
payload
|
|
345
|
+
);
|
|
346
|
+
sideEffects?.onSiteCall?.();
|
|
347
|
+
try {
|
|
348
|
+
const result = await httpClient.request(reqOpts);
|
|
349
|
+
sideEffects?.onSuccess?.(result);
|
|
350
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.serviceOptionsAndVariants;
|
|
351
|
+
} catch (err) {
|
|
352
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
353
|
+
err,
|
|
354
|
+
{
|
|
355
|
+
spreadPathsToArguments: {},
|
|
356
|
+
explicitPathsToArguments: { serviceOptionsAndVariants: "$[0]" },
|
|
357
|
+
singleArgumentUnchanged: false
|
|
358
|
+
},
|
|
359
|
+
["serviceOptionsAndVariants"]
|
|
360
|
+
);
|
|
361
|
+
sideEffects?.onError?.(err);
|
|
362
|
+
throw transformedError;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
async function cloneServiceOptionsAndVariants2(cloneFromId, targetServiceId) {
|
|
366
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
367
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
368
|
+
cloneFromId,
|
|
369
|
+
targetServiceId
|
|
370
|
+
});
|
|
371
|
+
const reqOpts = cloneServiceOptionsAndVariants(
|
|
372
|
+
payload
|
|
373
|
+
);
|
|
374
|
+
sideEffects?.onSiteCall?.();
|
|
375
|
+
try {
|
|
376
|
+
const result = await httpClient.request(reqOpts);
|
|
377
|
+
sideEffects?.onSuccess?.(result);
|
|
378
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
379
|
+
} catch (err) {
|
|
380
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
381
|
+
err,
|
|
382
|
+
{
|
|
383
|
+
spreadPathsToArguments: {},
|
|
384
|
+
explicitPathsToArguments: {
|
|
385
|
+
cloneFromId: "$[0]",
|
|
386
|
+
targetServiceId: "$[1]"
|
|
387
|
+
},
|
|
388
|
+
singleArgumentUnchanged: false
|
|
389
|
+
},
|
|
390
|
+
["cloneFromId", "targetServiceId"]
|
|
391
|
+
);
|
|
392
|
+
sideEffects?.onError?.(err);
|
|
393
|
+
throw transformedError;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
async function getServiceOptionsAndVariants2(serviceOptionsAndVariantsId) {
|
|
397
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
398
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
399
|
+
serviceOptionsAndVariantsId
|
|
400
|
+
});
|
|
401
|
+
const reqOpts = getServiceOptionsAndVariants(
|
|
402
|
+
payload
|
|
403
|
+
);
|
|
404
|
+
sideEffects?.onSiteCall?.();
|
|
405
|
+
try {
|
|
406
|
+
const result = await httpClient.request(reqOpts);
|
|
407
|
+
sideEffects?.onSuccess?.(result);
|
|
408
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.serviceOptionsAndVariants;
|
|
409
|
+
} catch (err) {
|
|
410
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
411
|
+
err,
|
|
412
|
+
{
|
|
413
|
+
spreadPathsToArguments: {},
|
|
414
|
+
explicitPathsToArguments: { serviceOptionsAndVariantsId: "$[0]" },
|
|
415
|
+
singleArgumentUnchanged: false
|
|
416
|
+
},
|
|
417
|
+
["serviceOptionsAndVariantsId"]
|
|
418
|
+
);
|
|
419
|
+
sideEffects?.onError?.(err);
|
|
420
|
+
throw transformedError;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
async function getServiceOptionsAndVariantsByServiceId2(serviceId) {
|
|
424
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
425
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
426
|
+
serviceId
|
|
427
|
+
});
|
|
428
|
+
const reqOpts = getServiceOptionsAndVariantsByServiceId(
|
|
429
|
+
payload
|
|
430
|
+
);
|
|
431
|
+
sideEffects?.onSiteCall?.();
|
|
432
|
+
try {
|
|
433
|
+
const result = await httpClient.request(reqOpts);
|
|
434
|
+
sideEffects?.onSuccess?.(result);
|
|
435
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
436
|
+
} catch (err) {
|
|
437
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
438
|
+
err,
|
|
439
|
+
{
|
|
440
|
+
spreadPathsToArguments: {},
|
|
441
|
+
explicitPathsToArguments: { serviceId: "$[0]" },
|
|
442
|
+
singleArgumentUnchanged: false
|
|
443
|
+
},
|
|
444
|
+
["serviceId"]
|
|
445
|
+
);
|
|
446
|
+
sideEffects?.onError?.(err);
|
|
447
|
+
throw transformedError;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
async function updateServiceOptionsAndVariants2(_id, serviceOptionsAndVariants) {
|
|
451
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
452
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
453
|
+
serviceOptionsAndVariants: { ...serviceOptionsAndVariants, id: _id }
|
|
454
|
+
});
|
|
455
|
+
const reqOpts = updateServiceOptionsAndVariants(
|
|
456
|
+
payload
|
|
457
|
+
);
|
|
458
|
+
sideEffects?.onSiteCall?.();
|
|
459
|
+
try {
|
|
460
|
+
const result = await httpClient.request(reqOpts);
|
|
461
|
+
sideEffects?.onSuccess?.(result);
|
|
462
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.serviceOptionsAndVariants;
|
|
463
|
+
} catch (err) {
|
|
464
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
465
|
+
err,
|
|
466
|
+
{
|
|
467
|
+
spreadPathsToArguments: { serviceOptionsAndVariants: "$[1]" },
|
|
468
|
+
explicitPathsToArguments: { "serviceOptionsAndVariants.id": "$[0]" },
|
|
469
|
+
singleArgumentUnchanged: false
|
|
470
|
+
},
|
|
471
|
+
["_id", "serviceOptionsAndVariants"]
|
|
472
|
+
);
|
|
473
|
+
sideEffects?.onError?.(err);
|
|
474
|
+
throw transformedError;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
async function deleteServiceOptionsAndVariants2(serviceOptionsAndVariantsId, options) {
|
|
478
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
479
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
480
|
+
serviceOptionsAndVariantsId,
|
|
481
|
+
revision: options?.revision
|
|
482
|
+
});
|
|
483
|
+
const reqOpts = deleteServiceOptionsAndVariants(
|
|
484
|
+
payload
|
|
485
|
+
);
|
|
486
|
+
sideEffects?.onSiteCall?.();
|
|
487
|
+
try {
|
|
488
|
+
const result = await httpClient.request(reqOpts);
|
|
489
|
+
sideEffects?.onSuccess?.(result);
|
|
490
|
+
} catch (err) {
|
|
491
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
492
|
+
err,
|
|
493
|
+
{
|
|
494
|
+
spreadPathsToArguments: {},
|
|
495
|
+
explicitPathsToArguments: {
|
|
496
|
+
serviceOptionsAndVariantsId: "$[0]",
|
|
497
|
+
revision: "$[1].revision"
|
|
498
|
+
},
|
|
499
|
+
singleArgumentUnchanged: false
|
|
500
|
+
},
|
|
501
|
+
["serviceOptionsAndVariantsId", "options"]
|
|
502
|
+
);
|
|
503
|
+
sideEffects?.onError?.(err);
|
|
504
|
+
throw transformedError;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
function queryServiceOptionsAndVariants2() {
|
|
508
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
509
|
+
return (0, import_query_builder.queryBuilder)({
|
|
510
|
+
func: async (payload) => {
|
|
511
|
+
const reqOpts = queryServiceOptionsAndVariants(
|
|
512
|
+
payload
|
|
513
|
+
);
|
|
514
|
+
sideEffects?.onSiteCall?.();
|
|
515
|
+
try {
|
|
516
|
+
const result = await httpClient.request(reqOpts);
|
|
517
|
+
sideEffects?.onSuccess?.(result);
|
|
518
|
+
return result;
|
|
519
|
+
} catch (err) {
|
|
520
|
+
sideEffects?.onError?.(err);
|
|
521
|
+
throw err;
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
requestTransformer: (query) => {
|
|
525
|
+
const args = [query, {}];
|
|
526
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
527
|
+
...args?.[1],
|
|
528
|
+
query: args?.[0]
|
|
529
|
+
});
|
|
530
|
+
},
|
|
531
|
+
responseTransformer: ({
|
|
532
|
+
data
|
|
533
|
+
}) => {
|
|
534
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
535
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
536
|
+
);
|
|
537
|
+
return {
|
|
538
|
+
items: transformedData?.serviceOptionsAndVariantsList,
|
|
539
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
540
|
+
};
|
|
541
|
+
},
|
|
542
|
+
errorTransformer: (err) => {
|
|
543
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
544
|
+
spreadPathsToArguments: {},
|
|
545
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
546
|
+
singleArgumentUnchanged: false
|
|
547
|
+
});
|
|
548
|
+
throw transformedError;
|
|
549
|
+
},
|
|
550
|
+
pagingMethod: "CURSOR",
|
|
551
|
+
transformationPaths: {}
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
555
|
+
0 && (module.exports = {
|
|
556
|
+
DayOfWeek,
|
|
557
|
+
PlacementType,
|
|
558
|
+
ResolutionMethod,
|
|
559
|
+
ServiceOptionType,
|
|
560
|
+
SortOrder,
|
|
561
|
+
WebhookIdentityType,
|
|
562
|
+
cloneServiceOptionsAndVariants,
|
|
563
|
+
createServiceOptionsAndVariants,
|
|
564
|
+
deleteServiceOptionsAndVariants,
|
|
565
|
+
getServiceOptionsAndVariants,
|
|
566
|
+
getServiceOptionsAndVariantsByServiceId,
|
|
567
|
+
queryServiceOptionsAndVariants,
|
|
568
|
+
updateServiceOptionsAndVariants
|
|
569
|
+
});
|
|
570
|
+
//# sourceMappingURL=index.typings.js.map
|