@wix/auto_sdk_bookings_pricing 1.0.0
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 +60 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.http.js +185 -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/cjs/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
- 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/cjs/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
- 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 +869 -0
- package/build/cjs/src/bookings-v2-price-info-pricing.universal.js +298 -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 +60 -0
- package/build/es/src/bookings-v2-price-info-pricing.http.js +180 -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/es/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
- 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/es/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
- 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 +869 -0
- package/build/es/src/bookings-v2-price-info-pricing.universal.js +270 -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 +60 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js +185 -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/cjs/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
- 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/cjs/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
- 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 +869 -0
- package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js +298 -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 +60 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.http.js +180 -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/internal/es/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
- 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/es/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
- 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 +869 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js +270 -0
- package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/bookings-v2-price-info-pricing.context.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/bookings-v2-price-info-pricing.context.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kFAAgE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/bookings-v2-price-info-pricing.universal.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/bookings-v2-price-info-pricing.universal.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oFAAkE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/bookings-v2-price-info-pricing.meta.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/bookings-v2-price-info-pricing.meta.js"), exports);
|
|
18
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+EAA6D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { previewPrice as publicPreviewPrice, calculatePrice as publicCalculatePrice } from './bookings-v2-price-info-pricing.public.js';
|
|
2
|
+
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
|
|
3
|
+
export declare const previewPrice: MaybeContext<BuildRESTFunction<typeof publicPreviewPrice> & typeof publicPreviewPrice>;
|
|
4
|
+
export declare const calculatePrice: MaybeContext<BuildRESTFunction<typeof publicCalculatePrice> & typeof publicCalculatePrice>;
|
|
5
|
+
export { MultiServiceBookingType, LocationType, ValueType, BookingStatus, PaymentStatus, SelectedPaymentOption, Platform, Actor, IdentityType, } from './bookings-v2-price-info-pricing.universal.js';
|
|
6
|
+
export { PriceInfo, PriceInfoTotalPriceOneOf, BookingLineItem, ServiceChoice, ServiceChoiceChoiceOneOf, Duration, PriceDescriptionInfo, PreviewPriceRequest, PreviewPriceResponse, CalculatePriceRequest, Booking, BookingParticipantsInfoOneOf, BookedEntity, BookedEntityItemOneOf, BookedSlot, BookedResource, Location, BookedSchedule, ContactDetails, Address, AddressStreetOneOf, StreetAddress, AddressLocation, Subdivision, CustomFormField, BookingSource, ParticipantNotification, IdentificationData, IdentificationDataIdOneOf, FlowControlSettings, ExtendedFields, ParticipantChoices, ServiceChoices, MultiServiceBookingInfo, CalculatePriceResponse, PreviewPriceResponseNonNullableFields, CalculatePriceResponseNonNullableFields, } from './bookings-v2-price-info-pricing.universal.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdentityType = exports.Actor = exports.Platform = exports.SelectedPaymentOption = exports.PaymentStatus = exports.BookingStatus = exports.ValueType = exports.LocationType = exports.MultiServiceBookingType = exports.calculatePrice = exports.previewPrice = void 0;
|
|
4
|
+
const bookings_v2_price_info_pricing_public_js_1 = require("./bookings-v2-price-info-pricing.public.js");
|
|
5
|
+
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
6
|
+
exports.previewPrice = (0, rest_modules_1.createRESTModule)(bookings_v2_price_info_pricing_public_js_1.previewPrice);
|
|
7
|
+
exports.calculatePrice = (0, rest_modules_1.createRESTModule)(bookings_v2_price_info_pricing_public_js_1.calculatePrice);
|
|
8
|
+
var bookings_v2_price_info_pricing_universal_js_1 = require("./bookings-v2-price-info-pricing.universal.js");
|
|
9
|
+
Object.defineProperty(exports, "MultiServiceBookingType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.MultiServiceBookingType; } });
|
|
10
|
+
Object.defineProperty(exports, "LocationType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.LocationType; } });
|
|
11
|
+
Object.defineProperty(exports, "ValueType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.ValueType; } });
|
|
12
|
+
Object.defineProperty(exports, "BookingStatus", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.BookingStatus; } });
|
|
13
|
+
Object.defineProperty(exports, "PaymentStatus", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.PaymentStatus; } });
|
|
14
|
+
Object.defineProperty(exports, "SelectedPaymentOption", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.SelectedPaymentOption; } });
|
|
15
|
+
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.Platform; } });
|
|
16
|
+
Object.defineProperty(exports, "Actor", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.Actor; } });
|
|
17
|
+
Object.defineProperty(exports, "IdentityType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_1.IdentityType; } });
|
|
18
|
+
//# sourceMappingURL=bookings-v2-price-info-pricing.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-v2-price-info-pricing.context.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.context.ts"],"names":[],"mappings":";;;AAAA,yGAGoD;AACpD,gEAAiE;AAGpD,QAAA,YAAY,GAEP,IAAA,+BAAgB,EAAC,uDAAkB,CAAC,CAAC;AAC1C,QAAA,cAAc,GAET,IAAA,+BAAgB,EAAC,yDAAoB,CAAC,CAAC;AAEzD,6GAUuD;AATrD,sJAAA,uBAAuB,OAAA;AACvB,2IAAA,YAAY,OAAA;AACZ,wIAAA,SAAS,OAAA;AACT,4IAAA,aAAa,OAAA;AACb,4IAAA,aAAa,OAAA;AACb,oJAAA,qBAAqB,OAAA;AACrB,uIAAA,QAAQ,OAAA;AACR,oIAAA,KAAK,OAAA;AACL,2IAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
/**
|
|
3
|
+
* Previews the base price for a set of line items belonging to the same service
|
|
4
|
+
* before a potential booking is actually created.
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* The returned price preview information about each line
|
|
9
|
+
* item's price and sums up each line item's price.
|
|
10
|
+
*
|
|
11
|
+
* The previewed price is not the actual price that will be used to charge the customer.
|
|
12
|
+
* `Preview Price` only estimates the base price by adding up the price
|
|
13
|
+
* of each line item before
|
|
14
|
+
* the booking is actually created.
|
|
15
|
+
*
|
|
16
|
+
* Use [`Calculate Price`](https://www.wix.com/velo/reference/wix-bookings-v2/pricing/calculateprice) to get the base price
|
|
17
|
+
* after the booking is created.
|
|
18
|
+
*
|
|
19
|
+
* Passing line items that belong to different services results in an error.
|
|
20
|
+
*
|
|
21
|
+
* ## Calculating the previewed price
|
|
22
|
+
*
|
|
23
|
+
* Wix Bookings has its own default pricing logic for previewing the price. You must
|
|
24
|
+
* pass the `serviceId` in the `slot`
|
|
25
|
+
* or `schedule` object to `previewPrice()`.
|
|
26
|
+
*
|
|
27
|
+
* You cannot call `previewPrice()` if you have customized Bookings pricing logic using the
|
|
28
|
+
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin. Calling `previewPrice` if custom pricing
|
|
29
|
+
* logic has been implemented for the site results in an error.
|
|
30
|
+
*/
|
|
31
|
+
export declare function previewPrice(payload: object): RequestOptionsFactory<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Calculates the base price of a booking.
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
* You can call `calculatePrice()` after a booking is created. The returned calculated price includes information about each line
|
|
38
|
+
* item's price and the booking's total price.
|
|
39
|
+
*
|
|
40
|
+
* You can use `previewPrice()` to get the base price
|
|
41
|
+
* before a booking is created.
|
|
42
|
+
*
|
|
43
|
+
* The calculated price is the base price that will be used as a basis for charging the customer.
|
|
44
|
+
* During checkout, additional taxes
|
|
45
|
+
* and fees might be added to this base price.
|
|
46
|
+
*
|
|
47
|
+
* ## Calculating the price
|
|
48
|
+
*
|
|
49
|
+
* Wix Bookings has its own default pricing logic for calculating the price. When
|
|
50
|
+
* using Wix Bookings' default pricing logic, you must pass the `serviceId` in the `slot`
|
|
51
|
+
* or `schedule` object to `calculatePrice()`.
|
|
52
|
+
*
|
|
53
|
+
* Alternatively you can customize the pricing logic using the
|
|
54
|
+
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin.
|
|
55
|
+
* If you integrate with a pricing provider, the customized pricing logic becomes
|
|
56
|
+
* the default logic. This means that, if the Custom Pricing service plugin is implemented,
|
|
57
|
+
* when calling `calculatePrice()`,
|
|
58
|
+
* the customized logic is used instead.
|
|
59
|
+
*/
|
|
60
|
+
export declare function calculatePrice(payload: object): RequestOptionsFactory<any>;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculatePrice = exports.previewPrice = void 0;
|
|
4
|
+
const float_1 = require("@wix/sdk-runtime/transformations/float");
|
|
5
|
+
const float_2 = require("@wix/sdk-runtime/transformations/float");
|
|
6
|
+
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
7
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
8
|
+
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
9
|
+
function resolveComWixpressBookingsPricingBookingsPricingServiceUrl(opts) {
|
|
10
|
+
const domainToMappings = {
|
|
11
|
+
'manage._base_domain_': [
|
|
12
|
+
{
|
|
13
|
+
srcPath: '/_api/bookings-pricing',
|
|
14
|
+
destPath: '',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
srcPath: '/_api/bookings-pricing/v2/price',
|
|
18
|
+
destPath: '/v2/pricing',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
_: [
|
|
22
|
+
{
|
|
23
|
+
srcPath: '/_api/bookings-pricing',
|
|
24
|
+
destPath: '',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
srcPath: '/_api/bookings-pricing/v2/price',
|
|
28
|
+
destPath: '/v2/pricing',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
'www.wixapis.com': [
|
|
32
|
+
{
|
|
33
|
+
srcPath: '/bookings/v2/pricing/v2/pricing',
|
|
34
|
+
destPath: '/v2/pricing',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
srcPath: '/bookings/v2/pricing',
|
|
38
|
+
destPath: '/v2/pricing',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
return (0, rest_modules_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
43
|
+
}
|
|
44
|
+
const PACKAGE_NAME = '@wix/auto_sdk_bookings_pricing';
|
|
45
|
+
/**
|
|
46
|
+
* Previews the base price for a set of line items belonging to the same service
|
|
47
|
+
* before a potential booking is actually created.
|
|
48
|
+
*
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
* The returned price preview information about each line
|
|
52
|
+
* item's price and sums up each line item's price.
|
|
53
|
+
*
|
|
54
|
+
* The previewed price is not the actual price that will be used to charge the customer.
|
|
55
|
+
* `Preview Price` only estimates the base price by adding up the price
|
|
56
|
+
* of each line item before
|
|
57
|
+
* the booking is actually created.
|
|
58
|
+
*
|
|
59
|
+
* Use [`Calculate Price`](https://www.wix.com/velo/reference/wix-bookings-v2/pricing/calculateprice) to get the base price
|
|
60
|
+
* after the booking is created.
|
|
61
|
+
*
|
|
62
|
+
* Passing line items that belong to different services results in an error.
|
|
63
|
+
*
|
|
64
|
+
* ## Calculating the previewed price
|
|
65
|
+
*
|
|
66
|
+
* Wix Bookings has its own default pricing logic for previewing the price. You must
|
|
67
|
+
* pass the `serviceId` in the `slot`
|
|
68
|
+
* or `schedule` object to `previewPrice()`.
|
|
69
|
+
*
|
|
70
|
+
* You cannot call `previewPrice()` if you have customized Bookings pricing logic using the
|
|
71
|
+
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin. Calling `previewPrice` if custom pricing
|
|
72
|
+
* logic has been implemented for the site results in an error.
|
|
73
|
+
*/
|
|
74
|
+
function previewPrice(payload) {
|
|
75
|
+
function __previewPrice({ host }) {
|
|
76
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
77
|
+
{
|
|
78
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
79
|
+
paths: [{ path: 'bookingLineItems.pricePerParticipant' }],
|
|
80
|
+
},
|
|
81
|
+
]);
|
|
82
|
+
const metadata = {
|
|
83
|
+
entityFqdn: 'wix.bookings.v2.price_info',
|
|
84
|
+
method: 'POST',
|
|
85
|
+
methodFqn: 'com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice',
|
|
86
|
+
packageName: PACKAGE_NAME,
|
|
87
|
+
url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
|
|
88
|
+
protoPath: '/v2/pricing/preview',
|
|
89
|
+
data: serializedData,
|
|
90
|
+
host,
|
|
91
|
+
}),
|
|
92
|
+
data: serializedData,
|
|
93
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
94
|
+
{
|
|
95
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
96
|
+
paths: [
|
|
97
|
+
{ path: 'priceInfo.calculatedPrice' },
|
|
98
|
+
{ path: 'priceInfo.deposit' },
|
|
99
|
+
{ path: 'priceInfo.bookingLineItems.pricePerParticipant' },
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
]),
|
|
103
|
+
};
|
|
104
|
+
return metadata;
|
|
105
|
+
}
|
|
106
|
+
return __previewPrice;
|
|
107
|
+
}
|
|
108
|
+
exports.previewPrice = previewPrice;
|
|
109
|
+
/**
|
|
110
|
+
* Calculates the base price of a booking.
|
|
111
|
+
*
|
|
112
|
+
*
|
|
113
|
+
*
|
|
114
|
+
* You can call `calculatePrice()` after a booking is created. The returned calculated price includes information about each line
|
|
115
|
+
* item's price and the booking's total price.
|
|
116
|
+
*
|
|
117
|
+
* You can use `previewPrice()` to get the base price
|
|
118
|
+
* before a booking is created.
|
|
119
|
+
*
|
|
120
|
+
* The calculated price is the base price that will be used as a basis for charging the customer.
|
|
121
|
+
* During checkout, additional taxes
|
|
122
|
+
* and fees might be added to this base price.
|
|
123
|
+
*
|
|
124
|
+
* ## Calculating the price
|
|
125
|
+
*
|
|
126
|
+
* Wix Bookings has its own default pricing logic for calculating the price. When
|
|
127
|
+
* using Wix Bookings' default pricing logic, you must pass the `serviceId` in the `slot`
|
|
128
|
+
* or `schedule` object to `calculatePrice()`.
|
|
129
|
+
*
|
|
130
|
+
* Alternatively you can customize the pricing logic using the
|
|
131
|
+
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin.
|
|
132
|
+
* If you integrate with a pricing provider, the customized pricing logic becomes
|
|
133
|
+
* the default logic. This means that, if the Custom Pricing service plugin is implemented,
|
|
134
|
+
* when calling `calculatePrice()`,
|
|
135
|
+
* the customized logic is used instead.
|
|
136
|
+
*/
|
|
137
|
+
function calculatePrice(payload) {
|
|
138
|
+
function __calculatePrice({ host }) {
|
|
139
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
140
|
+
{
|
|
141
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
142
|
+
paths: [
|
|
143
|
+
{ path: 'booking.createdDate' },
|
|
144
|
+
{ path: 'booking.startDate' },
|
|
145
|
+
{ path: 'booking.endDate' },
|
|
146
|
+
{ path: 'booking.updatedDate' },
|
|
147
|
+
{ path: 'booking.canceledDate' },
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
152
|
+
paths: [
|
|
153
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.latitude' },
|
|
154
|
+
{ path: 'booking.contactDetails.fullAddress.geocode.longitude' },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
]);
|
|
158
|
+
const metadata = {
|
|
159
|
+
entityFqdn: 'wix.bookings.v2.price_info',
|
|
160
|
+
method: 'POST',
|
|
161
|
+
methodFqn: 'com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice',
|
|
162
|
+
packageName: PACKAGE_NAME,
|
|
163
|
+
url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
|
|
164
|
+
protoPath: '/v2/pricing/calculate',
|
|
165
|
+
data: serializedData,
|
|
166
|
+
host,
|
|
167
|
+
}),
|
|
168
|
+
data: serializedData,
|
|
169
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
170
|
+
{
|
|
171
|
+
transformFn: float_2.transformRESTFloatToSDKFloat,
|
|
172
|
+
paths: [
|
|
173
|
+
{ path: 'priceInfo.calculatedPrice' },
|
|
174
|
+
{ path: 'priceInfo.deposit' },
|
|
175
|
+
{ path: 'priceInfo.bookingLineItems.pricePerParticipant' },
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
]),
|
|
179
|
+
};
|
|
180
|
+
return metadata;
|
|
181
|
+
}
|
|
182
|
+
return __calculatePrice;
|
|
183
|
+
}
|
|
184
|
+
exports.calculatePrice = calculatePrice;
|
|
185
|
+
//# sourceMappingURL=bookings-v2-price-info-pricing.http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-v2-price-info-pricing.http.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.http.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as ambassadorWixBookingsV2PriceInfoTypes from './bookings-v2-price-info-pricing.types.js';
|
|
2
|
+
import * as ambassadorWixBookingsV2PriceInfoUniversalTypes from './bookings-v2-price-info-pricing.universal.js';
|
|
3
|
+
export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
4
|
+
getUrl: (context: any) => string;
|
|
5
|
+
httpMethod: K;
|
|
6
|
+
path: string;
|
|
7
|
+
pathParams: M;
|
|
8
|
+
__requestType: T;
|
|
9
|
+
__originalRequestType: S;
|
|
10
|
+
__responseType: Q;
|
|
11
|
+
__originalResponseType: R;
|
|
12
|
+
};
|
|
13
|
+
export declare function previewPrice(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceRequest, ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceRequest, ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceResponse & ambassadorWixBookingsV2PriceInfoUniversalTypes.PreviewPriceResponseNonNullableFields, ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponse & ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponseNonNullableFields>;
|
|
14
|
+
export declare function calculatePrice(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceRequest, ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceRequest, ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponse & ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponseNonNullableFields, ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponse & ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponseNonNullableFields>;
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.calculatePrice = exports.previewPrice = void 0;
|
|
27
|
+
const ambassadorWixBookingsV2PriceInfo = __importStar(require("./bookings-v2-price-info-pricing.http.js"));
|
|
28
|
+
function previewPrice() {
|
|
29
|
+
const payload = {};
|
|
30
|
+
const getRequestOptions = ambassadorWixBookingsV2PriceInfo.previewPrice(payload);
|
|
31
|
+
const getUrl = (context) => {
|
|
32
|
+
const { url } = getRequestOptions(context);
|
|
33
|
+
return url;
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
getUrl,
|
|
37
|
+
httpMethod: 'POST',
|
|
38
|
+
path: '/v2/pricing/preview',
|
|
39
|
+
pathParams: {},
|
|
40
|
+
__requestType: null,
|
|
41
|
+
__originalRequestType: null,
|
|
42
|
+
__responseType: null,
|
|
43
|
+
__originalResponseType: null,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.previewPrice = previewPrice;
|
|
47
|
+
function calculatePrice() {
|
|
48
|
+
const payload = {};
|
|
49
|
+
const getRequestOptions = ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);
|
|
50
|
+
const getUrl = (context) => {
|
|
51
|
+
const { url } = getRequestOptions(context);
|
|
52
|
+
return url;
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
getUrl,
|
|
56
|
+
httpMethod: 'POST',
|
|
57
|
+
path: '/v2/pricing/calculate',
|
|
58
|
+
pathParams: {},
|
|
59
|
+
__requestType: null,
|
|
60
|
+
__originalRequestType: null,
|
|
61
|
+
__responseType: null,
|
|
62
|
+
__originalResponseType: null,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.calculatePrice = calculatePrice;
|
|
66
|
+
//# sourceMappingURL=bookings-v2-price-info-pricing.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-v2-price-info-pricing.meta.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2GAA6F;AAsB7F,SAAgB,YAAY;IAU1B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,gCAAgC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,oCA8BC;AAED,SAAgB,cAAc;IAU5B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,gCAAgC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAE3D,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,uBAAuB;QAC7B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,wCA8BC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { HttpClient } from '@wix/sdk-types';
|
|
2
|
+
import { Booking, BookingLineItem, CalculatePriceResponse, CalculatePriceResponseNonNullableFields, PreviewPriceResponse, PreviewPriceResponseNonNullableFields } from './bookings-v2-price-info-pricing.universal.js';
|
|
3
|
+
export declare const __metadata: {
|
|
4
|
+
PACKAGE_NAME: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function previewPrice(httpClient: HttpClient): PreviewPriceSignature;
|
|
7
|
+
interface PreviewPriceSignature {
|
|
8
|
+
/**
|
|
9
|
+
* Previews the base price for a set of line items belonging to the same service
|
|
10
|
+
* before a potential booking is actually created.
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* The returned price preview information about each line
|
|
15
|
+
* item's price and sums up each line item's price.
|
|
16
|
+
*
|
|
17
|
+
* The previewed price is not the actual price that will be used to charge the customer.
|
|
18
|
+
* `Preview Price` only estimates the base price by adding up the price
|
|
19
|
+
* of each line item before
|
|
20
|
+
* the booking is actually created.
|
|
21
|
+
*
|
|
22
|
+
* Use [`Calculate Price`](https://www.wix.com/velo/reference/wix-bookings-v2/pricing/calculateprice) to get the base price
|
|
23
|
+
* after the booking is created.
|
|
24
|
+
*
|
|
25
|
+
* Passing line items that belong to different services results in an error.
|
|
26
|
+
*
|
|
27
|
+
* ## Calculating the previewed price
|
|
28
|
+
*
|
|
29
|
+
* Wix Bookings has its own default pricing logic for previewing the price. You must
|
|
30
|
+
* pass the `serviceId` in the `slot`
|
|
31
|
+
* or `schedule` object to `previewPrice()`.
|
|
32
|
+
*
|
|
33
|
+
* You cannot call `previewPrice()` if you have customized Bookings pricing logic using the
|
|
34
|
+
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin. Calling `previewPrice` if custom pricing
|
|
35
|
+
* logic has been implemented for the site results in an error.
|
|
36
|
+
* @param - List of line items to preview the price for.
|
|
37
|
+
*/
|
|
38
|
+
(bookingLineItems: BookingLineItem[]): Promise<PreviewPriceResponse & PreviewPriceResponseNonNullableFields>;
|
|
39
|
+
}
|
|
40
|
+
export declare function calculatePrice(httpClient: HttpClient): CalculatePriceSignature;
|
|
41
|
+
interface CalculatePriceSignature {
|
|
42
|
+
/**
|
|
43
|
+
* Calculates the base price of a booking.
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
* You can call `calculatePrice()` after a booking is created. The returned calculated price includes information about each line
|
|
48
|
+
* item's price and the booking's total price.
|
|
49
|
+
*
|
|
50
|
+
* You can use `previewPrice()` to get the base price
|
|
51
|
+
* before a booking is created.
|
|
52
|
+
*
|
|
53
|
+
* The calculated price is the base price that will be used as a basis for charging the customer.
|
|
54
|
+
* During checkout, additional taxes
|
|
55
|
+
* and fees might be added to this base price.
|
|
56
|
+
*
|
|
57
|
+
* ## Calculating the price
|
|
58
|
+
*
|
|
59
|
+
* Wix Bookings has its own default pricing logic for calculating the price. When
|
|
60
|
+
* using Wix Bookings' default pricing logic, you must pass the `serviceId` in the `slot`
|
|
61
|
+
* or `schedule` object to `calculatePrice()`.
|
|
62
|
+
*
|
|
63
|
+
* Alternatively you can customize the pricing logic using the
|
|
64
|
+
* [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin.
|
|
65
|
+
* If you integrate with a pricing provider, the customized pricing logic becomes
|
|
66
|
+
* the default logic. This means that, if the Custom Pricing service plugin is implemented,
|
|
67
|
+
* when calling `calculatePrice()`,
|
|
68
|
+
* the customized logic is used instead.
|
|
69
|
+
* @param - Booking to calculate the price for.
|
|
70
|
+
*/
|
|
71
|
+
(booking: Booking): Promise<CalculatePriceResponse & CalculatePriceResponseNonNullableFields>;
|
|
72
|
+
}
|
|
73
|
+
export { Actor, Address, AddressLocation, AddressStreetOneOf, BookedEntity, BookedEntityItemOneOf, BookedResource, BookedSchedule, BookedSlot, Booking, BookingLineItem, BookingParticipantsInfoOneOf, BookingSource, BookingStatus, CalculatePriceRequest, CalculatePriceResponse, CalculatePriceResponseNonNullableFields, ContactDetails, CustomFormField, Duration, ExtendedFields, FlowControlSettings, IdentificationData, IdentificationDataIdOneOf, IdentityType, Location, LocationType, MultiServiceBookingInfo, MultiServiceBookingType, ParticipantChoices, ParticipantNotification, PaymentStatus, Platform, PreviewPriceRequest, PreviewPriceResponse, PreviewPriceResponseNonNullableFields, PriceDescriptionInfo, PriceInfo, PriceInfoTotalPriceOneOf, SelectedPaymentOption, ServiceChoice, ServiceChoiceChoiceOneOf, ServiceChoices, StreetAddress, Subdivision, ValueType, } from './bookings-v2-price-info-pricing.universal.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValueType = exports.SelectedPaymentOption = exports.Platform = exports.PaymentStatus = exports.MultiServiceBookingType = exports.LocationType = exports.IdentityType = exports.BookingStatus = exports.Actor = exports.calculatePrice = exports.previewPrice = exports.__metadata = void 0;
|
|
4
|
+
const bookings_v2_price_info_pricing_universal_js_1 = require("./bookings-v2-price-info-pricing.universal.js");
|
|
5
|
+
exports.__metadata = { PACKAGE_NAME: '@wix/bookings' };
|
|
6
|
+
function previewPrice(httpClient) {
|
|
7
|
+
return (bookingLineItems) => (0, bookings_v2_price_info_pricing_universal_js_1.previewPrice)(bookingLineItems,
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
{ httpClient });
|
|
10
|
+
}
|
|
11
|
+
exports.previewPrice = previewPrice;
|
|
12
|
+
function calculatePrice(httpClient) {
|
|
13
|
+
return (booking) => (0, bookings_v2_price_info_pricing_universal_js_1.calculatePrice)(booking,
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
{ httpClient });
|
|
16
|
+
}
|
|
17
|
+
exports.calculatePrice = calculatePrice;
|
|
18
|
+
var bookings_v2_price_info_pricing_universal_js_2 = require("./bookings-v2-price-info-pricing.universal.js");
|
|
19
|
+
Object.defineProperty(exports, "Actor", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.Actor; } });
|
|
20
|
+
Object.defineProperty(exports, "BookingStatus", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.BookingStatus; } });
|
|
21
|
+
Object.defineProperty(exports, "IdentityType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.IdentityType; } });
|
|
22
|
+
Object.defineProperty(exports, "LocationType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.LocationType; } });
|
|
23
|
+
Object.defineProperty(exports, "MultiServiceBookingType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.MultiServiceBookingType; } });
|
|
24
|
+
Object.defineProperty(exports, "PaymentStatus", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.PaymentStatus; } });
|
|
25
|
+
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.Platform; } });
|
|
26
|
+
Object.defineProperty(exports, "SelectedPaymentOption", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.SelectedPaymentOption; } });
|
|
27
|
+
Object.defineProperty(exports, "ValueType", { enumerable: true, get: function () { return bookings_v2_price_info_pricing_universal_js_2.ValueType; } });
|
|
28
|
+
//# sourceMappingURL=bookings-v2-price-info-pricing.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-v2-price-info-pricing.public.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.public.ts"],"names":[],"mappings":";;;AACA,+GASuD;AAE1C,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAE5D,SAAgB,YAAY,CAAC,UAAsB;IACjD,OAAO,CAAC,gBAAmC,EAAE,EAAE,CAC7C,IAAA,0DAAqB,EACnB,gBAAgB;IAChB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,oCAOC;AAsCD,SAAgB,cAAc,CAC5B,UAAsB;IAEtB,OAAO,CAAC,OAAgB,EAAE,EAAE,CAC1B,IAAA,4DAAuB,EACrB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,wCASC;AAqCD,6GA+CuD;AA9CrD,oIAAA,KAAK,OAAA;AAaL,4IAAA,aAAa,OAAA;AAWb,2IAAA,YAAY,OAAA;AAEZ,2IAAA,YAAY,OAAA;AAEZ,sJAAA,uBAAuB,OAAA;AAGvB,4IAAA,aAAa,OAAA;AACb,uIAAA,QAAQ,OAAA;AAOR,oJAAA,qBAAqB,OAAA;AAMrB,wIAAA,SAAS,OAAA"}
|