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