@wix/table-reservations 1.0.78 → 1.0.80

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