@wix/auto_sdk_bookings_pricing 1.0.12 → 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 +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.context.js +18 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.context.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.http.d.ts +59 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.http.js +184 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.http.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.meta.js +66 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
- package/build/{internal/index.d.ts → cjs/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
- package/build/cjs/src/bookings-v2-price-info-pricing.public.js +28 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.public.js.map +1 -0
- package/build/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.mts → cjs/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
- package/build/cjs/src/bookings-v2-price-info-pricing.types.js +133 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.types.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +1007 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.js +299 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
- package/build/es/src/bookings-v2-price-info-pricing.context.js +6 -0
- package/build/es/src/bookings-v2-price-info-pricing.context.js.map +1 -0
- package/build/es/src/bookings-v2-price-info-pricing.http.d.ts +59 -0
- package/build/es/src/bookings-v2-price-info-pricing.http.js +179 -0
- package/build/es/src/bookings-v2-price-info-pricing.http.js.map +1 -0
- package/build/es/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
- package/build/es/src/bookings-v2-price-info-pricing.meta.js +38 -0
- package/build/es/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
- package/build/{index.d.ts → es/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
- package/build/es/src/bookings-v2-price-info-pricing.public.js +14 -0
- package/build/es/src/bookings-v2-price-info-pricing.public.js.map +1 -0
- package/build/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.ts → es/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
- package/build/es/src/bookings-v2-price-info-pricing.types.js +130 -0
- package/build/es/src/bookings-v2-price-info-pricing.types.js.map +1 -0
- package/build/es/src/bookings-v2-price-info-pricing.universal.d.ts +1007 -0
- package/build/es/src/bookings-v2-price-info-pricing.universal.js +271 -0
- package/build/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.js +18 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.js.map +1 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.d.ts +59 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js +184 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js.map +1 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.js +66 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
- package/build/internal/{index.d.mts → cjs/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js +28 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js.map +1 -0
- package/build/internal/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.ts → cjs/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js +133 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js.map +1 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +1007 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js +299 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.context.js +6 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.context.js.map +1 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.d.ts +59 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.js +179 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.js.map +1 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.meta.js +38 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
- package/build/{index.d.mts → internal/es/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
- package/build/internal/es/src/bookings-v2-price-info-pricing.public.js +14 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.public.js.map +1 -0
- package/build/internal/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.mts → es/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
- package/build/internal/es/src/bookings-v2-price-info-pricing.types.js +130 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.types.js.map +1 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.d.ts +1007 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js +271 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
- package/package.json +11 -12
- package/build/index.js +0 -314
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -280
- package/build/index.mjs.map +0 -1
- package/build/internal/index.js +0 -314
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs +0 -280
- package/build/internal/index.mjs.map +0 -1
- package/build/internal/meta.d.mts +0 -793
- package/build/internal/meta.d.ts +0 -793
- package/build/internal/meta.js +0 -194
- package/build/internal/meta.js.map +0 -1
- package/build/internal/meta.mjs +0 -166
- package/build/internal/meta.mjs.map +0 -1
- package/build/meta.d.mts +0 -793
- package/build/meta.d.ts +0 -793
- package/build/meta.js +0 -194
- package/build/meta.js.map +0 -1
- package/build/meta.mjs +0 -166
- package/build/meta.mjs.map +0 -1
package/build/meta.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
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
|
-
// meta.ts
|
|
21
|
-
var meta_exports = {};
|
|
22
|
-
__export(meta_exports, {
|
|
23
|
-
calculatePrice: () => calculatePrice2,
|
|
24
|
-
previewPrice: () => previewPrice2
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(meta_exports);
|
|
27
|
-
|
|
28
|
-
// src/bookings-v2-price-info-pricing.http.ts
|
|
29
|
-
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
30
|
-
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
31
|
-
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
32
|
-
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
33
|
-
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
34
|
-
function resolveComWixpressBookingsPricingBookingsPricingServiceUrl(opts) {
|
|
35
|
-
const domainToMappings = {
|
|
36
|
-
"manage._base_domain_": [
|
|
37
|
-
{
|
|
38
|
-
srcPath: "/_api/bookings-pricing",
|
|
39
|
-
destPath: ""
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
srcPath: "/_api/bookings-pricing/v2/price",
|
|
43
|
-
destPath: "/v2/pricing"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
_: [
|
|
47
|
-
{
|
|
48
|
-
srcPath: "/_api/bookings-pricing",
|
|
49
|
-
destPath: ""
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
srcPath: "/_api/bookings-pricing/v2/price",
|
|
53
|
-
destPath: "/v2/pricing"
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"www.wixapis.com": [
|
|
57
|
-
{
|
|
58
|
-
srcPath: "/bookings/v2/pricing/v2/pricing",
|
|
59
|
-
destPath: "/v2/pricing"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
srcPath: "/bookings/v2/pricing",
|
|
63
|
-
destPath: "/v2/pricing"
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
};
|
|
67
|
-
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
68
|
-
}
|
|
69
|
-
var PACKAGE_NAME = "@wix/auto_sdk_bookings_pricing";
|
|
70
|
-
function previewPrice(payload) {
|
|
71
|
-
function __previewPrice({ host }) {
|
|
72
|
-
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
73
|
-
{
|
|
74
|
-
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
75
|
-
paths: [{ path: "bookingLineItems.pricePerParticipant" }]
|
|
76
|
-
}
|
|
77
|
-
]);
|
|
78
|
-
const metadata = {
|
|
79
|
-
entityFqdn: "wix.bookings.v2.price_info",
|
|
80
|
-
method: "POST",
|
|
81
|
-
methodFqn: "com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice",
|
|
82
|
-
packageName: PACKAGE_NAME,
|
|
83
|
-
url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
|
|
84
|
-
protoPath: "/v2/pricing/preview",
|
|
85
|
-
data: serializedData,
|
|
86
|
-
host
|
|
87
|
-
}),
|
|
88
|
-
data: serializedData,
|
|
89
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
90
|
-
{
|
|
91
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
92
|
-
paths: [
|
|
93
|
-
{ path: "priceInfo.calculatedPrice" },
|
|
94
|
-
{ path: "priceInfo.deposit" },
|
|
95
|
-
{ path: "priceInfo.bookingLineItems.pricePerParticipant" }
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
])
|
|
99
|
-
};
|
|
100
|
-
return metadata;
|
|
101
|
-
}
|
|
102
|
-
return __previewPrice;
|
|
103
|
-
}
|
|
104
|
-
function calculatePrice(payload) {
|
|
105
|
-
function __calculatePrice({ host }) {
|
|
106
|
-
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
107
|
-
{
|
|
108
|
-
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
109
|
-
paths: [
|
|
110
|
-
{ path: "booking.createdDate" },
|
|
111
|
-
{ path: "booking.startDate" },
|
|
112
|
-
{ path: "booking.endDate" },
|
|
113
|
-
{ path: "booking.updatedDate" },
|
|
114
|
-
{ path: "booking.canceledDate" }
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
119
|
-
paths: [
|
|
120
|
-
{ path: "booking.contactDetails.fullAddress.geocode.latitude" },
|
|
121
|
-
{ path: "booking.contactDetails.fullAddress.geocode.longitude" }
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
]);
|
|
125
|
-
const metadata = {
|
|
126
|
-
entityFqdn: "wix.bookings.v2.price_info",
|
|
127
|
-
method: "POST",
|
|
128
|
-
methodFqn: "com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice",
|
|
129
|
-
packageName: PACKAGE_NAME,
|
|
130
|
-
url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
|
|
131
|
-
protoPath: "/v2/pricing/calculate",
|
|
132
|
-
data: serializedData,
|
|
133
|
-
host
|
|
134
|
-
}),
|
|
135
|
-
data: serializedData,
|
|
136
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
137
|
-
{
|
|
138
|
-
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
139
|
-
paths: [
|
|
140
|
-
{ path: "priceInfo.calculatedPrice" },
|
|
141
|
-
{ path: "priceInfo.deposit" },
|
|
142
|
-
{ path: "priceInfo.bookingLineItems.pricePerParticipant" }
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
])
|
|
146
|
-
};
|
|
147
|
-
return metadata;
|
|
148
|
-
}
|
|
149
|
-
return __calculatePrice;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// src/bookings-v2-price-info-pricing.meta.ts
|
|
153
|
-
function previewPrice2() {
|
|
154
|
-
const payload = {};
|
|
155
|
-
const getRequestOptions = previewPrice(payload);
|
|
156
|
-
const getUrl = (context) => {
|
|
157
|
-
const { url } = getRequestOptions(context);
|
|
158
|
-
return url;
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
getUrl,
|
|
162
|
-
httpMethod: "POST",
|
|
163
|
-
path: "/v2/pricing/preview",
|
|
164
|
-
pathParams: {},
|
|
165
|
-
__requestType: null,
|
|
166
|
-
__originalRequestType: null,
|
|
167
|
-
__responseType: null,
|
|
168
|
-
__originalResponseType: null
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
function calculatePrice2() {
|
|
172
|
-
const payload = {};
|
|
173
|
-
const getRequestOptions = calculatePrice(payload);
|
|
174
|
-
const getUrl = (context) => {
|
|
175
|
-
const { url } = getRequestOptions(context);
|
|
176
|
-
return url;
|
|
177
|
-
};
|
|
178
|
-
return {
|
|
179
|
-
getUrl,
|
|
180
|
-
httpMethod: "POST",
|
|
181
|
-
path: "/v2/pricing/calculate",
|
|
182
|
-
pathParams: {},
|
|
183
|
-
__requestType: null,
|
|
184
|
-
__originalRequestType: null,
|
|
185
|
-
__responseType: null,
|
|
186
|
-
__originalResponseType: null
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
190
|
-
0 && (module.exports = {
|
|
191
|
-
calculatePrice,
|
|
192
|
-
previewPrice
|
|
193
|
-
});
|
|
194
|
-
//# sourceMappingURL=meta.js.map
|
package/build/meta.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../meta.ts","../src/bookings-v2-price-info-pricing.http.ts","../src/bookings-v2-price-info-pricing.meta.ts"],"sourcesContent":["export * from './src/bookings-v2-price-info-pricing.meta.js';\n","import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressBookingsPricingBookingsPricingServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n _: [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/bookings/v2/pricing/v2/pricing',\n destPath: '/v2/pricing',\n },\n {\n srcPath: '/bookings/v2/pricing',\n destPath: '/v2/pricing',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_pricing';\n\n/**\n * Previews the base price for a set of line items belonging to the same\n * service, before a booking is created. During the booking flow, additional\n * taxes and fees may be added to the base price.\n *\n *\n * ## Response\n *\n * The response includes each line item's individual preview price and the\n * total of all line item preview prices. Note that the final price upon\n * booking creation may differ from the preview price.\n *\n * ## Errors\n *\n * _Preview Price_ fails if:\n *\n * - You specify line items that belong to different *services*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).\n * - The site is using the *Bookings Pricing Integration SPI*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).\n *\n * ## When to call Calculate Price instead\n *\n * To retrieve the price of an existing booking, call *Calculate Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)).\n */\nexport function previewPrice(payload: object): RequestOptionsFactory<any> {\n function __previewPrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [{ path: 'bookingLineItems.pricePerParticipant' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/preview',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __previewPrice;\n}\n\n/**\n * Calculates the base price of a booking.\n *\n *\n * The returned price serves as the foundation for charging the customer. During the\n * _eCommerce checkout_\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),\n * additional taxes and fees may be added to this base price.\n *\n * ## Price calculation method\n *\n * By default, Wix Bookings calculates a booking's price based on the relevant\n * `serviceOptionsAndVariants.variants.values.price`\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).\n * You must then specify either `booking.bookedEntity.slot.serviceId` or\n * `booking.bookedEntity.schedule.scheduleId`.\n *\n * If the business uses the *Wix Bookings Pricing Integration service plugin*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),\n * the returned `priceInfo` object reflects values received from the SPI implementor in\n * _Calculate Price_\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).\n * In this case, it suffices to specify `booking.bookedEntity`.\n *\n * ## When to call Preview Price instead\n *\n * To estimate the price for multiple booking line items before the booking exists,\n * call *Preview Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)).\n */\nexport function calculatePrice(payload: object): RequestOptionsFactory<any> {\n function __calculatePrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'booking.createdDate' },\n { path: 'booking.startDate' },\n { path: 'booking.endDate' },\n { path: 'booking.updatedDate' },\n { path: 'booking.canceledDate' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'booking.contactDetails.fullAddress.geocode.latitude' },\n { path: 'booking.contactDetails.fullAddress.geocode.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/calculate',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __calculatePrice;\n}\n","import * as ambassadorWixBookingsV2PriceInfo from './bookings-v2-price-info-pricing.http.js';\nimport * as ambassadorWixBookingsV2PriceInfoTypes from './bookings-v2-price-info-pricing.types.js';\nimport * as ambassadorWixBookingsV2PriceInfoUniversalTypes from './bookings-v2-price-info-pricing.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function previewPrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.previewPrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/preview',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function calculatePrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/calculate',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,oBAAAC;AAAA;AAAA;;;ACAA,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,0BAA2B;AAI3B,SAAS,2DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MAC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AAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["calculatePrice","previewPrice","import_float","payload","previewPrice","calculatePrice"]}
|
package/build/meta.mjs
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
// src/bookings-v2-price-info-pricing.http.ts
|
|
2
|
-
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
3
|
-
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
4
|
-
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
5
|
-
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
6
|
-
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
7
|
-
function resolveComWixpressBookingsPricingBookingsPricingServiceUrl(opts) {
|
|
8
|
-
const domainToMappings = {
|
|
9
|
-
"manage._base_domain_": [
|
|
10
|
-
{
|
|
11
|
-
srcPath: "/_api/bookings-pricing",
|
|
12
|
-
destPath: ""
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
srcPath: "/_api/bookings-pricing/v2/price",
|
|
16
|
-
destPath: "/v2/pricing"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
_: [
|
|
20
|
-
{
|
|
21
|
-
srcPath: "/_api/bookings-pricing",
|
|
22
|
-
destPath: ""
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
srcPath: "/_api/bookings-pricing/v2/price",
|
|
26
|
-
destPath: "/v2/pricing"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"www.wixapis.com": [
|
|
30
|
-
{
|
|
31
|
-
srcPath: "/bookings/v2/pricing/v2/pricing",
|
|
32
|
-
destPath: "/v2/pricing"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
srcPath: "/bookings/v2/pricing",
|
|
36
|
-
destPath: "/v2/pricing"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
};
|
|
40
|
-
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
41
|
-
}
|
|
42
|
-
var PACKAGE_NAME = "@wix/auto_sdk_bookings_pricing";
|
|
43
|
-
function previewPrice(payload) {
|
|
44
|
-
function __previewPrice({ host }) {
|
|
45
|
-
const serializedData = transformPaths(payload, [
|
|
46
|
-
{
|
|
47
|
-
transformFn: transformSDKFloatToRESTFloat,
|
|
48
|
-
paths: [{ path: "bookingLineItems.pricePerParticipant" }]
|
|
49
|
-
}
|
|
50
|
-
]);
|
|
51
|
-
const metadata = {
|
|
52
|
-
entityFqdn: "wix.bookings.v2.price_info",
|
|
53
|
-
method: "POST",
|
|
54
|
-
methodFqn: "com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice",
|
|
55
|
-
packageName: PACKAGE_NAME,
|
|
56
|
-
url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
|
|
57
|
-
protoPath: "/v2/pricing/preview",
|
|
58
|
-
data: serializedData,
|
|
59
|
-
host
|
|
60
|
-
}),
|
|
61
|
-
data: serializedData,
|
|
62
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
63
|
-
{
|
|
64
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
65
|
-
paths: [
|
|
66
|
-
{ path: "priceInfo.calculatedPrice" },
|
|
67
|
-
{ path: "priceInfo.deposit" },
|
|
68
|
-
{ path: "priceInfo.bookingLineItems.pricePerParticipant" }
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
])
|
|
72
|
-
};
|
|
73
|
-
return metadata;
|
|
74
|
-
}
|
|
75
|
-
return __previewPrice;
|
|
76
|
-
}
|
|
77
|
-
function calculatePrice(payload) {
|
|
78
|
-
function __calculatePrice({ host }) {
|
|
79
|
-
const serializedData = transformPaths(payload, [
|
|
80
|
-
{
|
|
81
|
-
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
82
|
-
paths: [
|
|
83
|
-
{ path: "booking.createdDate" },
|
|
84
|
-
{ path: "booking.startDate" },
|
|
85
|
-
{ path: "booking.endDate" },
|
|
86
|
-
{ path: "booking.updatedDate" },
|
|
87
|
-
{ path: "booking.canceledDate" }
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
transformFn: transformSDKFloatToRESTFloat,
|
|
92
|
-
paths: [
|
|
93
|
-
{ path: "booking.contactDetails.fullAddress.geocode.latitude" },
|
|
94
|
-
{ path: "booking.contactDetails.fullAddress.geocode.longitude" }
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
]);
|
|
98
|
-
const metadata = {
|
|
99
|
-
entityFqdn: "wix.bookings.v2.price_info",
|
|
100
|
-
method: "POST",
|
|
101
|
-
methodFqn: "com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice",
|
|
102
|
-
packageName: PACKAGE_NAME,
|
|
103
|
-
url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
|
|
104
|
-
protoPath: "/v2/pricing/calculate",
|
|
105
|
-
data: serializedData,
|
|
106
|
-
host
|
|
107
|
-
}),
|
|
108
|
-
data: serializedData,
|
|
109
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
110
|
-
{
|
|
111
|
-
transformFn: transformRESTFloatToSDKFloat,
|
|
112
|
-
paths: [
|
|
113
|
-
{ path: "priceInfo.calculatedPrice" },
|
|
114
|
-
{ path: "priceInfo.deposit" },
|
|
115
|
-
{ path: "priceInfo.bookingLineItems.pricePerParticipant" }
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
])
|
|
119
|
-
};
|
|
120
|
-
return metadata;
|
|
121
|
-
}
|
|
122
|
-
return __calculatePrice;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// src/bookings-v2-price-info-pricing.meta.ts
|
|
126
|
-
function previewPrice2() {
|
|
127
|
-
const payload = {};
|
|
128
|
-
const getRequestOptions = previewPrice(payload);
|
|
129
|
-
const getUrl = (context) => {
|
|
130
|
-
const { url } = getRequestOptions(context);
|
|
131
|
-
return url;
|
|
132
|
-
};
|
|
133
|
-
return {
|
|
134
|
-
getUrl,
|
|
135
|
-
httpMethod: "POST",
|
|
136
|
-
path: "/v2/pricing/preview",
|
|
137
|
-
pathParams: {},
|
|
138
|
-
__requestType: null,
|
|
139
|
-
__originalRequestType: null,
|
|
140
|
-
__responseType: null,
|
|
141
|
-
__originalResponseType: null
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function calculatePrice2() {
|
|
145
|
-
const payload = {};
|
|
146
|
-
const getRequestOptions = calculatePrice(payload);
|
|
147
|
-
const getUrl = (context) => {
|
|
148
|
-
const { url } = getRequestOptions(context);
|
|
149
|
-
return url;
|
|
150
|
-
};
|
|
151
|
-
return {
|
|
152
|
-
getUrl,
|
|
153
|
-
httpMethod: "POST",
|
|
154
|
-
path: "/v2/pricing/calculate",
|
|
155
|
-
pathParams: {},
|
|
156
|
-
__requestType: null,
|
|
157
|
-
__originalRequestType: null,
|
|
158
|
-
__responseType: null,
|
|
159
|
-
__originalResponseType: null
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
export {
|
|
163
|
-
calculatePrice2 as calculatePrice,
|
|
164
|
-
previewPrice2 as previewPrice
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=meta.mjs.map
|
package/build/meta.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bookings-v2-price-info-pricing.http.ts","../src/bookings-v2-price-info-pricing.meta.ts"],"sourcesContent":["import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressBookingsPricingBookingsPricingServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n _: [\n {\n srcPath: '/_api/bookings-pricing',\n destPath: '',\n },\n {\n srcPath: '/_api/bookings-pricing/v2/price',\n destPath: '/v2/pricing',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/bookings/v2/pricing/v2/pricing',\n destPath: '/v2/pricing',\n },\n {\n srcPath: '/bookings/v2/pricing',\n destPath: '/v2/pricing',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_bookings_pricing';\n\n/**\n * Previews the base price for a set of line items belonging to the same\n * service, before a booking is created. During the booking flow, additional\n * taxes and fees may be added to the base price.\n *\n *\n * ## Response\n *\n * The response includes each line item's individual preview price and the\n * total of all line item preview prices. Note that the final price upon\n * booking creation may differ from the preview price.\n *\n * ## Errors\n *\n * _Preview Price_ fails if:\n *\n * - You specify line items that belong to different *services*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction)).\n * - The site is using the *Bookings Pricing Integration SPI*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).\n *\n * ## When to call Calculate Price instead\n *\n * To retrieve the price of an existing booking, call *Calculate Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/calculate-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/calculate-price)).\n */\nexport function previewPrice(payload: object): RequestOptionsFactory<any> {\n function __previewPrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [{ path: 'bookingLineItems.pricePerParticipant' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/preview',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __previewPrice;\n}\n\n/**\n * Calculates the base price of a booking.\n *\n *\n * The returned price serves as the foundation for charging the customer. During the\n * _eCommerce checkout_\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),\n * additional taxes and fees may be added to this base price.\n *\n * ## Price calculation method\n *\n * By default, Wix Bookings calculates a booking's price based on the relevant\n * `serviceOptionsAndVariants.variants.values.price`\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/service-options-and-variants/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/service-options-and-variants/introduction)).\n * You must then specify either `booking.bookedEntity.slot.serviceId` or\n * `booking.bookedEntity.schedule.scheduleId`.\n *\n * If the business uses the *Wix Bookings Pricing Integration service plugin*\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),\n * the returned `priceInfo` object reflects values received from the SPI implementor in\n * _Calculate Price_\n * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).\n * In this case, it suffices to specify `booking.bookedEntity`.\n *\n * ## When to call Preview Price instead\n *\n * To estimate the price for multiple booking line items before the booking exists,\n * call *Preview Price*\n * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/pricing/preview-price) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-api/preview-price)).\n */\nexport function calculatePrice(payload: object): RequestOptionsFactory<any> {\n function __calculatePrice({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'booking.createdDate' },\n { path: 'booking.startDate' },\n { path: 'booking.endDate' },\n { path: 'booking.updatedDate' },\n { path: 'booking.canceledDate' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'booking.contactDetails.fullAddress.geocode.latitude' },\n { path: 'booking.contactDetails.fullAddress.geocode.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bookings.v2.price_info',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({\n protoPath: '/v2/pricing/calculate',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'priceInfo.calculatedPrice' },\n { path: 'priceInfo.deposit' },\n { path: 'priceInfo.bookingLineItems.pricePerParticipant' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __calculatePrice;\n}\n","import * as ambassadorWixBookingsV2PriceInfo from './bookings-v2-price-info-pricing.http.js';\nimport * as ambassadorWixBookingsV2PriceInfoTypes from './bookings-v2-price-info-pricing.types.js';\nimport * as ambassadorWixBookingsV2PriceInfoUniversalTypes from './bookings-v2-price-info-pricing.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function previewPrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.previewPrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/preview',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function calculatePrice(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceRequest,\n ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponse,\n ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/pricing/calculate',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AA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