@wix/auto_sdk_restaurants_recipients 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.
- package/build/cjs/index.d.ts +103 -0
- package/build/cjs/index.js +672 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +827 -0
- package/build/cjs/index.typings.js +545 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +357 -0
- package/build/cjs/meta.js +436 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +103 -0
- package/build/es/index.mjs +636 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +827 -0
- package/build/es/index.typings.mjs +512 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +357 -0
- package/build/es/meta.mjs +403 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +103 -0
- package/build/internal/cjs/index.js +672 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +827 -0
- package/build/internal/cjs/index.typings.js +545 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +357 -0
- package/build/internal/cjs/meta.js +436 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/index.d.mts +103 -0
- package/build/internal/es/index.mjs +636 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +827 -0
- package/build/internal/es/index.typings.mjs +512 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +357 -0
- package/build/internal/es/meta.mjs +403 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Channel: () => Channel,
|
|
24
|
+
SortOrder: () => SortOrder,
|
|
25
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
26
|
+
bulkUpdateRecipientTags: () => bulkUpdateRecipientTags4,
|
|
27
|
+
bulkUpdateRecipientTagsByFilter: () => bulkUpdateRecipientTagsByFilter4,
|
|
28
|
+
createRecipient: () => createRecipient4,
|
|
29
|
+
deleteRecipient: () => deleteRecipient4,
|
|
30
|
+
getRecipient: () => getRecipient4,
|
|
31
|
+
onRecipientCreated: () => onRecipientCreated2,
|
|
32
|
+
onRecipientDeleted: () => onRecipientDeleted2,
|
|
33
|
+
onRecipientUpdated: () => onRecipientUpdated2,
|
|
34
|
+
queryRecipients: () => queryRecipients4,
|
|
35
|
+
updateRecipient: () => updateRecipient4
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
|
|
39
|
+
// src/restaurants-recipient-v1-recipient-recipients.public.ts
|
|
40
|
+
var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
41
|
+
var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
42
|
+
var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
43
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
44
|
+
|
|
45
|
+
// src/restaurants-recipient-v1-recipient-recipients.universal.ts
|
|
46
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
47
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
48
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
49
|
+
|
|
50
|
+
// src/restaurants-recipient-v1-recipient-recipients.http.ts
|
|
51
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
52
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
53
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
54
|
+
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
55
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
56
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
57
|
+
function resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl(opts) {
|
|
58
|
+
const domainToMappings = {
|
|
59
|
+
"manage._base_domain_": [
|
|
60
|
+
{
|
|
61
|
+
srcPath: "/_api/rest-notification-recipients",
|
|
62
|
+
destPath: ""
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"dev._base_domain_": [
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/_api/rest-notification-recipients",
|
|
68
|
+
destPath: ""
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"www.wixapis.com": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/rest-notification-recipients/v1",
|
|
74
|
+
destPath: "/v1"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/restaurants/recipient/v1/recipients",
|
|
78
|
+
destPath: "/v1/recipients"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
_: [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/rest-notification-recipients",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"*.dev.wix-code.com": [
|
|
88
|
+
{
|
|
89
|
+
srcPath: "/_api/rest-notification-recipients",
|
|
90
|
+
destPath: ""
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
95
|
+
}
|
|
96
|
+
var PACKAGE_NAME = "@wix/auto_sdk_restaurants_recipients";
|
|
97
|
+
function createRecipient(payload) {
|
|
98
|
+
function __createRecipient({ host }) {
|
|
99
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
100
|
+
{
|
|
101
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
102
|
+
paths: [
|
|
103
|
+
{ path: "recipient.createdDate" },
|
|
104
|
+
{ path: "recipient.updatedDate" }
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
]);
|
|
108
|
+
const metadata = {
|
|
109
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
110
|
+
method: "POST",
|
|
111
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.CreateRecipient",
|
|
112
|
+
packageName: PACKAGE_NAME,
|
|
113
|
+
migrationOptions: {
|
|
114
|
+
optInTransformResponse: true
|
|
115
|
+
},
|
|
116
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
117
|
+
protoPath: "/v1/recipients",
|
|
118
|
+
data: serializedData,
|
|
119
|
+
host
|
|
120
|
+
}),
|
|
121
|
+
data: serializedData,
|
|
122
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
123
|
+
{
|
|
124
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
125
|
+
paths: [
|
|
126
|
+
{ path: "recipient.createdDate" },
|
|
127
|
+
{ path: "recipient.updatedDate" }
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
])
|
|
131
|
+
};
|
|
132
|
+
return metadata;
|
|
133
|
+
}
|
|
134
|
+
return __createRecipient;
|
|
135
|
+
}
|
|
136
|
+
function getRecipient(payload) {
|
|
137
|
+
function __getRecipient({ host }) {
|
|
138
|
+
const metadata = {
|
|
139
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
140
|
+
method: "GET",
|
|
141
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.GetRecipient",
|
|
142
|
+
packageName: PACKAGE_NAME,
|
|
143
|
+
migrationOptions: {
|
|
144
|
+
optInTransformResponse: true
|
|
145
|
+
},
|
|
146
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
147
|
+
protoPath: "/v1/recipients/{recipientId}",
|
|
148
|
+
data: payload,
|
|
149
|
+
host
|
|
150
|
+
}),
|
|
151
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
152
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
153
|
+
{
|
|
154
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
155
|
+
paths: [
|
|
156
|
+
{ path: "recipient.createdDate" },
|
|
157
|
+
{ path: "recipient.updatedDate" }
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
])
|
|
161
|
+
};
|
|
162
|
+
return metadata;
|
|
163
|
+
}
|
|
164
|
+
return __getRecipient;
|
|
165
|
+
}
|
|
166
|
+
function updateRecipient(payload) {
|
|
167
|
+
function __updateRecipient({ host }) {
|
|
168
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
169
|
+
{
|
|
170
|
+
transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
|
|
171
|
+
paths: [{ path: "fieldMask" }]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
175
|
+
paths: [
|
|
176
|
+
{ path: "recipient.createdDate" },
|
|
177
|
+
{ path: "recipient.updatedDate" }
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
]);
|
|
181
|
+
const metadata = {
|
|
182
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
183
|
+
method: "PATCH",
|
|
184
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.UpdateRecipient",
|
|
185
|
+
packageName: PACKAGE_NAME,
|
|
186
|
+
migrationOptions: {
|
|
187
|
+
optInTransformResponse: true
|
|
188
|
+
},
|
|
189
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
190
|
+
protoPath: "/v1/recipients/{recipient.id}",
|
|
191
|
+
data: serializedData,
|
|
192
|
+
host
|
|
193
|
+
}),
|
|
194
|
+
data: serializedData,
|
|
195
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
196
|
+
{
|
|
197
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
198
|
+
paths: [
|
|
199
|
+
{ path: "recipient.createdDate" },
|
|
200
|
+
{ path: "recipient.updatedDate" }
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
])
|
|
204
|
+
};
|
|
205
|
+
return metadata;
|
|
206
|
+
}
|
|
207
|
+
return __updateRecipient;
|
|
208
|
+
}
|
|
209
|
+
function deleteRecipient(payload) {
|
|
210
|
+
function __deleteRecipient({ host }) {
|
|
211
|
+
const metadata = {
|
|
212
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
213
|
+
method: "DELETE",
|
|
214
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.DeleteRecipient",
|
|
215
|
+
packageName: PACKAGE_NAME,
|
|
216
|
+
migrationOptions: {
|
|
217
|
+
optInTransformResponse: true
|
|
218
|
+
},
|
|
219
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
220
|
+
protoPath: "/v1/recipients/{recipientId}",
|
|
221
|
+
data: payload,
|
|
222
|
+
host
|
|
223
|
+
}),
|
|
224
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
225
|
+
};
|
|
226
|
+
return metadata;
|
|
227
|
+
}
|
|
228
|
+
return __deleteRecipient;
|
|
229
|
+
}
|
|
230
|
+
function queryRecipients(payload) {
|
|
231
|
+
function __queryRecipients({ host }) {
|
|
232
|
+
const metadata = {
|
|
233
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
234
|
+
method: "GET",
|
|
235
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.QueryRecipients",
|
|
236
|
+
packageName: PACKAGE_NAME,
|
|
237
|
+
migrationOptions: {
|
|
238
|
+
optInTransformResponse: true
|
|
239
|
+
},
|
|
240
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
241
|
+
protoPath: "/v1/recipients/query",
|
|
242
|
+
data: payload,
|
|
243
|
+
host
|
|
244
|
+
}),
|
|
245
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload, true),
|
|
246
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
247
|
+
{
|
|
248
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
249
|
+
paths: [
|
|
250
|
+
{ path: "recipients.createdDate" },
|
|
251
|
+
{ path: "recipients.updatedDate" }
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
]),
|
|
255
|
+
fallback: [
|
|
256
|
+
{
|
|
257
|
+
method: "POST",
|
|
258
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl(
|
|
259
|
+
{ protoPath: "/v1/recipients/query", data: payload, host }
|
|
260
|
+
),
|
|
261
|
+
data: payload
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
};
|
|
265
|
+
return metadata;
|
|
266
|
+
}
|
|
267
|
+
return __queryRecipients;
|
|
268
|
+
}
|
|
269
|
+
function bulkUpdateRecipientTags(payload) {
|
|
270
|
+
function __bulkUpdateRecipientTags({ host }) {
|
|
271
|
+
const metadata = {
|
|
272
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
273
|
+
method: "POST",
|
|
274
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.BulkUpdateRecipientTags",
|
|
275
|
+
packageName: PACKAGE_NAME,
|
|
276
|
+
migrationOptions: {
|
|
277
|
+
optInTransformResponse: true
|
|
278
|
+
},
|
|
279
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
280
|
+
protoPath: "/v1/bulk/recipients/update-tags",
|
|
281
|
+
data: payload,
|
|
282
|
+
host
|
|
283
|
+
}),
|
|
284
|
+
data: payload
|
|
285
|
+
};
|
|
286
|
+
return metadata;
|
|
287
|
+
}
|
|
288
|
+
return __bulkUpdateRecipientTags;
|
|
289
|
+
}
|
|
290
|
+
function bulkUpdateRecipientTagsByFilter(payload) {
|
|
291
|
+
function __bulkUpdateRecipientTagsByFilter({ host }) {
|
|
292
|
+
const metadata = {
|
|
293
|
+
entityFqdn: "wix.restaurants.recipient.v1.recipient",
|
|
294
|
+
method: "POST",
|
|
295
|
+
methodFqn: "wix.restaurants.recipient.v1.NotificationRecipientsService.BulkUpdateRecipientTagsByFilter",
|
|
296
|
+
packageName: PACKAGE_NAME,
|
|
297
|
+
migrationOptions: {
|
|
298
|
+
optInTransformResponse: true
|
|
299
|
+
},
|
|
300
|
+
url: resolveWixRestaurantsRecipientV1NotificationRecipientsServiceUrl({
|
|
301
|
+
protoPath: "/v1/bulk/recipients/update-tags-by-filter",
|
|
302
|
+
data: payload,
|
|
303
|
+
host
|
|
304
|
+
}),
|
|
305
|
+
data: payload
|
|
306
|
+
};
|
|
307
|
+
return metadata;
|
|
308
|
+
}
|
|
309
|
+
return __bulkUpdateRecipientTagsByFilter;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// src/restaurants-recipient-v1-recipient-recipients.universal.ts
|
|
313
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
314
|
+
var Channel = /* @__PURE__ */ ((Channel2) => {
|
|
315
|
+
Channel2["UNKNOWN_CHANNEL"] = "UNKNOWN_CHANNEL";
|
|
316
|
+
Channel2["SMS"] = "SMS";
|
|
317
|
+
Channel2["PHONE"] = "PHONE";
|
|
318
|
+
return Channel2;
|
|
319
|
+
})(Channel || {});
|
|
320
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
321
|
+
SortOrder2["ASC"] = "ASC";
|
|
322
|
+
SortOrder2["DESC"] = "DESC";
|
|
323
|
+
return SortOrder2;
|
|
324
|
+
})(SortOrder || {});
|
|
325
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
326
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
327
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
328
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
329
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
330
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
331
|
+
return WebhookIdentityType2;
|
|
332
|
+
})(WebhookIdentityType || {});
|
|
333
|
+
async function createRecipient2(recipient) {
|
|
334
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
335
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
336
|
+
recipient
|
|
337
|
+
});
|
|
338
|
+
const reqOpts = createRecipient(payload);
|
|
339
|
+
sideEffects?.onSiteCall?.();
|
|
340
|
+
try {
|
|
341
|
+
const result = await httpClient.request(reqOpts);
|
|
342
|
+
sideEffects?.onSuccess?.(result);
|
|
343
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.recipient;
|
|
344
|
+
} catch (err) {
|
|
345
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
346
|
+
err,
|
|
347
|
+
{
|
|
348
|
+
spreadPathsToArguments: {},
|
|
349
|
+
explicitPathsToArguments: { recipient: "$[0]" },
|
|
350
|
+
singleArgumentUnchanged: false
|
|
351
|
+
},
|
|
352
|
+
["recipient"]
|
|
353
|
+
);
|
|
354
|
+
sideEffects?.onError?.(err);
|
|
355
|
+
throw transformedError;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
async function getRecipient2(recipientId) {
|
|
359
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
360
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
361
|
+
recipientId
|
|
362
|
+
});
|
|
363
|
+
const reqOpts = getRecipient(payload);
|
|
364
|
+
sideEffects?.onSiteCall?.();
|
|
365
|
+
try {
|
|
366
|
+
const result = await httpClient.request(reqOpts);
|
|
367
|
+
sideEffects?.onSuccess?.(result);
|
|
368
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.recipient;
|
|
369
|
+
} catch (err) {
|
|
370
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
371
|
+
err,
|
|
372
|
+
{
|
|
373
|
+
spreadPathsToArguments: {},
|
|
374
|
+
explicitPathsToArguments: { recipientId: "$[0]" },
|
|
375
|
+
singleArgumentUnchanged: false
|
|
376
|
+
},
|
|
377
|
+
["recipientId"]
|
|
378
|
+
);
|
|
379
|
+
sideEffects?.onError?.(err);
|
|
380
|
+
throw transformedError;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
async function updateRecipient2(_id, recipient) {
|
|
384
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
385
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
386
|
+
recipient: { ...recipient, id: _id }
|
|
387
|
+
});
|
|
388
|
+
const reqOpts = updateRecipient(payload);
|
|
389
|
+
sideEffects?.onSiteCall?.();
|
|
390
|
+
try {
|
|
391
|
+
const result = await httpClient.request(reqOpts);
|
|
392
|
+
sideEffects?.onSuccess?.(result);
|
|
393
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.recipient;
|
|
394
|
+
} catch (err) {
|
|
395
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
396
|
+
err,
|
|
397
|
+
{
|
|
398
|
+
spreadPathsToArguments: { recipient: "$[1]" },
|
|
399
|
+
explicitPathsToArguments: { "recipient.id": "$[0]" },
|
|
400
|
+
singleArgumentUnchanged: false
|
|
401
|
+
},
|
|
402
|
+
["_id", "recipient"]
|
|
403
|
+
);
|
|
404
|
+
sideEffects?.onError?.(err);
|
|
405
|
+
throw transformedError;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
async function deleteRecipient2(recipientId) {
|
|
409
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
410
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
411
|
+
recipientId
|
|
412
|
+
});
|
|
413
|
+
const reqOpts = deleteRecipient(payload);
|
|
414
|
+
sideEffects?.onSiteCall?.();
|
|
415
|
+
try {
|
|
416
|
+
const result = await httpClient.request(reqOpts);
|
|
417
|
+
sideEffects?.onSuccess?.(result);
|
|
418
|
+
} catch (err) {
|
|
419
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
420
|
+
err,
|
|
421
|
+
{
|
|
422
|
+
spreadPathsToArguments: {},
|
|
423
|
+
explicitPathsToArguments: { recipientId: "$[0]" },
|
|
424
|
+
singleArgumentUnchanged: false
|
|
425
|
+
},
|
|
426
|
+
["recipientId"]
|
|
427
|
+
);
|
|
428
|
+
sideEffects?.onError?.(err);
|
|
429
|
+
throw transformedError;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
function queryRecipients2() {
|
|
433
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
434
|
+
return (0, import_query_builder.queryBuilder)({
|
|
435
|
+
func: async (payload) => {
|
|
436
|
+
const reqOpts = queryRecipients(payload);
|
|
437
|
+
sideEffects?.onSiteCall?.();
|
|
438
|
+
try {
|
|
439
|
+
const result = await httpClient.request(reqOpts);
|
|
440
|
+
sideEffects?.onSuccess?.(result);
|
|
441
|
+
return result;
|
|
442
|
+
} catch (err) {
|
|
443
|
+
sideEffects?.onError?.(err);
|
|
444
|
+
throw err;
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
requestTransformer: (query) => {
|
|
448
|
+
const args = [query, {}];
|
|
449
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
450
|
+
...args?.[1],
|
|
451
|
+
query: args?.[0]
|
|
452
|
+
});
|
|
453
|
+
},
|
|
454
|
+
responseTransformer: ({ data }) => {
|
|
455
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
456
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
457
|
+
);
|
|
458
|
+
return {
|
|
459
|
+
items: transformedData?.recipients,
|
|
460
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
461
|
+
};
|
|
462
|
+
},
|
|
463
|
+
errorTransformer: (err) => {
|
|
464
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
465
|
+
spreadPathsToArguments: {},
|
|
466
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
467
|
+
singleArgumentUnchanged: false
|
|
468
|
+
});
|
|
469
|
+
throw transformedError;
|
|
470
|
+
},
|
|
471
|
+
pagingMethod: "CURSOR",
|
|
472
|
+
transformationPaths: {}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
async function bulkUpdateRecipientTags2(recipientIds, options) {
|
|
476
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
477
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
478
|
+
recipientIds,
|
|
479
|
+
assignTags: options?.assignTags,
|
|
480
|
+
unassignTags: options?.unassignTags
|
|
481
|
+
});
|
|
482
|
+
const reqOpts = bulkUpdateRecipientTags(
|
|
483
|
+
payload
|
|
484
|
+
);
|
|
485
|
+
sideEffects?.onSiteCall?.();
|
|
486
|
+
try {
|
|
487
|
+
const result = await httpClient.request(reqOpts);
|
|
488
|
+
sideEffects?.onSuccess?.(result);
|
|
489
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
490
|
+
} catch (err) {
|
|
491
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
492
|
+
err,
|
|
493
|
+
{
|
|
494
|
+
spreadPathsToArguments: {},
|
|
495
|
+
explicitPathsToArguments: {
|
|
496
|
+
recipientIds: "$[0]",
|
|
497
|
+
assignTags: "$[1].assignTags",
|
|
498
|
+
unassignTags: "$[1].unassignTags"
|
|
499
|
+
},
|
|
500
|
+
singleArgumentUnchanged: false
|
|
501
|
+
},
|
|
502
|
+
["recipientIds", "options"]
|
|
503
|
+
);
|
|
504
|
+
sideEffects?.onError?.(err);
|
|
505
|
+
throw transformedError;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
async function bulkUpdateRecipientTagsByFilter2(filter, options) {
|
|
509
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
510
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
511
|
+
filter,
|
|
512
|
+
assignTags: options?.assignTags,
|
|
513
|
+
unassignTags: options?.unassignTags
|
|
514
|
+
});
|
|
515
|
+
const reqOpts = bulkUpdateRecipientTagsByFilter(
|
|
516
|
+
payload
|
|
517
|
+
);
|
|
518
|
+
sideEffects?.onSiteCall?.();
|
|
519
|
+
try {
|
|
520
|
+
const result = await httpClient.request(reqOpts);
|
|
521
|
+
sideEffects?.onSuccess?.(result);
|
|
522
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
523
|
+
} catch (err) {
|
|
524
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
525
|
+
err,
|
|
526
|
+
{
|
|
527
|
+
spreadPathsToArguments: {},
|
|
528
|
+
explicitPathsToArguments: {
|
|
529
|
+
filter: "$[0]",
|
|
530
|
+
assignTags: "$[1].assignTags",
|
|
531
|
+
unassignTags: "$[1].unassignTags"
|
|
532
|
+
},
|
|
533
|
+
singleArgumentUnchanged: false
|
|
534
|
+
},
|
|
535
|
+
["filter", "options"]
|
|
536
|
+
);
|
|
537
|
+
sideEffects?.onError?.(err);
|
|
538
|
+
throw transformedError;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// src/restaurants-recipient-v1-recipient-recipients.public.ts
|
|
543
|
+
function createRecipient3(httpClient) {
|
|
544
|
+
return (recipient) => createRecipient2(
|
|
545
|
+
recipient,
|
|
546
|
+
// @ts-ignore
|
|
547
|
+
{ httpClient }
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
function getRecipient3(httpClient) {
|
|
551
|
+
return (recipientId) => getRecipient2(
|
|
552
|
+
recipientId,
|
|
553
|
+
// @ts-ignore
|
|
554
|
+
{ httpClient }
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
function updateRecipient3(httpClient) {
|
|
558
|
+
return (_id, recipient) => updateRecipient2(
|
|
559
|
+
_id,
|
|
560
|
+
recipient,
|
|
561
|
+
// @ts-ignore
|
|
562
|
+
{ httpClient }
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
function deleteRecipient3(httpClient) {
|
|
566
|
+
return (recipientId) => deleteRecipient2(
|
|
567
|
+
recipientId,
|
|
568
|
+
// @ts-ignore
|
|
569
|
+
{ httpClient }
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
function queryRecipients3(httpClient) {
|
|
573
|
+
return () => queryRecipients2(
|
|
574
|
+
// @ts-ignore
|
|
575
|
+
{ httpClient }
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
function bulkUpdateRecipientTags3(httpClient) {
|
|
579
|
+
return (recipientIds, options) => bulkUpdateRecipientTags2(
|
|
580
|
+
recipientIds,
|
|
581
|
+
options,
|
|
582
|
+
// @ts-ignore
|
|
583
|
+
{ httpClient }
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
function bulkUpdateRecipientTagsByFilter3(httpClient) {
|
|
587
|
+
return (filter, options) => bulkUpdateRecipientTagsByFilter2(
|
|
588
|
+
filter,
|
|
589
|
+
options,
|
|
590
|
+
// @ts-ignore
|
|
591
|
+
{ httpClient }
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
var onRecipientCreated = (0, import_sdk_types.EventDefinition)(
|
|
595
|
+
"wix.restaurants.recipient.v1.recipient_created",
|
|
596
|
+
true,
|
|
597
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
598
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
599
|
+
{
|
|
600
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
601
|
+
paths: [
|
|
602
|
+
{ path: "entity.createdDate" },
|
|
603
|
+
{ path: "entity.updatedDate" },
|
|
604
|
+
{ path: "metadata.eventTime" }
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
])
|
|
608
|
+
)
|
|
609
|
+
)();
|
|
610
|
+
var onRecipientDeleted = (0, import_sdk_types.EventDefinition)(
|
|
611
|
+
"wix.restaurants.recipient.v1.recipient_deleted",
|
|
612
|
+
true,
|
|
613
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
614
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
615
|
+
{
|
|
616
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
617
|
+
paths: [
|
|
618
|
+
{ path: "entity.createdDate" },
|
|
619
|
+
{ path: "entity.updatedDate" },
|
|
620
|
+
{ path: "metadata.eventTime" }
|
|
621
|
+
]
|
|
622
|
+
}
|
|
623
|
+
])
|
|
624
|
+
)
|
|
625
|
+
)();
|
|
626
|
+
var onRecipientUpdated = (0, import_sdk_types.EventDefinition)(
|
|
627
|
+
"wix.restaurants.recipient.v1.recipient_updated",
|
|
628
|
+
true,
|
|
629
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
630
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
631
|
+
{
|
|
632
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
633
|
+
paths: [
|
|
634
|
+
{ path: "entity.createdDate" },
|
|
635
|
+
{ path: "entity.updatedDate" },
|
|
636
|
+
{ path: "metadata.eventTime" }
|
|
637
|
+
]
|
|
638
|
+
}
|
|
639
|
+
])
|
|
640
|
+
)
|
|
641
|
+
)();
|
|
642
|
+
|
|
643
|
+
// src/restaurants-recipient-v1-recipient-recipients.context.ts
|
|
644
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
645
|
+
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
646
|
+
var createRecipient4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createRecipient3);
|
|
647
|
+
var getRecipient4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getRecipient3);
|
|
648
|
+
var updateRecipient4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateRecipient3);
|
|
649
|
+
var deleteRecipient4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteRecipient3);
|
|
650
|
+
var queryRecipients4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryRecipients3);
|
|
651
|
+
var bulkUpdateRecipientTags4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdateRecipientTags3);
|
|
652
|
+
var bulkUpdateRecipientTagsByFilter4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdateRecipientTagsByFilter3);
|
|
653
|
+
var onRecipientCreated2 = (0, import_event_definition_modules.createEventModule)(onRecipientCreated);
|
|
654
|
+
var onRecipientDeleted2 = (0, import_event_definition_modules.createEventModule)(onRecipientDeleted);
|
|
655
|
+
var onRecipientUpdated2 = (0, import_event_definition_modules.createEventModule)(onRecipientUpdated);
|
|
656
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
657
|
+
0 && (module.exports = {
|
|
658
|
+
Channel,
|
|
659
|
+
SortOrder,
|
|
660
|
+
WebhookIdentityType,
|
|
661
|
+
bulkUpdateRecipientTags,
|
|
662
|
+
bulkUpdateRecipientTagsByFilter,
|
|
663
|
+
createRecipient,
|
|
664
|
+
deleteRecipient,
|
|
665
|
+
getRecipient,
|
|
666
|
+
onRecipientCreated,
|
|
667
|
+
onRecipientDeleted,
|
|
668
|
+
onRecipientUpdated,
|
|
669
|
+
queryRecipients,
|
|
670
|
+
updateRecipient
|
|
671
|
+
});
|
|
672
|
+
//# sourceMappingURL=index.js.map
|