@wix/bookings 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +4 -1
- package/build/cjs/index.js +5 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/bookings-availability-v1-slot-availability.http.d.ts +6 -6
- package/build/cjs/src/bookings-availability-v1-slot-availability.http.js +6 -6
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.d.ts +14 -29
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js +7 -6
- package/build/cjs/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
- package/build/cjs/src/bookings-reader-v2-extended-booking.http.d.ts +38 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.http.js +117 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.http.js.map +1 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.public.d.ts +5 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.public.js +22 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.public.js.map +1 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.types.d.ts +730 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.types.js +90 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.types.js.map +1 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.universal.d.ts +786 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.universal.js +226 -0
- package/build/cjs/src/bookings-reader-v2-extended-booking.universal.js.map +1 -0
- package/build/cjs/src/bookings-v2-booking.http.d.ts +123 -0
- package/build/cjs/src/bookings-v2-booking.http.js +305 -0
- package/build/cjs/src/bookings-v2-booking.http.js.map +1 -0
- package/build/cjs/src/bookings-v2-booking.public.d.ts +9 -0
- package/build/cjs/src/bookings-v2-booking.public.js +47 -0
- package/build/cjs/src/bookings-v2-booking.public.js.map +1 -0
- package/build/cjs/src/bookings-v2-booking.types.d.ts +1594 -0
- package/build/cjs/src/bookings-v2-booking.types.js +99 -0
- package/build/cjs/src/bookings-v2-booking.types.js.map +1 -0
- package/build/cjs/src/bookings-v2-booking.universal.d.ts +1840 -0
- package/build/cjs/src/bookings-v2-booking.universal.js +561 -0
- package/build/cjs/src/bookings-v2-booking.universal.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info.http.d.ts +56 -0
- package/build/cjs/src/bookings-v2-price-info.http.js +164 -0
- package/build/cjs/src/bookings-v2-price-info.http.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info.public.d.ts +6 -0
- package/build/cjs/src/bookings-v2-price-info.public.js +26 -0
- package/build/cjs/src/bookings-v2-price-info.public.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info.types.d.ts +594 -0
- package/build/cjs/src/bookings-v2-price-info.types.js +79 -0
- package/build/cjs/src/bookings-v2-price-info.types.js.map +1 -0
- package/build/cjs/src/bookings-v2-price-info.universal.d.ts +664 -0
- package/build/cjs/src/bookings-v2-price-info.universal.js +274 -0
- package/build/cjs/src/bookings-v2-price-info.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -1
- package/build/es/index.js +4 -1
- package/build/es/index.js.map +1 -1
- package/build/es/src/bookings-availability-v1-slot-availability.http.d.ts +6 -6
- package/build/es/src/bookings-availability-v1-slot-availability.http.js +6 -6
- package/build/es/src/bookings-availability-v1-slot-availability.universal.d.ts +14 -29
- package/build/es/src/bookings-availability-v1-slot-availability.universal.js +7 -6
- package/build/es/src/bookings-availability-v1-slot-availability.universal.js.map +1 -1
- package/build/es/src/bookings-reader-v2-extended-booking.http.d.ts +38 -0
- package/build/es/src/bookings-reader-v2-extended-booking.http.js +113 -0
- package/build/es/src/bookings-reader-v2-extended-booking.http.js.map +1 -0
- package/build/es/src/bookings-reader-v2-extended-booking.public.d.ts +5 -0
- package/build/es/src/bookings-reader-v2-extended-booking.public.js +8 -0
- package/build/es/src/bookings-reader-v2-extended-booking.public.js.map +1 -0
- package/build/es/src/bookings-reader-v2-extended-booking.types.d.ts +730 -0
- package/build/es/src/bookings-reader-v2-extended-booking.types.js +87 -0
- package/build/es/src/bookings-reader-v2-extended-booking.types.js.map +1 -0
- package/build/es/src/bookings-reader-v2-extended-booking.universal.d.ts +786 -0
- package/build/es/src/bookings-reader-v2-extended-booking.universal.js +203 -0
- package/build/es/src/bookings-reader-v2-extended-booking.universal.js.map +1 -0
- package/build/es/src/bookings-v2-booking.http.d.ts +123 -0
- package/build/es/src/bookings-v2-booking.http.js +297 -0
- package/build/es/src/bookings-v2-booking.http.js.map +1 -0
- package/build/es/src/bookings-v2-booking.public.d.ts +9 -0
- package/build/es/src/bookings-v2-booking.public.js +28 -0
- package/build/es/src/bookings-v2-booking.public.js.map +1 -0
- package/build/es/src/bookings-v2-booking.types.d.ts +1594 -0
- package/build/es/src/bookings-v2-booking.types.js +96 -0
- package/build/es/src/bookings-v2-booking.types.js.map +1 -0
- package/build/es/src/bookings-v2-booking.universal.d.ts +1840 -0
- package/build/es/src/bookings-v2-booking.universal.js +534 -0
- package/build/es/src/bookings-v2-booking.universal.js.map +1 -0
- package/build/es/src/bookings-v2-price-info.http.d.ts +56 -0
- package/build/es/src/bookings-v2-price-info.http.js +159 -0
- package/build/es/src/bookings-v2-price-info.http.js.map +1 -0
- package/build/es/src/bookings-v2-price-info.public.d.ts +6 -0
- package/build/es/src/bookings-v2-price-info.public.js +13 -0
- package/build/es/src/bookings-v2-price-info.public.js.map +1 -0
- package/build/es/src/bookings-v2-price-info.types.d.ts +594 -0
- package/build/es/src/bookings-v2-price-info.types.js +76 -0
- package/build/es/src/bookings-v2-price-info.types.js.map +1 -0
- package/build/es/src/bookings-v2-price-info.universal.d.ts +664 -0
- package/build/es/src/bookings-v2-price-info.universal.js +250 -0
- package/build/es/src/bookings-v2-price-info.universal.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.calculatePrice = exports.previewPrice = exports.IdentityType = exports.Actor = exports.Platform = exports.SelectedPaymentOption = exports.PaymentStatus = exports.BookingStatus = exports.ValueType = exports.LocationType = exports.__debug = void 0;
|
|
32
|
+
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
+
const ambassadorWixBookingsV2PriceInfo = __importStar(require("./bookings-v2-price-info.http"));
|
|
34
|
+
let __verbose = false;
|
|
35
|
+
function __log(...args) {
|
|
36
|
+
__verbose && console.log(...args);
|
|
37
|
+
}
|
|
38
|
+
function __inspect(obj) {
|
|
39
|
+
return obj;
|
|
40
|
+
}
|
|
41
|
+
exports.__debug = {
|
|
42
|
+
verboseLogging: {
|
|
43
|
+
on: () => (__verbose = true),
|
|
44
|
+
off: () => (__verbose = false),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const _toVeloEntity = '$';
|
|
48
|
+
const _fromVeloEntity = '$';
|
|
49
|
+
var LocationType;
|
|
50
|
+
(function (LocationType) {
|
|
51
|
+
LocationType["UNDEFINED"] = "UNDEFINED";
|
|
52
|
+
LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
|
|
53
|
+
LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
|
|
54
|
+
LocationType["CUSTOM"] = "CUSTOM";
|
|
55
|
+
})(LocationType = exports.LocationType || (exports.LocationType = {}));
|
|
56
|
+
var ValueType;
|
|
57
|
+
(function (ValueType) {
|
|
58
|
+
/** Short text. This is the default value type. */
|
|
59
|
+
ValueType["SHORT_TEXT"] = "SHORT_TEXT";
|
|
60
|
+
/** Long text */
|
|
61
|
+
ValueType["LONG_TEXT"] = "LONG_TEXT";
|
|
62
|
+
/** a text that represent the check box value: if selected the value is "true", otherwise "false". */
|
|
63
|
+
ValueType["CHECK_BOX"] = "CHECK_BOX";
|
|
64
|
+
})(ValueType = exports.ValueType || (exports.ValueType = {}));
|
|
65
|
+
/** Booking status. */
|
|
66
|
+
var BookingStatus;
|
|
67
|
+
(function (BookingStatus) {
|
|
68
|
+
BookingStatus["CREATED"] = "CREATED";
|
|
69
|
+
BookingStatus["CONFIRMED"] = "CONFIRMED";
|
|
70
|
+
BookingStatus["CANCELED"] = "CANCELED";
|
|
71
|
+
BookingStatus["PENDING"] = "PENDING";
|
|
72
|
+
BookingStatus["DECLINED"] = "DECLINED";
|
|
73
|
+
BookingStatus["WAITING_LIST"] = "WAITING_LIST";
|
|
74
|
+
})(BookingStatus = exports.BookingStatus || (exports.BookingStatus = {}));
|
|
75
|
+
/**
|
|
76
|
+
* Payment status.
|
|
77
|
+
* Automatically updated when using eCom checkout APIs.
|
|
78
|
+
*/
|
|
79
|
+
var PaymentStatus;
|
|
80
|
+
(function (PaymentStatus) {
|
|
81
|
+
PaymentStatus["UNDEFINED"] = "UNDEFINED";
|
|
82
|
+
PaymentStatus["NOT_PAID"] = "NOT_PAID";
|
|
83
|
+
PaymentStatus["PAID"] = "PAID";
|
|
84
|
+
/** not supported yet. */
|
|
85
|
+
PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
|
|
86
|
+
/** not supported yet */
|
|
87
|
+
PaymentStatus["REFUNDED"] = "REFUNDED";
|
|
88
|
+
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
|
89
|
+
/**
|
|
90
|
+
* The selected payment option.
|
|
91
|
+
* One of the payment options offered by the service.
|
|
92
|
+
* This field is be set when the user selects an option during booking.
|
|
93
|
+
* If left undefined, the payment option is resolved by the service configuration on checkout.
|
|
94
|
+
*/
|
|
95
|
+
var SelectedPaymentOption;
|
|
96
|
+
(function (SelectedPaymentOption) {
|
|
97
|
+
SelectedPaymentOption["UNDEFINED"] = "UNDEFINED";
|
|
98
|
+
SelectedPaymentOption["OFFLINE"] = "OFFLINE";
|
|
99
|
+
SelectedPaymentOption["ONLINE"] = "ONLINE";
|
|
100
|
+
SelectedPaymentOption["MEMBERSHIP"] = "MEMBERSHIP";
|
|
101
|
+
/** Payment can only be done using a membership and must be manually redeemed in the dashboard by the site owner. */
|
|
102
|
+
SelectedPaymentOption["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
|
|
103
|
+
})(SelectedPaymentOption = exports.SelectedPaymentOption || (exports.SelectedPaymentOption = {}));
|
|
104
|
+
var Platform;
|
|
105
|
+
(function (Platform) {
|
|
106
|
+
Platform["UNDEFINED_PLATFORM"] = "UNDEFINED_PLATFORM";
|
|
107
|
+
Platform["WEB"] = "WEB";
|
|
108
|
+
Platform["MOBILE_APP"] = "MOBILE_APP";
|
|
109
|
+
})(Platform = exports.Platform || (exports.Platform = {}));
|
|
110
|
+
var Actor;
|
|
111
|
+
(function (Actor) {
|
|
112
|
+
Actor["UNDEFINED_ACTOR"] = "UNDEFINED_ACTOR";
|
|
113
|
+
Actor["BUSINESS"] = "BUSINESS";
|
|
114
|
+
Actor["CUSTOMER"] = "CUSTOMER";
|
|
115
|
+
})(Actor = exports.Actor || (exports.Actor = {}));
|
|
116
|
+
var IdentityType;
|
|
117
|
+
(function (IdentityType) {
|
|
118
|
+
IdentityType["UNKNOWN"] = "UNKNOWN";
|
|
119
|
+
IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
120
|
+
IdentityType["MEMBER"] = "MEMBER";
|
|
121
|
+
IdentityType["WIX_USER"] = "WIX_USER";
|
|
122
|
+
IdentityType["APP"] = "APP";
|
|
123
|
+
})(IdentityType = exports.IdentityType || (exports.IdentityType = {}));
|
|
124
|
+
const _calculatePriceRequest = {};
|
|
125
|
+
const _calculatePriceResponse = {};
|
|
126
|
+
const _previewPriceRequest = {};
|
|
127
|
+
const _previewPriceResponse = {};
|
|
128
|
+
/**
|
|
129
|
+
* Previews the base price for a set of line items belonging to the same service,
|
|
130
|
+
* before a booking is actually created.
|
|
131
|
+
*
|
|
132
|
+
* The returned price preview information about each line
|
|
133
|
+
* item's price and sums up each line item's price.
|
|
134
|
+
*
|
|
135
|
+
* The previewed price is not the actual price that will be used to charge the customer.
|
|
136
|
+
* `Preview Price` only estimates the base price by adding up the price
|
|
137
|
+
* of each line item before
|
|
138
|
+
* the booking is actually created.
|
|
139
|
+
*
|
|
140
|
+
* Use [`Calculate Price`](https://example.com) to get the base price
|
|
141
|
+
* after the booking is created.
|
|
142
|
+
*
|
|
143
|
+
* Passing line items that belong to different services results in an error.
|
|
144
|
+
*
|
|
145
|
+
* ## Calculating the previewed price
|
|
146
|
+
*
|
|
147
|
+
* Wix Bookings has its own default pricing logic for previewing the price. You must
|
|
148
|
+
* pass the `serviceId` in the [`slot`](https://example.com/)
|
|
149
|
+
* or [`schedule`](https://example.com/) object to `Preview Price`.
|
|
150
|
+
*
|
|
151
|
+
* You cannot call `Preview Price` if you have customized Bookings pricing logic using the
|
|
152
|
+
* [Bookings Pricing Provider SPI](https://example.com/). Calling `Preview Price` if custom pricing
|
|
153
|
+
* logic has been implemented for the site results in an error.
|
|
154
|
+
* @public
|
|
155
|
+
* @documentationMaturity preview
|
|
156
|
+
*/
|
|
157
|
+
function previewPrice(options) {
|
|
158
|
+
var _a, _b, _c;
|
|
159
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
160
|
+
const requestTransformation = { bookingLineItems: '$[0].bookingLineItems' };
|
|
161
|
+
const responseTransformation = '$';
|
|
162
|
+
// @ts-ignore
|
|
163
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
164
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
165
|
+
rootSchema: _previewPriceRequest,
|
|
166
|
+
depSchemas: {},
|
|
167
|
+
fqdnTransformation: {
|
|
168
|
+
paths: [],
|
|
169
|
+
transformation: _fromVeloEntity,
|
|
170
|
+
},
|
|
171
|
+
customTransformation: requestTransformation,
|
|
172
|
+
});
|
|
173
|
+
const { fromJSON } = velo_1.serializer({
|
|
174
|
+
rootSchema: _previewPriceResponse,
|
|
175
|
+
depSchemas: {},
|
|
176
|
+
fqdnTransformation: {
|
|
177
|
+
paths: [...['priceInfo']],
|
|
178
|
+
transformation: _toVeloEntity,
|
|
179
|
+
},
|
|
180
|
+
customTransformation: responseTransformation,
|
|
181
|
+
});
|
|
182
|
+
const payload = toAmbassadorRequest([options]);
|
|
183
|
+
const reqOpts = ambassadorWixBookingsV2PriceInfo.previewPrice(payload);
|
|
184
|
+
__log(`"PreviewPrice" sending request with: ${__inspect(reqOpts)}`);
|
|
185
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
186
|
+
try {
|
|
187
|
+
const result = yield httpClient.request(reqOpts);
|
|
188
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
189
|
+
return fromJSON(result.data);
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
193
|
+
'options',
|
|
194
|
+
]);
|
|
195
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
196
|
+
throw transformedError;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
exports.previewPrice = previewPrice;
|
|
201
|
+
/**
|
|
202
|
+
* Calculates the base price of a booking.
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* You can call `Calculate Price` after a booking is created. The returned calculated price includes information about each line
|
|
206
|
+
* item's price and the booking's total price.
|
|
207
|
+
*
|
|
208
|
+
* You can use [`Preview Price`](https://example.com) to get the base price
|
|
209
|
+
* before a booking is created.
|
|
210
|
+
*
|
|
211
|
+
* The calculated price is the base price that will be used as a basis for charging the customer.
|
|
212
|
+
* During checkout, additional taxes
|
|
213
|
+
* and fees might be added to this base price.
|
|
214
|
+
*
|
|
215
|
+
* ## Calculating the price
|
|
216
|
+
*
|
|
217
|
+
* Wix Bookings has its own default pricing logic for calculating the price. When
|
|
218
|
+
* using Wix Bookings' default pricing logic, you must pass the `serviceId` in the [`slot`](https://example.com/)
|
|
219
|
+
* or [`schedule`](https://example.com/) object to `Calculate Price`.
|
|
220
|
+
*
|
|
221
|
+
* Alternatively you can customize the pricing logic using the
|
|
222
|
+
* [Bookings Pricing Provider SPI](https://example.com/).
|
|
223
|
+
* If you integrate with a pricing provider, the customized pricing logic becomes
|
|
224
|
+
* the default logic.
|
|
225
|
+
* @param booking - Booking to calculate the price for.
|
|
226
|
+
* @public
|
|
227
|
+
* @documentationMaturity preview
|
|
228
|
+
* @requiredField booking
|
|
229
|
+
*/
|
|
230
|
+
function calculatePrice(booking) {
|
|
231
|
+
var _a, _b, _c;
|
|
232
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
233
|
+
const requestTransformation = { booking: '$[0]' };
|
|
234
|
+
const responseTransformation = '$';
|
|
235
|
+
// @ts-ignore
|
|
236
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
237
|
+
const { toAmbassadorRequest } = velo_1.serializer({
|
|
238
|
+
rootSchema: _calculatePriceRequest,
|
|
239
|
+
depSchemas: {},
|
|
240
|
+
fqdnTransformation: {
|
|
241
|
+
paths: [],
|
|
242
|
+
transformation: _fromVeloEntity,
|
|
243
|
+
},
|
|
244
|
+
customTransformation: requestTransformation,
|
|
245
|
+
});
|
|
246
|
+
const { fromJSON } = velo_1.serializer({
|
|
247
|
+
rootSchema: _calculatePriceResponse,
|
|
248
|
+
depSchemas: {},
|
|
249
|
+
fqdnTransformation: {
|
|
250
|
+
paths: [...['priceInfo']],
|
|
251
|
+
transformation: _toVeloEntity,
|
|
252
|
+
},
|
|
253
|
+
customTransformation: responseTransformation,
|
|
254
|
+
});
|
|
255
|
+
const payload = toAmbassadorRequest([booking]);
|
|
256
|
+
const reqOpts = ambassadorWixBookingsV2PriceInfo.calculatePrice(payload);
|
|
257
|
+
__log(`"CalculatePrice" sending request with: ${__inspect(reqOpts)}`);
|
|
258
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
259
|
+
try {
|
|
260
|
+
const result = yield httpClient.request(reqOpts);
|
|
261
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
262
|
+
return fromJSON(result.data);
|
|
263
|
+
}
|
|
264
|
+
catch (err) {
|
|
265
|
+
const transformedError = velo_1.transformError(err, requestTransformation, [
|
|
266
|
+
'booking',
|
|
267
|
+
]);
|
|
268
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
269
|
+
throw transformedError;
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
exports.calculatePrice = calculatePrice;
|
|
274
|
+
//# sourceMappingURL=bookings-v2-price-info.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-v2-price-info.universal.js","sourceRoot":"","sources":["../../../src/bookings-v2-price-info.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,gGAAkF;AAElF,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AA+T5B,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,G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CAAC;YAC9B,UAAU,EAAE,uBAAuB;YACnC,UAAU,EAAE,EAAE;YACd,kBAAkB,EAAE;gBAClB,KAAK,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACzB,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAE/C,MAAM,OAAO,GAAG,gCAAgC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAEzE,KAAK,CAAC,0CAA0C,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEtE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,qBAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AApDD,wCAoDC"}
|
package/build/es/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export * as availabilityCalendar from './src/bookings-availability-v1-slot-availability.public';
|
|
2
1
|
export * as sessions from './src/bookings-calendar-v1-session.public';
|
|
3
2
|
export * as resources from './src/bookings-catalog-v1-resource.public';
|
|
3
|
+
export * as availabilityCalendar from './src/bookings-availability-v1-slot-availability.public';
|
|
4
|
+
export * as extendedBookings from './src/bookings-reader-v2-extended-booking.public';
|
|
5
|
+
export * as bookings from './src/bookings-v2-booking.public';
|
|
6
|
+
export * as bookingsPricing from './src/bookings-v2-price-info.public';
|
package/build/es/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export * as availabilityCalendar from './src/bookings-availability-v1-slot-availability.public';
|
|
2
1
|
export * as sessions from './src/bookings-calendar-v1-session.public';
|
|
3
2
|
export * as resources from './src/bookings-catalog-v1-resource.public';
|
|
3
|
+
export * as availabilityCalendar from './src/bookings-availability-v1-slot-availability.public';
|
|
4
|
+
export * as extendedBookings from './src/bookings-reader-v2-extended-booking.public';
|
|
5
|
+
export * as bookings from './src/bookings-v2-booking.public';
|
|
6
|
+
export * as bookingsPricing from './src/bookings-v2-price-info.public';
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
package/build/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,oBAAoB,MAAM,yDAAyD,CAAC;AAChG,OAAO,KAAK,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,2CAA2C,CAAC;AACtE,OAAO,KAAK,SAAS,MAAM,2CAA2C,CAAC;AACvE,OAAO,KAAK,oBAAoB,MAAM,yDAAyD,CAAC;AAChG,OAAO,KAAK,gBAAgB,MAAM,kDAAkD,CAAC;AACrF,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAC7D,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { QueryAvailabilityRequest, QueryAvailabilityResponse } from './bookings-
|
|
|
5
5
|
* that match the provided query criteria (paging, filtering, and sorting).
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
|
-
* The Calendar
|
|
8
|
+
* The Availability Calendar APIs calculate the availability of sessions for
|
|
9
9
|
* appointments and classes, but not
|
|
10
10
|
* for courses.
|
|
11
11
|
*
|
|
@@ -29,7 +29,7 @@ import { QueryAvailabilityRequest, QueryAvailabilityResponse } from './bookings-
|
|
|
29
29
|
* Locked sessions do not impact session availability and `bookable` can
|
|
30
30
|
* be `true` even if `locked` is `true`. For example, if a session has a waitlist and a
|
|
31
31
|
* place frees up, the slot is offered to the customers on the waitlist, one by one. The
|
|
32
|
-
*
|
|
32
|
+
* session remains locked because there is still a waitlist, but for a period of time
|
|
33
33
|
* there is availability, until a customer on the waitlist takes the slot. Locking
|
|
34
34
|
* prevents customers who are not yet on the waitlist from grabbing the slot.
|
|
35
35
|
*
|
|
@@ -41,10 +41,10 @@ import { QueryAvailabilityRequest, QueryAvailabilityResponse } from './bookings-
|
|
|
41
41
|
* because at `00:00` the clock moved
|
|
42
42
|
* 1 hour forward to `01:00`.
|
|
43
43
|
*
|
|
44
|
-
* In this case, the Availability APIs take this
|
|
45
|
-
* into account and mediate the time gaps automatically. The non-
|
|
46
|
-
*
|
|
47
|
-
* So if the `
|
|
44
|
+
* In this case, the Availability Calendar APIs take this
|
|
45
|
+
* into account and mediate the time gaps automatically. The non-existent local time is
|
|
46
|
+
* automatically moved forward 1 hour to match local DST. Local times that exist do not change.
|
|
47
|
+
* So if the `queryAvailability()` function is called with a `startDate` of `2021-09-05T00:00:01.000`
|
|
48
48
|
* and an `endDate` of `2021-09-06T00:00:02.000`, `2021-09-05T01:00:01.000` is used in the query
|
|
49
49
|
* instead. The start time shifts one hour forward and the end time remains the same.
|
|
50
50
|
*/
|
|
@@ -90,7 +90,7 @@ function resolveComWixpressBookingsAvailabilityAvailabilityCalendarUrl(opts) {
|
|
|
90
90
|
* that match the provided query criteria (paging, filtering, and sorting).
|
|
91
91
|
*
|
|
92
92
|
*
|
|
93
|
-
* The Calendar
|
|
93
|
+
* The Availability Calendar APIs calculate the availability of sessions for
|
|
94
94
|
* appointments and classes, but not
|
|
95
95
|
* for courses.
|
|
96
96
|
*
|
|
@@ -114,7 +114,7 @@ function resolveComWixpressBookingsAvailabilityAvailabilityCalendarUrl(opts) {
|
|
|
114
114
|
* Locked sessions do not impact session availability and `bookable` can
|
|
115
115
|
* be `true` even if `locked` is `true`. For example, if a session has a waitlist and a
|
|
116
116
|
* place frees up, the slot is offered to the customers on the waitlist, one by one. The
|
|
117
|
-
*
|
|
117
|
+
* session remains locked because there is still a waitlist, but for a period of time
|
|
118
118
|
* there is availability, until a customer on the waitlist takes the slot. Locking
|
|
119
119
|
* prevents customers who are not yet on the waitlist from grabbing the slot.
|
|
120
120
|
*
|
|
@@ -126,10 +126,10 @@ function resolveComWixpressBookingsAvailabilityAvailabilityCalendarUrl(opts) {
|
|
|
126
126
|
* because at `00:00` the clock moved
|
|
127
127
|
* 1 hour forward to `01:00`.
|
|
128
128
|
*
|
|
129
|
-
* In this case, the Availability APIs take this
|
|
130
|
-
* into account and mediate the time gaps automatically. The non-
|
|
131
|
-
*
|
|
132
|
-
* So if the `
|
|
129
|
+
* In this case, the Availability Calendar APIs take this
|
|
130
|
+
* into account and mediate the time gaps automatically. The non-existent local time is
|
|
131
|
+
* automatically moved forward 1 hour to match local DST. Local times that exist do not change.
|
|
132
|
+
* So if the `queryAvailability()` function is called with a `startDate` of `2021-09-05T00:00:01.000`
|
|
133
133
|
* and an `endDate` of `2021-09-06T00:00:02.000`, `2021-09-05T01:00:01.000` is used in the query
|
|
134
134
|
* instead. The start time shifts one hour forward and the end time remains the same.
|
|
135
135
|
*/
|
|
@@ -63,10 +63,9 @@ export interface Slot {
|
|
|
63
63
|
*/
|
|
64
64
|
endDate?: string | null;
|
|
65
65
|
/**
|
|
66
|
-
* The timezone for which slot availability is to be calculated.
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* when calculating availability.
|
|
66
|
+
* The timezone for which slot availability is to be calculated. If specified,
|
|
67
|
+
* dates are based on the local date/time, meaning that the timezone offset
|
|
68
|
+
* in the date's format is ignored.
|
|
70
69
|
*/
|
|
71
70
|
timezone?: string | null;
|
|
72
71
|
/**
|
|
@@ -133,12 +132,9 @@ export interface QueryAvailabilityRequest {
|
|
|
133
132
|
/** Query options. */
|
|
134
133
|
query: QueryV2;
|
|
135
134
|
/**
|
|
136
|
-
* The timezone for which
|
|
135
|
+
* The timezone for which slot availability is to be calculated. If specified,
|
|
137
136
|
* dates are based on the local date/time, meaning that the timezone offset
|
|
138
137
|
* in the date's format is ignored.
|
|
139
|
-
*
|
|
140
|
-
* Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)
|
|
141
|
-
* when calculating availability.
|
|
142
138
|
*/
|
|
143
139
|
timezone?: string | null;
|
|
144
140
|
/**
|
|
@@ -154,16 +150,10 @@ export interface QueryAvailabilityRequest {
|
|
|
154
150
|
}
|
|
155
151
|
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
156
152
|
/**
|
|
157
|
-
* Filter object.
|
|
158
|
-
* fields you can filter by, see [Calendar Availability: Supported Fields, Filters, and Sorting](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/supported-fields,-filters,-and-sorting).
|
|
159
|
-
* You must include the `startDate` and `endDate` in the filter. This avoids large results that can impact performance.
|
|
153
|
+
* Filter object. You must include the `startDate` and `endDate` in the filter. This avoids large results that can impact performance.
|
|
160
154
|
*/
|
|
161
155
|
filter?: Record<string, any> | null;
|
|
162
|
-
/**
|
|
163
|
-
* Sort options.
|
|
164
|
-
* Currently, only sorting by `startDate` is supported. For details
|
|
165
|
-
* on sorting, see [Calendar Availability: Supported Fields, Filters and Sorting](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/supported-fields,-filters,-and-sorting).
|
|
166
|
-
*/
|
|
156
|
+
/** Currently, only sorting by `startDate` is supported. */
|
|
167
157
|
sort?: Sorting[];
|
|
168
158
|
/** List of projected fields to return. All fields are supported. */
|
|
169
159
|
fields?: string[];
|
|
@@ -228,9 +218,6 @@ export interface GetSlotAvailabilityRequest {
|
|
|
228
218
|
* The timezone for which slot availability is to be calculated. If specified,
|
|
229
219
|
* dates are based on the local date/time, meaning that the timezone offset
|
|
230
220
|
* in the date's format is ignored.
|
|
231
|
-
*
|
|
232
|
-
* Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)
|
|
233
|
-
* when calculating availability.
|
|
234
221
|
*/
|
|
235
222
|
timezone?: string | null;
|
|
236
223
|
}
|
|
@@ -269,7 +256,7 @@ export interface ScheduleAvailability {
|
|
|
269
256
|
* that match the provided query criteria (paging, filtering, and sorting).
|
|
270
257
|
*
|
|
271
258
|
*
|
|
272
|
-
* The Calendar
|
|
259
|
+
* The Availability Calendar APIs calculate the availability of sessions for
|
|
273
260
|
* appointments and classes, but not
|
|
274
261
|
* for courses.
|
|
275
262
|
*
|
|
@@ -293,7 +280,7 @@ export interface ScheduleAvailability {
|
|
|
293
280
|
* Locked sessions do not impact session availability and `bookable` can
|
|
294
281
|
* be `true` even if `locked` is `true`. For example, if a session has a waitlist and a
|
|
295
282
|
* place frees up, the slot is offered to the customers on the waitlist, one by one. The
|
|
296
|
-
*
|
|
283
|
+
* session remains locked because there is still a waitlist, but for a period of time
|
|
297
284
|
* there is availability, until a customer on the waitlist takes the slot. Locking
|
|
298
285
|
* prevents customers who are not yet on the waitlist from grabbing the slot.
|
|
299
286
|
*
|
|
@@ -305,10 +292,10 @@ export interface ScheduleAvailability {
|
|
|
305
292
|
* because at `00:00` the clock moved
|
|
306
293
|
* 1 hour forward to `01:00`.
|
|
307
294
|
*
|
|
308
|
-
* In this case, the Availability APIs take this
|
|
309
|
-
* into account and mediate the time gaps automatically. The non-
|
|
310
|
-
*
|
|
311
|
-
* So if the `
|
|
295
|
+
* In this case, the Availability Calendar APIs take this
|
|
296
|
+
* into account and mediate the time gaps automatically. The non-existent local time is
|
|
297
|
+
* automatically moved forward 1 hour to match local DST. Local times that exist do not change.
|
|
298
|
+
* So if the `queryAvailability()` function is called with a `startDate` of `2021-09-05T00:00:01.000`
|
|
312
299
|
* and an `endDate` of `2021-09-06T00:00:02.000`, `2021-09-05T01:00:01.000` is used in the query
|
|
313
300
|
* instead. The start time shifts one hour forward and the end time remains the same.
|
|
314
301
|
* @param query - Query options.
|
|
@@ -316,16 +303,14 @@ export interface ScheduleAvailability {
|
|
|
316
303
|
* @documentationMaturity preview
|
|
317
304
|
* @requiredField query
|
|
318
305
|
* @requiredField query.filter
|
|
306
|
+
* @param options - Additional options for performing the query.
|
|
319
307
|
*/
|
|
320
308
|
export declare function queryAvailability(query: QueryV2, options?: QueryAvailabilityOptions): Promise<QueryAvailabilityResponse>;
|
|
321
309
|
export interface QueryAvailabilityOptions {
|
|
322
310
|
/**
|
|
323
|
-
* The timezone for which
|
|
311
|
+
* The timezone for which slot availability is to be calculated. If specified,
|
|
324
312
|
* dates are based on the local date/time, meaning that the timezone offset
|
|
325
313
|
* in the date's format is ignored.
|
|
326
|
-
*
|
|
327
|
-
* Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)
|
|
328
|
-
* when calculating availability.
|
|
329
314
|
*/
|
|
330
315
|
timezone?: string | null;
|
|
331
316
|
/**
|
|
@@ -43,7 +43,7 @@ const _queryAvailabilityResponse = {};
|
|
|
43
43
|
* that match the provided query criteria (paging, filtering, and sorting).
|
|
44
44
|
*
|
|
45
45
|
*
|
|
46
|
-
* The Calendar
|
|
46
|
+
* The Availability Calendar APIs calculate the availability of sessions for
|
|
47
47
|
* appointments and classes, but not
|
|
48
48
|
* for courses.
|
|
49
49
|
*
|
|
@@ -67,7 +67,7 @@ const _queryAvailabilityResponse = {};
|
|
|
67
67
|
* Locked sessions do not impact session availability and `bookable` can
|
|
68
68
|
* be `true` even if `locked` is `true`. For example, if a session has a waitlist and a
|
|
69
69
|
* place frees up, the slot is offered to the customers on the waitlist, one by one. The
|
|
70
|
-
*
|
|
70
|
+
* session remains locked because there is still a waitlist, but for a period of time
|
|
71
71
|
* there is availability, until a customer on the waitlist takes the slot. Locking
|
|
72
72
|
* prevents customers who are not yet on the waitlist from grabbing the slot.
|
|
73
73
|
*
|
|
@@ -79,10 +79,10 @@ const _queryAvailabilityResponse = {};
|
|
|
79
79
|
* because at `00:00` the clock moved
|
|
80
80
|
* 1 hour forward to `01:00`.
|
|
81
81
|
*
|
|
82
|
-
* In this case, the Availability APIs take this
|
|
83
|
-
* into account and mediate the time gaps automatically. The non-
|
|
84
|
-
*
|
|
85
|
-
* So if the `
|
|
82
|
+
* In this case, the Availability Calendar APIs take this
|
|
83
|
+
* into account and mediate the time gaps automatically. The non-existent local time is
|
|
84
|
+
* automatically moved forward 1 hour to match local DST. Local times that exist do not change.
|
|
85
|
+
* So if the `queryAvailability()` function is called with a `startDate` of `2021-09-05T00:00:01.000`
|
|
86
86
|
* and an `endDate` of `2021-09-06T00:00:02.000`, `2021-09-05T01:00:01.000` is used in the query
|
|
87
87
|
* instead. The start time shifts one hour forward and the end time remains the same.
|
|
88
88
|
* @param query - Query options.
|
|
@@ -90,6 +90,7 @@ const _queryAvailabilityResponse = {};
|
|
|
90
90
|
* @documentationMaturity preview
|
|
91
91
|
* @requiredField query
|
|
92
92
|
* @requiredField query.filter
|
|
93
|
+
* @param options - Additional options for performing the query.
|
|
93
94
|
*/
|
|
94
95
|
export function queryAvailability(query, options) {
|
|
95
96
|
var _a, _b, _c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings-availability-v1-slot-availability.universal.js","sourceRoot":"","sources":["../../../src/bookings-availability-v1-slot-availability.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,mDAAmD,MAAM,mDAAmD,CAAC;AAEzH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"bookings-availability-v1-slot-availability.universal.js","sourceRoot":"","sources":["../../../src/bookings-availability-v1-slot-availability.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,mDAAmD,MAAM,mDAAmD,CAAC;AAEzH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,G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AG,CAAC,2BAA2B,CAAC,CAAC;gBACzC,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QAEtD,MAAM,OAAO,GACX,mDAAmD,CAAC,iBAAiB,CACnE,OAAO,CACR,CAAC;QAEJ,KAAK,CAAC,6CAA6C,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEzE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,OAAO;gBACP,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { QueryExtendedBookingsRequest, QueryExtendedBookingsResponse } from './bookings-reader-v2-extended-booking.types';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves a list of bookings, given the provided paging, filtering, and sorting.
|
|
5
|
+
*
|
|
6
|
+
* Up to 100 bookings can be returned per request.
|
|
7
|
+
*
|
|
8
|
+
* Query Extended Bookings runs with these defaults, which you can override:
|
|
9
|
+
*
|
|
10
|
+
* - `createdDate` sorted in `DESC` order
|
|
11
|
+
* - `cursorPaging.limit` is `50`
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* You can retrieve information about which actions the customer can perform
|
|
15
|
+
* for the bookings. To do so, pass `withBookingAllowedActions` as `true`.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* For field support see
|
|
19
|
+
* [supported filters](https://dev.wix.com/api/rest/wix-bookings/bookings-reader-v2/supported-filters)
|
|
20
|
+
* for more information.
|
|
21
|
+
*
|
|
22
|
+
* You can only specify a filter only once per query. If a filter is provided
|
|
23
|
+
* more than once, only the first occurrence affects the returned bookings.
|
|
24
|
+
*
|
|
25
|
+
* When using filters for dates, you must use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
|
|
26
|
+
*
|
|
27
|
+
* Bookings that are part of a schedule don't have a `sessionId`. Therefore you
|
|
28
|
+
* must use the `sessionId` filter that isn't part of the `query` object to
|
|
29
|
+
* filter bookings for courses.
|
|
30
|
+
*
|
|
31
|
+
* To learn about working with _Query_ endpoints, see
|
|
32
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
33
|
+
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging),
|
|
34
|
+
* and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
35
|
+
*
|
|
36
|
+
* When calling Query Extended Bookings, the retrieved data may not contain your most recent changes.
|
|
37
|
+
*/
|
|
38
|
+
export declare function queryExtendedBookings(payload: QueryExtendedBookingsRequest): RequestOptionsFactory<QueryExtendedBookingsResponse>;
|