@wix/bookings 1.0.0 → 1.0.1
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 +2 -0
- package/build/cjs/index.js +3 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/bookings-calendar-v1-session.http.d.ts +75 -0
- package/build/cjs/src/bookings-calendar-v1-session.http.js +355 -0
- package/build/cjs/src/bookings-calendar-v1-session.http.js.map +1 -0
- package/build/cjs/src/bookings-calendar-v1-session.public.d.ts +8 -0
- package/build/cjs/src/bookings-calendar-v1-session.public.js +41 -0
- package/build/cjs/src/bookings-calendar-v1-session.public.js.map +1 -0
- package/build/cjs/src/bookings-calendar-v1-session.types.d.ts +1011 -0
- package/build/cjs/src/bookings-calendar-v1-session.types.js +110 -0
- package/build/cjs/src/bookings-calendar-v1-session.types.js.map +1 -0
- package/build/cjs/src/bookings-calendar-v1-session.universal.d.ts +1178 -0
- package/build/cjs/src/bookings-calendar-v1-session.universal.js +437 -0
- package/build/cjs/src/bookings-calendar-v1-session.universal.js.map +1 -0
- package/build/cjs/src/bookings-catalog-v1-resource.http.d.ts +195 -0
- package/build/cjs/src/bookings-catalog-v1-resource.http.js +564 -0
- package/build/cjs/src/bookings-catalog-v1-resource.http.js.map +1 -0
- package/build/cjs/src/bookings-catalog-v1-resource.public.d.ts +10 -0
- package/build/cjs/src/bookings-catalog-v1-resource.public.js +55 -0
- package/build/cjs/src/bookings-catalog-v1-resource.public.js.map +1 -0
- package/build/cjs/src/bookings-catalog-v1-resource.types.d.ts +931 -0
- package/build/cjs/src/bookings-catalog-v1-resource.types.js +125 -0
- package/build/cjs/src/bookings-catalog-v1-resource.types.js.map +1 -0
- package/build/cjs/src/bookings-catalog-v1-resource.universal.d.ts +1201 -0
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js +740 -0
- package/build/cjs/src/bookings-catalog-v1-resource.universal.js.map +1 -0
- package/build/es/index.d.ts +2 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -1
- package/build/es/src/bookings-calendar-v1-session.http.d.ts +75 -0
- package/build/es/src/bookings-calendar-v1-session.http.js +348 -0
- package/build/es/src/bookings-calendar-v1-session.http.js.map +1 -0
- package/build/es/src/bookings-calendar-v1-session.public.d.ts +8 -0
- package/build/es/src/bookings-calendar-v1-session.public.js +23 -0
- package/build/es/src/bookings-calendar-v1-session.public.js.map +1 -0
- package/build/es/src/bookings-calendar-v1-session.types.d.ts +1011 -0
- package/build/es/src/bookings-calendar-v1-session.types.js +107 -0
- package/build/es/src/bookings-calendar-v1-session.types.js.map +1 -0
- package/build/es/src/bookings-calendar-v1-session.universal.d.ts +1178 -0
- package/build/es/src/bookings-calendar-v1-session.universal.js +411 -0
- package/build/es/src/bookings-calendar-v1-session.universal.js.map +1 -0
- package/build/es/src/bookings-catalog-v1-resource.http.d.ts +195 -0
- package/build/es/src/bookings-catalog-v1-resource.http.js +555 -0
- package/build/es/src/bookings-catalog-v1-resource.http.js.map +1 -0
- package/build/es/src/bookings-catalog-v1-resource.public.d.ts +10 -0
- package/build/es/src/bookings-catalog-v1-resource.public.js +33 -0
- package/build/es/src/bookings-catalog-v1-resource.public.js.map +1 -0
- package/build/es/src/bookings-catalog-v1-resource.types.d.ts +931 -0
- package/build/es/src/bookings-catalog-v1-resource.types.js +122 -0
- package/build/es/src/bookings-catalog-v1-resource.types.js.map +1 -0
- package/build/es/src/bookings-catalog-v1-resource.universal.d.ts +1201 -0
- package/build/es/src/bookings-catalog-v1-resource.universal.js +712 -0
- package/build/es/src/bookings-catalog-v1-resource.universal.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { serializer, transformError } from '@wix/metro-runtime/velo';
|
|
11
|
+
import * as ambassadorWixBookingsCalendarV1Session from './bookings-calendar-v1-session.http';
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
let __verbose = false;
|
|
14
|
+
function __log(...args) {
|
|
15
|
+
__verbose && console.log(...args);
|
|
16
|
+
}
|
|
17
|
+
function __inspect(obj) {
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
export const __debug = {
|
|
21
|
+
verboseLogging: {
|
|
22
|
+
on: () => (__verbose = true),
|
|
23
|
+
off: () => (__verbose = false),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const _toVeloEntity = '$';
|
|
27
|
+
const _fromVeloEntity = '$';
|
|
28
|
+
export var Transparency;
|
|
29
|
+
(function (Transparency) {
|
|
30
|
+
Transparency["UNDEFINED"] = "UNDEFINED";
|
|
31
|
+
/** The schedule can have available slots during the session. */
|
|
32
|
+
Transparency["FREE"] = "FREE";
|
|
33
|
+
/** The schedule cannot have available slots during the session. Default value. */
|
|
34
|
+
Transparency["BUSY"] = "BUSY";
|
|
35
|
+
})(Transparency || (Transparency = {}));
|
|
36
|
+
export var LocationType;
|
|
37
|
+
(function (LocationType) {
|
|
38
|
+
LocationType["UNDEFINED"] = "UNDEFINED";
|
|
39
|
+
LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
|
|
40
|
+
LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
|
|
41
|
+
LocationType["CUSTOM"] = "CUSTOM";
|
|
42
|
+
})(LocationType || (LocationType = {}));
|
|
43
|
+
/** For future use */
|
|
44
|
+
export var LocationStatus;
|
|
45
|
+
(function (LocationStatus) {
|
|
46
|
+
LocationStatus["ACTIVE"] = "ACTIVE";
|
|
47
|
+
LocationStatus["INACTIVE"] = "INACTIVE";
|
|
48
|
+
})(LocationStatus || (LocationStatus = {}));
|
|
49
|
+
/** For future use */
|
|
50
|
+
export var LocationsLocationType;
|
|
51
|
+
(function (LocationsLocationType) {
|
|
52
|
+
LocationsLocationType["UNKNOWN"] = "UNKNOWN";
|
|
53
|
+
LocationsLocationType["BRANCH"] = "BRANCH";
|
|
54
|
+
LocationsLocationType["OFFICES"] = "OFFICES";
|
|
55
|
+
LocationsLocationType["RECEPTION"] = "RECEPTION";
|
|
56
|
+
LocationsLocationType["HEADQUARTERS"] = "HEADQUARTERS";
|
|
57
|
+
})(LocationsLocationType || (LocationsLocationType = {}));
|
|
58
|
+
/** Enumerates the days of the week. */
|
|
59
|
+
export var DayOfWeek;
|
|
60
|
+
(function (DayOfWeek) {
|
|
61
|
+
DayOfWeek["MONDAY"] = "MONDAY";
|
|
62
|
+
DayOfWeek["TUESDAY"] = "TUESDAY";
|
|
63
|
+
DayOfWeek["WEDNESDAY"] = "WEDNESDAY";
|
|
64
|
+
DayOfWeek["THURSDAY"] = "THURSDAY";
|
|
65
|
+
DayOfWeek["FRIDAY"] = "FRIDAY";
|
|
66
|
+
DayOfWeek["SATURDAY"] = "SATURDAY";
|
|
67
|
+
DayOfWeek["SUNDAY"] = "SUNDAY";
|
|
68
|
+
})(DayOfWeek || (DayOfWeek = {}));
|
|
69
|
+
export var ApprovalStatus;
|
|
70
|
+
(function (ApprovalStatus) {
|
|
71
|
+
/** Default. */
|
|
72
|
+
ApprovalStatus["UNDEFINED"] = "UNDEFINED";
|
|
73
|
+
/** Pending business approval. */
|
|
74
|
+
ApprovalStatus["PENDING"] = "PENDING";
|
|
75
|
+
/** Approved by the business. */
|
|
76
|
+
ApprovalStatus["APPROVED"] = "APPROVED";
|
|
77
|
+
/** Declined by the business. */
|
|
78
|
+
ApprovalStatus["DECLINED"] = "DECLINED";
|
|
79
|
+
})(ApprovalStatus || (ApprovalStatus = {}));
|
|
80
|
+
export var CalendarType;
|
|
81
|
+
(function (CalendarType) {
|
|
82
|
+
CalendarType["UNDEFINED"] = "UNDEFINED";
|
|
83
|
+
CalendarType["GOOGLE"] = "GOOGLE";
|
|
84
|
+
CalendarType["I_CAL"] = "I_CAL";
|
|
85
|
+
/** use MICROSOFT */
|
|
86
|
+
CalendarType["OUTLOOK"] = "OUTLOOK";
|
|
87
|
+
/** use MICROSOFT */
|
|
88
|
+
CalendarType["OFFICE_365"] = "OFFICE_365";
|
|
89
|
+
CalendarType["MICROSOFT"] = "MICROSOFT";
|
|
90
|
+
CalendarType["OTHER"] = "OTHER";
|
|
91
|
+
})(CalendarType || (CalendarType = {}));
|
|
92
|
+
export var Status;
|
|
93
|
+
(function (Status) {
|
|
94
|
+
Status["UNDEFINED"] = "UNDEFINED";
|
|
95
|
+
/** The session is confirmed. Default status. */
|
|
96
|
+
Status["CONFIRMED"] = "CONFIRMED";
|
|
97
|
+
/**
|
|
98
|
+
* The session is cancelled.
|
|
99
|
+
* A cancelled session can be the cancellation of a recurring session that should no longer be displayed or a deleted single session.
|
|
100
|
+
* The ListSessions returns cancelled sessions only if 'includeDelete' flag is set to true.
|
|
101
|
+
*/
|
|
102
|
+
Status["CANCELLED"] = "CANCELLED";
|
|
103
|
+
})(Status || (Status = {}));
|
|
104
|
+
export var SessionType;
|
|
105
|
+
(function (SessionType) {
|
|
106
|
+
SessionType["UNDEFINED"] = "UNDEFINED";
|
|
107
|
+
/**
|
|
108
|
+
* The session creates an event on the calendar for the owner of the schedule that the session belongs to.
|
|
109
|
+
* Default type.
|
|
110
|
+
*/
|
|
111
|
+
SessionType["EVENT"] = "EVENT";
|
|
112
|
+
/** The session represents a resource's available working hours. */
|
|
113
|
+
SessionType["WORKING_HOURS"] = "WORKING_HOURS";
|
|
114
|
+
/** Deprecated. please use WORKING_HOURS */
|
|
115
|
+
SessionType["TIME_AVAILABILITY"] = "TIME_AVAILABILITY";
|
|
116
|
+
/** Deprecated. The session represents a resource's available hours. please use WORKING_HOURS */
|
|
117
|
+
SessionType["AVAILABILITY"] = "AVAILABILITY";
|
|
118
|
+
})(SessionType || (SessionType = {}));
|
|
119
|
+
export var ConferenceType;
|
|
120
|
+
(function (ConferenceType) {
|
|
121
|
+
ConferenceType["UNDEFINED"] = "UNDEFINED";
|
|
122
|
+
/** API-generated online meeting. */
|
|
123
|
+
ConferenceType["ONLINE_MEETING_PROVIDER"] = "ONLINE_MEETING_PROVIDER";
|
|
124
|
+
/** User-defined meeting. */
|
|
125
|
+
ConferenceType["CUSTOM"] = "CUSTOM";
|
|
126
|
+
})(ConferenceType || (ConferenceType = {}));
|
|
127
|
+
export var CacheInfoStatus;
|
|
128
|
+
(function (CacheInfoStatus) {
|
|
129
|
+
CacheInfoStatus["UNDEFINED"] = "UNDEFINED";
|
|
130
|
+
CacheInfoStatus["INACTIVE"] = "INACTIVE";
|
|
131
|
+
CacheInfoStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
132
|
+
CacheInfoStatus["ACTIVE"] = "ACTIVE";
|
|
133
|
+
})(CacheInfoStatus || (CacheInfoStatus = {}));
|
|
134
|
+
const _getSessionRequest = {};
|
|
135
|
+
const _getSessionResponse = { session: '_session' };
|
|
136
|
+
const _listSessionsRequest = {};
|
|
137
|
+
const _listSessionsResponse = { sessions: '_session' };
|
|
138
|
+
const _location = { businessLocation: '_locationsLocation' };
|
|
139
|
+
const _locationsLocation = { address: 'wix.common.Address' };
|
|
140
|
+
const _queryEventSessionInstancesRequest = {};
|
|
141
|
+
const _queryEventSessionInstancesResponse = { sessions: '_session' };
|
|
142
|
+
const _querySessionsRequest = {};
|
|
143
|
+
const _querySessionsResponse = { sessions: '_session' };
|
|
144
|
+
const _session = { location: '_location' };
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves a list of sessions, given the provided time range, filtering, and paging.
|
|
147
|
+
*
|
|
148
|
+
* Query Sessions runs with these defaults, which you can override:
|
|
149
|
+
* - All session types are returned.
|
|
150
|
+
* - `instance` is true. This means only single sessions and instances of recurring sessions are returned.
|
|
151
|
+
* - Session objects are returned with the fields specified in the `NO_PI` fieldset. This means they don't contain personal information.
|
|
152
|
+
* - `query.cursorPaging.limit` is `50`.
|
|
153
|
+
*
|
|
154
|
+
* Note the following limitations, which you can't override:
|
|
155
|
+
* - Sessions are always sorted by `start.timestamp` in `ASC` order.
|
|
156
|
+
* - The maximum time range you can query is 1 year.
|
|
157
|
+
*
|
|
158
|
+
* To query only for events, set `type` to `EVENT`. An event is a single or recurring session that appears in a calendar, for example an appointment or a class.
|
|
159
|
+
*
|
|
160
|
+
* To query for recurring session pattern definitions, set `instance` to `false`. In this case, you don't need to specify a time range.
|
|
161
|
+
*
|
|
162
|
+
* To return session objects including personal information, use the `ALL_PI` fieldset. This requires the CALENDAR.SESSION_READ_PI permission scope.
|
|
163
|
+
*
|
|
164
|
+
* For details on fieldsets, see [Sessions: Supported Fieldsets](#fieldsets).
|
|
165
|
+
*
|
|
166
|
+
* For field support for filters, see [Sessions: Supported Filters](#filtering).
|
|
167
|
+
*
|
|
168
|
+
* To learn about working with _Query_ endpoints in general, see
|
|
169
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and
|
|
170
|
+
* [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
171
|
+
* @public
|
|
172
|
+
* @documentationMaturity preview
|
|
173
|
+
*/
|
|
174
|
+
export function querySessions(options) {
|
|
175
|
+
var _a, _b, _c;
|
|
176
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
177
|
+
const requestTransformation = {
|
|
178
|
+
fromDate: '$[0].fromDate',
|
|
179
|
+
toDate: '$[0].toDate',
|
|
180
|
+
query: '$[0].query',
|
|
181
|
+
type: '$[0].type',
|
|
182
|
+
instance: '$[0].instance',
|
|
183
|
+
};
|
|
184
|
+
const responseTransformation = '$';
|
|
185
|
+
// @ts-ignore
|
|
186
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
187
|
+
const { toAmbassadorRequest } = serializer({
|
|
188
|
+
rootSchema: _querySessionsRequest,
|
|
189
|
+
depSchemas: {},
|
|
190
|
+
fqdnTransformation: {
|
|
191
|
+
paths: [],
|
|
192
|
+
transformation: _fromVeloEntity,
|
|
193
|
+
},
|
|
194
|
+
customTransformation: requestTransformation,
|
|
195
|
+
});
|
|
196
|
+
const { fromJSON } = serializer({
|
|
197
|
+
rootSchema: _querySessionsResponse,
|
|
198
|
+
depSchemas: { _location, _locationsLocation, _session },
|
|
199
|
+
fqdnTransformation: {
|
|
200
|
+
paths: [...['Array#sessions']],
|
|
201
|
+
transformation: _toVeloEntity,
|
|
202
|
+
},
|
|
203
|
+
customTransformation: responseTransformation,
|
|
204
|
+
});
|
|
205
|
+
const payload = toAmbassadorRequest([options]);
|
|
206
|
+
const reqOpts = ambassadorWixBookingsCalendarV1Session.calendarServerQuerySessions(payload);
|
|
207
|
+
__log(`"QuerySessions" sending request with: ${__inspect(reqOpts)}`);
|
|
208
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
209
|
+
try {
|
|
210
|
+
const result = yield httpClient.request(reqOpts);
|
|
211
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
212
|
+
return fromJSON(result.data);
|
|
213
|
+
}
|
|
214
|
+
catch (err) {
|
|
215
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
216
|
+
'options',
|
|
217
|
+
]);
|
|
218
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
219
|
+
throw transformedError;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Retrieves a session by ID.
|
|
225
|
+
*
|
|
226
|
+
*
|
|
227
|
+
* By default session object without any personal information is returned.
|
|
228
|
+
* This means without `participants`, `location`, `calendarConference`, and
|
|
229
|
+
* `externalCalendarOverrides`. You can retrieve full session object by passing
|
|
230
|
+
* `ALL_PI` in the `fieldsets` array. It isn't possible to retrieve sessions
|
|
231
|
+
* with personal information just for specific participants.
|
|
232
|
+
* @param _id - ID of the session to retrieve.
|
|
233
|
+
* @public
|
|
234
|
+
* @documentationMaturity preview
|
|
235
|
+
* @requiredField _id
|
|
236
|
+
* @returns Retrieved session.
|
|
237
|
+
*/
|
|
238
|
+
export function getSession(_id, options) {
|
|
239
|
+
var _a, _b, _c;
|
|
240
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
241
|
+
const requestTransformation = { id: '$[0]', fieldsets: '$[1].fieldsets' };
|
|
242
|
+
const responseTransformation = '$.session';
|
|
243
|
+
// @ts-ignore
|
|
244
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
245
|
+
const { toAmbassadorRequest } = serializer({
|
|
246
|
+
rootSchema: _getSessionRequest,
|
|
247
|
+
depSchemas: {},
|
|
248
|
+
fqdnTransformation: {
|
|
249
|
+
paths: [],
|
|
250
|
+
transformation: _fromVeloEntity,
|
|
251
|
+
},
|
|
252
|
+
customTransformation: requestTransformation,
|
|
253
|
+
});
|
|
254
|
+
const { fromJSON } = serializer({
|
|
255
|
+
rootSchema: _getSessionResponse,
|
|
256
|
+
depSchemas: { _location, _locationsLocation, _session },
|
|
257
|
+
fqdnTransformation: {
|
|
258
|
+
paths: [...['session']],
|
|
259
|
+
transformation: _toVeloEntity,
|
|
260
|
+
},
|
|
261
|
+
customTransformation: responseTransformation,
|
|
262
|
+
});
|
|
263
|
+
const payload = toAmbassadorRequest([_id, options]);
|
|
264
|
+
const reqOpts = ambassadorWixBookingsCalendarV1Session.getSession(payload);
|
|
265
|
+
__log(`"GetSession" sending request with: ${__inspect(reqOpts)}`);
|
|
266
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
267
|
+
try {
|
|
268
|
+
const result = yield httpClient.request(reqOpts);
|
|
269
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
270
|
+
return fromJSON(result.data);
|
|
271
|
+
}
|
|
272
|
+
catch (err) {
|
|
273
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
274
|
+
'_id',
|
|
275
|
+
'options',
|
|
276
|
+
]);
|
|
277
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
278
|
+
throw transformedError;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Retrieves a list of sessions.
|
|
284
|
+
*
|
|
285
|
+
*
|
|
286
|
+
* By default session objects without any personal information are returned.
|
|
287
|
+
* This means without `participants`, `location`, `calendarConference`, and
|
|
288
|
+
* `externalCalendarOverrides`. You can retrieve full session objects by passing
|
|
289
|
+
* `ALL_PI` in the `fieldsets` array. It isn't possible to retrieve sessions
|
|
290
|
+
* with personal information just for specific participants.
|
|
291
|
+
* @param ids - IDs of the sessions to retrieve.
|
|
292
|
+
* @public
|
|
293
|
+
* @documentationMaturity preview
|
|
294
|
+
* @requiredField ids
|
|
295
|
+
*/
|
|
296
|
+
export function listSessions(ids, options) {
|
|
297
|
+
var _a, _b, _c;
|
|
298
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
299
|
+
const requestTransformation = { ids: '$[0]', fieldsets: '$[1].fieldsets' };
|
|
300
|
+
const responseTransformation = '$';
|
|
301
|
+
// @ts-ignore
|
|
302
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
303
|
+
const { toAmbassadorRequest } = serializer({
|
|
304
|
+
rootSchema: _listSessionsRequest,
|
|
305
|
+
depSchemas: {},
|
|
306
|
+
fqdnTransformation: {
|
|
307
|
+
paths: [],
|
|
308
|
+
transformation: _fromVeloEntity,
|
|
309
|
+
},
|
|
310
|
+
customTransformation: requestTransformation,
|
|
311
|
+
});
|
|
312
|
+
const { fromJSON } = serializer({
|
|
313
|
+
rootSchema: _listSessionsResponse,
|
|
314
|
+
depSchemas: { _location, _locationsLocation, _session },
|
|
315
|
+
fqdnTransformation: {
|
|
316
|
+
paths: [...['Array#sessions']],
|
|
317
|
+
transformation: _toVeloEntity,
|
|
318
|
+
},
|
|
319
|
+
customTransformation: responseTransformation,
|
|
320
|
+
});
|
|
321
|
+
const payload = toAmbassadorRequest([ids, options]);
|
|
322
|
+
const reqOpts = ambassadorWixBookingsCalendarV1Session.listSessions(payload);
|
|
323
|
+
__log(`"ListSessions" sending request with: ${__inspect(reqOpts)}`);
|
|
324
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
325
|
+
try {
|
|
326
|
+
const result = yield httpClient.request(reqOpts);
|
|
327
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
328
|
+
return fromJSON(result.data);
|
|
329
|
+
}
|
|
330
|
+
catch (err) {
|
|
331
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
332
|
+
'ids',
|
|
333
|
+
'options',
|
|
334
|
+
]);
|
|
335
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
336
|
+
throw transformedError;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Retrieves a list of event session instances, given the provided paging and filtering.
|
|
342
|
+
*
|
|
343
|
+
*
|
|
344
|
+
* By default session objects without any personal information are returned.
|
|
345
|
+
* This means without `participants`, `location`, `calendarConference`, and
|
|
346
|
+
* `externalCalendarOverrides`. You can retrieve full session objects by passing
|
|
347
|
+
* `ALL_PI` in the `fieldsets` array. It isn't possible to retrieve sessions
|
|
348
|
+
* with personal information just for specific participants.
|
|
349
|
+
*
|
|
350
|
+
* > __Note:__ Sessions are sorted by `start.timestamp`, in ascending order.
|
|
351
|
+
* > Other sorting options aren't supported.
|
|
352
|
+
*
|
|
353
|
+
*
|
|
354
|
+
* For a detailed list of supported operations in the Bookings Calendar V2 API, see
|
|
355
|
+
* [filtering](https://dev.wix.com/api/rest/wix-bookings/calendar-v2/filters).
|
|
356
|
+
*
|
|
357
|
+
*
|
|
358
|
+
* To learn about working with _Query_ endpoints, see
|
|
359
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
|
|
360
|
+
* and [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging).
|
|
361
|
+
* @public
|
|
362
|
+
* @documentationMaturity preview
|
|
363
|
+
*/
|
|
364
|
+
export function queryEventSessionInstances(options) {
|
|
365
|
+
var _a, _b, _c;
|
|
366
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
367
|
+
const requestTransformation = {
|
|
368
|
+
fromDate: '$[0].fromDate',
|
|
369
|
+
toDate: '$[0].toDate',
|
|
370
|
+
query: '$[0].query',
|
|
371
|
+
};
|
|
372
|
+
const responseTransformation = '$';
|
|
373
|
+
// @ts-ignore
|
|
374
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
375
|
+
const { toAmbassadorRequest } = serializer({
|
|
376
|
+
rootSchema: _queryEventSessionInstancesRequest,
|
|
377
|
+
depSchemas: {},
|
|
378
|
+
fqdnTransformation: {
|
|
379
|
+
paths: [],
|
|
380
|
+
transformation: _fromVeloEntity,
|
|
381
|
+
},
|
|
382
|
+
customTransformation: requestTransformation,
|
|
383
|
+
});
|
|
384
|
+
const { fromJSON } = serializer({
|
|
385
|
+
rootSchema: _queryEventSessionInstancesResponse,
|
|
386
|
+
depSchemas: { _location, _locationsLocation, _session },
|
|
387
|
+
fqdnTransformation: {
|
|
388
|
+
paths: [...['Array#sessions']],
|
|
389
|
+
transformation: _toVeloEntity,
|
|
390
|
+
},
|
|
391
|
+
customTransformation: responseTransformation,
|
|
392
|
+
});
|
|
393
|
+
const payload = toAmbassadorRequest([options]);
|
|
394
|
+
const reqOpts = ambassadorWixBookingsCalendarV1Session.queryEventSessionInstances(payload);
|
|
395
|
+
__log(`"QueryEventSessionInstances" sending request with: ${__inspect(reqOpts)}`);
|
|
396
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
397
|
+
try {
|
|
398
|
+
const result = yield httpClient.request(reqOpts);
|
|
399
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
400
|
+
return fromJSON(result.data);
|
|
401
|
+
}
|
|
402
|
+
catch (err) {
|
|
403
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
404
|
+
'options',
|
|
405
|
+
]);
|
|
406
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
407
|
+
throw transformedError;
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
//# sourceMappingURL=bookings-calendar-v1-session.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings-calendar-v1-session.universal.js","sourceRoot":"","sources":["../../../src/bookings-calendar-v1-session.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,sCAAsC,MAAM,qCAAqC,CAAC;AAC9F,aAAa;AAEb,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,C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SACxB;;CACF"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { CreateResourceRequest, CreateResourceResponse, DeleteResourceRequest, DeleteResourceResponse, ListResourcesRequest, ListResourcesResponse, QueryResourcesRequest, QueryResourcesResponse, UpdateResourceRequest, UpdateResourceResponse, ResourceUpdateScheduleRequest, UpdateScheduleResponse } from './bookings-catalog-v1-resource.types';
|
|
3
|
+
/**
|
|
4
|
+
* > **Deprecation Notice**
|
|
5
|
+
* >
|
|
6
|
+
* > **This endpoint has been replaced with [Query Resource](https://dev.wix.com/api/rest/wix-bookings/resources/list-resources/query-resource) and will be removed on March 31, 2022.**
|
|
7
|
+
* > **If your app uses this endpoint, we recommend updating your code as soon as possible.**
|
|
8
|
+
*
|
|
9
|
+
* Retrieves a list of the resources according to the provided filters and paging.
|
|
10
|
+
* <!--ONLY:REST-->
|
|
11
|
+
* This query is optional. If no query is provided than all non-deleted resources are returned.
|
|
12
|
+
*
|
|
13
|
+
* |Property|Is supported|
|
|
14
|
+
* |--|--|
|
|
15
|
+
* |filter | supports `resource.id`, `resource.tag`, `resource.status`|
|
|
16
|
+
* |paging | supported |
|
|
17
|
+
* |fields | supported |
|
|
18
|
+
* |fieldsets | **not supported** |
|
|
19
|
+
* |sort| **not supported** |
|
|
20
|
+
*
|
|
21
|
+
* > **Permissions**
|
|
22
|
+
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
23
|
+
* <!--END:ONLY:REST-->
|
|
24
|
+
*/
|
|
25
|
+
export declare function list(payload: ListResourcesRequest): RequestOptionsFactory<ListResourcesResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a list of the resources according to the specified filters and paging.
|
|
28
|
+
*
|
|
29
|
+
* The query parameter is optional. If no query is provided than all non-deleted resources are returned.
|
|
30
|
+
*
|
|
31
|
+
* |Property|Is supported|
|
|
32
|
+
* |--|--|
|
|
33
|
+
* |filter | supported fields: `resource.id`, `resource.tags`, `resource.status`|
|
|
34
|
+
* |paging | supported |
|
|
35
|
+
* |fields | supported |
|
|
36
|
+
* |fieldsets | **not supported** |
|
|
37
|
+
* |sort | **not supported** |
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
* >**Notes:**
|
|
41
|
+
* > + The following objects in the `query` parameter are not supported for this query:
|
|
42
|
+
* > - `sort`
|
|
43
|
+
* > - `fieldsets`
|
|
44
|
+
*
|
|
45
|
+
* > **Permissions**
|
|
46
|
+
* > This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.
|
|
47
|
+
*/
|
|
48
|
+
export declare function query(payload: QueryResourcesRequest): RequestOptionsFactory<QueryResourcesResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a resource.
|
|
51
|
+
* <!--ONLY:VELO
|
|
52
|
+
* The `createResource()` function returns a Promise that resolves to the created resource.
|
|
53
|
+
* <!--END:ONLY:VELO-->
|
|
54
|
+
*
|
|
55
|
+
* Bookings resources are created with a schedule. The schedule and its sessions determine the resource's availability. Note that the schedule must contain a start date in the `availability.start` property.
|
|
56
|
+
* For resources that are available during the business's default hours, add the business's schedule as a linked schedule in the resource's schedule. For resources that have their own hours, create sessions with type `"WORKING_HOURS"` using the resource's schedule.
|
|
57
|
+
* You can use both individual and recurring sessions to define resource availability. You cannot use availability constraints for resource schedules.
|
|
58
|
+
*
|
|
59
|
+
* <!--ONLY:VELO
|
|
60
|
+
* When creating a resource using `createResource()`, include the resource's schedule information. Set the schedule information as follows:
|
|
61
|
+
* + If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the `scheduleInfo` parameter. The default hours can bee found in the Dashboard under **Settings** in the **Bookings** section, on the **Appointment hours** page.
|
|
62
|
+
* + If the resource has its own custom working hours, create the resource, then create sessions of type `"WORKING_HOURS"` using the [`createSession()`](wix-bookings-backend.Sessions/createsession) function. Use the `scheduleId` returned from `createResource()` when creating the sessions. These session can be single sessions or recurring sessions.
|
|
63
|
+
* + You can have both default business hours and custom hours for the same resource schedule by combining the steps above.
|
|
64
|
+
*
|
|
65
|
+
* > **Notes:**
|
|
66
|
+
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
67
|
+
* > + The Wix Bookings app does not show non-recurring `WORKING_HOURS` sessions in the resource calendar.
|
|
68
|
+
* > + You can only add the business resource's schedule as a linked schedule for a resource.
|
|
69
|
+
* > + A resource can have one schedule only.
|
|
70
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
71
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can create a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
72
|
+
* <!--END:ONLY:VELO-->
|
|
73
|
+
*
|
|
74
|
+
* <!--ONLY:REST-->
|
|
75
|
+
* Use the following steps to create resources:
|
|
76
|
+
* - Create the resource using including schedule information.
|
|
77
|
+
* - If the resource uses the default business hours, get the business resource's schedule ID and include it in the `scheduleInfo.availability.linkedSchedules` array in the in the schedule parameters.
|
|
78
|
+
* - If the resource has its own custom working hours, create sessions of type `"WORKING_HOURS"`. Use the `scheduleId` of the new resource when creating the sessions. These session can be single sessions or recurring sessions. You can have both business hours and custom hours for the same resource schedule.
|
|
79
|
+
*
|
|
80
|
+
* >**Notes:**
|
|
81
|
+
* > + A resource can have one schedule only.
|
|
82
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
83
|
+
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
84
|
+
*
|
|
85
|
+
*
|
|
86
|
+
*
|
|
87
|
+
* >**Permissions:**
|
|
88
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
89
|
+
* <!--END:ONLY:REST-->
|
|
90
|
+
*/
|
|
91
|
+
export declare function create(payload: CreateResourceRequest): RequestOptionsFactory<CreateResourceResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Updates a resource.
|
|
94
|
+
* <!--ONLY:VELO
|
|
95
|
+
* The `updateResource()` function returns a Promise that resolves when a resource is updated.
|
|
96
|
+
* Use this function to update all bookings resource information except for the resource's schedule. To update a resource's schedule use [`updateResourceSchedule()`](wix-bookings-backend/resource/updateresourceschedule).
|
|
97
|
+
*
|
|
98
|
+
* >**Notes:**
|
|
99
|
+
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
100
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
101
|
+
* <!--END:ONLY:VELO-->
|
|
102
|
+
* <!--ONLY:REST-->
|
|
103
|
+
* Use this endpoint to update all resource information except for the resource's schedule. To update a resource's schedule use
|
|
104
|
+
* the [Update Schedule](https://dev.wix.com/api/rest/wix-bookings/resources/update-schedule) endpoint.
|
|
105
|
+
*
|
|
106
|
+
* >**Notes:**
|
|
107
|
+
* > + When updating a resource you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"business"` and `"staff"`.
|
|
108
|
+
* > + When updating a resource's schedule you cannot change the resource tag used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
109
|
+
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
110
|
+
*
|
|
111
|
+
* >**Permissions:**
|
|
112
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
113
|
+
* <!--END:ONLY:REST-->
|
|
114
|
+
*/
|
|
115
|
+
export declare function update(payload: UpdateResourceRequest): RequestOptionsFactory<UpdateResourceResponse>;
|
|
116
|
+
/**
|
|
117
|
+
* Updates a resource's schedule
|
|
118
|
+
* <!--ONLY:VELO
|
|
119
|
+
* The `updateResourceSchedule()` function returns a Promise that resolves when a resource's schedule has been updated.
|
|
120
|
+
* Use this function to update the bookings resource's schedule. To update other resource details use [`updateResource()`] (wix-bookings-backend/resources/updateresource).
|
|
121
|
+
* The following schedule properties can be updated:
|
|
122
|
+
* + `availability.start`
|
|
123
|
+
* + `availability.linkedSchedules`
|
|
124
|
+
* <!--END:ONLY:VELO-->
|
|
125
|
+
*
|
|
126
|
+
* To update a resource's schedule to remove business hours and add custom hours:
|
|
127
|
+
* <!--ONLY:REST-->
|
|
128
|
+
* + Update the resource's schedule to remove the business's `scheduleId` from the `availability.linkedSchedules` array.
|
|
129
|
+
* + Create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
130
|
+
* <!--END:ONLY:REST-->
|
|
131
|
+
* <!--ONLY:VELO
|
|
132
|
+
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to remove the business's scheduleId from the `availability.linkedSchedules` array.
|
|
133
|
+
* + Use [`createSession()`](wix-bookings-backend.Sessions/createsession) to create a set of recurring sessions of type `"WORKING_HOURS"` to define the resource's new hours.
|
|
134
|
+
* <!--END:ONLY:VELO-->
|
|
135
|
+
*
|
|
136
|
+
* To update a resource's schedule to add default business hours, and keep or remove custom hours:
|
|
137
|
+
* <!--ONLY:REST-->
|
|
138
|
+
* + Update the resource's schedule to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
139
|
+
* + If you want to remove the custom sessions, delete the resource's sessions of type `"WORKING_HOURS"`.
|
|
140
|
+
* You do not have to delete exiting custom sessions. Custom session that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
141
|
+
* <!--END:ONLY:REST-->
|
|
142
|
+
* <!--ONLY:VELO
|
|
143
|
+
* + Use [`updateResourceSchedule()`](wix-bookings-backend.Resources/updateresourcesession) to add the business resource's `scheduleId` to the `availability.linkedSchedules` array.
|
|
144
|
+
* + If you want to remove the custom sessions, use [`deleteSession()`](wix-bookings-backend.Sessions/deletesession) to delete the resource's sessions of type `"WORKING_HOURS"`. You do not have to delete exiting custom sessions. You can have both default working hours and custom hours for the same schedule. Custom sessions that are not deleted will continue to be included in availability calculations and can still be booked.
|
|
145
|
+
*
|
|
146
|
+
* > **Notes:**
|
|
147
|
+
* > + The Wix Bookings app does not show both default business hours and custom hours on the **Staff** page in the dashboard. If you've set up both custom and default business hours, only the default business hours will appear in the app, although both are working.
|
|
148
|
+
* > + A resource can have one schedule only.
|
|
149
|
+
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
150
|
+
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
151
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can update a resource schedule. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
152
|
+
* @snippet [updateResourceScheduleDefaultToCustom.es6=Update a resource's schedule from business to custom hours]
|
|
153
|
+
* Update a resource's schedule from the business's default working hours to 2 custom days per week.
|
|
154
|
+
* @snippet [updateResourceScheduleCustomToDefault.es6=Update a resource's schedule from custom to business hours]
|
|
155
|
+
* <!--END:ONLY:VELO-->
|
|
156
|
+
* <!--ONLY:REST-->
|
|
157
|
+
* >**Notes:**
|
|
158
|
+
* > + A resource can have one schedule only.
|
|
159
|
+
* > + A resource can have both default business hours and custom hours in its schedule.
|
|
160
|
+
* > + When updating a resource's schedule you cannot change the system tags used by the Wix Bookings app. Tags used by the app have the values `"INDIVIDUAL"`, `"GROUP"`, and `"COURSE”`.
|
|
161
|
+
* > + The `businessLocation.businessSchedule` object in the `schedule.location` object is not supported.
|
|
162
|
+
*
|
|
163
|
+
*
|
|
164
|
+
*
|
|
165
|
+
* >**Permissions:**
|
|
166
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
167
|
+
* <!--END:ONLY:REST-->
|
|
168
|
+
*/
|
|
169
|
+
export declare function updateSchedule(payload: ResourceUpdateScheduleRequest): RequestOptionsFactory<UpdateScheduleResponse>;
|
|
170
|
+
/**
|
|
171
|
+
* Deletes a resource.
|
|
172
|
+
* <!--ONLY:VELO
|
|
173
|
+
* The `deleteResource()` function returns a Promise that is resolved when a resource is deleted.
|
|
174
|
+
* <!--END:ONLY:VELO-->
|
|
175
|
+
* Deleting a resource updates its `status` to `"DELETED"`.
|
|
176
|
+
*
|
|
177
|
+
* You cannot delete a resource if it has booked sessions.
|
|
178
|
+
*
|
|
179
|
+
* <!--ONLY:VELO
|
|
180
|
+
* >**Notes:**
|
|
181
|
+
* > + The Bookings app automatically creates a resource with a name and tag of value `"business"``. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
182
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
183
|
+
* > + Only users with the **Bookings Admin** [role](https://support.wix.com/en/article/roles-permissions-overview#bookings-admin) can delete a resource. You can override the role permissions by setting the `options.suppressAuth` parameter to `true`.
|
|
184
|
+
* <!--END:ONLY:VELO-->
|
|
185
|
+
*
|
|
186
|
+
* <!--ONLY:REST-->
|
|
187
|
+
* >**Notes:**
|
|
188
|
+
* > + The Bookings app creates a resource with `"business"` in name and tag values. This resource is used for the business's schedule and working hours and cannot be deleted.
|
|
189
|
+
* > + You can have up to 135 active resources and an additional 135 deleted resources.
|
|
190
|
+
*
|
|
191
|
+
* >**Permissions:**
|
|
192
|
+
* > This endpoint requires the Manage Bookings [permission scope](https://devforum.wix.com/kb/en/article/available-permissions).
|
|
193
|
+
* <!--END:ONLY:REST-->
|
|
194
|
+
*/
|
|
195
|
+
export declare function _delete(payload: DeleteResourceRequest): RequestOptionsFactory<DeleteResourceResponse>;
|