@wix/auto_sdk_bookings_pricing 1.0.18 → 1.0.19

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 (129) hide show
  1. package/build/{cjs/src/bookings-v2-price-info-pricing.types.d.ts → bookings-v2-price-info-pricing.universal-Bg2-I7Zy.d.mts} +63 -63
  2. package/build/{internal/cjs/src/bookings-v2-price-info-pricing.types.d.ts → bookings-v2-price-info-pricing.universal-Bg2-I7Zy.d.ts} +63 -63
  3. package/build/{internal/es/src/bookings-v2-price-info-pricing.public.d.ts → index.d.mts} +11 -8
  4. package/build/{internal/cjs/src/bookings-v2-price-info-pricing.public.d.ts → index.d.ts} +11 -8
  5. package/build/index.js +314 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +280 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/{es/src/bookings-v2-price-info-pricing.types.d.ts → internal/bookings-v2-price-info-pricing.universal-Bg2-I7Zy.d.mts} +63 -63
  10. package/build/internal/{es/src/bookings-v2-price-info-pricing.types.d.ts → bookings-v2-price-info-pricing.universal-Bg2-I7Zy.d.ts} +63 -63
  11. package/build/{cjs/src/bookings-v2-price-info-pricing.public.d.ts → internal/index.d.mts} +11 -8
  12. package/build/{es/src/bookings-v2-price-info-pricing.public.d.ts → internal/index.d.ts} +11 -8
  13. package/build/internal/index.js +314 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +280 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +803 -0
  18. package/build/internal/meta.d.ts +803 -0
  19. package/build/internal/meta.js +194 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +166 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +803 -0
  24. package/build/meta.d.ts +803 -0
  25. package/build/meta.js +194 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +166 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/bookings-v2-price-info-pricing.context.d.ts +0 -6
  40. package/build/cjs/src/bookings-v2-price-info-pricing.context.js +0 -18
  41. package/build/cjs/src/bookings-v2-price-info-pricing.context.js.map +0 -1
  42. package/build/cjs/src/bookings-v2-price-info-pricing.http.d.ts +0 -59
  43. package/build/cjs/src/bookings-v2-price-info-pricing.http.js +0 -184
  44. package/build/cjs/src/bookings-v2-price-info-pricing.http.js.map +0 -1
  45. package/build/cjs/src/bookings-v2-price-info-pricing.meta.d.ts +0 -14
  46. package/build/cjs/src/bookings-v2-price-info-pricing.meta.js +0 -66
  47. package/build/cjs/src/bookings-v2-price-info-pricing.meta.js.map +0 -1
  48. package/build/cjs/src/bookings-v2-price-info-pricing.public.js +0 -28
  49. package/build/cjs/src/bookings-v2-price-info-pricing.public.js.map +0 -1
  50. package/build/cjs/src/bookings-v2-price-info-pricing.types.js +0 -133
  51. package/build/cjs/src/bookings-v2-price-info-pricing.types.js.map +0 -1
  52. package/build/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +0 -1025
  53. package/build/cjs/src/bookings-v2-price-info-pricing.universal.js +0 -303
  54. package/build/cjs/src/bookings-v2-price-info-pricing.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/src/bookings-v2-price-info-pricing.context.d.ts +0 -6
  65. package/build/es/src/bookings-v2-price-info-pricing.context.js +0 -6
  66. package/build/es/src/bookings-v2-price-info-pricing.context.js.map +0 -1
  67. package/build/es/src/bookings-v2-price-info-pricing.http.d.ts +0 -59
  68. package/build/es/src/bookings-v2-price-info-pricing.http.js +0 -179
  69. package/build/es/src/bookings-v2-price-info-pricing.http.js.map +0 -1
  70. package/build/es/src/bookings-v2-price-info-pricing.meta.d.ts +0 -14
  71. package/build/es/src/bookings-v2-price-info-pricing.meta.js +0 -38
  72. package/build/es/src/bookings-v2-price-info-pricing.meta.js.map +0 -1
  73. package/build/es/src/bookings-v2-price-info-pricing.public.js +0 -14
  74. package/build/es/src/bookings-v2-price-info-pricing.public.js.map +0 -1
  75. package/build/es/src/bookings-v2-price-info-pricing.types.js +0 -130
  76. package/build/es/src/bookings-v2-price-info-pricing.types.js.map +0 -1
  77. package/build/es/src/bookings-v2-price-info-pricing.universal.d.ts +0 -1025
  78. package/build/es/src/bookings-v2-price-info-pricing.universal.js +0 -275
  79. package/build/es/src/bookings-v2-price-info-pricing.universal.js.map +0 -1
  80. package/build/internal/cjs/index.d.ts +0 -1
  81. package/build/internal/cjs/index.js +0 -18
  82. package/build/internal/cjs/index.js.map +0 -1
  83. package/build/internal/cjs/index.typings.d.ts +0 -1
  84. package/build/internal/cjs/index.typings.js +0 -18
  85. package/build/internal/cjs/index.typings.js.map +0 -1
  86. package/build/internal/cjs/meta.d.ts +0 -1
  87. package/build/internal/cjs/meta.js +0 -18
  88. package/build/internal/cjs/meta.js.map +0 -1
  89. package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.d.ts +0 -6
  90. package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.js +0 -18
  91. package/build/internal/cjs/src/bookings-v2-price-info-pricing.context.js.map +0 -1
  92. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.d.ts +0 -59
  93. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js +0 -184
  94. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js.map +0 -1
  95. package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.d.ts +0 -14
  96. package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.js +0 -66
  97. package/build/internal/cjs/src/bookings-v2-price-info-pricing.meta.js.map +0 -1
  98. package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js +0 -28
  99. package/build/internal/cjs/src/bookings-v2-price-info-pricing.public.js.map +0 -1
  100. package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js +0 -133
  101. package/build/internal/cjs/src/bookings-v2-price-info-pricing.types.js.map +0 -1
  102. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.d.ts +0 -1025
  103. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js +0 -303
  104. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js.map +0 -1
  105. package/build/internal/es/index.d.ts +0 -1
  106. package/build/internal/es/index.js +0 -2
  107. package/build/internal/es/index.js.map +0 -1
  108. package/build/internal/es/index.typings.d.ts +0 -1
  109. package/build/internal/es/index.typings.js +0 -2
  110. package/build/internal/es/index.typings.js.map +0 -1
  111. package/build/internal/es/meta.d.ts +0 -1
  112. package/build/internal/es/meta.js +0 -2
  113. package/build/internal/es/meta.js.map +0 -1
  114. package/build/internal/es/src/bookings-v2-price-info-pricing.context.d.ts +0 -6
  115. package/build/internal/es/src/bookings-v2-price-info-pricing.context.js +0 -6
  116. package/build/internal/es/src/bookings-v2-price-info-pricing.context.js.map +0 -1
  117. package/build/internal/es/src/bookings-v2-price-info-pricing.http.d.ts +0 -59
  118. package/build/internal/es/src/bookings-v2-price-info-pricing.http.js +0 -179
  119. package/build/internal/es/src/bookings-v2-price-info-pricing.http.js.map +0 -1
  120. package/build/internal/es/src/bookings-v2-price-info-pricing.meta.d.ts +0 -14
  121. package/build/internal/es/src/bookings-v2-price-info-pricing.meta.js +0 -38
  122. package/build/internal/es/src/bookings-v2-price-info-pricing.meta.js.map +0 -1
  123. package/build/internal/es/src/bookings-v2-price-info-pricing.public.js +0 -14
  124. package/build/internal/es/src/bookings-v2-price-info-pricing.public.js.map +0 -1
  125. package/build/internal/es/src/bookings-v2-price-info-pricing.types.js +0 -130
  126. package/build/internal/es/src/bookings-v2-price-info-pricing.types.js.map +0 -1
  127. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.d.ts +0 -1025
  128. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js +0 -275
  129. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js.map +0 -1
@@ -1,303 +0,0 @@
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 = exports.IdentityType = exports.Actor = exports.Platform = exports.SelectedPaymentOption = exports.PaymentStatus = exports.BookingStatus = exports.ValueType = exports.LocationType = exports.MultiServiceBookingType = void 0;
27
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
- const ambassadorWixBookingsV2PriceInfo = __importStar(require("./bookings-v2-price-info-pricing.http.js"));
30
- /**
31
- * A multi-service booking is considered available if all individual bookings are available as returned from List Multi Service Availability Time Slots.
32
- * Currently, `SEPARATE_BOOKINGS` and `PARALLEL_BOOKINGS` are not supported.
33
- * Multi-service booking is available if each of its bookings is available separately.
34
- * For `SEQUENTIAL_BOOKINGS`, see `List Multi Service Availability Time Slots` documentation.
35
- */
36
- var MultiServiceBookingType;
37
- (function (MultiServiceBookingType) {
38
- MultiServiceBookingType["SEQUENTIAL_BOOKINGS"] = "SEQUENTIAL_BOOKINGS";
39
- MultiServiceBookingType["SEPARATE_BOOKINGS"] = "SEPARATE_BOOKINGS";
40
- MultiServiceBookingType["PARALLEL_BOOKINGS"] = "PARALLEL_BOOKINGS";
41
- })(MultiServiceBookingType || (exports.MultiServiceBookingType = MultiServiceBookingType = {}));
42
- var LocationType;
43
- (function (LocationType) {
44
- LocationType["UNDEFINED"] = "UNDEFINED";
45
- LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
46
- LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
47
- LocationType["CUSTOM"] = "CUSTOM";
48
- })(LocationType || (exports.LocationType = LocationType = {}));
49
- var ValueType;
50
- (function (ValueType) {
51
- /** Short text. This is the default value type. */
52
- ValueType["SHORT_TEXT"] = "SHORT_TEXT";
53
- /** Long text. */
54
- ValueType["LONG_TEXT"] = "LONG_TEXT";
55
- /** A text that represents the check box value. If selected the value is `true`, otherwise `false`. */
56
- ValueType["CHECK_BOX"] = "CHECK_BOX";
57
- })(ValueType || (exports.ValueType = ValueType = {}));
58
- /** Booking status. */
59
- var BookingStatus;
60
- (function (BookingStatus) {
61
- /**
62
- * The booking was created, but the customer hasn't completed the related
63
- * eCommerce order yet.
64
- */
65
- BookingStatus["CREATED"] = "CREATED";
66
- /**
67
- * The merchant has confirmed the booking and it appears in the
68
- * business calendar. Merchants can set up their *services*
69
- * ([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))
70
- * to automatically confirm all `PENDING` bookings.
71
- */
72
- BookingStatus["CONFIRMED"] = "CONFIRMED";
73
- /**
74
- * The customer has canceled the booking. Depending on the relevant service's
75
- * _policy snapshot_
76
- * ([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))
77
- * they may have to pay a _cancellation fee_
78
- * ([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)).
79
- */
80
- BookingStatus["CANCELED"] = "CANCELED";
81
- /**
82
- * The merchant must manually confirm the booking before it appears
83
- * in the business calendar.
84
- */
85
- BookingStatus["PENDING"] = "PENDING";
86
- /** The merchant has declined the booking before the customer was charged. */
87
- BookingStatus["DECLINED"] = "DECLINED";
88
- /**
89
- * The booking is on a waitlist.
90
- * Currently, you can't call Register to Waitlist
91
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/waitlist/register-to-waitlist))
92
- * for course or appointment bookings, even though this is supported in live sites.
93
- * You can call Register to Waitlist only for class session bookings.
94
- */
95
- BookingStatus["WAITING_LIST"] = "WAITING_LIST";
96
- })(BookingStatus || (exports.BookingStatus = BookingStatus = {}));
97
- /**
98
- * Payment status.
99
- * Automatically updated when using eCommerce checkout APIs.
100
- */
101
- var PaymentStatus;
102
- (function (PaymentStatus) {
103
- /** Undefined payment status. */
104
- PaymentStatus["UNDEFINED"] = "UNDEFINED";
105
- /** The booking isn't paid. */
106
- PaymentStatus["NOT_PAID"] = "NOT_PAID";
107
- /** The booking is fully paid. */
108
- PaymentStatus["PAID"] = "PAID";
109
- /** The booking is partially paid. */
110
- PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
111
- /** The booking is refunded. */
112
- PaymentStatus["REFUNDED"] = "REFUNDED";
113
- /** The booking is free of charge. */
114
- PaymentStatus["EXEMPT"] = "EXEMPT";
115
- })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
116
- /**
117
- * Selected payment option.
118
- *
119
- * One of the payment options offered by the service.
120
- * This field is set when the user selects an option during booking.
121
- * If left undefined, the payment option is resolved by the service configuration on checkout.
122
- */
123
- var SelectedPaymentOption;
124
- (function (SelectedPaymentOption) {
125
- /** Undefined payment option. */
126
- SelectedPaymentOption["UNDEFINED"] = "UNDEFINED";
127
- /** Offline payment. */
128
- SelectedPaymentOption["OFFLINE"] = "OFFLINE";
129
- /** Online payment. */
130
- SelectedPaymentOption["ONLINE"] = "ONLINE";
131
- /** Payment using a Wix Pricing Plan. */
132
- SelectedPaymentOption["MEMBERSHIP"] = "MEMBERSHIP";
133
- /**
134
- * Customers can pay only in person with a Wix Pricing Plan, while the Wix user
135
- * must manually redeem the pricing plan in the dashboard.
136
- */
137
- SelectedPaymentOption["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
138
- })(SelectedPaymentOption || (exports.SelectedPaymentOption = SelectedPaymentOption = {}));
139
- var Platform;
140
- (function (Platform) {
141
- Platform["UNDEFINED_PLATFORM"] = "UNDEFINED_PLATFORM";
142
- Platform["WEB"] = "WEB";
143
- Platform["MOBILE_APP"] = "MOBILE_APP";
144
- })(Platform || (exports.Platform = Platform = {}));
145
- var Actor;
146
- (function (Actor) {
147
- Actor["UNDEFINED_ACTOR"] = "UNDEFINED_ACTOR";
148
- Actor["BUSINESS"] = "BUSINESS";
149
- Actor["CUSTOMER"] = "CUSTOMER";
150
- })(Actor || (exports.Actor = Actor = {}));
151
- var IdentityType;
152
- (function (IdentityType) {
153
- IdentityType["UNKNOWN"] = "UNKNOWN";
154
- IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
155
- IdentityType["MEMBER"] = "MEMBER";
156
- IdentityType["WIX_USER"] = "WIX_USER";
157
- IdentityType["APP"] = "APP";
158
- })(IdentityType || (exports.IdentityType = IdentityType = {}));
159
- /**
160
- * Previews the base price for a set of line items belonging to the same
161
- * service, before a booking is created. During the booking flow, additional
162
- * taxes and fees may be added to the base price.
163
- *
164
- *
165
- * ## Response
166
- *
167
- * The response includes each line item's individual preview price and the
168
- * total of all line item preview prices. Note that the final price upon
169
- * booking creation may differ from the preview price.
170
- *
171
- * ## Errors
172
- *
173
- * _Preview Price_ fails if:
174
- *
175
- * - You specify line items that belong to different *services*
176
- * ([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)).
177
- * - The site is using the *Bookings Pricing Integration SPI*
178
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
179
- *
180
- * ## When to call Calculate Price instead
181
- *
182
- * To retrieve the price of an existing booking, call *Calculate Price*
183
- * ([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)).
184
- * @param bookingLineItems - List of line items to preview the price for.
185
- * @public
186
- * @documentationMaturity preview
187
- * @requiredField bookingLineItems
188
- * @permissionId BOOKINGS.PRICE_PREVIEW
189
- * @permissionScope Manage Stores
190
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
191
- * @permissionScope Manage Bookings Services and Settings
192
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
193
- * @permissionScope Manage Bookings
194
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
195
- * @permissionScope Read Bookings - Including Participants
196
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
197
- * @permissionScope Read Bookings - all read permissions
198
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
199
- * @permissionScope Manage Bookings - all permissions
200
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
201
- * @applicableIdentity APP
202
- * @applicableIdentity VISITOR
203
- * @fqn com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice
204
- */
205
- async function previewPrice(bookingLineItems) {
206
- // @ts-ignore
207
- const { httpClient, sideEffects } = arguments[1];
208
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
209
- bookingLineItems: bookingLineItems,
210
- });
211
- const reqOpts = ambassadorWixBookingsV2PriceInfo.previewPrice(payload);
212
- sideEffects?.onSiteCall?.();
213
- try {
214
- const result = await httpClient.request(reqOpts);
215
- sideEffects?.onSuccess?.(result);
216
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
217
- }
218
- catch (err) {
219
- const transformedError = (0, transform_error_1.transformError)(err, {
220
- spreadPathsToArguments: {},
221
- explicitPathsToArguments: { bookingLineItems: '$[0]' },
222
- singleArgumentUnchanged: false,
223
- }, ['bookingLineItems']);
224
- sideEffects?.onError?.(err);
225
- throw transformedError;
226
- }
227
- }
228
- exports.previewPrice = previewPrice;
229
- /**
230
- * Calculates the base price of a booking.
231
- *
232
- *
233
- * The returned price serves as the foundation for charging the customer. During the
234
- * _eCommerce checkout_
235
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
236
- * additional taxes and fees may be added to this base price.
237
- *
238
- * ## Price calculation method
239
- *
240
- * By default, Wix Bookings calculates a booking's price based on the relevant
241
- * `serviceOptionsAndVariants.variants.values.price`
242
- * ([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)).
243
- * You must then specify either `booking.bookedEntity.slot.serviceId` or
244
- * `booking.bookedEntity.schedule.scheduleId`.
245
- *
246
- * If the business uses the *Wix Bookings Pricing Integration service plugin*
247
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
248
- * the returned `priceInfo` object reflects values received from the SPI implementor in
249
- * _Calculate Price_
250
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
251
- * In this case, it suffices to specify `booking.bookedEntity`.
252
- *
253
- * ## When to call Preview Price instead
254
- *
255
- * To estimate the price for multiple booking line items before the booking exists,
256
- * call *Preview Price*
257
- * ([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)).
258
- * @param booking - _Booking_
259
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/bookings/bookings-writer-v2/introduction))
260
- * to calculate the base price for.
261
- * @public
262
- * @documentationMaturity preview
263
- * @requiredField booking
264
- * @permissionId BOOKINGS.PRICE_CALCULATE
265
- * @permissionScope Manage Stores
266
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
267
- * @permissionScope Manage Bookings Services and Settings
268
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
269
- * @permissionScope Manage Bookings
270
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
271
- * @permissionScope Read Bookings - Including Participants
272
- * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
273
- * @permissionScope Read Bookings - all read permissions
274
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
275
- * @permissionScope Manage Bookings - all permissions
276
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
277
- * @applicableIdentity APP
278
- * @applicableIdentity VISITOR
279
- * @fqn com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice
280
- */
281
- async function calculatePrice(booking) {
282
- // @ts-ignore
283
- const { httpClient, sideEffects } = arguments[1];
284
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ booking: booking });
285
- const reqOpts = ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);
286
- sideEffects?.onSiteCall?.();
287
- try {
288
- const result = await httpClient.request(reqOpts);
289
- sideEffects?.onSuccess?.(result);
290
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
291
- }
292
- catch (err) {
293
- const transformedError = (0, transform_error_1.transformError)(err, {
294
- spreadPathsToArguments: {},
295
- explicitPathsToArguments: { booking: '$[0]' },
296
- singleArgumentUnchanged: false,
297
- }, ['booking']);
298
- sideEffects?.onError?.(err);
299
- throw transformedError;
300
- }
301
- }
302
- exports.calculatePrice = calculatePrice;
303
- //# sourceMappingURL=bookings-v2-price-info-pricing.universal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bookings-v2-price-info-pricing.universal.js","sourceRoot":"","sources":["../../../../src/bookings-v2-price-info-pricing.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,2GAA6F;AAyU7F;;;;;GAKG;AACH,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,sEAA2C,CAAA;IAC3C,kEAAuC,CAAA;IACvC,kEAAuC,CAAA;AACzC,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAuJD,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAoKD,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,kDAAkD;IAClD,sCAAyB,CAAA;IACzB,iBAAiB;IACjB,oCAAuB,CA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;;;;;;;;;;;;;;;;GAmDG;AACI,KAAK,UAAU,cAAc,CAClC,OAAgB;IAShB,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAE5E,MAAM,OAAO,GAAG,gCAAgC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAEzE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,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;AAxCD,wCAwCC"}
@@ -1 +0,0 @@
1
- export * from './src/bookings-v2-price-info-pricing.context.js';
@@ -1,2 +0,0 @@
1
- export * from './src/bookings-v2-price-info-pricing.context.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
@@ -1 +0,0 @@
1
- export * from './src/bookings-v2-price-info-pricing.universal.js';
@@ -1,2 +0,0 @@
1
- export * from './src/bookings-v2-price-info-pricing.universal.js';
2
- //# sourceMappingURL=index.typings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC"}
@@ -1 +0,0 @@
1
- export * from './src/bookings-v2-price-info-pricing.meta.js';
@@ -1,2 +0,0 @@
1
- export * from './src/bookings-v2-price-info-pricing.meta.js';
2
- //# sourceMappingURL=meta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC"}
@@ -1,6 +0,0 @@
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, BookedAddOn, CalculatePriceResponse, } from './bookings-v2-price-info-pricing.universal.js';
@@ -1,6 +0,0 @@
1
- import { previewPrice as publicPreviewPrice, calculatePrice as publicCalculatePrice, } from './bookings-v2-price-info-pricing.public.js';
2
- import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
3
- export const previewPrice = /*#__PURE__*/ createRESTModule(publicPreviewPrice);
4
- export const calculatePrice = /*#__PURE__*/ createRESTModule(publicCalculatePrice);
5
- export { MultiServiceBookingType, LocationType, ValueType, BookingStatus, PaymentStatus, SelectedPaymentOption, Platform, Actor, IdentityType, } from './bookings-v2-price-info-pricing.universal.js';
6
- //# sourceMappingURL=bookings-v2-price-info-pricing.context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bookings-v2-price-info-pricing.context.js","sourceRoot":"","sources":["../../../../src/bookings-v2-price-info-pricing.context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,kBAAkB,EAClC,cAAc,IAAI,oBAAoB,GACvC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,CAAC,MAAM,YAAY,GAErB,aAAa,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,cAAc,GAEvB,aAAa,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;AAEzD,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,KAAK,EACL,YAAY,GACb,MAAM,+CAA+C,CAAC"}
@@ -1,59 +0,0 @@
1
- import { RequestOptionsFactory } from '@wix/sdk-types';
2
- /**
3
- * Previews the base price for a set of line items belonging to the same
4
- * service, before a booking is created. During the booking flow, additional
5
- * taxes and fees may be added to the base price.
6
- *
7
- *
8
- * ## Response
9
- *
10
- * The response includes each line item's individual preview price and the
11
- * total of all line item preview prices. Note that the final price upon
12
- * booking creation may differ from the preview price.
13
- *
14
- * ## Errors
15
- *
16
- * _Preview Price_ fails if:
17
- *
18
- * - You specify line items that belong to different *services*
19
- * ([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)).
20
- * - The site is using the *Bookings Pricing Integration SPI*
21
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
22
- *
23
- * ## When to call Calculate Price instead
24
- *
25
- * To retrieve the price of an existing booking, call *Calculate Price*
26
- * ([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)).
27
- */
28
- export declare function previewPrice(payload: object): RequestOptionsFactory<any>;
29
- /**
30
- * Calculates the base price of a booking.
31
- *
32
- *
33
- * The returned price serves as the foundation for charging the customer. During the
34
- * _eCommerce checkout_
35
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
36
- * additional taxes and fees may be added to this base price.
37
- *
38
- * ## Price calculation method
39
- *
40
- * By default, Wix Bookings calculates a booking's price based on the relevant
41
- * `serviceOptionsAndVariants.variants.values.price`
42
- * ([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)).
43
- * You must then specify either `booking.bookedEntity.slot.serviceId` or
44
- * `booking.bookedEntity.schedule.scheduleId`.
45
- *
46
- * If the business uses the *Wix Bookings Pricing Integration service plugin*
47
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
48
- * the returned `priceInfo` object reflects values received from the SPI implementor in
49
- * _Calculate Price_
50
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
51
- * In this case, it suffices to specify `booking.bookedEntity`.
52
- *
53
- * ## When to call Preview Price instead
54
- *
55
- * To estimate the price for multiple booking line items before the booking exists,
56
- * call *Preview Price*
57
- * ([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)).
58
- */
59
- export declare function calculatePrice(payload: object): RequestOptionsFactory<any>;
@@ -1,179 +0,0 @@
1
- import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';
2
- import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';
3
- import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
4
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
5
- import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
6
- function resolveComWixpressBookingsPricingBookingsPricingServiceUrl(opts) {
7
- const domainToMappings = {
8
- 'manage._base_domain_': [
9
- {
10
- srcPath: '/_api/bookings-pricing',
11
- destPath: '',
12
- },
13
- {
14
- srcPath: '/_api/bookings-pricing/v2/price',
15
- destPath: '/v2/pricing',
16
- },
17
- ],
18
- _: [
19
- {
20
- srcPath: '/_api/bookings-pricing',
21
- destPath: '',
22
- },
23
- {
24
- srcPath: '/_api/bookings-pricing/v2/price',
25
- destPath: '/v2/pricing',
26
- },
27
- ],
28
- 'www.wixapis.com': [
29
- {
30
- srcPath: '/bookings/v2/pricing/v2/pricing',
31
- destPath: '/v2/pricing',
32
- },
33
- {
34
- srcPath: '/bookings/v2/pricing',
35
- destPath: '/v2/pricing',
36
- },
37
- ],
38
- };
39
- return resolveUrl(Object.assign(opts, { domainToMappings }));
40
- }
41
- const PACKAGE_NAME = '@wix/auto_sdk_bookings_pricing';
42
- /**
43
- * Previews the base price for a set of line items belonging to the same
44
- * service, before a booking is created. During the booking flow, additional
45
- * taxes and fees may be added to the base price.
46
- *
47
- *
48
- * ## Response
49
- *
50
- * The response includes each line item's individual preview price and the
51
- * total of all line item preview prices. Note that the final price upon
52
- * booking creation may differ from the preview price.
53
- *
54
- * ## Errors
55
- *
56
- * _Preview Price_ fails if:
57
- *
58
- * - You specify line items that belong to different *services*
59
- * ([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)).
60
- * - The site is using the *Bookings Pricing Integration SPI*
61
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
62
- *
63
- * ## When to call Calculate Price instead
64
- *
65
- * To retrieve the price of an existing booking, call *Calculate Price*
66
- * ([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)).
67
- */
68
- export function previewPrice(payload) {
69
- function __previewPrice({ host }) {
70
- const serializedData = transformPaths(payload, [
71
- {
72
- transformFn: transformSDKFloatToRESTFloat,
73
- paths: [{ path: 'bookingLineItems.pricePerParticipant' }],
74
- },
75
- ]);
76
- const metadata = {
77
- entityFqdn: 'wix.bookings.v2.price_info',
78
- method: 'POST',
79
- methodFqn: 'com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice',
80
- packageName: PACKAGE_NAME,
81
- url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
82
- protoPath: '/v2/pricing/preview',
83
- data: serializedData,
84
- host,
85
- }),
86
- data: serializedData,
87
- transformResponse: (payload) => transformPaths(payload, [
88
- {
89
- transformFn: transformRESTFloatToSDKFloat,
90
- paths: [
91
- { path: 'priceInfo.calculatedPrice' },
92
- { path: 'priceInfo.deposit' },
93
- { path: 'priceInfo.bookingLineItems.pricePerParticipant' },
94
- ],
95
- },
96
- ]),
97
- };
98
- return metadata;
99
- }
100
- return __previewPrice;
101
- }
102
- /**
103
- * Calculates the base price of a booking.
104
- *
105
- *
106
- * The returned price serves as the foundation for charging the customer. During the
107
- * _eCommerce checkout_
108
- * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
109
- * additional taxes and fees may be added to this base price.
110
- *
111
- * ## Price calculation method
112
- *
113
- * By default, Wix Bookings calculates a booking's price based on the relevant
114
- * `serviceOptionsAndVariants.variants.values.price`
115
- * ([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)).
116
- * You must then specify either `booking.bookedEntity.slot.serviceId` or
117
- * `booking.bookedEntity.schedule.scheduleId`.
118
- *
119
- * If the business uses the *Wix Bookings Pricing Integration service plugin*
120
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
121
- * the returned `priceInfo` object reflects values received from the SPI implementor in
122
- * _Calculate Price_
123
- * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
124
- * In this case, it suffices to specify `booking.bookedEntity`.
125
- *
126
- * ## When to call Preview Price instead
127
- *
128
- * To estimate the price for multiple booking line items before the booking exists,
129
- * call *Preview Price*
130
- * ([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)).
131
- */
132
- export function calculatePrice(payload) {
133
- function __calculatePrice({ host }) {
134
- const serializedData = transformPaths(payload, [
135
- {
136
- transformFn: transformSDKTimestampToRESTTimestamp,
137
- paths: [
138
- { path: 'booking.createdDate' },
139
- { path: 'booking.startDate' },
140
- { path: 'booking.endDate' },
141
- { path: 'booking.updatedDate' },
142
- { path: 'booking.canceledDate' },
143
- ],
144
- },
145
- {
146
- transformFn: transformSDKFloatToRESTFloat,
147
- paths: [
148
- { path: 'booking.contactDetails.fullAddress.geocode.latitude' },
149
- { path: 'booking.contactDetails.fullAddress.geocode.longitude' },
150
- ],
151
- },
152
- ]);
153
- const metadata = {
154
- entityFqdn: 'wix.bookings.v2.price_info',
155
- method: 'POST',
156
- methodFqn: 'com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice',
157
- packageName: PACKAGE_NAME,
158
- url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
159
- protoPath: '/v2/pricing/calculate',
160
- data: serializedData,
161
- host,
162
- }),
163
- data: serializedData,
164
- transformResponse: (payload) => transformPaths(payload, [
165
- {
166
- transformFn: transformRESTFloatToSDKFloat,
167
- paths: [
168
- { path: 'priceInfo.calculatedPrice' },
169
- { path: 'priceInfo.deposit' },
170
- { path: 'priceInfo.bookingLineItems.pricePerParticipant' },
171
- ],
172
- },
173
- ]),
174
- };
175
- return metadata;
176
- }
177
- return __calculatePrice;
178
- }
179
- //# sourceMappingURL=bookings-v2-price-info-pricing.http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bookings-v2-price-info-pricing.http.js","sourceRoot":"","sources":["../../../../src/bookings-v2-price-info-pricing.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;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,iCAAiC;gBAC1C,QAAQ,EAAE,aAAa;aACxB;SACF;QACD,CAAC,EAAE;YACD;gBACE,OAAO,EAAE,wBAAwB;gBACjC,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,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C;AAC1B,CAAC"}
@@ -1,14 +0,0 @@
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, ambassadorWixBookingsV2PriceInfoTypes.PreviewPriceResponse>;
14
- export declare function calculatePrice(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceRequest, ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceRequest, ambassadorWixBookingsV2PriceInfoUniversalTypes.CalculatePriceResponse, ambassadorWixBookingsV2PriceInfoTypes.CalculatePriceResponse>;