@wix/table-reservations 1.0.77 → 1.0.79

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 (133) hide show
  1. package/build/cjs/context.d.ts +3 -3
  2. package/build/cjs/context.js +3 -3
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +3 -3
  5. package/build/cjs/index.js +3 -3
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +3 -3
  8. package/build/cjs/meta.js +3 -3
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +3 -3
  11. package/build/es/context.js +3 -3
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +3 -3
  14. package/build/es/index.js +3 -3
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +3 -3
  17. package/build/es/meta.js +3 -3
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +13 -9
  20. package/build/cjs/index.typings.d.ts +0 -3
  21. package/build/cjs/index.typings.js +0 -30
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/table-reservations-v1-reservation-location.context.d.ts +0 -6
  24. package/build/cjs/src/table-reservations-v1-reservation-location.context.js +0 -73
  25. package/build/cjs/src/table-reservations-v1-reservation-location.context.js.map +0 -1
  26. package/build/cjs/src/table-reservations-v1-reservation-location.http.d.ts +0 -40
  27. package/build/cjs/src/table-reservations-v1-reservation-location.http.js +0 -266
  28. package/build/cjs/src/table-reservations-v1-reservation-location.http.js.map +0 -1
  29. package/build/cjs/src/table-reservations-v1-reservation-location.meta.d.ts +0 -20
  30. package/build/cjs/src/table-reservations-v1-reservation-location.meta.js +0 -106
  31. package/build/cjs/src/table-reservations-v1-reservation-location.meta.js.map +0 -1
  32. package/build/cjs/src/table-reservations-v1-reservation-location.public.d.ts +0 -178
  33. package/build/cjs/src/table-reservations-v1-reservation-location.public.js +0 -48
  34. package/build/cjs/src/table-reservations-v1-reservation-location.public.js.map +0 -1
  35. package/build/cjs/src/table-reservations-v1-reservation-location.types.d.ts +0 -2260
  36. package/build/cjs/src/table-reservations-v1-reservation-location.types.js +0 -187
  37. package/build/cjs/src/table-reservations-v1-reservation-location.types.js.map +0 -1
  38. package/build/cjs/src/table-reservations-v1-reservation-location.universal.d.ts +0 -2333
  39. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js +0 -613
  40. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js.map +0 -1
  41. package/build/cjs/src/table-reservations-v1-reservation.context.d.ts +0 -11
  42. package/build/cjs/src/table-reservations-v1-reservation.context.js +0 -158
  43. package/build/cjs/src/table-reservations-v1-reservation.context.js.map +0 -1
  44. package/build/cjs/src/table-reservations-v1-reservation.http.d.ts +0 -89
  45. package/build/cjs/src/table-reservations-v1-reservation.http.js +0 -508
  46. package/build/cjs/src/table-reservations-v1-reservation.http.js.map +0 -1
  47. package/build/cjs/src/table-reservations-v1-reservation.meta.d.ts +0 -29
  48. package/build/cjs/src/table-reservations-v1-reservation.meta.js +0 -199
  49. package/build/cjs/src/table-reservations-v1-reservation.meta.js.map +0 -1
  50. package/build/cjs/src/table-reservations-v1-reservation.public.d.ts +0 -26
  51. package/build/cjs/src/table-reservations-v1-reservation.public.js +0 -78
  52. package/build/cjs/src/table-reservations-v1-reservation.public.js.map +0 -1
  53. package/build/cjs/src/table-reservations-v1-reservation.types.d.ts +0 -976
  54. package/build/cjs/src/table-reservations-v1-reservation.types.js +0 -119
  55. package/build/cjs/src/table-reservations-v1-reservation.types.js.map +0 -1
  56. package/build/cjs/src/table-reservations-v1-reservation.universal.d.ts +0 -1382
  57. package/build/cjs/src/table-reservations-v1-reservation.universal.js +0 -872
  58. package/build/cjs/src/table-reservations-v1-reservation.universal.js.map +0 -1
  59. package/build/cjs/src/table-reservations-v1-time-slot.context.d.ts +0 -3
  60. package/build/cjs/src/table-reservations-v1-time-slot.context.js +0 -22
  61. package/build/cjs/src/table-reservations-v1-time-slot.context.js.map +0 -1
  62. package/build/cjs/src/table-reservations-v1-time-slot.http.d.ts +0 -13
  63. package/build/cjs/src/table-reservations-v1-time-slot.http.js +0 -126
  64. package/build/cjs/src/table-reservations-v1-time-slot.http.js.map +0 -1
  65. package/build/cjs/src/table-reservations-v1-time-slot.meta.d.ts +0 -13
  66. package/build/cjs/src/table-reservations-v1-time-slot.meta.js +0 -47
  67. package/build/cjs/src/table-reservations-v1-time-slot.meta.js.map +0 -1
  68. package/build/cjs/src/table-reservations-v1-time-slot.public.d.ts +0 -8
  69. package/build/cjs/src/table-reservations-v1-time-slot.public.js +0 -17
  70. package/build/cjs/src/table-reservations-v1-time-slot.public.js.map +0 -1
  71. package/build/cjs/src/table-reservations-v1-time-slot.types.d.ts +0 -137
  72. package/build/cjs/src/table-reservations-v1-time-slot.types.js +0 -32
  73. package/build/cjs/src/table-reservations-v1-time-slot.types.js.map +0 -1
  74. package/build/cjs/src/table-reservations-v1-time-slot.universal.d.ts +0 -178
  75. package/build/cjs/src/table-reservations-v1-time-slot.universal.js +0 -166
  76. package/build/cjs/src/table-reservations-v1-time-slot.universal.js.map +0 -1
  77. package/build/es/index.typings.d.ts +0 -3
  78. package/build/es/index.typings.js +0 -4
  79. package/build/es/index.typings.js.map +0 -1
  80. package/build/es/src/table-reservations-v1-reservation-location.context.d.ts +0 -6
  81. package/build/es/src/table-reservations-v1-reservation-location.context.js +0 -66
  82. package/build/es/src/table-reservations-v1-reservation-location.context.js.map +0 -1
  83. package/build/es/src/table-reservations-v1-reservation-location.http.d.ts +0 -40
  84. package/build/es/src/table-reservations-v1-reservation-location.http.js +0 -259
  85. package/build/es/src/table-reservations-v1-reservation-location.http.js.map +0 -1
  86. package/build/es/src/table-reservations-v1-reservation-location.meta.d.ts +0 -20
  87. package/build/es/src/table-reservations-v1-reservation-location.meta.js +0 -76
  88. package/build/es/src/table-reservations-v1-reservation-location.meta.js.map +0 -1
  89. package/build/es/src/table-reservations-v1-reservation-location.public.d.ts +0 -178
  90. package/build/es/src/table-reservations-v1-reservation-location.public.js +0 -25
  91. package/build/es/src/table-reservations-v1-reservation-location.public.js.map +0 -1
  92. package/build/es/src/table-reservations-v1-reservation-location.types.d.ts +0 -2260
  93. package/build/es/src/table-reservations-v1-reservation-location.types.js +0 -184
  94. package/build/es/src/table-reservations-v1-reservation-location.types.js.map +0 -1
  95. package/build/es/src/table-reservations-v1-reservation-location.universal.d.ts +0 -2333
  96. package/build/es/src/table-reservations-v1-reservation-location.universal.js +0 -583
  97. package/build/es/src/table-reservations-v1-reservation-location.universal.js.map +0 -1
  98. package/build/es/src/table-reservations-v1-reservation.context.d.ts +0 -11
  99. package/build/es/src/table-reservations-v1-reservation.context.js +0 -146
  100. package/build/es/src/table-reservations-v1-reservation.context.js.map +0 -1
  101. package/build/es/src/table-reservations-v1-reservation.http.d.ts +0 -89
  102. package/build/es/src/table-reservations-v1-reservation.http.js +0 -496
  103. package/build/es/src/table-reservations-v1-reservation.http.js.map +0 -1
  104. package/build/es/src/table-reservations-v1-reservation.meta.d.ts +0 -29
  105. package/build/es/src/table-reservations-v1-reservation.meta.js +0 -164
  106. package/build/es/src/table-reservations-v1-reservation.meta.js.map +0 -1
  107. package/build/es/src/table-reservations-v1-reservation.public.d.ts +0 -26
  108. package/build/es/src/table-reservations-v1-reservation.public.js +0 -50
  109. package/build/es/src/table-reservations-v1-reservation.public.js.map +0 -1
  110. package/build/es/src/table-reservations-v1-reservation.types.d.ts +0 -976
  111. package/build/es/src/table-reservations-v1-reservation.types.js +0 -116
  112. package/build/es/src/table-reservations-v1-reservation.types.js.map +0 -1
  113. package/build/es/src/table-reservations-v1-reservation.universal.d.ts +0 -1382
  114. package/build/es/src/table-reservations-v1-reservation.universal.js +0 -837
  115. package/build/es/src/table-reservations-v1-reservation.universal.js.map +0 -1
  116. package/build/es/src/table-reservations-v1-time-slot.context.d.ts +0 -3
  117. package/build/es/src/table-reservations-v1-time-slot.context.js +0 -18
  118. package/build/es/src/table-reservations-v1-time-slot.context.js.map +0 -1
  119. package/build/es/src/table-reservations-v1-time-slot.http.d.ts +0 -13
  120. package/build/es/src/table-reservations-v1-time-slot.http.js +0 -122
  121. package/build/es/src/table-reservations-v1-time-slot.http.js.map +0 -1
  122. package/build/es/src/table-reservations-v1-time-slot.meta.d.ts +0 -13
  123. package/build/es/src/table-reservations-v1-time-slot.meta.js +0 -20
  124. package/build/es/src/table-reservations-v1-time-slot.meta.js.map +0 -1
  125. package/build/es/src/table-reservations-v1-time-slot.public.d.ts +0 -8
  126. package/build/es/src/table-reservations-v1-time-slot.public.js +0 -9
  127. package/build/es/src/table-reservations-v1-time-slot.public.js.map +0 -1
  128. package/build/es/src/table-reservations-v1-time-slot.types.d.ts +0 -137
  129. package/build/es/src/table-reservations-v1-time-slot.types.js +0 -29
  130. package/build/es/src/table-reservations-v1-time-slot.types.js.map +0 -1
  131. package/build/es/src/table-reservations-v1-time-slot.universal.d.ts +0 -178
  132. package/build/es/src/table-reservations-v1-time-slot.universal.js +0 -139
  133. package/build/es/src/table-reservations-v1-time-slot.universal.js.map +0 -1
@@ -1,837 +0,0 @@
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, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
11
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
- import { EventDefinition } from '@wix/sdk-types';
13
- import * as ambassadorWixTableReservationsV1Reservation from './table-reservations-v1-reservation.http';
14
- // @ts-ignore
15
- import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
16
- const _toVeloEntity = '$';
17
- const _fromVeloEntity = '$';
18
- export var Status;
19
- (function (Status) {
20
- Status["UNKNOWN"] = "UNKNOWN";
21
- /** The reservation is held for 10 minutes, during which time the reservee should fill in their details. */
22
- Status["HELD"] = "HELD";
23
- /** The reservation has been reserved. */
24
- Status["RESERVED"] = "RESERVED";
25
- /** The reservation has been canceled. */
26
- Status["CANCELED"] = "CANCELED";
27
- /** The reservation has finished successfully. */
28
- Status["FINISHED"] = "FINISHED";
29
- /** The reservee didn't arrive. */
30
- Status["NO_SHOW"] = "NO_SHOW";
31
- /** The reservee occupied the table. */
32
- Status["SEATED"] = "SEATED";
33
- /** The reservee requested a reservation and is waiting for manual approval. */
34
- Status["REQUESTED"] = "REQUESTED";
35
- /** The owner declined a reservee's request. */
36
- Status["DECLINED"] = "DECLINED";
37
- /** The reservation is held for 10 minutes from the created time, during which time the reservee should pay. After payment is completed status will be changed automatically to RESERVED. */
38
- Status["PAYMENT_PENDING"] = "PAYMENT_PENDING";
39
- })(Status || (Status = {}));
40
- export var Source;
41
- (function (Source) {
42
- Source["UNKNOWN"] = "UNKNOWN";
43
- /** The reservation is created by a User. */
44
- Source["OFFLINE"] = "OFFLINE";
45
- /** The reservation is created by UoU. */
46
- Source["ONLINE"] = "ONLINE";
47
- /** The reservation is created by a User. It can be created without reservee data. */
48
- Source["WALK_IN"] = "WALK_IN";
49
- })(Source || (Source = {}));
50
- export var TableCombinationConflictType;
51
- (function (TableCombinationConflictType) {
52
- TableCombinationConflictType["UNKNOWN"] = "UNKNOWN";
53
- TableCombinationConflictType["RESERVED"] = "RESERVED";
54
- TableCombinationConflictType["TOO_BIG"] = "TOO_BIG";
55
- TableCombinationConflictType["TOO_SMALL"] = "TOO_SMALL";
56
- TableCombinationConflictType["OFFLINE_ONLY"] = "OFFLINE_ONLY";
57
- })(TableCombinationConflictType || (TableCombinationConflictType = {}));
58
- export var Type;
59
- (function (Type) {
60
- Type["UNKNOWN"] = "UNKNOWN";
61
- Type["PARTY_PACING"] = "PARTY_PACING";
62
- Type["SEAT_PACING"] = "SEAT_PACING";
63
- })(Type || (Type = {}));
64
- export var Set;
65
- (function (Set) {
66
- Set["PUBLIC"] = "PUBLIC";
67
- Set["FULL"] = "FULL";
68
- })(Set || (Set = {}));
69
- export var SortOrder;
70
- (function (SortOrder) {
71
- SortOrder["ASC"] = "ASC";
72
- SortOrder["DESC"] = "DESC";
73
- })(SortOrder || (SortOrder = {}));
74
- export var SortType;
75
- (function (SortType) {
76
- SortType["COUNT"] = "COUNT";
77
- SortType["VALUE"] = "VALUE";
78
- })(SortType || (SortType = {}));
79
- export var SortDirection;
80
- (function (SortDirection) {
81
- SortDirection["DESC"] = "DESC";
82
- SortDirection["ASC"] = "ASC";
83
- })(SortDirection || (SortDirection = {}));
84
- export var MissingValues;
85
- (function (MissingValues) {
86
- MissingValues["EXCLUDE"] = "EXCLUDE";
87
- MissingValues["INCLUDE"] = "INCLUDE";
88
- })(MissingValues || (MissingValues = {}));
89
- export var ScalarType;
90
- (function (ScalarType) {
91
- ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
92
- ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
93
- ScalarType["MIN"] = "MIN";
94
- ScalarType["MAX"] = "MAX";
95
- ScalarType["SUM"] = "SUM";
96
- ScalarType["AVG"] = "AVG";
97
- })(ScalarType || (ScalarType = {}));
98
- export var NestedAggregationType;
99
- (function (NestedAggregationType) {
100
- NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
101
- NestedAggregationType["VALUE"] = "VALUE";
102
- NestedAggregationType["RANGE"] = "RANGE";
103
- NestedAggregationType["SCALAR"] = "SCALAR";
104
- NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
105
- })(NestedAggregationType || (NestedAggregationType = {}));
106
- export var Interval;
107
- (function (Interval) {
108
- Interval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
109
- Interval["YEAR"] = "YEAR";
110
- Interval["MONTH"] = "MONTH";
111
- Interval["WEEK"] = "WEEK";
112
- Interval["DAY"] = "DAY";
113
- Interval["HOUR"] = "HOUR";
114
- Interval["MINUTE"] = "MINUTE";
115
- Interval["SECOND"] = "SECOND";
116
- })(Interval || (Interval = {}));
117
- export var AggregationType;
118
- (function (AggregationType) {
119
- AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
120
- AggregationType["VALUE"] = "VALUE";
121
- AggregationType["RANGE"] = "RANGE";
122
- AggregationType["SCALAR"] = "SCALAR";
123
- AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
124
- AggregationType["NESTED"] = "NESTED";
125
- })(AggregationType || (AggregationType = {}));
126
- export var Mode;
127
- (function (Mode) {
128
- /** any */
129
- Mode["OR"] = "OR";
130
- /** all */
131
- Mode["AND"] = "AND";
132
- })(Mode || (Mode = {}));
133
- const _cancelReservationRequest = {};
134
- const _cancelReservationResponse = {};
135
- const _createHeldReservationRequest = {};
136
- const _createHeldReservationResponse = {};
137
- const _createReservationRequest = {};
138
- const _createReservationResponse = {};
139
- const _getReservationRequest = {};
140
- const _getReservationResponse = {};
141
- const _listReservationsRequest = {};
142
- const _listReservationsResponse = {};
143
- const _queryReservationsRequest = {};
144
- const _queryReservationsResponse = {};
145
- const _reserveReservationRequest = {};
146
- const _reserveReservationResponse = {};
147
- const _searchReservationsRequest = {};
148
- const _searchReservationsResponse = {};
149
- const _updateReservationRequest = {};
150
- const _updateReservationResponse = {};
151
- const _details = {
152
- startDate: 'google.protobuf.Timestamp',
153
- endDate: 'google.protobuf.Timestamp',
154
- };
155
- const _reservation = {
156
- createdDate: 'google.protobuf.Timestamp',
157
- updatedDate: 'google.protobuf.Timestamp',
158
- details: '_details',
159
- };
160
- export const onReservationCreated = EventDefinition('wix.table_reservations.v1.reservation_created', true, {
161
- rootSchema: _reservation,
162
- depSchemas: { _details },
163
- })();
164
- export const onReservationUpdated = EventDefinition('wix.table_reservations.v1.reservation_updated', true, {
165
- rootSchema: _reservation,
166
- depSchemas: { _details },
167
- })();
168
- /**
169
- * Creates a new reservation.
170
- *
171
- * `createReservation()` accepts and requires different fields depending on the `status` provided and your permissions.
172
- *
173
- * **Status and source**
174
- *
175
- * If a `status` is not provided, it will be set to:
176
- * * `RESERVED` if manual approval is not required for confirmation
177
- * * `REQUESTED` if manual approval is required for confirmation.
178
- *
179
- * A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
180
- * Attempting to create a reservation without these fields will result in an error.
181
- *
182
- * **Permissions**
183
- *
184
- * 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.
185
- *
186
- * 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.
187
- *
188
- *
189
- * > **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()`.
190
- * @param reservation - Reservation details.
191
- * @public
192
- * @documentationMaturity preview
193
- * @requiredField reservation
194
- * @requiredField reservation.details
195
- * @requiredField reservation.details.partySize
196
- * @requiredField reservation.details.reservationLocationId
197
- * @requiredField reservation.details.startDate
198
- * @param options - Options for creating the reservation.
199
- * @permissionScope Manage Reservations (Medium)
200
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
201
- * @permissionScope Manage Reservations (Full)
202
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
203
- * @permissionScope Manage Reservations (Basic)
204
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
205
- * @permissionScope Manage Reservations (Full)
206
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
207
- * @applicableIdentity APP
208
- * @applicableIdentity MEMBER
209
- * @applicableIdentity VISITOR
210
- * @returns Reservation.
211
- */
212
- export function createReservation(reservation, options) {
213
- var _a, _b, _c;
214
- return __awaiter(this, arguments, void 0, function* () {
215
- const requestTransformation = {
216
- reservation: '$[0]',
217
- ignoreTableCombinationConflicts: '$[1].ignoreTableCombinationConflicts',
218
- ignoreReservationLocationConflicts: '$[1].ignoreReservationLocationConflicts',
219
- };
220
- const responseTransformation = '$.reservation';
221
- // @ts-ignore
222
- const { httpClient, sideEffects } = arguments[2];
223
- const { toAmbassadorRequest } = serializer({
224
- rootSchema: _createReservationRequest,
225
- depSchemas: {},
226
- fqdnTransformation: {
227
- paths: [...['reservation']],
228
- transformation: _fromVeloEntity,
229
- },
230
- customTransformation: requestTransformation,
231
- });
232
- const { fromJSON } = serializer({
233
- rootSchema: _createReservationResponse,
234
- depSchemas: {},
235
- fqdnTransformation: {
236
- paths: [...['reservation']],
237
- transformation: _toVeloEntity,
238
- },
239
- customTransformation: responseTransformation,
240
- });
241
- const payload = toAmbassadorRequest([reservation, options]);
242
- const reqOpts = ambassadorWixTableReservationsV1Reservation.createReservation(payload);
243
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
244
- try {
245
- const result = yield httpClient.request(reqOpts);
246
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
247
- return fromJSON(result.data);
248
- }
249
- catch (err) {
250
- const transformedError = sdkTransformError(err, {
251
- spreadPathsToArguments: {},
252
- explicitPathsToArguments: {
253
- reservation: '$[0]',
254
- ignoreTableCombinationConflicts: '$[1].ignoreTableCombinationConflicts',
255
- ignoreReservationLocationConflicts: '$[1].ignoreReservationLocationConflicts',
256
- },
257
- singleArgumentUnchanged: false,
258
- }, ['reservation', 'options']);
259
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
260
- throw transformedError;
261
- }
262
- });
263
- }
264
- /**
265
- * Retrieves a reservation.
266
- *
267
- * Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
268
- * @param reservationId - Reservation ID.
269
- * @public
270
- * @documentationMaturity preview
271
- * @requiredField reservationId
272
- * @permissionScope Manage Reservations (Medium)
273
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
274
- * @permissionScope Manage Reservations (Full)
275
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
276
- * @permissionScope Manage Reservations (Basic)
277
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
278
- * @permissionScope Manage Reservations (Medium)
279
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
280
- * @permissionScope Manage Reservations (Full)
281
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
282
- * @applicableIdentity APP
283
- * @applicableIdentity MEMBER
284
- * @applicableIdentity VISITOR
285
- * @returns Reservation.
286
- */
287
- export function getReservation(reservationId, options) {
288
- var _a, _b, _c;
289
- return __awaiter(this, arguments, void 0, function* () {
290
- const requestTransformation = {
291
- reservationId: '$[0]',
292
- fieldsets: '$[1].fieldsets',
293
- };
294
- const responseTransformation = '$.reservation';
295
- // @ts-ignore
296
- const { httpClient, sideEffects } = arguments[2];
297
- const { toAmbassadorRequest } = serializer({
298
- rootSchema: _getReservationRequest,
299
- depSchemas: {},
300
- fqdnTransformation: {
301
- paths: [],
302
- transformation: _fromVeloEntity,
303
- },
304
- customTransformation: requestTransformation,
305
- });
306
- const { fromJSON } = serializer({
307
- rootSchema: _getReservationResponse,
308
- depSchemas: {},
309
- fqdnTransformation: {
310
- paths: [...['reservation']],
311
- transformation: _toVeloEntity,
312
- },
313
- customTransformation: responseTransformation,
314
- });
315
- const payload = toAmbassadorRequest([reservationId, options]);
316
- const reqOpts = ambassadorWixTableReservationsV1Reservation.getReservation(payload);
317
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
318
- try {
319
- const result = yield httpClient.request(reqOpts);
320
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
321
- return fromJSON(result.data);
322
- }
323
- catch (err) {
324
- const transformedError = sdkTransformError(err, {
325
- spreadPathsToArguments: {},
326
- explicitPathsToArguments: {
327
- reservationId: '$[0]',
328
- fieldsets: '$[1].fieldsets',
329
- },
330
- singleArgumentUnchanged: false,
331
- }, ['reservationId', 'options']);
332
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
333
- throw transformedError;
334
- }
335
- });
336
- }
337
- /**
338
- * Updates a reservation.
339
- *
340
- * 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.
341
- *
342
- * 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.
343
- * @param _id - Reservation ID.
344
- * @public
345
- * @documentationMaturity preview
346
- * @requiredField _id
347
- * @requiredField reservation
348
- * @requiredField reservation.revision
349
- * @param options - Options for updating the reservation.
350
- * @param reservation - Reservation information to update.
351
- * @permissionScope Manage Reservations (Medium)
352
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
353
- * @permissionScope Manage Reservations (Full)
354
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
355
- * @permissionScope Manage Reservations (Full)
356
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
357
- * @applicableIdentity APP
358
- * @returns Reservation.
359
- */
360
- export function updateReservation(_id, reservation, options) {
361
- var _a, _b, _c;
362
- return __awaiter(this, arguments, void 0, function* () {
363
- const requestTransformation = {
364
- reservation: { '*': '$[1]', id: '$[0]' },
365
- ignoreTableCombinationConflicts: '$[2].ignoreTableCombinationConflicts',
366
- ignoreReservationLocationConflicts: '$[2].ignoreReservationLocationConflicts',
367
- };
368
- const responseTransformation = '$.reservation';
369
- // @ts-ignore
370
- const { httpClient, sideEffects } = arguments[3];
371
- const { toAmbassadorRequest } = serializer({
372
- rootSchema: _updateReservationRequest,
373
- depSchemas: {},
374
- fqdnTransformation: {
375
- paths: [...['reservation']],
376
- transformation: _fromVeloEntity,
377
- },
378
- customTransformation: requestTransformation,
379
- });
380
- const { fromJSON } = serializer({
381
- rootSchema: _updateReservationResponse,
382
- depSchemas: {},
383
- fqdnTransformation: {
384
- paths: [...['reservation']],
385
- transformation: _toVeloEntity,
386
- },
387
- customTransformation: responseTransformation,
388
- });
389
- const payload = toAmbassadorRequest([_id, reservation, options]);
390
- const reqOpts = ambassadorWixTableReservationsV1Reservation.updateReservation(payload);
391
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
392
- try {
393
- const result = yield httpClient.request(reqOpts);
394
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
395
- return fromJSON(result.data);
396
- }
397
- catch (err) {
398
- const transformedError = sdkTransformError(err, {
399
- spreadPathsToArguments: { reservation: '$[1]' },
400
- explicitPathsToArguments: {
401
- 'reservation.id': '$[0]',
402
- ignoreTableCombinationConflicts: '$[2].ignoreTableCombinationConflicts',
403
- ignoreReservationLocationConflicts: '$[2].ignoreReservationLocationConflicts',
404
- },
405
- singleArgumentUnchanged: false,
406
- }, ['_id', 'reservation', 'options']);
407
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
408
- throw transformedError;
409
- }
410
- });
411
- }
412
- /**
413
- * Creates a new temporary reservation and holds it for the customer for 10 minutes.
414
- *
415
- * 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.
416
- *
417
- * You cannot call `updateReservation()` to change a reservation’s status from `HELD`. Trying to do so returns an error. Instead, you should use `reserveReservation()`.
418
- *
419
- * If you do not wish to have `HELD` reservations in your flow, you can create a reservation with all required details using `createReservation()`.
420
- *
421
- * @param reservationDetails - Held reservation information to update.
422
- * @public
423
- * @documentationMaturity preview
424
- * @requiredField reservationDetails
425
- * @requiredField reservationDetails.partySize
426
- * @requiredField reservationDetails.reservationLocationId
427
- * @requiredField reservationDetails.startDate
428
- * @permissionScope Manage Reservations (Medium)
429
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
430
- * @permissionScope Manage Reservations (Full)
431
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
432
- * @permissionScope Manage Reservations (Basic)
433
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
434
- * @applicableIdentity APP
435
- * @applicableIdentity MEMBER
436
- * @applicableIdentity VISITOR
437
- */
438
- export function createHeldReservation(reservationDetails) {
439
- var _a, _b, _c;
440
- return __awaiter(this, arguments, void 0, function* () {
441
- const requestTransformation = { reservationDetails: '$[0]' };
442
- const responseTransformation = '$';
443
- // @ts-ignore
444
- const { httpClient, sideEffects } = arguments[1];
445
- const { toAmbassadorRequest } = serializer({
446
- rootSchema: _createHeldReservationRequest,
447
- depSchemas: {},
448
- fqdnTransformation: {
449
- paths: [],
450
- transformation: _fromVeloEntity,
451
- },
452
- customTransformation: requestTransformation,
453
- });
454
- const { fromJSON } = serializer({
455
- rootSchema: _createHeldReservationResponse,
456
- depSchemas: {},
457
- fqdnTransformation: {
458
- paths: [...['reservation']],
459
- transformation: _toVeloEntity,
460
- },
461
- customTransformation: responseTransformation,
462
- });
463
- const payload = toAmbassadorRequest([reservationDetails]);
464
- const reqOpts = ambassadorWixTableReservationsV1Reservation.createHeldReservation(payload);
465
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
466
- try {
467
- const result = yield httpClient.request(reqOpts);
468
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
469
- return fromJSON(result.data);
470
- }
471
- catch (err) {
472
- const transformedError = sdkTransformError(err, {
473
- spreadPathsToArguments: {},
474
- explicitPathsToArguments: { reservationDetails: '$[0]' },
475
- singleArgumentUnchanged: false,
476
- }, ['reservationDetails']);
477
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
478
- throw transformedError;
479
- }
480
- });
481
- }
482
- /**
483
- * Reserves or requests a held reservation.
484
- *
485
- * Held reservations are temporary reservations with the `HELD` status created by `createHeldReservation()`.
486
- *
487
- * 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.
488
- *
489
- * `Reserve Reservation` changes a reservation's `HELD` status to:
490
- * * `RESERVED` if the reservation's reservation location does not require manual approval.
491
- * * `REQUESTED` if the reservation's reservation location requires manual approval.
492
- * @param reservationId - Reservation ID.
493
- * @param reservee - Reservee details.
494
- * @param revision - Revision number.
495
- *
496
- * Include the existing `revision` to prevent conflicting updates to reservations.
497
- * @public
498
- * @documentationMaturity preview
499
- * @requiredField reservationId
500
- * @requiredField reservee
501
- * @requiredField reservee.firstName
502
- * @requiredField reservee.phone
503
- * @requiredField revision
504
- * @permissionScope Manage Reservations (Medium)
505
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
506
- * @permissionScope Manage Reservations (Full)
507
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
508
- * @permissionScope Manage Reservations (Basic)
509
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
510
- * @applicableIdentity APP
511
- * @applicableIdentity MEMBER
512
- * @applicableIdentity VISITOR
513
- */
514
- export function reserveReservation(reservationId, reservee, revision) {
515
- var _a, _b, _c;
516
- return __awaiter(this, arguments, void 0, function* () {
517
- const requestTransformation = {
518
- reservationId: '$[0]',
519
- reservee: '$[1]',
520
- revision: '$[2]',
521
- };
522
- const responseTransformation = '$';
523
- // @ts-ignore
524
- const { httpClient, sideEffects } = arguments[3];
525
- const { toAmbassadorRequest } = serializer({
526
- rootSchema: _reserveReservationRequest,
527
- depSchemas: {},
528
- fqdnTransformation: {
529
- paths: [],
530
- transformation: _fromVeloEntity,
531
- },
532
- customTransformation: requestTransformation,
533
- });
534
- const { fromJSON } = serializer({
535
- rootSchema: _reserveReservationResponse,
536
- depSchemas: {},
537
- fqdnTransformation: {
538
- paths: [...['reservation']],
539
- transformation: _toVeloEntity,
540
- },
541
- customTransformation: responseTransformation,
542
- });
543
- const payload = toAmbassadorRequest([reservationId, reservee, revision]);
544
- const reqOpts = ambassadorWixTableReservationsV1Reservation.reserveReservation(payload);
545
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
546
- try {
547
- const result = yield httpClient.request(reqOpts);
548
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
549
- return fromJSON(result.data);
550
- }
551
- catch (err) {
552
- const transformedError = sdkTransformError(err, {
553
- spreadPathsToArguments: {},
554
- explicitPathsToArguments: {
555
- reservationId: '$[0]',
556
- reservee: '$[1]',
557
- revision: '$[2]',
558
- },
559
- singleArgumentUnchanged: false,
560
- }, ['reservationId', 'reservee', 'revision']);
561
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
562
- throw transformedError;
563
- }
564
- });
565
- }
566
- /**
567
- * Cancels a reservation.
568
- *
569
- * Sets the reservation status to `CANCELED`.
570
- * @param reservationId - Reservation ID.
571
- * @param revision - Revision number.
572
- *
573
- * Include the existing `revision` to prevent conflicting updates to reservations.
574
- * @public
575
- * @documentationMaturity preview
576
- * @requiredField reservationId
577
- * @requiredField revision
578
- * @param options - Options for canceling the reservation.
579
- * @permissionScope Manage Reservations (Medium)
580
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
581
- * @permissionScope Manage Reservations (Full)
582
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
583
- * @permissionScope Manage Reservations (Basic)
584
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
585
- * @applicableIdentity APP
586
- * @applicableIdentity MEMBER
587
- * @applicableIdentity VISITOR
588
- */
589
- export function cancelReservation(reservationId, revision, options) {
590
- var _a, _b, _c;
591
- return __awaiter(this, arguments, void 0, function* () {
592
- const requestTransformation = {
593
- reservationId: '$[0]',
594
- revision: '$[1]',
595
- phone: '$[2].phone',
596
- };
597
- const responseTransformation = '$';
598
- // @ts-ignore
599
- const { httpClient, sideEffects } = arguments[3];
600
- const { toAmbassadorRequest } = serializer({
601
- rootSchema: _cancelReservationRequest,
602
- depSchemas: {},
603
- fqdnTransformation: {
604
- paths: [],
605
- transformation: _fromVeloEntity,
606
- },
607
- customTransformation: requestTransformation,
608
- });
609
- const { fromJSON } = serializer({
610
- rootSchema: _cancelReservationResponse,
611
- depSchemas: {},
612
- fqdnTransformation: {
613
- paths: [...['reservation']],
614
- transformation: _toVeloEntity,
615
- },
616
- customTransformation: responseTransformation,
617
- });
618
- const payload = toAmbassadorRequest([reservationId, revision, options]);
619
- const reqOpts = ambassadorWixTableReservationsV1Reservation.cancelReservation(payload);
620
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
621
- try {
622
- const result = yield httpClient.request(reqOpts);
623
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
624
- return fromJSON(result.data);
625
- }
626
- catch (err) {
627
- const transformedError = sdkTransformError(err, {
628
- spreadPathsToArguments: {},
629
- explicitPathsToArguments: {
630
- reservationId: '$[0]',
631
- revision: '$[1]',
632
- phone: '$[2].phone',
633
- },
634
- singleArgumentUnchanged: false,
635
- }, ['reservationId', 'revision', 'options']);
636
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
637
- throw transformedError;
638
- }
639
- });
640
- }
641
- /**
642
- * Retrieves a list of up to 100 reservations.
643
- * @public
644
- * @documentationMaturity preview
645
- * @param options - Options for listing the reservations.
646
- * @permissionScope Manage Reservations (Medium)
647
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
648
- * @permissionScope Manage Reservations (Full)
649
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
650
- * @applicableIdentity APP
651
- */
652
- export function listReservations(options) {
653
- var _a, _b, _c;
654
- return __awaiter(this, arguments, void 0, function* () {
655
- const requestTransformation = {
656
- paging: '$[0].paging',
657
- sort: '$[0].sort',
658
- startDateFrom: '$[0].startDateFrom',
659
- startDateTo: '$[0].startDateTo',
660
- status: '$[0].status',
661
- };
662
- const responseTransformation = '$';
663
- // @ts-ignore
664
- const { httpClient, sideEffects } = arguments[1];
665
- const { toAmbassadorRequest } = serializer({
666
- rootSchema: _listReservationsRequest,
667
- depSchemas: {},
668
- fqdnTransformation: {
669
- paths: [],
670
- transformation: _fromVeloEntity,
671
- },
672
- customTransformation: requestTransformation,
673
- });
674
- const { fromJSON } = serializer({
675
- rootSchema: _listReservationsResponse,
676
- depSchemas: {},
677
- fqdnTransformation: {
678
- paths: [...['Array#reservations']],
679
- transformation: _toVeloEntity,
680
- },
681
- customTransformation: responseTransformation,
682
- });
683
- const payload = toAmbassadorRequest([options]);
684
- const reqOpts = ambassadorWixTableReservationsV1Reservation.listReservations(payload);
685
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
686
- try {
687
- const result = yield httpClient.request(reqOpts);
688
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
689
- return fromJSON(result.data);
690
- }
691
- catch (err) {
692
- const transformedError = sdkTransformError(err, {
693
- spreadPathsToArguments: {},
694
- explicitPathsToArguments: {
695
- paging: '$[0].paging',
696
- sort: '$[0].sort',
697
- startDateFrom: '$[0].startDateFrom',
698
- startDateTo: '$[0].startDateTo',
699
- status: '$[0].status',
700
- },
701
- singleArgumentUnchanged: false,
702
- }, ['options']);
703
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
704
- throw transformedError;
705
- }
706
- });
707
- }
708
- /**
709
- * Creates a query to retrieve a list of reservations.
710
- *
711
- * The `queryReservations()` function builds a query to retrieve a list of reservations and returns a [`ReservationsQueryBuilder`](#ReservationsQueryBuilder) object.
712
- *
713
- * The returned object contains the query definition, which is used to run the query using the [find()](#ReservationsQueryBuilder/find) function.
714
- *
715
- * 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.
716
- *
717
- * `queryReservations()` runs with the following `ReservationsQueryBuilder` defaults, which you can override:
718
- *
719
- * * [`skip(0)`](#ReservationsQueryBuilder/skip)
720
- * * [`limit(50)`](#ReservationsQueryBuilder/limit)
721
- * * [`descending('_createdDate')`](#ReservationsQueryBuilder/descending)
722
- *
723
- * The following `ReservationsQueryBuilder` functions are supported for `queryReservations()`. For a full description of the reservation object, see the object returned for the [`items`](#ReservationsQueryResult/items) property in [`ReservationsQueryResult`](#ReservationsQueryResult).
724
- * @public
725
- * @documentationMaturity preview
726
- * @permissionScope Manage Reservations (Medium)
727
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
728
- * @permissionScope Manage Reservations (Full)
729
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
730
- * @applicableIdentity APP
731
- */
732
- export function queryReservations() {
733
- const requestTransformation = { '*': '$[1]', query: '$[0]' };
734
- const responseTransformation = {
735
- items: '$.reservations',
736
- pagingMetadata: '$.pagingMetadata',
737
- };
738
- // @ts-ignore
739
- const { httpClient, sideEffects } = arguments[0];
740
- const { toAmbassadorRequest } = serializer({
741
- rootSchema: _queryReservationsRequest,
742
- depSchemas: {},
743
- fqdnTransformation: {
744
- paths: [],
745
- transformation: _fromVeloEntity,
746
- },
747
- customTransformation: requestTransformation,
748
- });
749
- const { fromJSON } = serializer({
750
- rootSchema: _queryReservationsResponse,
751
- depSchemas: {},
752
- fqdnTransformation: {
753
- paths: [...['Array#reservations']],
754
- transformation: _toVeloEntity,
755
- },
756
- customTransformation: responseTransformation,
757
- });
758
- return wrapWithQueryBuilder({
759
- func: (payload) => __awaiter(this, void 0, void 0, function* () {
760
- var _a, _b, _c;
761
- const reqOpts = ambassadorWixTableReservationsV1Reservation.queryReservations(payload);
762
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
763
- try {
764
- const result = yield httpClient.request(reqOpts);
765
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
766
- return result;
767
- }
768
- catch (err) {
769
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
770
- throw err;
771
- }
772
- }),
773
- requestTransformer: (...args) => toAmbassadorRequest(args),
774
- responseTransformer: ({ data }) => fromJSON(data),
775
- errorTransformer: (err) => {
776
- const transformedError = transformError(err, requestTransformation);
777
- throw transformedError;
778
- },
779
- pagingMethod: 'CURSOR',
780
- transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
781
- })({ cursorWithEmptyFilterAndSort: true });
782
- }
783
- /** @param search - Search query.
784
- * @public
785
- * @documentationMaturity preview
786
- * @requiredField search
787
- * @permissionScope Manage Reservations (Medium)
788
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
789
- * @permissionScope Manage Reservations (Full)
790
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
791
- * @applicableIdentity APP
792
- */
793
- export function searchReservations(search) {
794
- var _a, _b, _c;
795
- return __awaiter(this, arguments, void 0, function* () {
796
- const requestTransformation = { search: '$[0]' };
797
- const responseTransformation = '$';
798
- // @ts-ignore
799
- const { httpClient, sideEffects } = arguments[1];
800
- const { toAmbassadorRequest } = serializer({
801
- rootSchema: _searchReservationsRequest,
802
- depSchemas: {},
803
- fqdnTransformation: {
804
- paths: [],
805
- transformation: _fromVeloEntity,
806
- },
807
- customTransformation: requestTransformation,
808
- });
809
- const { fromJSON } = serializer({
810
- rootSchema: _searchReservationsResponse,
811
- depSchemas: {},
812
- fqdnTransformation: {
813
- paths: [...['Array#reservations']],
814
- transformation: _toVeloEntity,
815
- },
816
- customTransformation: responseTransformation,
817
- });
818
- const payload = toAmbassadorRequest([search]);
819
- const reqOpts = ambassadorWixTableReservationsV1Reservation.searchReservations(payload);
820
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
821
- try {
822
- const result = yield httpClient.request(reqOpts);
823
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
824
- return fromJSON(result.data);
825
- }
826
- catch (err) {
827
- const transformedError = sdkTransformError(err, {
828
- spreadPathsToArguments: {},
829
- explicitPathsToArguments: { search: '$[0]' },
830
- singleArgumentUnchanged: false,
831
- }, ['search']);
832
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
833
- throw transformedError;
834
- }
835
- });
836
- }
837
- //# sourceMappingURL=table-reservations-v1-reservation.universal.js.map