@wix/table-reservations 1.0.5 → 1.0.6

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 (49) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +2 -1
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +2 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/src/table-reservations-v1-time-slot.http.d.ts +12 -0
  11. package/build/cjs/src/table-reservations-v1-time-slot.http.js +114 -0
  12. package/build/cjs/src/table-reservations-v1-time-slot.http.js.map +1 -0
  13. package/build/cjs/src/table-reservations-v1-time-slot.meta.d.ts +13 -0
  14. package/build/cjs/src/table-reservations-v1-time-slot.meta.js +43 -0
  15. package/build/cjs/src/table-reservations-v1-time-slot.meta.js.map +1 -0
  16. package/build/cjs/src/table-reservations-v1-time-slot.public.d.ts +8 -0
  17. package/build/cjs/src/table-reservations-v1-time-slot.public.js +17 -0
  18. package/build/cjs/src/table-reservations-v1-time-slot.public.js.map +1 -0
  19. package/build/cjs/src/table-reservations-v1-time-slot.types.d.ts +119 -0
  20. package/build/cjs/src/table-reservations-v1-time-slot.types.js +32 -0
  21. package/build/cjs/src/table-reservations-v1-time-slot.types.js.map +1 -0
  22. package/build/cjs/src/table-reservations-v1-time-slot.universal.d.ts +156 -0
  23. package/build/cjs/src/table-reservations-v1-time-slot.universal.js +159 -0
  24. package/build/cjs/src/table-reservations-v1-time-slot.universal.js.map +1 -0
  25. package/build/es/index.d.ts +1 -0
  26. package/build/es/index.js +1 -0
  27. package/build/es/index.js.map +1 -1
  28. package/build/es/index.typings.d.ts +1 -0
  29. package/build/es/index.typings.js +1 -0
  30. package/build/es/index.typings.js.map +1 -1
  31. package/build/es/meta.d.ts +1 -0
  32. package/build/es/meta.js +1 -0
  33. package/build/es/meta.js.map +1 -1
  34. package/build/es/src/table-reservations-v1-time-slot.http.d.ts +12 -0
  35. package/build/es/src/table-reservations-v1-time-slot.http.js +110 -0
  36. package/build/es/src/table-reservations-v1-time-slot.http.js.map +1 -0
  37. package/build/es/src/table-reservations-v1-time-slot.meta.d.ts +13 -0
  38. package/build/es/src/table-reservations-v1-time-slot.meta.js +20 -0
  39. package/build/es/src/table-reservations-v1-time-slot.meta.js.map +1 -0
  40. package/build/es/src/table-reservations-v1-time-slot.public.d.ts +8 -0
  41. package/build/es/src/table-reservations-v1-time-slot.public.js +9 -0
  42. package/build/es/src/table-reservations-v1-time-slot.public.js.map +1 -0
  43. package/build/es/src/table-reservations-v1-time-slot.types.d.ts +119 -0
  44. package/build/es/src/table-reservations-v1-time-slot.types.js +29 -0
  45. package/build/es/src/table-reservations-v1-time-slot.types.js.map +1 -0
  46. package/build/es/src/table-reservations-v1-time-slot.universal.d.ts +156 -0
  47. package/build/es/src/table-reservations-v1-time-slot.universal.js +136 -0
  48. package/build/es/src/table-reservations-v1-time-slot.universal.js.map +1 -0
  49. package/package.json +2 -2
@@ -1,2 +1,3 @@
1
1
  export * as reservations from './src/table-reservations-v1-reservation.public';
2
2
  export * as reservationLocations from './src/table-reservations-v1-reservation-location.public';
3
+ export * as timeSlots from './src/table-reservations-v1-time-slot.public';
@@ -19,7 +19,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.reservationLocations = exports.reservations = void 0;
22
+ exports.timeSlots = exports.reservationLocations = exports.reservations = void 0;
23
23
  exports.reservations = __importStar(require("./src/table-reservations-v1-reservation.public"));
24
24
  exports.reservationLocations = __importStar(require("./src/table-reservations-v1-reservation-location.public"));
25
+ exports.timeSlots = __importStar(require("./src/table-reservations-v1-time-slot.public"));
25
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+FAA+E;AAC/E,gHAAgG"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+FAA+E;AAC/E,gHAAgG;AAChG,0FAA0E"}
@@ -1,2 +1,3 @@
1
1
  export * as reservations from './src/table-reservations-v1-reservation.universal';
2
2
  export * as reservationLocations from './src/table-reservations-v1-reservation-location.universal';
3
+ export * as timeSlots from './src/table-reservations-v1-time-slot.universal';
@@ -19,7 +19,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.reservationLocations = exports.reservations = void 0;
22
+ exports.timeSlots = exports.reservationLocations = exports.reservations = void 0;
23
23
  exports.reservations = __importStar(require("./src/table-reservations-v1-reservation.universal"));
24
24
  exports.reservationLocations = __importStar(require("./src/table-reservations-v1-reservation-location.universal"));
25
+ exports.timeSlots = __importStar(require("./src/table-reservations-v1-time-slot.universal"));
25
26
  //# sourceMappingURL=index.typings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,kGAAkF;AAClF,mHAAmG"}
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,kGAAkF;AAClF,mHAAmG;AACnG,6FAA6E"}
@@ -1,2 +1,3 @@
1
1
  export * as reservations from './src/table-reservations-v1-reservation.meta';
2
2
  export * as reservationLocations from './src/table-reservations-v1-reservation-location.meta';
3
+ export * as timeSlots from './src/table-reservations-v1-time-slot.meta';
package/build/cjs/meta.js CHANGED
@@ -19,7 +19,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.reservationLocations = exports.reservations = void 0;
22
+ exports.timeSlots = exports.reservationLocations = exports.reservations = void 0;
23
23
  exports.reservations = __importStar(require("./src/table-reservations-v1-reservation.meta"));
24
24
  exports.reservationLocations = __importStar(require("./src/table-reservations-v1-reservation-location.meta"));
25
+ exports.timeSlots = __importStar(require("./src/table-reservations-v1-time-slot.meta"));
25
26
  //# sourceMappingURL=meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6FAA6E;AAC7E,8GAA8F"}
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6FAA6E;AAC7E,8GAA8F;AAC9F,wFAAwE"}
@@ -0,0 +1,12 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { GetTimeSlotsRequest, GetTimeSlotsResponse, GetTimeSlotsResponseNonNullableFields } from './table-reservations-v1-time-slot.types';
3
+ /**
4
+ * Returns a list of time slots at a given restaurant on a given `date`, and their availability for a given `partySize`.
5
+ *
6
+ * Without passing optional parameters, the list will contain a single time slot at the given `date`.
7
+ * Use `slotsBefore` and `slotsAfter` to get additional time slots before and after the given `date`.
8
+ *
9
+ * If you do not provide a `duration`, it will be calculated by the server based on the reservation location's configuration, and previous reservations made at that location.
10
+ * The reservation location's settings used to determine the duration are its `defaultTurnoverTime` and `turnoverTimeRules`. These specify how much time should be allotted for a reservation of a party of a given size.
11
+ */
12
+ export declare function getTimeSlots(payload: GetTimeSlotsRequest): RequestOptionsFactory<GetTimeSlotsResponse & GetTimeSlotsResponseNonNullableFields>;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimeSlots = void 0;
4
+ const ambassador_1 = require("@wix/metro-runtime/ambassador");
5
+ const metro_runtime_1 = require("@wix/metro-runtime");
6
+ const _getTimeSlotsRequest = { date: 'google.protobuf.Timestamp' };
7
+ const _getTimeSlotsResponse = { timeSlots: '_timeSlot' };
8
+ const _timeSlot = { startDate: 'google.protobuf.Timestamp' };
9
+ function resolveWixTableReservationsTimeSlotV1TimeSlotsServiceUrl(opts) {
10
+ const domainToMappings = {
11
+ _: [
12
+ {
13
+ srcPath: '/_api/table-reservations/reservations',
14
+ destPath: '',
15
+ },
16
+ ],
17
+ 'editor.wixapps.net': [
18
+ {
19
+ srcPath: '/_api/table-reservations/reservations',
20
+ destPath: '',
21
+ },
22
+ ],
23
+ 'manage._base_domain_': [
24
+ {
25
+ srcPath: '/_api/table-reservations/reservations',
26
+ destPath: '',
27
+ },
28
+ ],
29
+ 'www._base_domain_': [
30
+ {
31
+ srcPath: '/_api/table-reservations/reservations',
32
+ destPath: '',
33
+ },
34
+ ],
35
+ 'api._api_base_domain_': [
36
+ {
37
+ srcPath: '/table-reservations/reservations',
38
+ destPath: '',
39
+ },
40
+ ],
41
+ '*.dev.wix-code.com': [
42
+ {
43
+ srcPath: '/_api/table-reservations/reservations',
44
+ destPath: '',
45
+ },
46
+ ],
47
+ 'editor._base_domain_': [
48
+ {
49
+ srcPath: '/_api/table-reservations/reservations',
50
+ destPath: '',
51
+ },
52
+ ],
53
+ 'blocks._base_domain_': [
54
+ {
55
+ srcPath: '/_api/table-reservations/reservations',
56
+ destPath: '',
57
+ },
58
+ ],
59
+ 'create.editorx': [
60
+ {
61
+ srcPath: '/_api/table-reservations/reservations',
62
+ destPath: '',
63
+ },
64
+ ],
65
+ 'bo._base_domain_': [
66
+ {
67
+ srcPath: '/_api/table-reservations/reservations',
68
+ destPath: '',
69
+ },
70
+ ],
71
+ 'www.wixapis.com': [
72
+ {
73
+ srcPath: '/table-reservations/reservations',
74
+ destPath: '',
75
+ },
76
+ ],
77
+ };
78
+ return (0, metro_runtime_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
79
+ }
80
+ /**
81
+ * Returns a list of time slots at a given restaurant on a given `date`, and their availability for a given `partySize`.
82
+ *
83
+ * Without passing optional parameters, the list will contain a single time slot at the given `date`.
84
+ * Use `slotsBefore` and `slotsAfter` to get additional time slots before and after the given `date`.
85
+ *
86
+ * If you do not provide a `duration`, it will be calculated by the server based on the reservation location's configuration, and previous reservations made at that location.
87
+ * The reservation location's settings used to determine the duration are its `defaultTurnoverTime` and `turnoverTimeRules`. These specify how much time should be allotted for a reservation of a party of a given size.
88
+ */
89
+ function getTimeSlots(payload) {
90
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getTimeSlotsRequest, {});
91
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getTimeSlotsResponse, {
92
+ _timeSlot,
93
+ });
94
+ function __getTimeSlots({ host }) {
95
+ const serializedData = toReq(payload);
96
+ const metadata = {
97
+ entityFqdn: 'wix.table_reservations.v1.time_slot',
98
+ method: 'POST',
99
+ methodFqn: 'wix.table_reservations.time_slot.v1.TimeSlotsService.GetTimeSlots',
100
+ url: resolveWixTableReservationsTimeSlotV1TimeSlotsServiceUrl({
101
+ protoPath: '/v1/time-slots',
102
+ data: serializedData,
103
+ host,
104
+ }),
105
+ data: serializedData,
106
+ transformResponse: fromRes,
107
+ };
108
+ return metadata;
109
+ }
110
+ __getTimeSlots.fromReq = fromReq;
111
+ return __getTimeSlots;
112
+ }
113
+ exports.getTimeSlots = getTimeSlots;
114
+ //# sourceMappingURL=table-reservations-v1-time-slot.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-reservations-v1-time-slot.http.js","sourceRoot":"","sources":["../../../src/table-reservations-v1-time-slot.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;AAShD,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;AACnE,MAAM,qBAAqB,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACzD,MAAM,SAAS,GAAG,EAAE,SAAS,EAAE,2BAA2B,EAAE,CAAC;AAE7D,SAAS,wDAAwD,CAC/D,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,CAAC,EAAE;YACD;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,oBAAoB,EAAE;YACpB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,EAAE;aACb;SACF;QACD,oBAAoB,EAAE;YACpB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,gBAAgB,EAAE;YAChB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,OAAO,EAAE,uCAAuC;gBAChD,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,OAA4B;IAI5B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EACrD,oBAAoB,EACpB,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EAAC,qBAAqB,EAAE;QAC9D,SAAS;KACV,CAAC,CAAC;IAEH,SAAS,cAAc,CAAC,EAAE,IAAI,EAAO;QACnC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,qCAAqC;YACjD,MAAM,EAAE,MAAa;YACrB,SAAS,EACP,mEAAmE;YACrE,GAAG,EAAE,wDAAwD,CAAC;gBAC5D,SAAS,EAAE,gBAAgB;gBAC3B,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;IAEjC,OAAO,cAAc,CAAC;AACxB,CAAC;AAnCD,oCAmCC"}
@@ -0,0 +1,13 @@
1
+ import * as ambassadorWixTableReservationsV1TimeSlotTypes from './table-reservations-v1-time-slot.types';
2
+ import * as ambassadorWixTableReservationsV1TimeSlotUniversalTypes from './table-reservations-v1-time-slot.universal';
3
+ export declare type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
+ getUrl: (context: any) => string;
5
+ httpMethod: K;
6
+ path: string;
7
+ pathParams: M;
8
+ __requestType: T;
9
+ __originalRequestType: S;
10
+ __responseType: Q;
11
+ __originalResponseType: R;
12
+ };
13
+ export declare function getTimeSlots(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixTableReservationsV1TimeSlotUniversalTypes.GetTimeSlotsRequest, ambassadorWixTableReservationsV1TimeSlotTypes.GetTimeSlotsRequest, ambassadorWixTableReservationsV1TimeSlotUniversalTypes.GetTimeSlotsResponse & ambassadorWixTableReservationsV1TimeSlotUniversalTypes.GetTimeSlotsResponseNonNullableFields, ambassadorWixTableReservationsV1TimeSlotTypes.GetTimeSlotsResponse & ambassadorWixTableReservationsV1TimeSlotTypes.GetTimeSlotsResponseNonNullableFields>;
@@ -0,0 +1,43 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.getTimeSlots = void 0;
23
+ const ambassadorWixTableReservationsV1TimeSlot = __importStar(require("./table-reservations-v1-time-slot.http"));
24
+ function getTimeSlots() {
25
+ const payload = {};
26
+ const getRequestOptions = ambassadorWixTableReservationsV1TimeSlot.getTimeSlots(payload);
27
+ const getUrl = (context) => {
28
+ const { url } = getRequestOptions(context);
29
+ return url;
30
+ };
31
+ return {
32
+ getUrl,
33
+ httpMethod: 'POST',
34
+ path: '/v1/time-slots',
35
+ pathParams: {},
36
+ __requestType: null,
37
+ __originalRequestType: null,
38
+ __responseType: null,
39
+ __originalResponseType: null,
40
+ };
41
+ }
42
+ exports.getTimeSlots = getTimeSlots;
43
+ //# sourceMappingURL=table-reservations-v1-time-slot.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-reservations-v1-time-slot.meta.js","sourceRoot":"","sources":["../../../src/table-reservations-v1-time-slot.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iHAAmG;AAsBnG,SAAgB,YAAY;IAU1B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,wCAAwC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,oCA8BC"}
@@ -0,0 +1,8 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { GetTimeSlotsOptions } from './table-reservations-v1-time-slot.universal';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function getTimeSlots(httpClient: HttpClient): (reservationLocationId: string, date: Date, partySize: number | null, options?: GetTimeSlotsOptions | undefined) => Promise<import("./table-reservations-v1-time-slot.universal").GetTimeSlotsResponse & import("./table-reservations-v1-time-slot.universal").GetTimeSlotsResponseNonNullableFields>;
7
+ export { Status, TableConflictType, TableCombinationConflictType, Type, } from './table-reservations-v1-time-slot.universal';
8
+ export { TimeSlot, TimeSlotTableCombination, GetTimeSlotsRequest, GetTimeSlotsResponse, CheckReservationDetailsRequest, CheckReservationDetailsResponse, Table, TableConflict, TableCombination, TableCombinationConflict, ReservationLocationConflict, GetTimeSlotsResponseNonNullableFields, GetTimeSlotsOptions, } from './table-reservations-v1-time-slot.universal';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Type = exports.TableCombinationConflictType = exports.TableConflictType = exports.Status = exports.getTimeSlots = exports.__metadata = void 0;
4
+ const table_reservations_v1_time_slot_universal_1 = require("./table-reservations-v1-time-slot.universal");
5
+ exports.__metadata = { PACKAGE_NAME: '@wix/table-reservations' };
6
+ function getTimeSlots(httpClient) {
7
+ return (reservationLocationId, date, partySize, options) => (0, table_reservations_v1_time_slot_universal_1.getTimeSlots)(reservationLocationId, date, partySize, options,
8
+ // @ts-ignore
9
+ { httpClient });
10
+ }
11
+ exports.getTimeSlots = getTimeSlots;
12
+ var table_reservations_v1_time_slot_universal_2 = require("./table-reservations-v1-time-slot.universal");
13
+ Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return table_reservations_v1_time_slot_universal_2.Status; } });
14
+ Object.defineProperty(exports, "TableConflictType", { enumerable: true, get: function () { return table_reservations_v1_time_slot_universal_2.TableConflictType; } });
15
+ Object.defineProperty(exports, "TableCombinationConflictType", { enumerable: true, get: function () { return table_reservations_v1_time_slot_universal_2.TableCombinationConflictType; } });
16
+ Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return table_reservations_v1_time_slot_universal_2.Type; } });
17
+ //# sourceMappingURL=table-reservations-v1-time-slot.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-reservations-v1-time-slot.public.js","sourceRoot":"","sources":["../../../src/table-reservations-v1-time-slot.public.ts"],"names":[],"mappings":";;;AACA,2GAGqD;AAExC,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAEtE,SAAgB,YAAY,CAAC,UAAsB;IACjD,OAAO,CACL,qBAA6B,EAC7B,IAAU,EACV,SAAwB,EACxB,OAA6B,EAC7B,EAAE,CACF,IAAA,wDAAqB,EACnB,qBAAqB,EACrB,IAAI,EACJ,SAAS,EACT,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAfD,oCAeC;AAED,yGAKqD;AAJnD,mIAAA,MAAM,OAAA;AACN,8IAAA,iBAAiB,OAAA;AACjB,yJAAA,4BAA4B,OAAA;AAC5B,iIAAA,IAAI,OAAA"}
@@ -0,0 +1,119 @@
1
+ export interface TimeSlot {
2
+ /** Start date and time of this time slot. */
3
+ startDate?: Date;
4
+ /** Duration in minutes of this time slot. */
5
+ duration?: number;
6
+ /** Availability status of this time slot. */
7
+ status?: Status;
8
+ /** Whether manual approval is required to make a reservation in this time slot. */
9
+ manualApproval?: boolean | null;
10
+ }
11
+ export declare enum Status {
12
+ AVAILABLE = "AVAILABLE",
13
+ UNAVAILABLE = "UNAVAILABLE",
14
+ NON_WORKING_HOURS = "NON_WORKING_HOURS"
15
+ }
16
+ /** Table combination. */
17
+ export interface TimeSlotTableCombination {
18
+ /** Table IDs of the tables in the combination. */
19
+ tableIds?: string[];
20
+ }
21
+ export interface GetTimeSlotsRequest {
22
+ /** ID of the reservation location for which to retrieve time slots. */
23
+ reservationLocationId: string;
24
+ /** Date and time for which to retrieve a time slot. */
25
+ date: Date;
26
+ /**
27
+ * Duration in minutes of the time slot.
28
+ *
29
+ * Min: `5`
30
+ */
31
+ duration?: number | null;
32
+ /**
33
+ * Size of the party that needs to be seated during this time slot.
34
+ *
35
+ * Min: `1`
36
+ */
37
+ partySize: number | null;
38
+ /** The number of time slots to retrieve before the given `date`. */
39
+ slotsBefore?: number | null;
40
+ /** The number of time slots to retrieve after the given `date`. */
41
+ slotsAfter?: number | null;
42
+ }
43
+ export interface GetTimeSlotsResponse {
44
+ /** A list of time slots and their availabilities according to the given party size. */
45
+ timeSlots?: TimeSlot[];
46
+ }
47
+ export interface CheckReservationDetailsRequest {
48
+ /** Reservation location ID. */
49
+ reservationLocationId?: string;
50
+ /** Date. */
51
+ date?: Date;
52
+ /** Duration. */
53
+ duration?: number | null;
54
+ /** Party size. */
55
+ partySize?: number | null;
56
+ /** Reservation, that should be ignored during the check. */
57
+ excludeReservationId?: string | null;
58
+ /** Requested table combination. */
59
+ tableIds?: string[];
60
+ }
61
+ export interface CheckReservationDetailsResponse {
62
+ /** Tables states. */
63
+ tables?: Table[];
64
+ /** Table combinations states. */
65
+ tableCombinations?: TableCombination[];
66
+ /** Reservation location conflicts. */
67
+ reservationLocationConflicts?: ReservationLocationConflict[];
68
+ /** Requested table combination state. */
69
+ requestedTableCombination?: TableCombination;
70
+ }
71
+ export interface Table {
72
+ id?: string;
73
+ /** Table conflicts. */
74
+ tableConflicts?: TableConflict[];
75
+ }
76
+ export interface TableConflict {
77
+ /** Conflict type. */
78
+ type?: TableConflictType;
79
+ }
80
+ export declare enum TableConflictType {
81
+ UNKNOWN = "UNKNOWN",
82
+ TABLE_RESERVED = "TABLE_RESERVED",
83
+ TABLE_TOO_BIG = "TABLE_TOO_BIG",
84
+ TABLE_TOO_SMALL = "TABLE_TOO_SMALL",
85
+ OFFLINE_ONLY = "OFFLINE_ONLY"
86
+ }
87
+ export interface TableCombination {
88
+ tableIds?: string[];
89
+ tableCombinationConflicts?: TableCombinationConflict[];
90
+ }
91
+ export interface TableCombinationConflict {
92
+ /** Conflict type. */
93
+ type?: TableCombinationConflictType;
94
+ }
95
+ export declare enum TableCombinationConflictType {
96
+ UNKNOWN = "UNKNOWN",
97
+ RESERVED = "RESERVED",
98
+ TOO_BIG = "TOO_BIG",
99
+ TOO_SMALL = "TOO_SMALL",
100
+ OFFLINE_ONLY = "OFFLINE_ONLY"
101
+ }
102
+ export interface ReservationLocationConflict {
103
+ /** Reservation location conflict type. */
104
+ type?: Type;
105
+ }
106
+ export declare enum Type {
107
+ UNKNOWN = "UNKNOWN",
108
+ PARTY_PACING = "PARTY_PACING",
109
+ SEAT_PACING = "SEAT_PACING"
110
+ }
111
+ export interface GetTimeSlotsResponseNonNullableFields {
112
+ timeSlots: {
113
+ duration: number;
114
+ status: Status;
115
+ tableCombinations: {
116
+ tableIds: string[];
117
+ }[];
118
+ }[];
119
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Type = exports.TableCombinationConflictType = exports.TableConflictType = exports.Status = void 0;
4
+ var Status;
5
+ (function (Status) {
6
+ Status["AVAILABLE"] = "AVAILABLE";
7
+ Status["UNAVAILABLE"] = "UNAVAILABLE";
8
+ Status["NON_WORKING_HOURS"] = "NON_WORKING_HOURS";
9
+ })(Status = exports.Status || (exports.Status = {}));
10
+ var TableConflictType;
11
+ (function (TableConflictType) {
12
+ TableConflictType["UNKNOWN"] = "UNKNOWN";
13
+ TableConflictType["TABLE_RESERVED"] = "TABLE_RESERVED";
14
+ TableConflictType["TABLE_TOO_BIG"] = "TABLE_TOO_BIG";
15
+ TableConflictType["TABLE_TOO_SMALL"] = "TABLE_TOO_SMALL";
16
+ TableConflictType["OFFLINE_ONLY"] = "OFFLINE_ONLY";
17
+ })(TableConflictType = exports.TableConflictType || (exports.TableConflictType = {}));
18
+ var TableCombinationConflictType;
19
+ (function (TableCombinationConflictType) {
20
+ TableCombinationConflictType["UNKNOWN"] = "UNKNOWN";
21
+ TableCombinationConflictType["RESERVED"] = "RESERVED";
22
+ TableCombinationConflictType["TOO_BIG"] = "TOO_BIG";
23
+ TableCombinationConflictType["TOO_SMALL"] = "TOO_SMALL";
24
+ TableCombinationConflictType["OFFLINE_ONLY"] = "OFFLINE_ONLY";
25
+ })(TableCombinationConflictType = exports.TableCombinationConflictType || (exports.TableCombinationConflictType = {}));
26
+ var Type;
27
+ (function (Type) {
28
+ Type["UNKNOWN"] = "UNKNOWN";
29
+ Type["PARTY_PACING"] = "PARTY_PACING";
30
+ Type["SEAT_PACING"] = "SEAT_PACING";
31
+ })(Type = exports.Type || (exports.Type = {}));
32
+ //# sourceMappingURL=table-reservations-v1-time-slot.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-reservations-v1-time-slot.types.js","sourceRoot":"","sources":["../../../src/table-reservations-v1-time-slot.types.ts"],"names":[],"mappings":";;;AAWA,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,iCAAuB,CAAA;IACvB,qCAA2B,CAAA;IAC3B,iDAAuC,CAAA;AACzC,CAAC,EAJW,MAAM,GAAN,cAAM,KAAN,cAAM,QAIjB;AAyED,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,sDAAiC,CAAA;IACjC,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;IACnC,kDAA6B,CAAA;AAC/B,CAAC,EANW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAM5B;AAYD,IAAY,4BAMX;AAND,WAAY,4BAA4B;IACtC,mDAAmB,CAAA;IACnB,qDAAqB,CAAA;IACrB,mDAAmB,CAAA;IACnB,uDAAuB,CAAA;IACvB,6DAA6B,CAAA;AAC/B,CAAC,EANW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAMvC;AAOD,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,2BAAmB,CAAA;IACnB,qCAA6B,CAAA;IAC7B,mCAA2B,CAAA;AAC7B,CAAC,EAJW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAIf"}
@@ -0,0 +1,156 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ export interface TimeSlot {
8
+ /** Start date and time of this time slot. */
9
+ startDate?: Date;
10
+ /** Duration in minutes of this time slot. */
11
+ duration?: number;
12
+ /** Availability status of this time slot. */
13
+ status?: Status;
14
+ /** Whether manual approval is required to make a reservation in this time slot. */
15
+ manualApproval?: boolean | null;
16
+ }
17
+ export declare enum Status {
18
+ AVAILABLE = "AVAILABLE",
19
+ UNAVAILABLE = "UNAVAILABLE",
20
+ NON_WORKING_HOURS = "NON_WORKING_HOURS"
21
+ }
22
+ /** Table combination. */
23
+ export interface TimeSlotTableCombination {
24
+ /** Table IDs of the tables in the combination. */
25
+ tableIds?: string[];
26
+ }
27
+ export interface GetTimeSlotsRequest {
28
+ /** ID of the reservation location for which to retrieve time slots. */
29
+ reservationLocationId: string;
30
+ /** Date and time for which to retrieve a time slot. */
31
+ date: Date;
32
+ /**
33
+ * Duration in minutes of the time slot.
34
+ *
35
+ * Min: `5`
36
+ */
37
+ duration?: number | null;
38
+ /**
39
+ * Size of the party that needs to be seated during this time slot.
40
+ *
41
+ * Min: `1`
42
+ */
43
+ partySize: number | null;
44
+ /** The number of time slots to retrieve before the given `date`. */
45
+ slotsBefore?: number | null;
46
+ /** The number of time slots to retrieve after the given `date`. */
47
+ slotsAfter?: number | null;
48
+ }
49
+ export interface GetTimeSlotsResponse {
50
+ /** A list of time slots and their availabilities according to the given party size. */
51
+ timeSlots?: TimeSlot[];
52
+ }
53
+ export interface CheckReservationDetailsRequest {
54
+ /** Reservation location ID. */
55
+ reservationLocationId?: string;
56
+ /** Date. */
57
+ date?: Date;
58
+ /** Duration. */
59
+ duration?: number | null;
60
+ /** Party size. */
61
+ partySize?: number | null;
62
+ /** Reservation, that should be ignored during the check. */
63
+ excludeReservationId?: string | null;
64
+ /** Requested table combination. */
65
+ tableIds?: string[];
66
+ }
67
+ export interface CheckReservationDetailsResponse {
68
+ /** Tables states. */
69
+ tables?: Table[];
70
+ /** Table combinations states. */
71
+ tableCombinations?: TableCombination[];
72
+ /** Reservation location conflicts. */
73
+ reservationLocationConflicts?: ReservationLocationConflict[];
74
+ /** Requested table combination state. */
75
+ requestedTableCombination?: TableCombination;
76
+ }
77
+ export interface Table {
78
+ _id?: string;
79
+ /** Table conflicts. */
80
+ tableConflicts?: TableConflict[];
81
+ }
82
+ export interface TableConflict {
83
+ /** Conflict type. */
84
+ type?: TableConflictType;
85
+ }
86
+ export declare enum TableConflictType {
87
+ UNKNOWN = "UNKNOWN",
88
+ TABLE_RESERVED = "TABLE_RESERVED",
89
+ TABLE_TOO_BIG = "TABLE_TOO_BIG",
90
+ TABLE_TOO_SMALL = "TABLE_TOO_SMALL",
91
+ OFFLINE_ONLY = "OFFLINE_ONLY"
92
+ }
93
+ export interface TableCombination {
94
+ tableIds?: string[];
95
+ tableCombinationConflicts?: TableCombinationConflict[];
96
+ }
97
+ export interface TableCombinationConflict {
98
+ /** Conflict type. */
99
+ type?: TableCombinationConflictType;
100
+ }
101
+ export declare enum TableCombinationConflictType {
102
+ UNKNOWN = "UNKNOWN",
103
+ RESERVED = "RESERVED",
104
+ TOO_BIG = "TOO_BIG",
105
+ TOO_SMALL = "TOO_SMALL",
106
+ OFFLINE_ONLY = "OFFLINE_ONLY"
107
+ }
108
+ export interface ReservationLocationConflict {
109
+ /** Reservation location conflict type. */
110
+ type?: Type;
111
+ }
112
+ export declare enum Type {
113
+ UNKNOWN = "UNKNOWN",
114
+ PARTY_PACING = "PARTY_PACING",
115
+ SEAT_PACING = "SEAT_PACING"
116
+ }
117
+ export interface GetTimeSlotsResponseNonNullableFields {
118
+ timeSlots: {
119
+ duration: number;
120
+ status: Status;
121
+ }[];
122
+ }
123
+ /**
124
+ * Returns a list of time slots at a given restaurant on a given `date`, and their availability for a given `partySize`.
125
+ *
126
+ * Without passing optional parameters, the list will contain a single time slot at the given `date`.
127
+ * Use `slotsBefore` and `slotsAfter` to get additional time slots before and after the given `date`.
128
+ *
129
+ * If you do not provide a `duration`, it will be calculated by the server based on the reservation location's configuration, and previous reservations made at that location.
130
+ * The reservation location's settings used to determine the duration are its `defaultTurnoverTime` and `turnoverTimeRules`. These specify how much time should be allotted for a reservation of a party of a given size.
131
+ * @param reservationLocationId - ID of the reservation location for which to retrieve time slots.
132
+ * @param date - Date and time for which to retrieve a time slot.
133
+ * @param partySize - Size of the party that needs to be seated during this time slot.
134
+ *
135
+ * Min: `1`
136
+ * @public
137
+ * @documentationMaturity preview
138
+ * @requiredField date
139
+ * @requiredField partySize
140
+ * @requiredField reservationLocationId
141
+ * @applicableIdentity MEMBER
142
+ * @applicableIdentity VISITOR
143
+ */
144
+ export declare function getTimeSlots(reservationLocationId: string, date: Date, partySize: number | null, options?: GetTimeSlotsOptions): Promise<GetTimeSlotsResponse & GetTimeSlotsResponseNonNullableFields>;
145
+ export interface GetTimeSlotsOptions {
146
+ /**
147
+ * Duration in minutes of the time slot.
148
+ *
149
+ * Min: `5`
150
+ */
151
+ duration?: number | null;
152
+ /** The number of time slots to retrieve before the given `date`. */
153
+ slotsBefore?: number | null;
154
+ /** The number of time slots to retrieve after the given `date`. */
155
+ slotsAfter?: number | null;
156
+ }