@wix/auto_sdk_bookings_pricing 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) 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 +59 -0
  14. package/build/cjs/src/bookings-v2-price-info-pricing.http.js +184 -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/{internal/index.d.ts → cjs/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
  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/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.mts → cjs/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
  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 +1007 -0
  26. package/build/cjs/src/bookings-v2-price-info-pricing.universal.js +299 -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 +59 -0
  42. package/build/es/src/bookings-v2-price-info-pricing.http.js +179 -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/{index.d.ts → es/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
  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/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.ts → es/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
  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 +1007 -0
  54. package/build/es/src/bookings-v2-price-info-pricing.universal.js +271 -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 +59 -0
  69. package/build/internal/cjs/src/bookings-v2-price-info-pricing.http.js +184 -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/{index.d.mts → cjs/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
  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/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.ts → cjs/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
  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 +1007 -0
  81. package/build/internal/cjs/src/bookings-v2-price-info-pricing.universal.js +299 -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 +59 -0
  96. package/build/internal/es/src/bookings-v2-price-info-pricing.http.js +179 -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/{index.d.mts → internal/es/src/bookings-v2-price-info-pricing.public.d.ts} +8 -11
  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/{bookings-v2-price-info-pricing.universal-Ci_8AyL2.d.mts → es/src/bookings-v2-price-info-pricing.types.d.ts} +54 -56
  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 +1007 -0
  108. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js +271 -0
  109. package/build/internal/es/src/bookings-v2-price-info-pricing.universal.js.map +1 -0
  110. package/package.json +11 -12
  111. package/build/index.js +0 -314
  112. package/build/index.js.map +0 -1
  113. package/build/index.mjs +0 -280
  114. package/build/index.mjs.map +0 -1
  115. package/build/internal/index.js +0 -314
  116. package/build/internal/index.js.map +0 -1
  117. package/build/internal/index.mjs +0 -280
  118. package/build/internal/index.mjs.map +0 -1
  119. package/build/internal/meta.d.mts +0 -793
  120. package/build/internal/meta.d.ts +0 -793
  121. package/build/internal/meta.js +0 -194
  122. package/build/internal/meta.js.map +0 -1
  123. package/build/internal/meta.mjs +0 -166
  124. package/build/internal/meta.mjs.map +0 -1
  125. package/build/meta.d.mts +0 -793
  126. package/build/meta.d.ts +0 -793
  127. package/build/meta.js +0 -194
  128. package/build/meta.js.map +0 -1
  129. package/build/meta.mjs +0 -166
  130. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,271 @@
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
135
+ * service, before a booking is created. During the booking flow, additional
136
+ * taxes and fees may be added to the base price.
137
+ *
138
+ *
139
+ * ## Response
140
+ *
141
+ * The response includes each line item's individual preview price and the
142
+ * total of all line item preview prices. Note that the final price upon
143
+ * booking creation may differ from the preview price.
144
+ *
145
+ * ## Errors
146
+ *
147
+ * _Preview Price_ fails if:
148
+ *
149
+ * - You specify line items that belong to different *services*
150
+ * ([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)).
151
+ * - The site is using the *Bookings Pricing Integration SPI*
152
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)).
153
+ *
154
+ * ## When to call Calculate Price instead
155
+ *
156
+ * To retrieve the price of an existing booking, call *Calculate Price*
157
+ * ([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)).
158
+ * @param bookingLineItems - List of line items to preview the price for.
159
+ * @public
160
+ * @documentationMaturity preview
161
+ * @requiredField bookingLineItems
162
+ * @permissionId BOOKINGS.PRICE_PREVIEW
163
+ * @permissionScope Manage Bookings Services and Settings
164
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
165
+ * @permissionScope Manage Bookings
166
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
167
+ * @permissionScope Read Bookings - Including Participants
168
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
169
+ * @permissionScope Read Bookings - all read permissions
170
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
171
+ * @permissionScope Manage Bookings - all permissions
172
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
173
+ * @applicableIdentity APP
174
+ * @applicableIdentity VISITOR
175
+ * @fqn com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice
176
+ */
177
+ export async function previewPrice(bookingLineItems) {
178
+ // @ts-ignore
179
+ const { httpClient, sideEffects } = arguments[1];
180
+ const payload = renameKeysFromSDKRequestToRESTRequest({
181
+ bookingLineItems: bookingLineItems,
182
+ });
183
+ const reqOpts = ambassadorWixBookingsV2PriceInfo.previewPrice(payload);
184
+ sideEffects?.onSiteCall?.();
185
+ try {
186
+ const result = await httpClient.request(reqOpts);
187
+ sideEffects?.onSuccess?.(result);
188
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
189
+ }
190
+ catch (err) {
191
+ const transformedError = sdkTransformError(err, {
192
+ spreadPathsToArguments: {},
193
+ explicitPathsToArguments: { bookingLineItems: '$[0]' },
194
+ singleArgumentUnchanged: false,
195
+ }, ['bookingLineItems']);
196
+ sideEffects?.onError?.(err);
197
+ throw transformedError;
198
+ }
199
+ }
200
+ /**
201
+ * Calculates the base price of a booking.
202
+ *
203
+ *
204
+ * The returned price serves as the foundation for charging the customer. During the
205
+ * _eCommerce checkout_
206
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/introduction)),
207
+ * additional taxes and fees may be added to this base price.
208
+ *
209
+ * ## Price calculation method
210
+ *
211
+ * By default, Wix Bookings calculates a booking's price based on the relevant
212
+ * `serviceOptionsAndVariants.variants.values.price`
213
+ * ([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)).
214
+ * You must then specify either `booking.bookedEntity.slot.serviceId` or
215
+ * `booking.bookedEntity.schedule.scheduleId`.
216
+ *
217
+ * If the business uses the *Wix Bookings Pricing Integration service plugin*
218
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/introduction)),
219
+ * the returned `priceInfo` object reflects values received from the SPI implementor in
220
+ * _Calculate Price_
221
+ * ([REST](https://dev.wix.com/docs/rest/business-solutions/bookings/pricing/pricing-integration-service-plugin/calculate-price)).
222
+ * In this case, it suffices to specify `booking.bookedEntity`.
223
+ *
224
+ * ## When to call Preview Price instead
225
+ *
226
+ * To estimate the price for multiple booking line items before the booking exists,
227
+ * call *Preview Price*
228
+ * ([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)).
229
+ * @param booking - _Booking_
230
+ * ([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))
231
+ * to calculate the base price for.
232
+ * @public
233
+ * @documentationMaturity preview
234
+ * @requiredField booking
235
+ * @permissionId BOOKINGS.PRICE_CALCULATE
236
+ * @permissionScope Manage Bookings Services and Settings
237
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
238
+ * @permissionScope Manage Bookings
239
+ * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
240
+ * @permissionScope Read Bookings - Including Participants
241
+ * @permissionScopeId SCOPE.DC-BOOKINGS.READ-BOOKINGS-SENSITIVE
242
+ * @permissionScope Read Bookings - all read permissions
243
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.READ-BOOKINGS
244
+ * @permissionScope Manage Bookings - all permissions
245
+ * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
246
+ * @applicableIdentity APP
247
+ * @applicableIdentity VISITOR
248
+ * @fqn com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice
249
+ */
250
+ export async function calculatePrice(booking) {
251
+ // @ts-ignore
252
+ const { httpClient, sideEffects } = arguments[1];
253
+ const payload = renameKeysFromSDKRequestToRESTRequest({ booking: booking });
254
+ const reqOpts = ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);
255
+ sideEffects?.onSiteCall?.();
256
+ try {
257
+ const result = await httpClient.request(reqOpts);
258
+ sideEffects?.onSuccess?.(result);
259
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
260
+ }
261
+ catch (err) {
262
+ const transformedError = sdkTransformError(err, {
263
+ spreadPathsToArguments: {},
264
+ explicitPathsToArguments: { booking: '$[0]' },
265
+ singleArgumentUnchanged: false,
266
+ }, ['booking']);
267
+ sideEffects?.onError?.(err);
268
+ throw transformedError;
269
+ }
270
+ }
271
+ //# 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,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAA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AC;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"}
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_bookings_pricing",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
7
7
  },
8
8
  "keywords": [],
9
9
  "sideEffects": false,
10
- "main": "/build/index.js",
11
- "types": "./build/index.d.mts",
10
+ "main": "./build/cjs/index.js",
11
+ "types": "./build/es/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./build/index.mjs",
15
- "require": "./build/index.js",
16
- "types": "./build/index.d.mts"
14
+ "import": "./build/es/index.js",
15
+ "require": "./build/cjs/index.js",
16
+ "types": "./build/es/index.d.ts"
17
17
  },
18
18
  "./package.json": "./package.json",
19
19
  "./meta": {
20
- "import": "./build/meta.mjs",
21
- "require": "./build/meta.js",
22
- "types": "./build/meta.d.mts"
20
+ "import": "./build/es/meta.js",
21
+ "require": "./build/cjs/meta.js",
22
+ "types": "./build/es/meta.d.ts"
23
23
  }
24
24
  },
25
25
  "files": [
@@ -32,11 +32,10 @@
32
32
  "@wix/sdk-types": "^1.13.16"
33
33
  },
34
34
  "devDependencies": {
35
- "tsup": "^8.4.0",
36
35
  "typescript": "^5.3.2"
37
36
  },
38
37
  "scripts": {
39
- "build": "tsup",
38
+ "build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
40
39
  "test": ":"
41
40
  },
42
41
  "wix": {
@@ -49,5 +48,5 @@
49
48
  "fqdn": "wix.bookings.v2.price_info"
50
49
  }
51
50
  },
52
- "falconPackageHash": "da74f4f4c557e618accb4be1c68d4a791a6e84a31dd3f9550cf4a539"
51
+ "falconPackageHash": "6deec39cb1bb5b3cb65509134449f6d12513e44c114d73cec98c0003"
53
52
  }
package/build/index.js DELETED
@@ -1,314 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- Actor: () => Actor,
24
- BookingStatus: () => BookingStatus,
25
- IdentityType: () => IdentityType,
26
- LocationType: () => LocationType,
27
- MultiServiceBookingType: () => MultiServiceBookingType,
28
- PaymentStatus: () => PaymentStatus,
29
- Platform: () => Platform,
30
- SelectedPaymentOption: () => SelectedPaymentOption,
31
- ValueType: () => ValueType,
32
- calculatePrice: () => calculatePrice4,
33
- previewPrice: () => previewPrice4
34
- });
35
- module.exports = __toCommonJS(index_exports);
36
-
37
- // src/bookings-v2-price-info-pricing.universal.ts
38
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
39
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
40
-
41
- // src/bookings-v2-price-info-pricing.http.ts
42
- var import_float = require("@wix/sdk-runtime/transformations/float");
43
- var import_float2 = require("@wix/sdk-runtime/transformations/float");
44
- var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
45
- var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
46
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
47
- function resolveComWixpressBookingsPricingBookingsPricingServiceUrl(opts) {
48
- const domainToMappings = {
49
- "manage._base_domain_": [
50
- {
51
- srcPath: "/_api/bookings-pricing",
52
- destPath: ""
53
- },
54
- {
55
- srcPath: "/_api/bookings-pricing/v2/price",
56
- destPath: "/v2/pricing"
57
- }
58
- ],
59
- _: [
60
- {
61
- srcPath: "/_api/bookings-pricing",
62
- destPath: ""
63
- },
64
- {
65
- srcPath: "/_api/bookings-pricing/v2/price",
66
- destPath: "/v2/pricing"
67
- }
68
- ],
69
- "www.wixapis.com": [
70
- {
71
- srcPath: "/bookings/v2/pricing/v2/pricing",
72
- destPath: "/v2/pricing"
73
- },
74
- {
75
- srcPath: "/bookings/v2/pricing",
76
- destPath: "/v2/pricing"
77
- }
78
- ]
79
- };
80
- return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
81
- }
82
- var PACKAGE_NAME = "@wix/auto_sdk_bookings_pricing";
83
- function previewPrice(payload) {
84
- function __previewPrice({ host }) {
85
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
86
- {
87
- transformFn: import_float.transformSDKFloatToRESTFloat,
88
- paths: [{ path: "bookingLineItems.pricePerParticipant" }]
89
- }
90
- ]);
91
- const metadata = {
92
- entityFqdn: "wix.bookings.v2.price_info",
93
- method: "POST",
94
- methodFqn: "com.wixpress.bookings.pricing.BookingsPricingService.PreviewPrice",
95
- packageName: PACKAGE_NAME,
96
- url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
97
- protoPath: "/v2/pricing/preview",
98
- data: serializedData,
99
- host
100
- }),
101
- data: serializedData,
102
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
103
- {
104
- transformFn: import_float2.transformRESTFloatToSDKFloat,
105
- paths: [
106
- { path: "priceInfo.calculatedPrice" },
107
- { path: "priceInfo.deposit" },
108
- { path: "priceInfo.bookingLineItems.pricePerParticipant" }
109
- ]
110
- }
111
- ])
112
- };
113
- return metadata;
114
- }
115
- return __previewPrice;
116
- }
117
- function calculatePrice(payload) {
118
- function __calculatePrice({ host }) {
119
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
120
- {
121
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
122
- paths: [
123
- { path: "booking.createdDate" },
124
- { path: "booking.startDate" },
125
- { path: "booking.endDate" },
126
- { path: "booking.updatedDate" },
127
- { path: "booking.canceledDate" }
128
- ]
129
- },
130
- {
131
- transformFn: import_float.transformSDKFloatToRESTFloat,
132
- paths: [
133
- { path: "booking.contactDetails.fullAddress.geocode.latitude" },
134
- { path: "booking.contactDetails.fullAddress.geocode.longitude" }
135
- ]
136
- }
137
- ]);
138
- const metadata = {
139
- entityFqdn: "wix.bookings.v2.price_info",
140
- method: "POST",
141
- methodFqn: "com.wixpress.bookings.pricing.BookingsPricingService.CalculatePrice",
142
- packageName: PACKAGE_NAME,
143
- url: resolveComWixpressBookingsPricingBookingsPricingServiceUrl({
144
- protoPath: "/v2/pricing/calculate",
145
- data: serializedData,
146
- host
147
- }),
148
- data: serializedData,
149
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
150
- {
151
- transformFn: import_float2.transformRESTFloatToSDKFloat,
152
- paths: [
153
- { path: "priceInfo.calculatedPrice" },
154
- { path: "priceInfo.deposit" },
155
- { path: "priceInfo.bookingLineItems.pricePerParticipant" }
156
- ]
157
- }
158
- ])
159
- };
160
- return metadata;
161
- }
162
- return __calculatePrice;
163
- }
164
-
165
- // src/bookings-v2-price-info-pricing.universal.ts
166
- var MultiServiceBookingType = /* @__PURE__ */ ((MultiServiceBookingType2) => {
167
- MultiServiceBookingType2["SEQUENTIAL_BOOKINGS"] = "SEQUENTIAL_BOOKINGS";
168
- MultiServiceBookingType2["SEPARATE_BOOKINGS"] = "SEPARATE_BOOKINGS";
169
- MultiServiceBookingType2["PARALLEL_BOOKINGS"] = "PARALLEL_BOOKINGS";
170
- return MultiServiceBookingType2;
171
- })(MultiServiceBookingType || {});
172
- var LocationType = /* @__PURE__ */ ((LocationType2) => {
173
- LocationType2["UNDEFINED"] = "UNDEFINED";
174
- LocationType2["OWNER_BUSINESS"] = "OWNER_BUSINESS";
175
- LocationType2["OWNER_CUSTOM"] = "OWNER_CUSTOM";
176
- LocationType2["CUSTOM"] = "CUSTOM";
177
- return LocationType2;
178
- })(LocationType || {});
179
- var ValueType = /* @__PURE__ */ ((ValueType2) => {
180
- ValueType2["SHORT_TEXT"] = "SHORT_TEXT";
181
- ValueType2["LONG_TEXT"] = "LONG_TEXT";
182
- ValueType2["CHECK_BOX"] = "CHECK_BOX";
183
- return ValueType2;
184
- })(ValueType || {});
185
- var BookingStatus = /* @__PURE__ */ ((BookingStatus2) => {
186
- BookingStatus2["CREATED"] = "CREATED";
187
- BookingStatus2["CONFIRMED"] = "CONFIRMED";
188
- BookingStatus2["CANCELED"] = "CANCELED";
189
- BookingStatus2["PENDING"] = "PENDING";
190
- BookingStatus2["DECLINED"] = "DECLINED";
191
- BookingStatus2["WAITING_LIST"] = "WAITING_LIST";
192
- return BookingStatus2;
193
- })(BookingStatus || {});
194
- var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
195
- PaymentStatus2["UNDEFINED"] = "UNDEFINED";
196
- PaymentStatus2["NOT_PAID"] = "NOT_PAID";
197
- PaymentStatus2["PAID"] = "PAID";
198
- PaymentStatus2["PARTIALLY_PAID"] = "PARTIALLY_PAID";
199
- PaymentStatus2["REFUNDED"] = "REFUNDED";
200
- PaymentStatus2["EXEMPT"] = "EXEMPT";
201
- return PaymentStatus2;
202
- })(PaymentStatus || {});
203
- var SelectedPaymentOption = /* @__PURE__ */ ((SelectedPaymentOption2) => {
204
- SelectedPaymentOption2["UNDEFINED"] = "UNDEFINED";
205
- SelectedPaymentOption2["OFFLINE"] = "OFFLINE";
206
- SelectedPaymentOption2["ONLINE"] = "ONLINE";
207
- SelectedPaymentOption2["MEMBERSHIP"] = "MEMBERSHIP";
208
- SelectedPaymentOption2["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
209
- return SelectedPaymentOption2;
210
- })(SelectedPaymentOption || {});
211
- var Platform = /* @__PURE__ */ ((Platform2) => {
212
- Platform2["UNDEFINED_PLATFORM"] = "UNDEFINED_PLATFORM";
213
- Platform2["WEB"] = "WEB";
214
- Platform2["MOBILE_APP"] = "MOBILE_APP";
215
- return Platform2;
216
- })(Platform || {});
217
- var Actor = /* @__PURE__ */ ((Actor2) => {
218
- Actor2["UNDEFINED_ACTOR"] = "UNDEFINED_ACTOR";
219
- Actor2["BUSINESS"] = "BUSINESS";
220
- Actor2["CUSTOMER"] = "CUSTOMER";
221
- return Actor2;
222
- })(Actor || {});
223
- var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
224
- IdentityType2["UNKNOWN"] = "UNKNOWN";
225
- IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
226
- IdentityType2["MEMBER"] = "MEMBER";
227
- IdentityType2["WIX_USER"] = "WIX_USER";
228
- IdentityType2["APP"] = "APP";
229
- return IdentityType2;
230
- })(IdentityType || {});
231
- async function previewPrice2(bookingLineItems) {
232
- const { httpClient, sideEffects } = arguments[1];
233
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
234
- bookingLineItems
235
- });
236
- const reqOpts = previewPrice(payload);
237
- sideEffects?.onSiteCall?.();
238
- try {
239
- const result = await httpClient.request(reqOpts);
240
- sideEffects?.onSuccess?.(result);
241
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
242
- } catch (err) {
243
- const transformedError = (0, import_transform_error.transformError)(
244
- err,
245
- {
246
- spreadPathsToArguments: {},
247
- explicitPathsToArguments: { bookingLineItems: "$[0]" },
248
- singleArgumentUnchanged: false
249
- },
250
- ["bookingLineItems"]
251
- );
252
- sideEffects?.onError?.(err);
253
- throw transformedError;
254
- }
255
- }
256
- async function calculatePrice2(booking) {
257
- const { httpClient, sideEffects } = arguments[1];
258
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ booking });
259
- const reqOpts = calculatePrice(payload);
260
- sideEffects?.onSiteCall?.();
261
- try {
262
- const result = await httpClient.request(reqOpts);
263
- sideEffects?.onSuccess?.(result);
264
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
265
- } catch (err) {
266
- const transformedError = (0, import_transform_error.transformError)(
267
- err,
268
- {
269
- spreadPathsToArguments: {},
270
- explicitPathsToArguments: { booking: "$[0]" },
271
- singleArgumentUnchanged: false
272
- },
273
- ["booking"]
274
- );
275
- sideEffects?.onError?.(err);
276
- throw transformedError;
277
- }
278
- }
279
-
280
- // src/bookings-v2-price-info-pricing.public.ts
281
- function previewPrice3(httpClient) {
282
- return (bookingLineItems) => previewPrice2(
283
- bookingLineItems,
284
- // @ts-ignore
285
- { httpClient }
286
- );
287
- }
288
- function calculatePrice3(httpClient) {
289
- return (booking) => calculatePrice2(
290
- booking,
291
- // @ts-ignore
292
- { httpClient }
293
- );
294
- }
295
-
296
- // src/bookings-v2-price-info-pricing.context.ts
297
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
298
- var previewPrice4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(previewPrice3);
299
- var calculatePrice4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(calculatePrice3);
300
- // Annotate the CommonJS export names for ESM import in node:
301
- 0 && (module.exports = {
302
- Actor,
303
- BookingStatus,
304
- IdentityType,
305
- LocationType,
306
- MultiServiceBookingType,
307
- PaymentStatus,
308
- Platform,
309
- SelectedPaymentOption,
310
- ValueType,
311
- calculatePrice,
312
- previewPrice
313
- });
314
- //# sourceMappingURL=index.js.map