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