@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.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
  11. package/build/cjs/src/bookings-v2-price-info-pricing.context.js +18 -0
  12. package/build/cjs/src/bookings-v2-price-info-pricing.context.js.map +1 -0
  13. package/build/cjs/src/bookings-v2-price-info-pricing.http.d.ts +60 -0
  14. package/build/cjs/src/bookings-v2-price-info-pricing.http.js +185 -0
  15. package/build/cjs/src/bookings-v2-price-info-pricing.http.js.map +1 -0
  16. package/build/cjs/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
  17. package/build/cjs/src/bookings-v2-price-info-pricing.meta.js +66 -0
  18. package/build/cjs/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
  19. package/build/cjs/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
  20. package/build/cjs/src/bookings-v2-price-info-pricing.public.js +28 -0
  21. package/build/cjs/src/bookings-v2-price-info-pricing.public.js.map +1 -0
  22. package/build/cjs/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
  23. package/build/cjs/src/bookings-v2-price-info-pricing.types.js +133 -0
  24. package/build/cjs/src/bookings-v2-price-info-pricing.types.js.map +1 -0
  25. package/build/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +869 -0
  26. package/build/cjs/src/bookings-v2-price-info-pricing.universal.js +298 -0
  27. package/build/cjs/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
  39. package/build/es/src/bookings-v2-price-info-pricing.context.js +6 -0
  40. package/build/es/src/bookings-v2-price-info-pricing.context.js.map +1 -0
  41. package/build/es/src/bookings-v2-price-info-pricing.http.d.ts +60 -0
  42. package/build/es/src/bookings-v2-price-info-pricing.http.js +180 -0
  43. package/build/es/src/bookings-v2-price-info-pricing.http.js.map +1 -0
  44. package/build/es/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
  45. package/build/es/src/bookings-v2-price-info-pricing.meta.js +38 -0
  46. package/build/es/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
  47. package/build/es/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
  48. package/build/es/src/bookings-v2-price-info-pricing.public.js +14 -0
  49. package/build/es/src/bookings-v2-price-info-pricing.public.js.map +1 -0
  50. package/build/es/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
  51. package/build/es/src/bookings-v2-price-info-pricing.types.js +130 -0
  52. package/build/es/src/bookings-v2-price-info-pricing.types.js.map +1 -0
  53. package/build/es/src/bookings-v2-price-info-pricing.universal.d.ts +869 -0
  54. package/build/es/src/bookings-v2-price-info-pricing.universal.js +270 -0
  55. package/build/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
  66. package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.js +18 -0
  67. package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.js.map +1 -0
  68. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.d.ts +60 -0
  69. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js +185 -0
  70. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js.map +1 -0
  71. package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
  72. package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.js +66 -0
  73. package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
  74. package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
  75. package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js +28 -0
  76. package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js.map +1 -0
  77. package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
  78. package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js +133 -0
  79. package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js.map +1 -0
  80. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +869 -0
  81. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js +298 -0
  82. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/bookings-v2-price-info-pricing.context.d.ts +6 -0
  93. package/build/internal/es/src/bookings-v2-price-info-pricing.context.js +6 -0
  94. package/build/internal/es/src/bookings-v2-price-info-pricing.context.js.map +1 -0
  95. package/build/internal/es/src/bookings-v2-price-info-pricing.http.d.ts +60 -0
  96. package/build/internal/es/src/bookings-v2-price-info-pricing.http.js +180 -0
  97. package/build/internal/es/src/bookings-v2-price-info-pricing.http.js.map +1 -0
  98. package/build/internal/es/src/bookings-v2-price-info-pricing.meta.d.ts +14 -0
  99. package/build/internal/es/src/bookings-v2-price-info-pricing.meta.js +38 -0
  100. package/build/internal/es/src/bookings-v2-price-info-pricing.meta.js.map +1 -0
  101. package/build/internal/es/src/bookings-v2-price-info-pricing.public.d.ts +73 -0
  102. package/build/internal/es/src/bookings-v2-price-info-pricing.public.js +14 -0
  103. package/build/internal/es/src/bookings-v2-price-info-pricing.public.js.map +1 -0
  104. package/build/internal/es/src/bookings-v2-price-info-pricing.types.d.ts +773 -0
  105. package/build/internal/es/src/bookings-v2-price-info-pricing.types.js +130 -0
  106. package/build/internal/es/src/bookings-v2-price-info-pricing.types.js.map +1 -0
  107. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.d.ts +869 -0
  108. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js +270 -0
  109. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,270 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
+ import * as ambassadorWixBookingsV2PriceInfo from './bookings-v2-price-info-pricing.http.js';
4
+ /**
5
+ * A multi-service booking is considered available if all individual bookings are available as returned from List Multi Service Availability Time Slots.
6
+ * Currently, `SEPARATE_BOOKINGS` and `PARALLEL_BOOKINGS` are not supported.
7
+ * Multi-service booking is available if each of its bookings is available separately.
8
+ * For `SEQUENTIAL_BOOKINGS`, see `List Multi Service Availability Time Slots` documentation.
9
+ */
10
+ export var MultiServiceBookingType;
11
+ (function (MultiServiceBookingType) {
12
+ MultiServiceBookingType["SEQUENTIAL_BOOKINGS"] = "SEQUENTIAL_BOOKINGS";
13
+ MultiServiceBookingType["SEPARATE_BOOKINGS"] = "SEPARATE_BOOKINGS";
14
+ MultiServiceBookingType["PARALLEL_BOOKINGS"] = "PARALLEL_BOOKINGS";
15
+ })(MultiServiceBookingType || (MultiServiceBookingType = {}));
16
+ export var LocationType;
17
+ (function (LocationType) {
18
+ LocationType["UNDEFINED"] = "UNDEFINED";
19
+ LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
20
+ LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
21
+ LocationType["CUSTOM"] = "CUSTOM";
22
+ })(LocationType || (LocationType = {}));
23
+ export var ValueType;
24
+ (function (ValueType) {
25
+ /** Short text. This is the default value type. */
26
+ ValueType["SHORT_TEXT"] = "SHORT_TEXT";
27
+ /** Long text. */
28
+ ValueType["LONG_TEXT"] = "LONG_TEXT";
29
+ /** A text that represents the check box value. If selected the value is `true`, otherwise `false`. */
30
+ ValueType["CHECK_BOX"] = "CHECK_BOX";
31
+ })(ValueType || (ValueType = {}));
32
+ /** Booking status. */
33
+ export var BookingStatus;
34
+ (function (BookingStatus) {
35
+ /**
36
+ * The booking was created, but the customer hasn't completed the related
37
+ * eCommerce order yet.
38
+ */
39
+ BookingStatus["CREATED"] = "CREATED";
40
+ /**
41
+ * The merchant has confirmed the booking and it appears in the
42
+ * business calendar. Merchants can set up their services
43
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/setup) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/services/services-v2/introduction))
44
+ * to automatically confirm all `PENDING` bookings.
45
+ */
46
+ BookingStatus["CONFIRMED"] = "CONFIRMED";
47
+ /**
48
+ * The customer has canceled the booking. Depending on the relevant service's
49
+ * policy snapshot
50
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-policy-snapshots/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/policies/booking-policy-snapshots/introduction))
51
+ * they may have to pay a cancellation fee
52
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/booking-fees/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/booking-fees/introduction)).
53
+ */
54
+ BookingStatus["CANCELED"] = "CANCELED";
55
+ /**
56
+ * The merchant must manually confirm the booking before it appears
57
+ * in the business calendar.
58
+ */
59
+ BookingStatus["PENDING"] = "PENDING";
60
+ /** The merchant has declined the booking before the customer was charged. */
61
+ BookingStatus["DECLINED"] = "DECLINED";
62
+ /**
63
+ * The booking is on a waitlist.
64
+ * Currently, you can't call Register to Waitlist
65
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/waitlist/register-to-waitlist))
66
+ * for course or appointment bookings, even though this is supported in live sites.
67
+ * You can call Register to Waitlist only for class session bookings.
68
+ */
69
+ BookingStatus["WAITING_LIST"] = "WAITING_LIST";
70
+ })(BookingStatus || (BookingStatus = {}));
71
+ /**
72
+ * Payment status.
73
+ * Automatically updated when using eCommerce checkout APIs.
74
+ */
75
+ export var PaymentStatus;
76
+ (function (PaymentStatus) {
77
+ /** Undefined payment status. */
78
+ PaymentStatus["UNDEFINED"] = "UNDEFINED";
79
+ /** The booking isn't paid. */
80
+ PaymentStatus["NOT_PAID"] = "NOT_PAID";
81
+ /** The booking is fully paid. */
82
+ PaymentStatus["PAID"] = "PAID";
83
+ /** The booking is partially paid. */
84
+ PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
85
+ /** The booking is refunded. */
86
+ PaymentStatus["REFUNDED"] = "REFUNDED";
87
+ /** The booking is free of charge. */
88
+ PaymentStatus["EXEMPT"] = "EXEMPT";
89
+ })(PaymentStatus || (PaymentStatus = {}));
90
+ /**
91
+ * Selected payment option.
92
+ *
93
+ * One of the payment options offered by the service.
94
+ * This field is set when the user selects an option during booking.
95
+ * If left undefined, the payment option is resolved by the service configuration on checkout.
96
+ */
97
+ export var SelectedPaymentOption;
98
+ (function (SelectedPaymentOption) {
99
+ /** Undefined payment option. */
100
+ SelectedPaymentOption["UNDEFINED"] = "UNDEFINED";
101
+ /** Offline payment. */
102
+ SelectedPaymentOption["OFFLINE"] = "OFFLINE";
103
+ /** Online payment. */
104
+ SelectedPaymentOption["ONLINE"] = "ONLINE";
105
+ /** Payment using a Wix Pricing Plan. */
106
+ SelectedPaymentOption["MEMBERSHIP"] = "MEMBERSHIP";
107
+ /**
108
+ * Customers can pay only in person with a Wix Pricing Plan, while the Wix user
109
+ * must manually redeem the pricing plan in the dashboard.
110
+ */
111
+ SelectedPaymentOption["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
112
+ })(SelectedPaymentOption || (SelectedPaymentOption = {}));
113
+ export var Platform;
114
+ (function (Platform) {
115
+ Platform["UNDEFINED_PLATFORM"] = "UNDEFINED_PLATFORM";
116
+ Platform["WEB"] = "WEB";
117
+ Platform["MOBILE_APP"] = "MOBILE_APP";
118
+ })(Platform || (Platform = {}));
119
+ export var Actor;
120
+ (function (Actor) {
121
+ Actor["UNDEFINED_ACTOR"] = "UNDEFINED_ACTOR";
122
+ Actor["BUSINESS"] = "BUSINESS";
123
+ Actor["CUSTOMER"] = "CUSTOMER";
124
+ })(Actor || (Actor = {}));
125
+ export var IdentityType;
126
+ (function (IdentityType) {
127
+ IdentityType["UNKNOWN"] = "UNKNOWN";
128
+ IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
129
+ IdentityType["MEMBER"] = "MEMBER";
130
+ IdentityType["WIX_USER"] = "WIX_USER";
131
+ IdentityType["APP"] = "APP";
132
+ })(IdentityType || (IdentityType = {}));
133
+ /**
134
+ * Previews the base price for a set of line items belonging to the same service
135
+ * before a potential booking is actually created.
136
+ *
137
+ *
138
+ *
139
+ * The returned price preview information about each line
140
+ * item's price and sums up each line item's price.
141
+ *
142
+ * The previewed price is not the actual price that will be used to charge the customer.
143
+ * `Preview Price` only estimates the base price by adding up the price
144
+ * of each line item before
145
+ * the booking is actually created.
146
+ *
147
+ * Use [`Calculate Price`](https://www.wix.com/velo/reference/wix-bookings-v2/pricing/calculateprice) to get the base price
148
+ * after the booking is created.
149
+ *
150
+ * Passing line items that belong to different services results in an error.
151
+ *
152
+ * ## Calculating the previewed price
153
+ *
154
+ * Wix Bookings has its own default pricing logic for previewing the price. You must
155
+ * pass the `serviceId` in the `slot`
156
+ * or `schedule` object to `previewPrice()`.
157
+ *
158
+ * You cannot call `previewPrice()` if you have customized Bookings pricing logic using the
159
+ * [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
160
+ * logic has been implemented for the site results in an error.
161
+ * @param bookingLineItems - List of line items to preview the price for.
162
+ * @public
163
+ * @documentationMaturity preview
164
+ * @requiredField bookingLineItems
165
+ * @permissionId BOOKINGS.PRICE_PREVIEW
166
+ * @permissionScope Manage Bookings Services and Settings
167
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
168
+ * @permissionScope Manage Bookings
169
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
170
+ * @permissionScope Read Bookings - Including Participants
171
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
172
+ * @permissionScope Read Bookings - all read permissions
173
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
174
+ * @permissionScope Manage Bookings - all permissions
175
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
176
+ * @applicableIdentity APP
177
+ * @applicableIdentity VISITOR
178
+ * @fqn com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice
179
+ */
180
+ export async function previewPrice(bookingLineItems) {
181
+ // @ts-ignore
182
+ const { httpClient, sideEffects } = arguments[1];
183
+ const payload = renameKeysFromSDKRequestToRESTRequest({
184
+ bookingLineItems: bookingLineItems,
185
+ });
186
+ const reqOpts = ambassadorWixBookingsV2PriceInfo.previewPrice(payload);
187
+ sideEffects?.onSiteCall?.();
188
+ try {
189
+ const result = await httpClient.request(reqOpts);
190
+ sideEffects?.onSuccess?.(result);
191
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
192
+ }
193
+ catch (err) {
194
+ const transformedError = sdkTransformError(err, {
195
+ spreadPathsToArguments: {},
196
+ explicitPathsToArguments: { bookingLineItems: '$[0]' },
197
+ singleArgumentUnchanged: false,
198
+ }, ['bookingLineItems']);
199
+ sideEffects?.onError?.(err);
200
+ throw transformedError;
201
+ }
202
+ }
203
+ /**
204
+ * Calculates the base price of a booking.
205
+ *
206
+ *
207
+ *
208
+ * You can call `calculatePrice()` after a booking is created. The returned calculated price includes information about each line
209
+ * item's price and the booking's total price.
210
+ *
211
+ * You can use `previewPrice()` to get the base price
212
+ * before a booking is created.
213
+ *
214
+ * The calculated price is the base price that will be used as a basis for charging the customer.
215
+ * During checkout, additional taxes
216
+ * and fees might be added to this base price.
217
+ *
218
+ * ## Calculating the price
219
+ *
220
+ * Wix Bookings has its own default pricing logic for calculating the price. When
221
+ * using Wix Bookings' default pricing logic, you must pass the `serviceId` in the `slot`
222
+ * or `schedule` object to `calculatePrice()`.
223
+ *
224
+ * Alternatively you can customize the pricing logic using the
225
+ * [BookingsCustomPricing](https://dev.wix.com/docs/velo/api-reference/wix-bookings-v2/service-plugins-spis/bookings-custom-pricing/introduction) service plugin.
226
+ * If you integrate with a pricing provider, the customized pricing logic becomes
227
+ * the default logic. This means that, if the Custom Pricing service plugin is implemented,
228
+ * when calling `calculatePrice()`,
229
+ * the customized logic is used instead.
230
+ * @param booking - Booking to calculate the price for.
231
+ * @public
232
+ * @documentationMaturity preview
233
+ * @requiredField booking
234
+ * @permissionId BOOKINGS.PRICE_CALCULATE
235
+ * @permissionScope Manage Bookings Services and Settings
236
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
237
+ * @permissionScope Manage Bookings
238
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
239
+ * @permissionScope Read Bookings - Including Participants
240
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
241
+ * @permissionScope Read Bookings - all read permissions
242
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
243
+ * @permissionScope Manage Bookings - all permissions
244
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
245
+ * @applicableIdentity APP
246
+ * @applicableIdentity VISITOR
247
+ * @fqn com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice
248
+ */
249
+ export async function calculatePrice(booking) {
250
+ // @ts-ignore
251
+ const { httpClient, sideEffects } = arguments[1];
252
+ const payload = renameKeysFromSDKRequestToRESTRequest({ booking: booking });
253
+ const reqOpts = ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);
254
+ sideEffects?.onSiteCall?.();
255
+ try {
256
+ const result = await httpClient.request(reqOpts);
257
+ sideEffects?.onSuccess?.(result);
258
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
259
+ }
260
+ catch (err) {
261
+ const transformedError = sdkTransformError(err, {
262
+ spreadPathsToArguments: {},
263
+ explicitPathsToArguments: { booking: '$[0]' },
264
+ singleArgumentUnchanged: false,
265
+ }, ['booking']);
266
+ sideEffects?.onError?.(err);
267
+ throw transformedError;
268
+ }
269
+ }
270
+ //# sourceMappingURL=bookings-v2-price-info-pricing.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bookings-v2-price-info-pricing.universal.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info-pricing.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAA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/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;YAC7C,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
@@ -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":";;;AAAA,kEAAsF;AACtF,kEAAsF;AACtF,0EAAkG;AAClG,sFAAkF;AAClF,gEAA2D;AAI3D,SAAS,0DAA0D,CACjE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE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