@wix/auto_sdk_table-reservations_reservations 1.0.0
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 +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.context.d.ts +30 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.context.js +49 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.context.js.map +1 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.http.d.ts +96 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.http.js +561 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.http.js.map +1 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.meta.d.ts +32 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.meta.js +218 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.meta.js.map +1 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.public.d.ts +161 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.public.js +123 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.public.js.map +1 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.types.d.ts +1149 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.types.js +180 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.types.js.map +1 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.universal.d.ts +1740 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.universal.js +775 -0
- package/build/cjs/src/table-reservations-v1-reservation-reservations.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.context.d.ts +30 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.context.js +30 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.context.js.map +1 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.http.d.ts +96 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.http.js +548 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.http.js.map +1 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.meta.d.ts +32 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.meta.js +182 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.meta.js.map +1 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.public.d.ts +161 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.public.js +94 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.public.js.map +1 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.types.d.ts +1149 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.types.js +177 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.types.js.map +1 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.universal.d.ts +1740 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.universal.js +739 -0
- package/build/es/src/table-reservations-v1-reservation-reservations.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.context.d.ts +30 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.context.js +49 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.context.js.map +1 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.http.d.ts +96 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.http.js +561 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.http.js.map +1 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.meta.d.ts +32 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.meta.js +218 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.meta.js.map +1 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.public.d.ts +161 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.public.js +123 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.public.js.map +1 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.types.d.ts +1149 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.types.js +180 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.types.js.map +1 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.universal.d.ts +1740 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.universal.js +775 -0
- package/build/internal/cjs/src/table-reservations-v1-reservation-reservations.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.context.d.ts +30 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.context.js +30 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.context.js.map +1 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.http.d.ts +96 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.http.js +548 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.http.js.map +1 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.meta.d.ts +32 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.meta.js +182 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.meta.js.map +1 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.public.d.ts +161 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.public.js +94 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.public.js.map +1 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.types.d.ts +1149 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.types.js +177 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.types.js.map +1 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.universal.d.ts +1740 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.universal.js +739 -0
- package/build/internal/es/src/table-reservations-v1-reservation-reservations.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.searchReservations = exports.queryReservations = exports.listReservations = exports.deleteReservation = exports.cancelReservation = exports.reserveReservation = exports.createHeldReservation = exports.updateReservation = exports.getReservation = exports.createReservation = exports.WebhookIdentityType = exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.Set = exports.Type = exports.TableCombinationConflictType = exports.PaymentStatus = exports.Source = exports.Status = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixTableReservationsV1Reservation = __importStar(require("./table-reservations-v1-reservation-reservations.http.js"));
|
|
31
|
+
var Status;
|
|
32
|
+
(function (Status) {
|
|
33
|
+
/** Undefined reservation status. */
|
|
34
|
+
Status["UNKNOWN"] = "UNKNOWN";
|
|
35
|
+
/** A customer has begun the reservation flow, a temporary reservation is created and will expire in 10 minutes unless the customer moves forward with the reservation flow. This phase temporarily reserves the required number of seats and tables for a given party size at a chosen time while a customer enters details and/or confirms their reservation request. */
|
|
36
|
+
Status["HELD"] = "HELD";
|
|
37
|
+
/** The reservation is confirmed. */
|
|
38
|
+
Status["RESERVED"] = "RESERVED";
|
|
39
|
+
/** The reservation is canceled. */
|
|
40
|
+
Status["CANCELED"] = "CANCELED";
|
|
41
|
+
/** The reservation completed successfully. */
|
|
42
|
+
Status["FINISHED"] = "FINISHED";
|
|
43
|
+
/** The customer didn't show up for their reservation. */
|
|
44
|
+
Status["NO_SHOW"] = "NO_SHOW";
|
|
45
|
+
/** The customer is currently occupying the table. */
|
|
46
|
+
Status["SEATED"] = "SEATED";
|
|
47
|
+
/** A customer finished requesting this reservation, meaning they have added all necessary details and confirmed the request. Restaurant staff can now either approve or decline the reservation request. */
|
|
48
|
+
Status["REQUESTED"] = "REQUESTED";
|
|
49
|
+
/** The restaurant’s owner or staff declined the customer’s request to make the reservation. */
|
|
50
|
+
Status["DECLINED"] = "DECLINED";
|
|
51
|
+
/** A customer has begun the checkout flow, the temporary reservation is moved to this status and will expire in 10 minutes from the created time, during which time the reservee should pay. This status is set automatically when the reserve reservation endpoint is called for a reservation in `HELD` status and payment is needed. After payment is completed status will be changed automatically to `RESERVED`. */
|
|
52
|
+
Status["PAYMENT_PENDING"] = "PAYMENT_PENDING";
|
|
53
|
+
})(Status || (exports.Status = Status = {}));
|
|
54
|
+
var Source;
|
|
55
|
+
(function (Source) {
|
|
56
|
+
/** Undefined reservation source. */
|
|
57
|
+
Source["UNKNOWN"] = "UNKNOWN";
|
|
58
|
+
/** The reservation was made by a restaurant employee, for example when a customer calls to make a reservation. */
|
|
59
|
+
Source["OFFLINE"] = "OFFLINE";
|
|
60
|
+
/** The reservation was made through a website or app. */
|
|
61
|
+
Source["ONLINE"] = "ONLINE";
|
|
62
|
+
/** The reservation was made by a restaurant employee when the customer arrived at the restaurant without a prior reservation. */
|
|
63
|
+
Source["WALK_IN"] = "WALK_IN";
|
|
64
|
+
})(Source || (exports.Source = Source = {}));
|
|
65
|
+
var PaymentStatus;
|
|
66
|
+
(function (PaymentStatus) {
|
|
67
|
+
/** Undefined payment status. */
|
|
68
|
+
PaymentStatus["UNKNOWN"] = "UNKNOWN";
|
|
69
|
+
/** A reservation is free of charge. */
|
|
70
|
+
PaymentStatus["FREE"] = "FREE";
|
|
71
|
+
/** Payment is not received yet. */
|
|
72
|
+
PaymentStatus["NOT_PAID"] = "NOT_PAID";
|
|
73
|
+
/** The corresponding reservation order was fully paid. */
|
|
74
|
+
PaymentStatus["PAID"] = "PAID";
|
|
75
|
+
/** The corresponding reservation order was refunded, but the refund amount is less than the order total price. */
|
|
76
|
+
PaymentStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
|
|
77
|
+
/** The corresponding reservation order was fully refunded. The refund amount equals the total price. */
|
|
78
|
+
PaymentStatus["FULLY_REFUNDED"] = "FULLY_REFUNDED";
|
|
79
|
+
/** The corresponding reservation order was partially paid. */
|
|
80
|
+
PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
|
|
81
|
+
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
|
82
|
+
var TableCombinationConflictType;
|
|
83
|
+
(function (TableCombinationConflictType) {
|
|
84
|
+
/** Undefined conflict type. */
|
|
85
|
+
TableCombinationConflictType["UNKNOWN"] = "UNKNOWN";
|
|
86
|
+
/** One or more of the chosen tables are already reserved. */
|
|
87
|
+
TableCombinationConflictType["RESERVED"] = "RESERVED";
|
|
88
|
+
/** The party is too big for the selected table. */
|
|
89
|
+
TableCombinationConflictType["TOO_BIG"] = "TOO_BIG";
|
|
90
|
+
/** The party is too small for the selected table. */
|
|
91
|
+
TableCombinationConflictType["TOO_SMALL"] = "TOO_SMALL";
|
|
92
|
+
/** The restaurant does not allow online reservations. */
|
|
93
|
+
TableCombinationConflictType["OFFLINE_ONLY"] = "OFFLINE_ONLY";
|
|
94
|
+
})(TableCombinationConflictType || (exports.TableCombinationConflictType = TableCombinationConflictType = {}));
|
|
95
|
+
var Type;
|
|
96
|
+
(function (Type) {
|
|
97
|
+
/** Undefined reservation location conflict type. */
|
|
98
|
+
Type["UNKNOWN"] = "UNKNOWN";
|
|
99
|
+
/** The restaurant cannot accommodate a party of the given size according to party pacing settings. */
|
|
100
|
+
Type["PARTY_PACING"] = "PARTY_PACING";
|
|
101
|
+
/** The required number of seats are unavailable according to seat pacing settings. */
|
|
102
|
+
Type["SEAT_PACING"] = "SEAT_PACING";
|
|
103
|
+
})(Type || (exports.Type = Type = {}));
|
|
104
|
+
var Set;
|
|
105
|
+
(function (Set) {
|
|
106
|
+
/**
|
|
107
|
+
* Returns `id`, `status`, `details.reservationLocationId`, `details.startDate`, `details.endDate`, `details.partySize`, `createdDate`, `revision`, `declineReason`,
|
|
108
|
+
* `configuration.reservationForm.customFieldDefinitions`, `configuration.reservationForm.lastNameRequired`, `configuration.reservationForm.emailRequired`, `configuration.reservationForm.emailMarketingCheckbox`.
|
|
109
|
+
*/
|
|
110
|
+
Set["PUBLIC"] = "PUBLIC";
|
|
111
|
+
/** Returns all fields. */
|
|
112
|
+
Set["FULL"] = "FULL";
|
|
113
|
+
})(Set || (exports.Set = Set = {}));
|
|
114
|
+
var SortOrder;
|
|
115
|
+
(function (SortOrder) {
|
|
116
|
+
/** Sort by ascending order. */
|
|
117
|
+
SortOrder["ASC"] = "ASC";
|
|
118
|
+
/** Sort by descending order. */
|
|
119
|
+
SortOrder["DESC"] = "DESC";
|
|
120
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
121
|
+
var SortType;
|
|
122
|
+
(function (SortType) {
|
|
123
|
+
/** Sort by number of matches. */
|
|
124
|
+
SortType["COUNT"] = "COUNT";
|
|
125
|
+
/** Sort by value of the field alphabetically. */
|
|
126
|
+
SortType["VALUE"] = "VALUE";
|
|
127
|
+
})(SortType || (exports.SortType = SortType = {}));
|
|
128
|
+
var SortDirection;
|
|
129
|
+
(function (SortDirection) {
|
|
130
|
+
/** Sort in descending order. */
|
|
131
|
+
SortDirection["DESC"] = "DESC";
|
|
132
|
+
/** Sort in ascending order. */
|
|
133
|
+
SortDirection["ASC"] = "ASC";
|
|
134
|
+
})(SortDirection || (exports.SortDirection = SortDirection = {}));
|
|
135
|
+
var MissingValues;
|
|
136
|
+
(function (MissingValues) {
|
|
137
|
+
/** Exclude missing values from the aggregation results */
|
|
138
|
+
MissingValues["EXCLUDE"] = "EXCLUDE";
|
|
139
|
+
/** Include missing values in the aggregation results */
|
|
140
|
+
MissingValues["INCLUDE"] = "INCLUDE";
|
|
141
|
+
})(MissingValues || (exports.MissingValues = MissingValues = {}));
|
|
142
|
+
var ScalarType;
|
|
143
|
+
(function (ScalarType) {
|
|
144
|
+
/** Undefined scalar type. */
|
|
145
|
+
ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
146
|
+
/** Count of distinct values. */
|
|
147
|
+
ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
148
|
+
/** Minimum value. */
|
|
149
|
+
ScalarType["MIN"] = "MIN";
|
|
150
|
+
/** Maximum value. */
|
|
151
|
+
ScalarType["MAX"] = "MAX";
|
|
152
|
+
})(ScalarType || (exports.ScalarType = ScalarType = {}));
|
|
153
|
+
var NestedAggregationType;
|
|
154
|
+
(function (NestedAggregationType) {
|
|
155
|
+
/** Undefined aggregation type. */
|
|
156
|
+
NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
157
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
158
|
+
NestedAggregationType["VALUE"] = "VALUE";
|
|
159
|
+
/** An aggregation where you can define a set of ranges - each representing a bucket. */
|
|
160
|
+
NestedAggregationType["RANGE"] = "RANGE";
|
|
161
|
+
/** A single-value metric aggregation - such as min, max, sum, and avg. */
|
|
162
|
+
NestedAggregationType["SCALAR"] = "SCALAR";
|
|
163
|
+
/** An aggregation where result buckets are dynamically built - one per time interval such as hour, day, or week. */
|
|
164
|
+
NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
165
|
+
})(NestedAggregationType || (exports.NestedAggregationType = NestedAggregationType = {}));
|
|
166
|
+
var Interval;
|
|
167
|
+
(function (Interval) {
|
|
168
|
+
Interval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
169
|
+
Interval["YEAR"] = "YEAR";
|
|
170
|
+
Interval["MONTH"] = "MONTH";
|
|
171
|
+
Interval["WEEK"] = "WEEK";
|
|
172
|
+
Interval["DAY"] = "DAY";
|
|
173
|
+
Interval["HOUR"] = "HOUR";
|
|
174
|
+
Interval["MINUTE"] = "MINUTE";
|
|
175
|
+
Interval["SECOND"] = "SECOND";
|
|
176
|
+
})(Interval || (exports.Interval = Interval = {}));
|
|
177
|
+
var AggregationType;
|
|
178
|
+
(function (AggregationType) {
|
|
179
|
+
/** Undefined aggregation type. */
|
|
180
|
+
AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
181
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
182
|
+
AggregationType["VALUE"] = "VALUE";
|
|
183
|
+
/** An aggregation where you can define a set of ranges - each representing a bucket. */
|
|
184
|
+
AggregationType["RANGE"] = "RANGE";
|
|
185
|
+
/** A single-value metric aggregation - such as min, max, sum, or avg. */
|
|
186
|
+
AggregationType["SCALAR"] = "SCALAR";
|
|
187
|
+
/** An aggregation where result buckets are dynamically built - one per time interval such as hour, day, or week. */
|
|
188
|
+
AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
189
|
+
/** Multi-level aggregation, where each next aggregation is nested within the previous one. */
|
|
190
|
+
AggregationType["NESTED"] = "NESTED";
|
|
191
|
+
})(AggregationType || (exports.AggregationType = AggregationType = {}));
|
|
192
|
+
var Mode;
|
|
193
|
+
(function (Mode) {
|
|
194
|
+
/** Returns instances where any terms in the expression occur. */
|
|
195
|
+
Mode["OR"] = "OR";
|
|
196
|
+
/** Returns instances where all the terms in the expression occur. */
|
|
197
|
+
Mode["AND"] = "AND";
|
|
198
|
+
})(Mode || (exports.Mode = Mode = {}));
|
|
199
|
+
var WebhookIdentityType;
|
|
200
|
+
(function (WebhookIdentityType) {
|
|
201
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
202
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
203
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
204
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
205
|
+
WebhookIdentityType["APP"] = "APP";
|
|
206
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
207
|
+
/**
|
|
208
|
+
* Creates a new reservation.
|
|
209
|
+
*
|
|
210
|
+
* `createReservation()` accepts and requires different fields depending on the `status` provided and your permissions.
|
|
211
|
+
*
|
|
212
|
+
* **Status and source**
|
|
213
|
+
*
|
|
214
|
+
* If a `status` is not provided, it will be set to:
|
|
215
|
+
* * `RESERVED` if manual approval is not required for confirmation
|
|
216
|
+
* * `REQUESTED` if manual approval is required for confirmation.
|
|
217
|
+
*
|
|
218
|
+
* A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
|
|
219
|
+
* Attempting to create a reservation without these fields will result in an error.
|
|
220
|
+
*
|
|
221
|
+
* **Permissions**
|
|
222
|
+
*
|
|
223
|
+
* Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, or `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
|
|
224
|
+
*
|
|
225
|
+
* If `source` is not provided, its value is set depending on the permissions of the user making the call. See this API's Introduction article for more information.
|
|
226
|
+
*
|
|
227
|
+
*
|
|
228
|
+
* > **Note:** `createReservation()` requires all details of the reservation upfront. The process of creating a reservation can be broken up using `createHeldReservation`. `createHeldReservation` creates a temporary reservation that expires automatically unless it is completed with the addition of more details using `reserveReservation()`.
|
|
229
|
+
* @param reservation - Reservation details.
|
|
230
|
+
* @public
|
|
231
|
+
* @documentationMaturity preview
|
|
232
|
+
* @requiredField reservation
|
|
233
|
+
* @requiredField reservation.details
|
|
234
|
+
* @requiredField reservation.details.partySize
|
|
235
|
+
* @requiredField reservation.details.reservationLocationId
|
|
236
|
+
* @requiredField reservation.details.startDate
|
|
237
|
+
* @param options - Options for creating the reservation.
|
|
238
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_CREATE
|
|
239
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_CREATE_FORCE
|
|
240
|
+
* @permissionScope Manage Reservations (Medium)
|
|
241
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
242
|
+
* @permissionScope Manage Reservations (Full)
|
|
243
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
244
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
245
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
246
|
+
* @permissionScope Manage Reservations (Basic)
|
|
247
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
|
|
248
|
+
* @permissionScope Manage Reservations (Full)
|
|
249
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
250
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
251
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
252
|
+
* @applicableIdentity APP
|
|
253
|
+
* @applicableIdentity VISITOR
|
|
254
|
+
* @returns Reservation.
|
|
255
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.CreateReservation
|
|
256
|
+
*/
|
|
257
|
+
async function createReservation(reservation, options) {
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
260
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
261
|
+
reservation: reservation,
|
|
262
|
+
ignoreTableCombinationConflicts: options?.ignoreTableCombinationConflicts,
|
|
263
|
+
ignoreReservationLocationConflicts: options?.ignoreReservationLocationConflicts,
|
|
264
|
+
});
|
|
265
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.createReservation(payload);
|
|
266
|
+
sideEffects?.onSiteCall?.();
|
|
267
|
+
try {
|
|
268
|
+
const result = await httpClient.request(reqOpts);
|
|
269
|
+
sideEffects?.onSuccess?.(result);
|
|
270
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.reservation;
|
|
271
|
+
}
|
|
272
|
+
catch (err) {
|
|
273
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
274
|
+
spreadPathsToArguments: {},
|
|
275
|
+
explicitPathsToArguments: {
|
|
276
|
+
reservation: '$[0]',
|
|
277
|
+
ignoreTableCombinationConflicts: '$[1].ignoreTableCombinationConflicts',
|
|
278
|
+
ignoreReservationLocationConflicts: '$[1].ignoreReservationLocationConflicts',
|
|
279
|
+
},
|
|
280
|
+
singleArgumentUnchanged: false,
|
|
281
|
+
}, ['reservation', 'options']);
|
|
282
|
+
sideEffects?.onError?.(err);
|
|
283
|
+
throw transformedError;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
exports.createReservation = createReservation;
|
|
287
|
+
/**
|
|
288
|
+
* Retrieves a reservation.
|
|
289
|
+
*
|
|
290
|
+
* Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
|
|
291
|
+
* @param reservationId - Reservation ID.
|
|
292
|
+
* @public
|
|
293
|
+
* @documentationMaturity preview
|
|
294
|
+
* @requiredField reservationId
|
|
295
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_READ
|
|
296
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_READ_FULL
|
|
297
|
+
* @permissionScope Manage Reservations (Medium)
|
|
298
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
299
|
+
* @permissionScope Manage Reservations (Full)
|
|
300
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
301
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
302
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
303
|
+
* @permissionScope Manage Reservations (Basic)
|
|
304
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
|
|
305
|
+
* @permissionScope Manage Reservations (Medium)
|
|
306
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
307
|
+
* @permissionScope Manage Reservations (Full)
|
|
308
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
309
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
310
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
311
|
+
* @applicableIdentity APP
|
|
312
|
+
* @applicableIdentity VISITOR
|
|
313
|
+
* @returns Reservation.
|
|
314
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.GetReservation
|
|
315
|
+
*/
|
|
316
|
+
async function getReservation(reservationId, options) {
|
|
317
|
+
// @ts-ignore
|
|
318
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
319
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
320
|
+
reservationId: reservationId,
|
|
321
|
+
fieldsets: options?.fieldsets,
|
|
322
|
+
});
|
|
323
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.getReservation(payload);
|
|
324
|
+
sideEffects?.onSiteCall?.();
|
|
325
|
+
try {
|
|
326
|
+
const result = await httpClient.request(reqOpts);
|
|
327
|
+
sideEffects?.onSuccess?.(result);
|
|
328
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.reservation;
|
|
329
|
+
}
|
|
330
|
+
catch (err) {
|
|
331
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
332
|
+
spreadPathsToArguments: {},
|
|
333
|
+
explicitPathsToArguments: {
|
|
334
|
+
reservationId: '$[0]',
|
|
335
|
+
fieldsets: '$[1].fieldsets',
|
|
336
|
+
},
|
|
337
|
+
singleArgumentUnchanged: false,
|
|
338
|
+
}, ['reservationId', 'options']);
|
|
339
|
+
sideEffects?.onError?.(err);
|
|
340
|
+
throw transformedError;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
exports.getReservation = getReservation;
|
|
344
|
+
/**
|
|
345
|
+
* Updates a reservation.
|
|
346
|
+
*
|
|
347
|
+
* Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, and `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
|
|
348
|
+
*
|
|
349
|
+
* Each time the reservation is updated, revision increments by 1. The existing revision must be included when updating the reservation. This ensures you're working with the latest reservation information, and it prevents unintended overwrites.
|
|
350
|
+
* @param _id - Reservation ID.
|
|
351
|
+
* @public
|
|
352
|
+
* @documentationMaturity preview
|
|
353
|
+
* @requiredField _id
|
|
354
|
+
* @requiredField reservation
|
|
355
|
+
* @requiredField reservation.revision
|
|
356
|
+
* @param options - Options for updating the reservation.
|
|
357
|
+
* @param reservation - Reservation information to update.
|
|
358
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_UPDATE
|
|
359
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_UPDATE_FORCE
|
|
360
|
+
* @permissionScope Manage Reservations (Medium)
|
|
361
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
362
|
+
* @permissionScope Manage Reservations (Full)
|
|
363
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
364
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
365
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
366
|
+
* @permissionScope Manage Reservations (Full)
|
|
367
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
368
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
369
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
370
|
+
* @applicableIdentity APP
|
|
371
|
+
* @returns Reservation.
|
|
372
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.UpdateReservation
|
|
373
|
+
*/
|
|
374
|
+
async function updateReservation(_id, reservation, options) {
|
|
375
|
+
// @ts-ignore
|
|
376
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
377
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
378
|
+
reservation: { ...reservation, id: _id },
|
|
379
|
+
ignoreTableCombinationConflicts: options?.ignoreTableCombinationConflicts,
|
|
380
|
+
ignoreReservationLocationConflicts: options?.ignoreReservationLocationConflicts,
|
|
381
|
+
});
|
|
382
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.updateReservation(payload);
|
|
383
|
+
sideEffects?.onSiteCall?.();
|
|
384
|
+
try {
|
|
385
|
+
const result = await httpClient.request(reqOpts);
|
|
386
|
+
sideEffects?.onSuccess?.(result);
|
|
387
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.reservation;
|
|
388
|
+
}
|
|
389
|
+
catch (err) {
|
|
390
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
391
|
+
spreadPathsToArguments: { reservation: '$[1]' },
|
|
392
|
+
explicitPathsToArguments: {
|
|
393
|
+
'reservation.id': '$[0]',
|
|
394
|
+
ignoreTableCombinationConflicts: '$[2].ignoreTableCombinationConflicts',
|
|
395
|
+
ignoreReservationLocationConflicts: '$[2].ignoreReservationLocationConflicts',
|
|
396
|
+
},
|
|
397
|
+
singleArgumentUnchanged: false,
|
|
398
|
+
}, ['_id', 'reservation', 'options']);
|
|
399
|
+
sideEffects?.onError?.(err);
|
|
400
|
+
throw transformedError;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
exports.updateReservation = updateReservation;
|
|
404
|
+
/**
|
|
405
|
+
* Creates a new temporary reservation and holds it for the customer for 10 minutes.
|
|
406
|
+
*
|
|
407
|
+
* Creates a new reservation with the `HELD` status. `HELD` reservations are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to change a `HELD` reservation’s status after 10 minutes returns an error.
|
|
408
|
+
*
|
|
409
|
+
* You cannot call `updateReservation()` to change a reservation’s status from `HELD`. Trying to do so returns an error. Instead, you should use `reserveReservation()`.
|
|
410
|
+
*
|
|
411
|
+
* If you do not wish to have `HELD` reservations in your flow, you can create a reservation with all required details using `createReservation()`.
|
|
412
|
+
*
|
|
413
|
+
* @param reservationDetails - Held reservation information to update.
|
|
414
|
+
* @public
|
|
415
|
+
* @documentationMaturity preview
|
|
416
|
+
* @requiredField reservationDetails
|
|
417
|
+
* @requiredField reservationDetails.partySize
|
|
418
|
+
* @requiredField reservationDetails.reservationLocationId
|
|
419
|
+
* @requiredField reservationDetails.startDate
|
|
420
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_CREATE_HELD
|
|
421
|
+
* @permissionScope Manage Reservations (Medium)
|
|
422
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
423
|
+
* @permissionScope Manage Reservations (Full)
|
|
424
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
425
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
426
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
427
|
+
* @permissionScope Manage Reservations (Basic)
|
|
428
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
|
|
429
|
+
* @applicableIdentity APP
|
|
430
|
+
* @applicableIdentity VISITOR
|
|
431
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.CreateHeldReservation
|
|
432
|
+
*/
|
|
433
|
+
async function createHeldReservation(reservationDetails) {
|
|
434
|
+
// @ts-ignore
|
|
435
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
436
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
437
|
+
reservationDetails: reservationDetails,
|
|
438
|
+
});
|
|
439
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.createHeldReservation(payload);
|
|
440
|
+
sideEffects?.onSiteCall?.();
|
|
441
|
+
try {
|
|
442
|
+
const result = await httpClient.request(reqOpts);
|
|
443
|
+
sideEffects?.onSuccess?.(result);
|
|
444
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
445
|
+
}
|
|
446
|
+
catch (err) {
|
|
447
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
448
|
+
spreadPathsToArguments: {},
|
|
449
|
+
explicitPathsToArguments: { reservationDetails: '$[0]' },
|
|
450
|
+
singleArgumentUnchanged: false,
|
|
451
|
+
}, ['reservationDetails']);
|
|
452
|
+
sideEffects?.onError?.(err);
|
|
453
|
+
throw transformedError;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
exports.createHeldReservation = createHeldReservation;
|
|
457
|
+
/**
|
|
458
|
+
* Reserves or requests a held reservation.
|
|
459
|
+
*
|
|
460
|
+
* Held reservations are temporary reservations with the `HELD` status created by `createHeldReservation()`.
|
|
461
|
+
*
|
|
462
|
+
* They are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to call `Reserve Reservation` with a held reservation older than 10 minutes returns an error.
|
|
463
|
+
*
|
|
464
|
+
* `Reserve Reservation` changes a reservation's `HELD` status to:
|
|
465
|
+
* * `RESERVED` if the reservation's reservation location does not require manual approval.
|
|
466
|
+
* * `REQUESTED` if the reservation's reservation location requires manual approval.
|
|
467
|
+
* @param reservationId - Reservation ID.
|
|
468
|
+
* @param reservee - Reservee details.
|
|
469
|
+
* @param revision - Revision number.
|
|
470
|
+
*
|
|
471
|
+
* Specify the existing `revision` to prevent conflicting updates to reservations.
|
|
472
|
+
* @public
|
|
473
|
+
* @documentationMaturity preview
|
|
474
|
+
* @requiredField reservationId
|
|
475
|
+
* @requiredField reservee
|
|
476
|
+
* @requiredField reservee.firstName
|
|
477
|
+
* @requiredField reservee.phone
|
|
478
|
+
* @requiredField revision
|
|
479
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_RESERVE
|
|
480
|
+
* @permissionScope Manage Reservations (Medium)
|
|
481
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
482
|
+
* @permissionScope Manage Reservations (Full)
|
|
483
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
484
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
485
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
486
|
+
* @permissionScope Manage Reservations (Basic)
|
|
487
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
|
|
488
|
+
* @applicableIdentity APP
|
|
489
|
+
* @applicableIdentity VISITOR
|
|
490
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.ReserveReservation
|
|
491
|
+
*/
|
|
492
|
+
async function reserveReservation(reservationId, reservee, revision) {
|
|
493
|
+
// @ts-ignore
|
|
494
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
495
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
496
|
+
reservationId: reservationId,
|
|
497
|
+
reservee: reservee,
|
|
498
|
+
revision: revision,
|
|
499
|
+
});
|
|
500
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.reserveReservation(payload);
|
|
501
|
+
sideEffects?.onSiteCall?.();
|
|
502
|
+
try {
|
|
503
|
+
const result = await httpClient.request(reqOpts);
|
|
504
|
+
sideEffects?.onSuccess?.(result);
|
|
505
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
506
|
+
}
|
|
507
|
+
catch (err) {
|
|
508
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
509
|
+
spreadPathsToArguments: {},
|
|
510
|
+
explicitPathsToArguments: {
|
|
511
|
+
reservationId: '$[0]',
|
|
512
|
+
reservee: '$[1]',
|
|
513
|
+
revision: '$[2]',
|
|
514
|
+
},
|
|
515
|
+
singleArgumentUnchanged: false,
|
|
516
|
+
}, ['reservationId', 'reservee', 'revision']);
|
|
517
|
+
sideEffects?.onError?.(err);
|
|
518
|
+
throw transformedError;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
exports.reserveReservation = reserveReservation;
|
|
522
|
+
/**
|
|
523
|
+
* Cancels a reservation.
|
|
524
|
+
*
|
|
525
|
+
* Sets the reservation status to `CANCELED`.
|
|
526
|
+
* @param reservationId - Reservation ID.
|
|
527
|
+
* @param revision - Revision number.
|
|
528
|
+
*
|
|
529
|
+
* Specify the existing `revision` to prevent conflicting updates to reservations.
|
|
530
|
+
* @public
|
|
531
|
+
* @documentationMaturity preview
|
|
532
|
+
* @requiredField reservationId
|
|
533
|
+
* @requiredField revision
|
|
534
|
+
* @param options - Options for canceling the reservation.
|
|
535
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_CANCEL
|
|
536
|
+
* @permissionScope Manage Reservations (Medium)
|
|
537
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
538
|
+
* @permissionScope Manage Reservations (Full)
|
|
539
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
540
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
541
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
542
|
+
* @permissionScope Manage Reservations (Basic)
|
|
543
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
|
|
544
|
+
* @applicableIdentity APP
|
|
545
|
+
* @applicableIdentity VISITOR
|
|
546
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.CancelReservation
|
|
547
|
+
*/
|
|
548
|
+
async function cancelReservation(reservationId, revision, options) {
|
|
549
|
+
// @ts-ignore
|
|
550
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
551
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
552
|
+
reservationId: reservationId,
|
|
553
|
+
revision: revision,
|
|
554
|
+
phone: options?.phone,
|
|
555
|
+
});
|
|
556
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.cancelReservation(payload);
|
|
557
|
+
sideEffects?.onSiteCall?.();
|
|
558
|
+
try {
|
|
559
|
+
const result = await httpClient.request(reqOpts);
|
|
560
|
+
sideEffects?.onSuccess?.(result);
|
|
561
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
562
|
+
}
|
|
563
|
+
catch (err) {
|
|
564
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
565
|
+
spreadPathsToArguments: {},
|
|
566
|
+
explicitPathsToArguments: {
|
|
567
|
+
reservationId: '$[0]',
|
|
568
|
+
revision: '$[1]',
|
|
569
|
+
phone: '$[2].phone',
|
|
570
|
+
},
|
|
571
|
+
singleArgumentUnchanged: false,
|
|
572
|
+
}, ['reservationId', 'revision', 'options']);
|
|
573
|
+
sideEffects?.onError?.(err);
|
|
574
|
+
throw transformedError;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
exports.cancelReservation = cancelReservation;
|
|
578
|
+
/**
|
|
579
|
+
* Deletes a reservation. Only reservations with the `HELD` status can be deleted.
|
|
580
|
+
* @param reservationId - Reservation ID.
|
|
581
|
+
* @public
|
|
582
|
+
* @documentationMaturity preview
|
|
583
|
+
* @requiredField reservationId
|
|
584
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_DELETE
|
|
585
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
586
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
587
|
+
* @applicableIdentity APP
|
|
588
|
+
* @applicableIdentity VISITOR
|
|
589
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.DeleteReservation
|
|
590
|
+
*/
|
|
591
|
+
async function deleteReservation(reservationId) {
|
|
592
|
+
// @ts-ignore
|
|
593
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
594
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
595
|
+
reservationId: reservationId,
|
|
596
|
+
});
|
|
597
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.deleteReservation(payload);
|
|
598
|
+
sideEffects?.onSiteCall?.();
|
|
599
|
+
try {
|
|
600
|
+
const result = await httpClient.request(reqOpts);
|
|
601
|
+
sideEffects?.onSuccess?.(result);
|
|
602
|
+
}
|
|
603
|
+
catch (err) {
|
|
604
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
605
|
+
spreadPathsToArguments: {},
|
|
606
|
+
explicitPathsToArguments: { reservationId: '$[0]' },
|
|
607
|
+
singleArgumentUnchanged: false,
|
|
608
|
+
}, ['reservationId']);
|
|
609
|
+
sideEffects?.onError?.(err);
|
|
610
|
+
throw transformedError;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
exports.deleteReservation = deleteReservation;
|
|
614
|
+
/**
|
|
615
|
+
* Retrieves a list of up to 100 reservations.
|
|
616
|
+
* @public
|
|
617
|
+
* @documentationMaturity preview
|
|
618
|
+
* @param options - Options for listing the reservations.
|
|
619
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_READ_FULL
|
|
620
|
+
* @permissionScope Manage Reservations (Medium)
|
|
621
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
622
|
+
* @permissionScope Manage Reservations (Full)
|
|
623
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
624
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
625
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
626
|
+
* @applicableIdentity APP
|
|
627
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.ListReservations
|
|
628
|
+
*/
|
|
629
|
+
async function listReservations(options) {
|
|
630
|
+
// @ts-ignore
|
|
631
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
632
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
633
|
+
paging: options?.paging,
|
|
634
|
+
sort: options?.sort,
|
|
635
|
+
startDateFrom: options?.startDateFrom,
|
|
636
|
+
startDateTo: options?.startDateTo,
|
|
637
|
+
status: options?.status,
|
|
638
|
+
});
|
|
639
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.listReservations(payload);
|
|
640
|
+
sideEffects?.onSiteCall?.();
|
|
641
|
+
try {
|
|
642
|
+
const result = await httpClient.request(reqOpts);
|
|
643
|
+
sideEffects?.onSuccess?.(result);
|
|
644
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
645
|
+
}
|
|
646
|
+
catch (err) {
|
|
647
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
648
|
+
spreadPathsToArguments: {},
|
|
649
|
+
explicitPathsToArguments: {
|
|
650
|
+
paging: '$[0].paging',
|
|
651
|
+
sort: '$[0].sort',
|
|
652
|
+
startDateFrom: '$[0].startDateFrom',
|
|
653
|
+
startDateTo: '$[0].startDateTo',
|
|
654
|
+
status: '$[0].status',
|
|
655
|
+
},
|
|
656
|
+
singleArgumentUnchanged: false,
|
|
657
|
+
}, ['options']);
|
|
658
|
+
sideEffects?.onError?.(err);
|
|
659
|
+
throw transformedError;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
exports.listReservations = listReservations;
|
|
663
|
+
/**
|
|
664
|
+
* Creates a query to retrieve a list of reservations.
|
|
665
|
+
*
|
|
666
|
+
* The `queryReservations()` function builds a query to retrieve a list of reservations and returns a [`ReservationsQueryBuilder`](/reservations/reservations-query-builder) object.
|
|
667
|
+
*
|
|
668
|
+
* The returned object contains the query definition, which is used to run the query using the [find()](/reservations/reservations-query-builder/find) function.
|
|
669
|
+
*
|
|
670
|
+
* You can refine the query by chaining `ReservationsQueryBuilder` functions onto the query. `ReservationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservations()` returns.
|
|
671
|
+
*
|
|
672
|
+
* `queryReservations()` runs with the following `ReservationsQueryBuilder` defaults, which you can override:
|
|
673
|
+
*
|
|
674
|
+
* * [`limit(50)`](/reservations/reservations-query-builder/limit)
|
|
675
|
+
* * [`descending('_createdDate')`](/reservations/reservations-query-builder/descending)
|
|
676
|
+
*
|
|
677
|
+
* The following `ReservationsQueryBuilder` functions are supported for `queryReservations()`. For a full description of the reservation object, see the object returned for the [`items`](/reservations/reservations-query-builder/items) property in [`ReservationsQueryResult`](/reservations/reservations-query-result).
|
|
678
|
+
* @public
|
|
679
|
+
* @documentationMaturity preview
|
|
680
|
+
* @permissionScope Manage Reservations (Medium)
|
|
681
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
682
|
+
* @permissionScope Manage Reservations (Full)
|
|
683
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
684
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
685
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
686
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_READ_FULL
|
|
687
|
+
* @applicableIdentity APP
|
|
688
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.QueryReservations
|
|
689
|
+
*/
|
|
690
|
+
function queryReservations() {
|
|
691
|
+
// @ts-ignore
|
|
692
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
693
|
+
return (0, query_builder_1.queryBuilder)({
|
|
694
|
+
func: async (payload) => {
|
|
695
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.queryReservations(payload);
|
|
696
|
+
sideEffects?.onSiteCall?.();
|
|
697
|
+
try {
|
|
698
|
+
const result = await httpClient.request(reqOpts);
|
|
699
|
+
sideEffects?.onSuccess?.(result);
|
|
700
|
+
return result;
|
|
701
|
+
}
|
|
702
|
+
catch (err) {
|
|
703
|
+
sideEffects?.onError?.(err);
|
|
704
|
+
throw err;
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
requestTransformer: (query) => {
|
|
708
|
+
const args = [query, {}];
|
|
709
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
710
|
+
...args?.[1],
|
|
711
|
+
query: args?.[0],
|
|
712
|
+
});
|
|
713
|
+
},
|
|
714
|
+
responseTransformer: ({ data, }) => {
|
|
715
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(data);
|
|
716
|
+
return {
|
|
717
|
+
items: transformedData?.reservations,
|
|
718
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
719
|
+
};
|
|
720
|
+
},
|
|
721
|
+
errorTransformer: (err) => {
|
|
722
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
723
|
+
spreadPathsToArguments: {},
|
|
724
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
725
|
+
singleArgumentUnchanged: false,
|
|
726
|
+
});
|
|
727
|
+
throw transformedError;
|
|
728
|
+
},
|
|
729
|
+
pagingMethod: 'CURSOR',
|
|
730
|
+
transformationPaths: {},
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
exports.queryReservations = queryReservations;
|
|
734
|
+
/**
|
|
735
|
+
* Use this method to search the fields of the table reservations on a site for a given expression.
|
|
736
|
+
*
|
|
737
|
+
* You can also use this method to perform data aggregations on a site's table reservation fields.
|
|
738
|
+
* For a detailed list of supported operations, see the [Sorting, Filtering, and Search](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/sorting-filtering-and-search) article.
|
|
739
|
+
* @param search - Search query.
|
|
740
|
+
* @public
|
|
741
|
+
* @documentationMaturity preview
|
|
742
|
+
* @requiredField search
|
|
743
|
+
* @permissionId TABLE_RESERVATIONS.RESERVATION_READ_FULL
|
|
744
|
+
* @permissionScope Manage Reservations (Medium)
|
|
745
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
|
|
746
|
+
* @permissionScope Manage Reservations (Full)
|
|
747
|
+
* @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
|
|
748
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
749
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
750
|
+
* @applicableIdentity APP
|
|
751
|
+
* @fqn wix.table_reservations.reservation.v1.ReservationsService.SearchReservations
|
|
752
|
+
*/
|
|
753
|
+
async function searchReservations(search) {
|
|
754
|
+
// @ts-ignore
|
|
755
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
756
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ search: search });
|
|
757
|
+
const reqOpts = ambassadorWixTableReservationsV1Reservation.searchReservations(payload);
|
|
758
|
+
sideEffects?.onSiteCall?.();
|
|
759
|
+
try {
|
|
760
|
+
const result = await httpClient.request(reqOpts);
|
|
761
|
+
sideEffects?.onSuccess?.(result);
|
|
762
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
763
|
+
}
|
|
764
|
+
catch (err) {
|
|
765
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
766
|
+
spreadPathsToArguments: {},
|
|
767
|
+
explicitPathsToArguments: { search: '$[0]' },
|
|
768
|
+
singleArgumentUnchanged: false,
|
|
769
|
+
}, ['search']);
|
|
770
|
+
sideEffects?.onError?.(err);
|
|
771
|
+
throw transformedError;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
exports.searchReservations = searchReservations;
|
|
775
|
+
//# sourceMappingURL=table-reservations-v1-reservation-reservations.universal.js.map
|