@wix/auto_sdk_restaurants_operations 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/restaurants-operations-v1-operation-operations.context.d.ts +32 -0
  11. package/build/cjs/src/restaurants-operations-v1-operation-operations.context.js +54 -0
  12. package/build/cjs/src/restaurants-operations-v1-operation-operations.context.js.map +1 -0
  13. package/build/cjs/src/restaurants-operations-v1-operation-operations.http.d.ts +72 -0
  14. package/build/cjs/src/restaurants-operations-v1-operation-operations.http.js +682 -0
  15. package/build/cjs/src/restaurants-operations-v1-operation-operations.http.js.map +1 -0
  16. package/build/cjs/src/restaurants-operations-v1-operation-operations.meta.d.ts +40 -0
  17. package/build/cjs/src/restaurants-operations-v1-operation-operations.meta.js +256 -0
  18. package/build/cjs/src/restaurants-operations-v1-operation-operations.meta.js.map +1 -0
  19. package/build/cjs/src/restaurants-operations-v1-operation-operations.public.d.ts +144 -0
  20. package/build/cjs/src/restaurants-operations-v1-operation-operations.public.js +148 -0
  21. package/build/cjs/src/restaurants-operations-v1-operation-operations.public.js.map +1 -0
  22. package/build/cjs/src/restaurants-operations-v1-operation-operations.types.d.ts +1614 -0
  23. package/build/cjs/src/restaurants-operations-v1-operation-operations.types.js +190 -0
  24. package/build/cjs/src/restaurants-operations-v1-operation-operations.types.js.map +1 -0
  25. package/build/cjs/src/restaurants-operations-v1-operation-operations.universal.d.ts +2091 -0
  26. package/build/cjs/src/restaurants-operations-v1-operation-operations.universal.js +848 -0
  27. package/build/cjs/src/restaurants-operations-v1-operation-operations.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/restaurants-operations-v1-operation-operations.context.d.ts +32 -0
  39. package/build/es/src/restaurants-operations-v1-operation-operations.context.js +32 -0
  40. package/build/es/src/restaurants-operations-v1-operation-operations.context.js.map +1 -0
  41. package/build/es/src/restaurants-operations-v1-operation-operations.http.d.ts +72 -0
  42. package/build/es/src/restaurants-operations-v1-operation-operations.http.js +667 -0
  43. package/build/es/src/restaurants-operations-v1-operation-operations.http.js.map +1 -0
  44. package/build/es/src/restaurants-operations-v1-operation-operations.meta.d.ts +40 -0
  45. package/build/es/src/restaurants-operations-v1-operation-operations.meta.js +218 -0
  46. package/build/es/src/restaurants-operations-v1-operation-operations.meta.js.map +1 -0
  47. package/build/es/src/restaurants-operations-v1-operation-operations.public.d.ts +144 -0
  48. package/build/es/src/restaurants-operations-v1-operation-operations.public.js +114 -0
  49. package/build/es/src/restaurants-operations-v1-operation-operations.public.js.map +1 -0
  50. package/build/es/src/restaurants-operations-v1-operation-operations.types.d.ts +1614 -0
  51. package/build/es/src/restaurants-operations-v1-operation-operations.types.js +187 -0
  52. package/build/es/src/restaurants-operations-v1-operation-operations.types.js.map +1 -0
  53. package/build/es/src/restaurants-operations-v1-operation-operations.universal.d.ts +2091 -0
  54. package/build/es/src/restaurants-operations-v1-operation-operations.universal.js +810 -0
  55. package/build/es/src/restaurants-operations-v1-operation-operations.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.context.d.ts +32 -0
  66. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.context.js +54 -0
  67. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.context.js.map +1 -0
  68. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.http.d.ts +72 -0
  69. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.http.js +682 -0
  70. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.http.js.map +1 -0
  71. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.meta.d.ts +40 -0
  72. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.meta.js +256 -0
  73. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.meta.js.map +1 -0
  74. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.public.d.ts +144 -0
  75. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.public.js +148 -0
  76. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.public.js.map +1 -0
  77. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.types.d.ts +1614 -0
  78. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.types.js +190 -0
  79. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.types.js.map +1 -0
  80. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.universal.d.ts +2091 -0
  81. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.universal.js +848 -0
  82. package/build/internal/cjs/src/restaurants-operations-v1-operation-operations.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/restaurants-operations-v1-operation-operations.context.d.ts +32 -0
  93. package/build/internal/es/src/restaurants-operations-v1-operation-operations.context.js +32 -0
  94. package/build/internal/es/src/restaurants-operations-v1-operation-operations.context.js.map +1 -0
  95. package/build/internal/es/src/restaurants-operations-v1-operation-operations.http.d.ts +72 -0
  96. package/build/internal/es/src/restaurants-operations-v1-operation-operations.http.js +667 -0
  97. package/build/internal/es/src/restaurants-operations-v1-operation-operations.http.js.map +1 -0
  98. package/build/internal/es/src/restaurants-operations-v1-operation-operations.meta.d.ts +40 -0
  99. package/build/internal/es/src/restaurants-operations-v1-operation-operations.meta.js +218 -0
  100. package/build/internal/es/src/restaurants-operations-v1-operation-operations.meta.js.map +1 -0
  101. package/build/internal/es/src/restaurants-operations-v1-operation-operations.public.d.ts +144 -0
  102. package/build/internal/es/src/restaurants-operations-v1-operation-operations.public.js +114 -0
  103. package/build/internal/es/src/restaurants-operations-v1-operation-operations.public.js.map +1 -0
  104. package/build/internal/es/src/restaurants-operations-v1-operation-operations.types.d.ts +1614 -0
  105. package/build/internal/es/src/restaurants-operations-v1-operation-operations.types.js +187 -0
  106. package/build/internal/es/src/restaurants-operations-v1-operation-operations.types.js.map +1 -0
  107. package/build/internal/es/src/restaurants-operations-v1-operation-operations.universal.d.ts +2091 -0
  108. package/build/internal/es/src/restaurants-operations-v1-operation-operations.universal.js +810 -0
  109. package/build/internal/es/src/restaurants-operations-v1-operation-operations.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,810 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
+ import * as ambassadorWixRestaurantsOperationsV1Operation from './restaurants-operations-v1-operation-operations.http.js';
5
+ // @ts-ignore
6
+ import { transformSDKAddressToRESTAddress } from '@wix/sdk-runtime/transformations/address';
7
+ import { transformRESTAddressToSDKAddress } from '@wix/sdk-runtime/transformations/address';
8
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
9
+ /** Scheduling type enum. */
10
+ export var SchedulingType;
11
+ (function (SchedulingType) {
12
+ /** Unknown scheduling type. */
13
+ SchedulingType["UNKNOWN_SCHEDULING"] = "UNKNOWN_SCHEDULING";
14
+ /** Orders can be scheduled for the future and to be handled immediately. */
15
+ SchedulingType["ASAP"] = "ASAP";
16
+ /** Orders can be scheduled only for the future. */
17
+ SchedulingType["PREORDER"] = "PREORDER";
18
+ })(SchedulingType || (SchedulingType = {}));
19
+ /** Preparation time type enum. */
20
+ export var PreparationTimeType;
21
+ (function (PreparationTimeType) {
22
+ /** Unknown preparation time type. */
23
+ PreparationTimeType["UNKNOWN_PREPARATION_TIME"] = "UNKNOWN_PREPARATION_TIME";
24
+ /** Preparation time that is bounded by a maximum time. */
25
+ PreparationTimeType["MAX"] = "MAX";
26
+ /** Preparation time that is bounded by a range of times. */
27
+ PreparationTimeType["RANGE"] = "RANGE";
28
+ })(PreparationTimeType || (PreparationTimeType = {}));
29
+ /** Time unit enum. */
30
+ export var TimeUnit;
31
+ (function (TimeUnit) {
32
+ /** Unknown time unit. */
33
+ TimeUnit["UNKNOWN_TIME_UNIT"] = "UNKNOWN_TIME_UNIT";
34
+ /** Minutes time unit. */
35
+ TimeUnit["MINUTES"] = "MINUTES";
36
+ /** Hours time unit. */
37
+ TimeUnit["HOURS"] = "HOURS";
38
+ /** Days time unit. */
39
+ TimeUnit["DAYS"] = "DAYS";
40
+ })(TimeUnit || (TimeUnit = {}));
41
+ /** Asap preorder type enum. */
42
+ export var AsapPreorderType;
43
+ (function (AsapPreorderType) {
44
+ /** Unknown ASAP preorder type. */
45
+ AsapPreorderType["UNKNOWN_ASAP_PREORDER"] = "UNKNOWN_ASAP_PREORDER";
46
+ /** Doesn't allow preorder. */
47
+ AsapPreorderType["NO_PREORDER"] = "NO_PREORDER";
48
+ /** Allows preorder for a maximum specified number of business days in advance. */
49
+ AsapPreorderType["BUSINESS_DAYS_PREORDER"] = "BUSINESS_DAYS_PREORDER";
50
+ })(AsapPreorderType || (AsapPreorderType = {}));
51
+ export var EntitiesDayOfWeek;
52
+ (function (EntitiesDayOfWeek) {
53
+ /** Monday. */
54
+ EntitiesDayOfWeek["MON"] = "MON";
55
+ /** Tuesday. */
56
+ EntitiesDayOfWeek["TUE"] = "TUE";
57
+ /** Wednesday. */
58
+ EntitiesDayOfWeek["WED"] = "WED";
59
+ /** Thursday. */
60
+ EntitiesDayOfWeek["THU"] = "THU";
61
+ /** Friday. */
62
+ EntitiesDayOfWeek["FRI"] = "FRI";
63
+ /** Saturday. */
64
+ EntitiesDayOfWeek["SAT"] = "SAT";
65
+ /** Sunday. */
66
+ EntitiesDayOfWeek["SUN"] = "SUN";
67
+ })(EntitiesDayOfWeek || (EntitiesDayOfWeek = {}));
68
+ /** Preorder method type enum. */
69
+ export var MethodType;
70
+ (function (MethodType) {
71
+ /** Unknown preorder method type. */
72
+ MethodType["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
73
+ /** Preorder time has a minimum and a maximum. */
74
+ MethodType["TIME_BOUNDED"] = "TIME_BOUNDED";
75
+ /** Preorders have a weekly schedule with a weekly cutoff time. */
76
+ MethodType["WEEKLY_SCHEDULE"] = "WEEKLY_SCHEDULE";
77
+ })(MethodType || (MethodType = {}));
78
+ /** The fulfillment times type enum. */
79
+ export var FulfillmentTimesType;
80
+ (function (FulfillmentTimesType) {
81
+ /** Unknown fulfillment times type. */
82
+ FulfillmentTimesType["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
83
+ /** Display fulfillment times as time windows. */
84
+ FulfillmentTimesType["TIME_WINDOWS"] = "TIME_WINDOWS";
85
+ })(FulfillmentTimesType || (FulfillmentTimesType = {}));
86
+ /** Online ordering status enum. */
87
+ export var OnlineOrderingStatusType;
88
+ (function (OnlineOrderingStatusType) {
89
+ /** Online ordering status is not defined. */
90
+ OnlineOrderingStatusType["UNDEFINED_ONLINE_ORDERING_STATUS"] = "UNDEFINED_ONLINE_ORDERING_STATUS";
91
+ /** Operation currently accepts online orders. */
92
+ OnlineOrderingStatusType["ENABLED"] = "ENABLED";
93
+ /** Operation currently does not accept online orders. */
94
+ OnlineOrderingStatusType["DISABLED"] = "DISABLED";
95
+ /** Operation currently does not accept online orders, but will accept online orders from a specified time and date. When applied, `pausedUntilOptions` is a required field. */
96
+ OnlineOrderingStatusType["PAUSED_UNTIL"] = "PAUSED_UNTIL";
97
+ })(OnlineOrderingStatusType || (OnlineOrderingStatusType = {}));
98
+ /** Fulfillment type enum. */
99
+ export var FulfillmentType;
100
+ (function (FulfillmentType) {
101
+ /** Undefined fulfillment type. */
102
+ FulfillmentType["UNDEFINED_FULFILLMENT_TYPE"] = "UNDEFINED_FULFILLMENT_TYPE";
103
+ /** Pickup fulfillment. */
104
+ FulfillmentType["PICKUP"] = "PICKUP";
105
+ /** Delivery fulfillment. */
106
+ FulfillmentType["DELIVERY"] = "DELIVERY";
107
+ })(FulfillmentType || (FulfillmentType = {}));
108
+ /** Preparation time type enum. */
109
+ export var PreparationTimePreparationTimeType;
110
+ (function (PreparationTimePreparationTimeType) {
111
+ PreparationTimePreparationTimeType["UNKNOWN_PREPARATION_TIME"] = "UNKNOWN_PREPARATION_TIME";
112
+ PreparationTimePreparationTimeType["MAX_TIME"] = "MAX_TIME";
113
+ PreparationTimePreparationTimeType["TIME_RANGE"] = "TIME_RANGE";
114
+ })(PreparationTimePreparationTimeType || (PreparationTimePreparationTimeType = {}));
115
+ export var AsapFutureHandlingType;
116
+ (function (AsapFutureHandlingType) {
117
+ /** Unknown asap future handling type. */
118
+ AsapFutureHandlingType["UNKNOWN_ASAP_FUTURE_HANDLING"] = "UNKNOWN_ASAP_FUTURE_HANDLING";
119
+ /** No future handling. */
120
+ AsapFutureHandlingType["NO_FUTURE_HANDLING"] = "NO_FUTURE_HANDLING";
121
+ /** Allows future orders for up to a specified number of business days ahead. */
122
+ AsapFutureHandlingType["BUSINESS_DAYS_AHEAD_HANDLING"] = "BUSINESS_DAYS_AHEAD_HANDLING";
123
+ })(AsapFutureHandlingType || (AsapFutureHandlingType = {}));
124
+ export var SortOrder;
125
+ (function (SortOrder) {
126
+ SortOrder["ASC"] = "ASC";
127
+ SortOrder["DESC"] = "DESC";
128
+ })(SortOrder || (SortOrder = {}));
129
+ export var SubdivisionType;
130
+ (function (SubdivisionType) {
131
+ SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
132
+ /** State */
133
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
134
+ /** County */
135
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
136
+ /** City/town */
137
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
138
+ /** Neighborhood/quarter */
139
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
140
+ /** Street/block */
141
+ SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
142
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
143
+ SubdivisionType["COUNTRY"] = "COUNTRY";
144
+ })(SubdivisionType || (SubdivisionType = {}));
145
+ /** Fulfillment time type enum. */
146
+ export var FulfillmentTimeType;
147
+ (function (FulfillmentTimeType) {
148
+ /** Undefined fulfillment time type. */
149
+ FulfillmentTimeType["UNDEFINED_FULFILLMENT_TIME"] = "UNDEFINED_FULFILLMENT_TIME";
150
+ /** Fulfillment time has a maximum. */
151
+ FulfillmentTimeType["MAX_TIME"] = "MAX_TIME";
152
+ /** Fulfillment time has a minimum and a maximum. */
153
+ FulfillmentTimeType["DURATION_RANGE"] = "DURATION_RANGE";
154
+ })(FulfillmentTimeType || (FulfillmentTimeType = {}));
155
+ /** Fulfillment times display type enum. */
156
+ export var FulfillmentTimesDisplayType;
157
+ (function (FulfillmentTimesDisplayType) {
158
+ /** Undefined fulfillment times display type. */
159
+ FulfillmentTimesDisplayType["UNDEFINED_FULFILLMENT_TIMES_DISPLAY"] = "UNDEFINED_FULFILLMENT_TIMES_DISPLAY";
160
+ /** Fulfillment times are displayed as a list of time windows. */
161
+ FulfillmentTimesDisplayType["TIME_WINDOWS"] = "TIME_WINDOWS";
162
+ })(FulfillmentTimesDisplayType || (FulfillmentTimesDisplayType = {}));
163
+ /** Where the extra text should be displayed: before, after or instead of the actual address. */
164
+ export var PlacementType;
165
+ (function (PlacementType) {
166
+ PlacementType["BEFORE"] = "BEFORE";
167
+ PlacementType["AFTER"] = "AFTER";
168
+ PlacementType["REPLACE"] = "REPLACE";
169
+ })(PlacementType || (PlacementType = {}));
170
+ /** Enumerates the days of the week. */
171
+ export var DayOfWeek;
172
+ (function (DayOfWeek) {
173
+ DayOfWeek["MONDAY"] = "MONDAY";
174
+ DayOfWeek["TUESDAY"] = "TUESDAY";
175
+ DayOfWeek["WEDNESDAY"] = "WEDNESDAY";
176
+ DayOfWeek["THURSDAY"] = "THURSDAY";
177
+ DayOfWeek["FRIDAY"] = "FRIDAY";
178
+ DayOfWeek["SATURDAY"] = "SATURDAY";
179
+ DayOfWeek["SUNDAY"] = "SUNDAY";
180
+ })(DayOfWeek || (DayOfWeek = {}));
181
+ export var ResolutionMethod;
182
+ (function (ResolutionMethod) {
183
+ ResolutionMethod["QUERY_PARAM"] = "QUERY_PARAM";
184
+ ResolutionMethod["SUBDOMAIN"] = "SUBDOMAIN";
185
+ ResolutionMethod["SUBDIRECTORY"] = "SUBDIRECTORY";
186
+ })(ResolutionMethod || (ResolutionMethod = {}));
187
+ export var WebhookIdentityType;
188
+ (function (WebhookIdentityType) {
189
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
190
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
191
+ WebhookIdentityType["MEMBER"] = "MEMBER";
192
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
193
+ WebhookIdentityType["APP"] = "APP";
194
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
195
+ /**
196
+ * Creates a new operation.
197
+ * @param operation - Operation to create.
198
+ * @public
199
+ * @documentationMaturity preview
200
+ * @requiredField operation
201
+ * @permissionId RESTAURANTS.OPERATION_CREATE
202
+ * @permissionScope Manage Restaurants - all permissions
203
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
204
+ * @applicableIdentity APP
205
+ * @returns Created operation.
206
+ * @fqn wix.restaurants.operations.v1.OperationsService.CreateOperation
207
+ */
208
+ export async function createOperation(operation) {
209
+ // @ts-ignore
210
+ const { httpClient, sideEffects } = arguments[1];
211
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ operation: operation }), [
212
+ {
213
+ transformFn: transformSDKAddressToRESTAddress,
214
+ paths: [{ path: 'operation.businessLocationDetails.address' }],
215
+ },
216
+ ]);
217
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.createOperation(payload);
218
+ sideEffects?.onSiteCall?.();
219
+ try {
220
+ const result = await httpClient.request(reqOpts);
221
+ sideEffects?.onSuccess?.(result);
222
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
223
+ {
224
+ transformFn: transformRESTAddressToSDKAddress,
225
+ paths: [{ path: 'operation.businessLocationDetails.address' }],
226
+ },
227
+ ]))?.operation;
228
+ }
229
+ catch (err) {
230
+ const transformedError = sdkTransformError(err, {
231
+ spreadPathsToArguments: {},
232
+ explicitPathsToArguments: { operation: '$[0]' },
233
+ singleArgumentUnchanged: false,
234
+ }, ['operation']);
235
+ sideEffects?.onError?.(err);
236
+ throw transformedError;
237
+ }
238
+ }
239
+ /**
240
+ * Retrieves an operation.
241
+ * @param operationId - ID of the operation to retrieve.
242
+ * @public
243
+ * @documentationMaturity preview
244
+ * @requiredField operationId
245
+ * @permissionId RESTAURANTS.OPERATION_READ
246
+ * @permissionScope Manage Restaurants - all permissions
247
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
248
+ * @applicableIdentity APP
249
+ * @applicableIdentity VISITOR
250
+ * @returns Retrieved operation.
251
+ * @fqn wix.restaurants.operations.v1.OperationsService.GetOperation
252
+ */
253
+ export async function getOperation(operationId) {
254
+ // @ts-ignore
255
+ const { httpClient, sideEffects } = arguments[1];
256
+ const payload = renameKeysFromSDKRequestToRESTRequest({
257
+ operationId: operationId,
258
+ });
259
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.getOperation(payload);
260
+ sideEffects?.onSiteCall?.();
261
+ try {
262
+ const result = await httpClient.request(reqOpts);
263
+ sideEffects?.onSuccess?.(result);
264
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
265
+ {
266
+ transformFn: transformRESTAddressToSDKAddress,
267
+ paths: [{ path: 'operation.businessLocationDetails.address' }],
268
+ },
269
+ ]))?.operation;
270
+ }
271
+ catch (err) {
272
+ const transformedError = sdkTransformError(err, {
273
+ spreadPathsToArguments: {},
274
+ explicitPathsToArguments: { operationId: '$[0]' },
275
+ singleArgumentUnchanged: false,
276
+ }, ['operationId']);
277
+ sideEffects?.onError?.(err);
278
+ throw transformedError;
279
+ }
280
+ }
281
+ /**
282
+ * Updates an operation.
283
+ *
284
+ * If you update part of the `orderScheduling` property, the whole object is overwritten,
285
+ * so you must include the entire object unless you are not updating `orderScheduling` at all. <br />
286
+ *
287
+ * Each time the operation is updated,
288
+ * `revision` increments by 1.
289
+ * The current `revision` must be passed when updating the operation.
290
+ * This ensures you're working with the latest operation
291
+ * and prevents unintended overwrites.
292
+ * @param _id - Operation ID.
293
+ * @public
294
+ * @documentationMaturity preview
295
+ * @requiredField _id
296
+ * @requiredField operation
297
+ * @requiredField operation.revision
298
+ * @permissionId RESTAURANTS.OPERATION_UPDATE
299
+ * @permissionScope Manage Restaurants - all permissions
300
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
301
+ * @applicableIdentity APP
302
+ * @returns Updated operation.
303
+ * @fqn wix.restaurants.operations.v1.OperationsService.UpdateOperation
304
+ */
305
+ export async function updateOperation(_id, operation) {
306
+ // @ts-ignore
307
+ const { httpClient, sideEffects } = arguments[2];
308
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
309
+ operation: { ...operation, id: _id },
310
+ }), [
311
+ {
312
+ transformFn: transformSDKAddressToRESTAddress,
313
+ paths: [{ path: 'operation.businessLocationDetails.address' }],
314
+ },
315
+ ]);
316
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.updateOperation(payload);
317
+ sideEffects?.onSiteCall?.();
318
+ try {
319
+ const result = await httpClient.request(reqOpts);
320
+ sideEffects?.onSuccess?.(result);
321
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
322
+ {
323
+ transformFn: transformRESTAddressToSDKAddress,
324
+ paths: [{ path: 'operation.businessLocationDetails.address' }],
325
+ },
326
+ ]))?.operation;
327
+ }
328
+ catch (err) {
329
+ const transformedError = sdkTransformError(err, {
330
+ spreadPathsToArguments: { operation: '$[1]' },
331
+ explicitPathsToArguments: { 'operation.id': '$[0]' },
332
+ singleArgumentUnchanged: false,
333
+ }, ['_id', 'operation']);
334
+ sideEffects?.onError?.(err);
335
+ throw transformedError;
336
+ }
337
+ }
338
+ /**
339
+ * Deletes an operation.
340
+ * @param operationId - ID of the operation to delete.
341
+ * @public
342
+ * @documentationMaturity preview
343
+ * @requiredField operationId
344
+ * @permissionId RESTAURANTS.OPERATION_DELETE
345
+ * @permissionScope Manage Restaurants - all permissions
346
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
347
+ * @applicableIdentity APP
348
+ * @fqn wix.restaurants.operations.v1.OperationsService.DeleteOperation
349
+ */
350
+ export async function deleteOperation(operationId) {
351
+ // @ts-ignore
352
+ const { httpClient, sideEffects } = arguments[1];
353
+ const payload = renameKeysFromSDKRequestToRESTRequest({
354
+ operationId: operationId,
355
+ });
356
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.deleteOperation(payload);
357
+ sideEffects?.onSiteCall?.();
358
+ try {
359
+ const result = await httpClient.request(reqOpts);
360
+ sideEffects?.onSuccess?.(result);
361
+ }
362
+ catch (err) {
363
+ const transformedError = sdkTransformError(err, {
364
+ spreadPathsToArguments: {},
365
+ explicitPathsToArguments: { operationId: '$[0]' },
366
+ singleArgumentUnchanged: false,
367
+ }, ['operationId']);
368
+ sideEffects?.onError?.(err);
369
+ throw transformedError;
370
+ }
371
+ }
372
+ /**
373
+ * Creates a query to retrieve a list of operations.
374
+ *
375
+ * The `queryOperations()` function builds a query to retrieve a list of operations and returns an `OperationsQueryBuilder` object.
376
+ *
377
+ * The returned object contains the query definition, which is used to run the query using the [`find()`](/operations/operations-query-builder/find) function.
378
+ *
379
+ * You can refine the query by chaining `OperationsQueryBuilder` functions onto the query. `OperationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryOperations()` returns.
380
+ *
381
+ * `queryOperations()` runs with the following `OperationsQueryBuilder` defaults, which you can override:
382
+ *
383
+ * * [`limit(50)`](/operations/operations-query-builder/limit)
384
+ * * [`ascending('entityId')`](/operations/operations-methods-query-builder/ascending)
385
+ *
386
+ * The following `OperationsQueryBuilder` functions are supported for `queryOperations()`. For a full description of the operations object, see the object returned for the [`items`](/operations/operations-query-result/items) property in `OperationsQueryResult`.
387
+ * @public
388
+ * @documentationMaturity preview
389
+ * @permissionScope Manage Restaurants - all permissions
390
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
391
+ * @permissionId RESTAURANTS.OPERATION_READ
392
+ * @applicableIdentity APP
393
+ * @applicableIdentity VISITOR
394
+ * @fqn wix.restaurants.operations.v1.OperationsService.QueryOperation
395
+ */
396
+ export function queryOperation() {
397
+ // @ts-ignore
398
+ const { httpClient, sideEffects } = arguments[0];
399
+ return queryBuilder({
400
+ func: async (payload) => {
401
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.queryOperation(payload);
402
+ sideEffects?.onSiteCall?.();
403
+ try {
404
+ const result = await httpClient.request(reqOpts);
405
+ sideEffects?.onSuccess?.(result);
406
+ return result;
407
+ }
408
+ catch (err) {
409
+ sideEffects?.onError?.(err);
410
+ throw err;
411
+ }
412
+ },
413
+ requestTransformer: (query) => {
414
+ const args = [query, {}];
415
+ return renameKeysFromSDKRequestToRESTRequest({
416
+ ...args?.[1],
417
+ query: args?.[0],
418
+ });
419
+ },
420
+ responseTransformer: ({ data }) => {
421
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
422
+ {
423
+ transformFn: transformRESTAddressToSDKAddress,
424
+ paths: [{ path: 'operations.businessLocationDetails.address' }],
425
+ },
426
+ ]));
427
+ return {
428
+ items: transformedData?.operations,
429
+ pagingMetadata: transformedData?.pagingMetadata,
430
+ };
431
+ },
432
+ errorTransformer: (err) => {
433
+ const transformedError = sdkTransformError(err, {
434
+ spreadPathsToArguments: {},
435
+ explicitPathsToArguments: { query: '$[0]' },
436
+ singleArgumentUnchanged: false,
437
+ });
438
+ throw transformedError;
439
+ },
440
+ pagingMethod: 'CURSOR',
441
+ transformationPaths: {},
442
+ });
443
+ }
444
+ /**
445
+ * Retrieves a list of operations.
446
+ * The result will be sorted by created date in ascending order.
447
+ * @public
448
+ * @documentationMaturity preview
449
+ * @permissionId RESTAURANTS.OPERATION_READ
450
+ * @permissionScope Manage Restaurants - all permissions
451
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
452
+ * @applicableIdentity APP
453
+ * @applicableIdentity VISITOR
454
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListOperations
455
+ */
456
+ export async function listOperations() {
457
+ // @ts-ignore
458
+ const { httpClient, sideEffects } = arguments[0];
459
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
460
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listOperations(payload);
461
+ sideEffects?.onSiteCall?.();
462
+ try {
463
+ const result = await httpClient.request(reqOpts);
464
+ sideEffects?.onSuccess?.(result);
465
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
466
+ {
467
+ transformFn: transformRESTAddressToSDKAddress,
468
+ paths: [{ path: 'operations.businessLocationDetails.address' }],
469
+ },
470
+ ]));
471
+ }
472
+ catch (err) {
473
+ const transformedError = sdkTransformError(err, {
474
+ spreadPathsToArguments: {},
475
+ explicitPathsToArguments: {},
476
+ singleArgumentUnchanged: false,
477
+ }, []);
478
+ sideEffects?.onError?.(err);
479
+ throw transformedError;
480
+ }
481
+ }
482
+ /**
483
+ * Retrieves a list of available fulfillment options.
484
+ *
485
+ * What makes a fulfillment option available is whether you can submit an order given the scheduling configurations and the fulfillment method's availability.
486
+ * When a delivery address is not provided in the input, our system retrieves a list encompassing all types of fulfillment methods.
487
+ * Conversely, if a delivery address` is given, the response may includes non-delivery fulfillment options along with delivery fulfillment methods that are applicable to the given address, ensuring the address falls within the defined delivery area of these methods.
488
+ * @param operationId - Operation ID. Returned fulfillment options will belong to this operation.
489
+ * @public
490
+ * @documentationMaturity preview
491
+ * @requiredField operationId
492
+ * @permissionId RESTAURANTS.OPERATION_READ
493
+ * @permissionScope Manage Restaurants - all permissions
494
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
495
+ * @applicableIdentity APP
496
+ * @applicableIdentity VISITOR
497
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListAvailableFulfillmentOptions
498
+ */
499
+ export async function listAvailableFulfillmentOptions(operationId, options) {
500
+ // @ts-ignore
501
+ const { httpClient, sideEffects } = arguments[2];
502
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
503
+ operationId: operationId,
504
+ deliveryAddress: options?.deliveryAddress,
505
+ }), [
506
+ {
507
+ transformFn: transformSDKAddressToRESTAddress,
508
+ paths: [{ path: 'deliveryAddress' }],
509
+ },
510
+ ]);
511
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listAvailableFulfillmentOptions(payload);
512
+ sideEffects?.onSiteCall?.();
513
+ try {
514
+ const result = await httpClient.request(reqOpts);
515
+ sideEffects?.onSuccess?.(result);
516
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
517
+ {
518
+ transformFn: transformRESTAddressToSDKAddress,
519
+ paths: [{ path: 'fulfillmentOptions.pickupOptions.address' }],
520
+ },
521
+ ]));
522
+ }
523
+ catch (err) {
524
+ const transformedError = sdkTransformError(err, {
525
+ spreadPathsToArguments: {},
526
+ explicitPathsToArguments: {
527
+ operationId: '$[0]',
528
+ deliveryAddress: '$[1].deliveryAddress',
529
+ },
530
+ singleArgumentUnchanged: false,
531
+ }, ['operationId', 'options']);
532
+ sideEffects?.onError?.(err);
533
+ throw transformedError;
534
+ }
535
+ }
536
+ /**
537
+ * Retrieves a list of available time slots for each fulfillment type.
538
+ *
539
+ * Each time slot is the first available time slot for the given fulfillment type.
540
+ * @param operationId - Operation ID.
541
+ * Returned fulfillment options will belong to this operation.
542
+ * @public
543
+ * @documentationMaturity preview
544
+ * @requiredField operationId
545
+ * @permissionId RESTAURANTS.OPERATION_READ
546
+ * @permissionScope Manage Restaurants - all permissions
547
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
548
+ * @applicableIdentity APP
549
+ * @applicableIdentity VISITOR
550
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListFirstAvailableTimeSlotForFulfillmentTypes
551
+ */
552
+ export async function listFirstAvailableTimeSlotForFulfillmentTypes(operationId, options) {
553
+ // @ts-ignore
554
+ const { httpClient, sideEffects } = arguments[2];
555
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
556
+ operationId: operationId,
557
+ deliveryAddress: options?.deliveryAddress,
558
+ }), [
559
+ {
560
+ transformFn: transformSDKAddressToRESTAddress,
561
+ paths: [{ path: 'deliveryAddress' }],
562
+ },
563
+ ]);
564
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listFirstAvailableTimeSlotForFulfillmentTypes(payload);
565
+ sideEffects?.onSiteCall?.();
566
+ try {
567
+ const result = await httpClient.request(reqOpts);
568
+ sideEffects?.onSuccess?.(result);
569
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
570
+ {
571
+ transformFn: transformRESTAddressToSDKAddress,
572
+ paths: [{ path: 'timeSlots.fulfillmentAddress.address' }],
573
+ },
574
+ ]));
575
+ }
576
+ catch (err) {
577
+ const transformedError = sdkTransformError(err, {
578
+ spreadPathsToArguments: {},
579
+ explicitPathsToArguments: {
580
+ operationId: '$[0]',
581
+ deliveryAddress: '$[1].deliveryAddress',
582
+ },
583
+ singleArgumentUnchanged: false,
584
+ }, ['operationId', 'options']);
585
+ sideEffects?.onError?.(err);
586
+ throw transformedError;
587
+ }
588
+ }
589
+ /**
590
+ * Retrieves a list of available time slots for each fulfillment type.
591
+ *
592
+ * Each time slot is the first available time slot for the given fulfillment type.
593
+ * @param operationIds - Operation ID.
594
+ * Returned fulfillment options will belong to this operation.
595
+ * @public
596
+ * @documentationMaturity preview
597
+ * @requiredField operationIds
598
+ * @permissionId RESTAURANTS.OPERATION_READ
599
+ * @permissionScope Manage Restaurants - all permissions
600
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
601
+ * @applicableIdentity APP
602
+ * @applicableIdentity VISITOR
603
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListFirstAvailableTimeSlotsForOperations
604
+ */
605
+ export async function listFirstAvailableTimeSlotsForOperations(operationIds, options) {
606
+ // @ts-ignore
607
+ const { httpClient, sideEffects } = arguments[2];
608
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
609
+ operationIds: operationIds,
610
+ deliveryAddress: options?.deliveryAddress,
611
+ }), [
612
+ {
613
+ transformFn: transformSDKAddressToRESTAddress,
614
+ paths: [{ path: 'deliveryAddress' }],
615
+ },
616
+ ]);
617
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listFirstAvailableTimeSlotsForOperations(payload);
618
+ sideEffects?.onSiteCall?.();
619
+ try {
620
+ const result = await httpClient.request(reqOpts);
621
+ sideEffects?.onSuccess?.(result);
622
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
623
+ {
624
+ transformFn: transformRESTAddressToSDKAddress,
625
+ paths: [{ path: 'timeSlots.timeSlots.fulfillmentAddress.address' }],
626
+ },
627
+ ]));
628
+ }
629
+ catch (err) {
630
+ const transformedError = sdkTransformError(err, {
631
+ spreadPathsToArguments: {},
632
+ explicitPathsToArguments: {
633
+ operationIds: '$[0]',
634
+ deliveryAddress: '$[1].deliveryAddress',
635
+ },
636
+ singleArgumentUnchanged: false,
637
+ }, ['operationIds', 'options']);
638
+ sideEffects?.onError?.(err);
639
+ throw transformedError;
640
+ }
641
+ }
642
+ /**
643
+ * For each menu, retrieves the first available time slots for each fulfillment type.
644
+ * @param operationId - Operation ID.
645
+ * Returned timeslots that are belong to this operation.
646
+ * @public
647
+ * @documentationMaturity preview
648
+ * @requiredField operationId
649
+ * @permissionId RESTAURANTS.OPERATION_READ
650
+ * @permissionScope Manage Restaurants - all permissions
651
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
652
+ * @applicableIdentity APP
653
+ * @applicableIdentity VISITOR
654
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListFirstAvailableTimeSlotsForMenus
655
+ */
656
+ export async function listFirstAvailableTimeSlotsForMenus(operationId, options) {
657
+ // @ts-ignore
658
+ const { httpClient, sideEffects } = arguments[2];
659
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
660
+ operationId: operationId,
661
+ deliveryAddress: options?.deliveryAddress,
662
+ cursorPaging: options?.cursorPaging,
663
+ }), [
664
+ {
665
+ transformFn: transformSDKAddressToRESTAddress,
666
+ paths: [{ path: 'deliveryAddress' }],
667
+ },
668
+ ]);
669
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listFirstAvailableTimeSlotsForMenus(payload);
670
+ sideEffects?.onSiteCall?.();
671
+ try {
672
+ const result = await httpClient.request(reqOpts);
673
+ sideEffects?.onSuccess?.(result);
674
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
675
+ {
676
+ transformFn: transformRESTAddressToSDKAddress,
677
+ paths: [
678
+ {
679
+ path: 'timeSlotsPerMenu.timeslotsPerFulfillmentType.fulfillmentAddress.address',
680
+ },
681
+ ],
682
+ },
683
+ ]));
684
+ }
685
+ catch (err) {
686
+ const transformedError = sdkTransformError(err, {
687
+ spreadPathsToArguments: {},
688
+ explicitPathsToArguments: {
689
+ operationId: '$[0]',
690
+ deliveryAddress: '$[1].deliveryAddress',
691
+ cursorPaging: '$[1].cursorPaging',
692
+ },
693
+ singleArgumentUnchanged: false,
694
+ }, ['operationId', 'options']);
695
+ sideEffects?.onError?.(err);
696
+ throw transformedError;
697
+ }
698
+ }
699
+ /**
700
+ * Retrieves a list of the available time slots for a given date.
701
+ * @param operationId - Operation ID.
702
+ * The returned fulfillment options will belong to this operation.
703
+ * @public
704
+ * @documentationMaturity preview
705
+ * @requiredField operationId
706
+ * @requiredField options.date
707
+ * @requiredField options.date.day
708
+ * @requiredField options.date.month
709
+ * @requiredField options.date.year
710
+ * @permissionId RESTAURANTS.OPERATION_READ
711
+ * @permissionScope Manage Restaurants - all permissions
712
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
713
+ * @applicableIdentity APP
714
+ * @applicableIdentity VISITOR
715
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListAvailableTimeSlotsForDate
716
+ */
717
+ export async function listAvailableTimeSlotsForDate(operationId, options) {
718
+ // @ts-ignore
719
+ const { httpClient, sideEffects } = arguments[2];
720
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
721
+ operationId: operationId,
722
+ deliveryAddress: options?.deliveryAddress,
723
+ date: options?.date,
724
+ }), [
725
+ {
726
+ transformFn: transformSDKAddressToRESTAddress,
727
+ paths: [{ path: 'deliveryAddress' }],
728
+ },
729
+ ]);
730
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listAvailableTimeSlotsForDate(payload);
731
+ sideEffects?.onSiteCall?.();
732
+ try {
733
+ const result = await httpClient.request(reqOpts);
734
+ sideEffects?.onSuccess?.(result);
735
+ return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
736
+ {
737
+ transformFn: transformRESTAddressToSDKAddress,
738
+ paths: [{ path: 'timeSlots.fulfillmentAddress.address' }],
739
+ },
740
+ ]));
741
+ }
742
+ catch (err) {
743
+ const transformedError = sdkTransformError(err, {
744
+ spreadPathsToArguments: {},
745
+ explicitPathsToArguments: {
746
+ operationId: '$[0]',
747
+ deliveryAddress: '$[1].deliveryAddress',
748
+ date: '$[1].date',
749
+ },
750
+ singleArgumentUnchanged: false,
751
+ }, ['operationId', 'options']);
752
+ sideEffects?.onError?.(err);
753
+ throw transformedError;
754
+ }
755
+ }
756
+ /**
757
+ * Retrieves a list of the available dates in a given time range.
758
+ *
759
+ * A date is considered available if it has at least one available time slot.
760
+ * @param operationId - Operation ID.
761
+ * The returned fulfillment options will belong to this operation.
762
+ * @public
763
+ * @documentationMaturity preview
764
+ * @requiredField operationId
765
+ * @requiredField options.from
766
+ * @requiredField options.until
767
+ * @permissionId RESTAURANTS.OPERATION_READ
768
+ * @permissionScope Manage Restaurants - all permissions
769
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
770
+ * @applicableIdentity APP
771
+ * @applicableIdentity VISITOR
772
+ * @fqn wix.restaurants.operations.v1.OperationsService.ListAvailableDatesInRange
773
+ */
774
+ export async function listAvailableDatesInRange(operationId, options) {
775
+ // @ts-ignore
776
+ const { httpClient, sideEffects } = arguments[2];
777
+ const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
778
+ operationId: operationId,
779
+ deliveryAddress: options?.deliveryAddress,
780
+ from: options?.from,
781
+ until: options?.until,
782
+ }), [
783
+ {
784
+ transformFn: transformSDKAddressToRESTAddress,
785
+ paths: [{ path: 'deliveryAddress' }],
786
+ },
787
+ ]);
788
+ const reqOpts = ambassadorWixRestaurantsOperationsV1Operation.listAvailableDatesInRange(payload);
789
+ sideEffects?.onSiteCall?.();
790
+ try {
791
+ const result = await httpClient.request(reqOpts);
792
+ sideEffects?.onSuccess?.(result);
793
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
794
+ }
795
+ catch (err) {
796
+ const transformedError = sdkTransformError(err, {
797
+ spreadPathsToArguments: {},
798
+ explicitPathsToArguments: {
799
+ operationId: '$[0]',
800
+ deliveryAddress: '$[1].deliveryAddress',
801
+ from: '$[1].from',
802
+ until: '$[1].until',
803
+ },
804
+ singleArgumentUnchanged: false,
805
+ }, ['operationId', 'options']);
806
+ sideEffects?.onError?.(err);
807
+ throw transformedError;
808
+ }
809
+ }
810
+ //# sourceMappingURL=restaurants-operations-v1-operation-operations.universal.js.map