@wix/auto_sdk_events_notifications 1.0.71 → 1.0.72
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 +9 -9
- package/build/cjs/index.js +98 -101
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +973 -979
- package/build/cjs/index.typings.js +90 -93
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +938 -944
- package/build/cjs/meta.js +76 -79
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +9 -9
- package/build/es/index.mjs +98 -101
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +973 -979
- package/build/es/index.typings.mjs +90 -93
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +938 -944
- package/build/es/meta.mjs +76 -79
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +9 -9
- package/build/internal/cjs/index.js +98 -101
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +973 -979
- package/build/internal/cjs/index.typings.js +90 -93
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +938 -944
- package/build/internal/cjs/meta.js +76 -79
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +9 -9
- package/build/internal/es/index.mjs +98 -101
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +973 -979
- package/build/internal/es/index.typings.mjs +90 -93
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +938 -944
- package/build/internal/es/meta.mjs +76 -79
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { ResolveNotificationConfigResponse, UpsertNotificationConfig, UpsertNotificationConfigResponse,
|
|
2
|
+
import { TriggerNotificationOptions, ResolveNotificationConfigResponse, UpsertNotificationConfig, UpsertNotificationConfigResponse, NotificationConfigCreatedEnvelope, NotificationConfigUpdatedEnvelope } from './index.typings.js';
|
|
3
3
|
export { AccountInfo, AccountInfoMetadata, ActionEvent, Address, AddressLocation, AddressStreetOneOf, BaseEventMetadata, CheckIn, CommonAddress, CommonAddressLocation, CommonAddressStreetOneOf, CommonStreetAddress, CommonSubdivision, CouponDiscount, Discount, DiscountItem, DiscountItemDiscountOneOf, DomainEvent, DomainEventBodyOneOf, EmailNotificationConfig, EmailNotificationReminderTime, EmailNotificationReminderTimeWithLiterals, EmailNotificationType, EmailNotificationTypeWithLiterals, EmailTemplate, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventCanceled, EventCopied, EventDeleted, EventGuests, EventMetadata, EventStatus, EventStatusWithLiterals, Fee, FeeName, FeeNameWithLiterals, FeeType, FeeTypeWithLiterals, FormResponse, FormattedAddress, IdentificationData, IdentificationDataIdOneOf, InputValue, Invoice, Item, Link, Location, LocationType, LocationTypeWithLiterals, MapCoordinates, MessageEnvelope, Money, NotificationConfig, Occurrence, OnlineConferencingLogin, OrderCanceled, OrderConfirmed, OrderEmailAdded, OrderGuest, OrderPaid, OrderStatus, OrderStatusWithLiterals, PaidPlanDiscount, PaidPlanDiscountDiscountOneOf, PercentDiscount, PushNotificationType, PushNotificationTypeWithLiterals, Recurrences, ResolveEmailNotificationConfigRequest, ResolveEmailNotificationConfigResponse, ResolveNotificationConfigRequest, RestoreInfo, RsvpGuest, ScheduleConfig, StandardDetails, Status, StatusWithLiterals, StreetAddress, Subdivision, SubdivisionType, SubdivisionTypeWithLiterals, Tax, TaxType, TaxTypeWithLiterals, Ticket, TicketGuest, TicketPdfResolveDelayed, TicketPdfResolved, TriggerNotificationOptionsGuestsOneOf, TriggerNotificationOptionsNotificationOneOf, TriggerNotificationRequest, TriggerNotificationRequestGuestsOneOf, TriggerNotificationRequestNotificationOneOf, TriggerNotificationResponse, UpsertNotificationConfigRequest, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
4
|
|
|
5
|
+
declare function triggerNotification$1(httpClient: HttpClient): TriggerNotificationSignature;
|
|
6
|
+
interface TriggerNotificationSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Triggers notification
|
|
9
|
+
*/
|
|
10
|
+
(options: TriggerNotificationOptions): Promise<void>;
|
|
11
|
+
}
|
|
5
12
|
declare function resolveNotificationConfig$1(httpClient: HttpClient): ResolveNotificationConfigSignature;
|
|
6
13
|
interface ResolveNotificationConfigSignature {
|
|
7
14
|
/**
|
|
@@ -18,19 +25,12 @@ interface UpsertNotificationConfigSignature {
|
|
|
18
25
|
*/
|
|
19
26
|
(_id: string, notificationConfig: UpsertNotificationConfig): Promise<NonNullablePaths<UpsertNotificationConfigResponse, `notificationConfig.rsvpConfirmation.notificationType` | `notificationConfig.rsvpConfirmation.reminderTime`, 4>>;
|
|
20
27
|
}
|
|
21
|
-
declare function triggerNotification$1(httpClient: HttpClient): TriggerNotificationSignature;
|
|
22
|
-
interface TriggerNotificationSignature {
|
|
23
|
-
/**
|
|
24
|
-
* Triggers notification
|
|
25
|
-
*/
|
|
26
|
-
(options: TriggerNotificationOptions): Promise<void>;
|
|
27
|
-
}
|
|
28
28
|
declare const onNotificationConfigCreated$1: EventDefinition<NotificationConfigCreatedEnvelope, "wix.events.notifications.v2.notification_config_created">;
|
|
29
29
|
declare const onNotificationConfigUpdated$1: EventDefinition<NotificationConfigUpdatedEnvelope, "wix.events.notifications.v2.notification_config_updated">;
|
|
30
30
|
|
|
31
|
+
declare const triggerNotification: MaybeContext<BuildRESTFunction<typeof triggerNotification$1> & typeof triggerNotification$1>;
|
|
31
32
|
declare const resolveNotificationConfig: MaybeContext<BuildRESTFunction<typeof resolveNotificationConfig$1> & typeof resolveNotificationConfig$1>;
|
|
32
33
|
declare const upsertNotificationConfig: MaybeContext<BuildRESTFunction<typeof upsertNotificationConfig$1> & typeof upsertNotificationConfig$1>;
|
|
33
|
-
declare const triggerNotification: MaybeContext<BuildRESTFunction<typeof triggerNotification$1> & typeof triggerNotification$1>;
|
|
34
34
|
/** */
|
|
35
35
|
declare const onNotificationConfigCreated: BuildEventDefinition<typeof onNotificationConfigCreated$1> & typeof onNotificationConfigCreated$1;
|
|
36
36
|
/** */
|
package/build/cjs/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
|
57
57
|
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
58
58
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
59
59
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
60
|
-
function
|
|
60
|
+
function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
|
|
61
61
|
const domainToMappings = {
|
|
62
62
|
"api._api_base_domain_": [
|
|
63
63
|
{
|
|
@@ -90,7 +90,7 @@ function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
|
|
|
90
90
|
};
|
|
91
91
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
|
|
94
94
|
const domainToMappings = {
|
|
95
95
|
"api._api_base_domain_": [
|
|
96
96
|
{
|
|
@@ -124,6 +124,27 @@ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
|
|
|
124
124
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
125
125
|
}
|
|
126
126
|
var PACKAGE_NAME = "@wix/auto_sdk_events_notifications";
|
|
127
|
+
function triggerNotification(payload) {
|
|
128
|
+
function __triggerNotification({ host }) {
|
|
129
|
+
const metadata = {
|
|
130
|
+
entityFqdn: "wix.events.notifications.v2.notification_config",
|
|
131
|
+
method: "POST",
|
|
132
|
+
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
133
|
+
packageName: PACKAGE_NAME,
|
|
134
|
+
migrationOptions: {
|
|
135
|
+
optInTransformResponse: true
|
|
136
|
+
},
|
|
137
|
+
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
138
|
+
protoPath: "/v2/notifications/trigger",
|
|
139
|
+
data: payload,
|
|
140
|
+
host
|
|
141
|
+
}),
|
|
142
|
+
data: payload
|
|
143
|
+
};
|
|
144
|
+
return metadata;
|
|
145
|
+
}
|
|
146
|
+
return __triggerNotification;
|
|
147
|
+
}
|
|
127
148
|
function resolveNotificationConfig(payload) {
|
|
128
149
|
function __resolveNotificationConfig({ host }) {
|
|
129
150
|
const metadata = {
|
|
@@ -197,31 +218,9 @@ function upsertNotificationConfig(payload) {
|
|
|
197
218
|
}
|
|
198
219
|
return __upsertNotificationConfig;
|
|
199
220
|
}
|
|
200
|
-
function triggerNotification(payload) {
|
|
201
|
-
function __triggerNotification({ host }) {
|
|
202
|
-
const metadata = {
|
|
203
|
-
entityFqdn: "wix.events.notifications.v2.notification_config",
|
|
204
|
-
method: "POST",
|
|
205
|
-
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
206
|
-
packageName: PACKAGE_NAME,
|
|
207
|
-
migrationOptions: {
|
|
208
|
-
optInTransformResponse: true
|
|
209
|
-
},
|
|
210
|
-
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
211
|
-
protoPath: "/v2/notifications/trigger",
|
|
212
|
-
data: payload,
|
|
213
|
-
host
|
|
214
|
-
}),
|
|
215
|
-
data: payload
|
|
216
|
-
};
|
|
217
|
-
return metadata;
|
|
218
|
-
}
|
|
219
|
-
return __triggerNotification;
|
|
220
|
-
}
|
|
221
221
|
|
|
222
222
|
// src/events-notifications-v2-notification-config-notifications.universal.ts
|
|
223
223
|
var EmailNotificationType = /* @__PURE__ */ ((EmailNotificationType2) => {
|
|
224
|
-
EmailNotificationType2["UNKNOWN_NOTIFICATION_TYPE"] = "UNKNOWN_NOTIFICATION_TYPE";
|
|
225
224
|
EmailNotificationType2["EMAIL_RSVP_CONFIRMATION"] = "EMAIL_RSVP_CONFIRMATION";
|
|
226
225
|
EmailNotificationType2["EMAIL_NEW_SPOTS_AVAILABLE"] = "EMAIL_NEW_SPOTS_AVAILABLE";
|
|
227
226
|
EmailNotificationType2["EMAIL_EVENT_CANCELATION"] = "EMAIL_EVENT_CANCELATION";
|
|
@@ -232,7 +231,6 @@ var EmailNotificationType = /* @__PURE__ */ ((EmailNotificationType2) => {
|
|
|
232
231
|
return EmailNotificationType2;
|
|
233
232
|
})(EmailNotificationType || {});
|
|
234
233
|
var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderTime2) => {
|
|
235
|
-
EmailNotificationReminderTime2["UNKNOWN_REMINDER_TIME"] = "UNKNOWN_REMINDER_TIME";
|
|
236
234
|
EmailNotificationReminderTime2["INSTANT"] = "INSTANT";
|
|
237
235
|
EmailNotificationReminderTime2["BEFORE_1_DAY"] = "BEFORE_1_DAY";
|
|
238
236
|
EmailNotificationReminderTime2["BEFORE_3_DAYS"] = "BEFORE_3_DAYS";
|
|
@@ -241,11 +239,13 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
|
|
|
241
239
|
EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
|
|
242
240
|
return EmailNotificationReminderTime2;
|
|
243
241
|
})(EmailNotificationReminderTime || {});
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
242
|
+
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
243
|
+
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
244
|
+
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
245
|
+
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
246
|
+
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
247
|
+
return PushNotificationType2;
|
|
248
|
+
})(PushNotificationType || {});
|
|
249
249
|
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
250
250
|
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
251
251
|
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
@@ -256,37 +256,6 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
|
256
256
|
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
257
257
|
return SubdivisionType2;
|
|
258
258
|
})(SubdivisionType || {});
|
|
259
|
-
var Status = /* @__PURE__ */ ((Status2) => {
|
|
260
|
-
Status2["ONE_TIME"] = "ONE_TIME";
|
|
261
|
-
Status2["RECURRING"] = "RECURRING";
|
|
262
|
-
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
263
|
-
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
264
|
-
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
265
|
-
return Status2;
|
|
266
|
-
})(Status || {});
|
|
267
|
-
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
268
|
-
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
269
|
-
EventStatus2["STARTED"] = "STARTED";
|
|
270
|
-
EventStatus2["ENDED"] = "ENDED";
|
|
271
|
-
EventStatus2["CANCELED"] = "CANCELED";
|
|
272
|
-
return EventStatus2;
|
|
273
|
-
})(EventStatus || {});
|
|
274
|
-
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
275
|
-
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
276
|
-
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
277
|
-
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
278
|
-
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
279
|
-
WebhookIdentityType2["APP"] = "APP";
|
|
280
|
-
return WebhookIdentityType2;
|
|
281
|
-
})(WebhookIdentityType || {});
|
|
282
|
-
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
283
|
-
PushNotificationType2["UNKNOWN_PUSH_TYPE"] = "UNKNOWN_PUSH_TYPE";
|
|
284
|
-
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
285
|
-
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
286
|
-
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
287
|
-
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
288
|
-
return PushNotificationType2;
|
|
289
|
-
})(PushNotificationType || {});
|
|
290
259
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
291
260
|
OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
|
|
292
261
|
OrderStatus2["FREE"] = "FREE";
|
|
@@ -317,39 +286,78 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
|
|
|
317
286
|
FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
|
|
318
287
|
return FeeType2;
|
|
319
288
|
})(FeeType || {});
|
|
320
|
-
|
|
289
|
+
var LocationType = /* @__PURE__ */ ((LocationType2) => {
|
|
290
|
+
LocationType2["VENUE"] = "VENUE";
|
|
291
|
+
LocationType2["ONLINE"] = "ONLINE";
|
|
292
|
+
return LocationType2;
|
|
293
|
+
})(LocationType || {});
|
|
294
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
295
|
+
Status2["ONE_TIME"] = "ONE_TIME";
|
|
296
|
+
Status2["RECURRING"] = "RECURRING";
|
|
297
|
+
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
298
|
+
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
299
|
+
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
300
|
+
return Status2;
|
|
301
|
+
})(Status || {});
|
|
302
|
+
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
303
|
+
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
304
|
+
EventStatus2["STARTED"] = "STARTED";
|
|
305
|
+
EventStatus2["ENDED"] = "ENDED";
|
|
306
|
+
EventStatus2["CANCELED"] = "CANCELED";
|
|
307
|
+
return EventStatus2;
|
|
308
|
+
})(EventStatus || {});
|
|
309
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
310
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
311
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
312
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
313
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
314
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
315
|
+
return WebhookIdentityType2;
|
|
316
|
+
})(WebhookIdentityType || {});
|
|
317
|
+
async function triggerNotification2(options) {
|
|
321
318
|
const { httpClient, sideEffects } = arguments[1];
|
|
322
319
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
323
|
-
|
|
320
|
+
emailNotificationType: options?.emailNotificationType,
|
|
321
|
+
pushNotificationType: options?.pushNotificationType,
|
|
322
|
+
rsvpGuest: options?.rsvpGuest,
|
|
323
|
+
orderGuest: options?.orderGuest,
|
|
324
|
+
eventGuests: options?.eventGuests,
|
|
325
|
+
ticketGuest: options?.ticketGuest
|
|
324
326
|
});
|
|
325
|
-
const reqOpts =
|
|
327
|
+
const reqOpts = triggerNotification(
|
|
326
328
|
payload
|
|
327
329
|
);
|
|
328
330
|
sideEffects?.onSiteCall?.();
|
|
329
331
|
try {
|
|
330
332
|
const result = await httpClient.request(reqOpts);
|
|
331
333
|
sideEffects?.onSuccess?.(result);
|
|
332
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
333
334
|
} catch (err) {
|
|
334
335
|
const transformedError = (0, import_transform_error.transformError)(
|
|
335
336
|
err,
|
|
336
337
|
{
|
|
337
338
|
spreadPathsToArguments: {},
|
|
338
|
-
explicitPathsToArguments: {
|
|
339
|
+
explicitPathsToArguments: {
|
|
340
|
+
emailNotificationType: "$[0].emailNotificationType",
|
|
341
|
+
pushNotificationType: "$[0].pushNotificationType",
|
|
342
|
+
rsvpGuest: "$[0].rsvpGuest",
|
|
343
|
+
orderGuest: "$[0].orderGuest",
|
|
344
|
+
eventGuests: "$[0].eventGuests",
|
|
345
|
+
ticketGuest: "$[0].ticketGuest"
|
|
346
|
+
},
|
|
339
347
|
singleArgumentUnchanged: false
|
|
340
348
|
},
|
|
341
|
-
["
|
|
349
|
+
["options"]
|
|
342
350
|
);
|
|
343
351
|
sideEffects?.onError?.(err);
|
|
344
352
|
throw transformedError;
|
|
345
353
|
}
|
|
346
354
|
}
|
|
347
|
-
async function
|
|
348
|
-
const { httpClient, sideEffects } = arguments[
|
|
355
|
+
async function resolveNotificationConfig2(notificationConfigId) {
|
|
356
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
349
357
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
350
|
-
|
|
358
|
+
notificationConfigId
|
|
351
359
|
});
|
|
352
|
-
const reqOpts =
|
|
360
|
+
const reqOpts = resolveNotificationConfig(
|
|
353
361
|
payload
|
|
354
362
|
);
|
|
355
363
|
sideEffects?.onSiteCall?.();
|
|
@@ -361,49 +369,38 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
|
361
369
|
const transformedError = (0, import_transform_error.transformError)(
|
|
362
370
|
err,
|
|
363
371
|
{
|
|
364
|
-
spreadPathsToArguments: {
|
|
365
|
-
explicitPathsToArguments: {
|
|
372
|
+
spreadPathsToArguments: {},
|
|
373
|
+
explicitPathsToArguments: { notificationConfigId: "$[0]" },
|
|
366
374
|
singleArgumentUnchanged: false
|
|
367
375
|
},
|
|
368
|
-
["
|
|
376
|
+
["notificationConfigId"]
|
|
369
377
|
);
|
|
370
378
|
sideEffects?.onError?.(err);
|
|
371
379
|
throw transformedError;
|
|
372
380
|
}
|
|
373
381
|
}
|
|
374
|
-
async function
|
|
375
|
-
const { httpClient, sideEffects } = arguments[
|
|
382
|
+
async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
383
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
376
384
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
377
|
-
|
|
378
|
-
pushNotificationType: options?.pushNotificationType,
|
|
379
|
-
rsvpGuest: options?.rsvpGuest,
|
|
380
|
-
orderGuest: options?.orderGuest,
|
|
381
|
-
eventGuests: options?.eventGuests,
|
|
382
|
-
ticketGuest: options?.ticketGuest
|
|
385
|
+
notificationConfig: { ...notificationConfig, id: _id }
|
|
383
386
|
});
|
|
384
|
-
const reqOpts =
|
|
387
|
+
const reqOpts = upsertNotificationConfig(
|
|
385
388
|
payload
|
|
386
389
|
);
|
|
387
390
|
sideEffects?.onSiteCall?.();
|
|
388
391
|
try {
|
|
389
392
|
const result = await httpClient.request(reqOpts);
|
|
390
393
|
sideEffects?.onSuccess?.(result);
|
|
394
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
391
395
|
} catch (err) {
|
|
392
396
|
const transformedError = (0, import_transform_error.transformError)(
|
|
393
397
|
err,
|
|
394
398
|
{
|
|
395
|
-
spreadPathsToArguments: {},
|
|
396
|
-
explicitPathsToArguments: {
|
|
397
|
-
emailNotificationType: "$[0].emailNotificationType",
|
|
398
|
-
pushNotificationType: "$[0].pushNotificationType",
|
|
399
|
-
rsvpGuest: "$[0].rsvpGuest",
|
|
400
|
-
orderGuest: "$[0].orderGuest",
|
|
401
|
-
eventGuests: "$[0].eventGuests",
|
|
402
|
-
ticketGuest: "$[0].ticketGuest"
|
|
403
|
-
},
|
|
399
|
+
spreadPathsToArguments: { notificationConfig: "$[1]" },
|
|
400
|
+
explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
|
|
404
401
|
singleArgumentUnchanged: false
|
|
405
402
|
},
|
|
406
|
-
["
|
|
403
|
+
["_id", "notificationConfig"]
|
|
407
404
|
);
|
|
408
405
|
sideEffects?.onError?.(err);
|
|
409
406
|
throw transformedError;
|
|
@@ -411,6 +408,13 @@ async function triggerNotification2(options) {
|
|
|
411
408
|
}
|
|
412
409
|
|
|
413
410
|
// src/events-notifications-v2-notification-config-notifications.public.ts
|
|
411
|
+
function triggerNotification3(httpClient) {
|
|
412
|
+
return (options) => triggerNotification2(
|
|
413
|
+
options,
|
|
414
|
+
// @ts-ignore
|
|
415
|
+
{ httpClient }
|
|
416
|
+
);
|
|
417
|
+
}
|
|
414
418
|
function resolveNotificationConfig3(httpClient) {
|
|
415
419
|
return (notificationConfigId) => resolveNotificationConfig2(
|
|
416
420
|
notificationConfigId,
|
|
@@ -426,13 +430,6 @@ function upsertNotificationConfig3(httpClient) {
|
|
|
426
430
|
{ httpClient }
|
|
427
431
|
);
|
|
428
432
|
}
|
|
429
|
-
function triggerNotification3(httpClient) {
|
|
430
|
-
return (options) => triggerNotification2(
|
|
431
|
-
options,
|
|
432
|
-
// @ts-ignore
|
|
433
|
-
{ httpClient }
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
433
|
var onNotificationConfigCreated = (0, import_sdk_types.EventDefinition)(
|
|
437
434
|
"wix.events.notifications.v2.notification_config_created",
|
|
438
435
|
true,
|
|
@@ -471,9 +468,9 @@ var onNotificationConfigUpdated = (0, import_sdk_types.EventDefinition)(
|
|
|
471
468
|
// src/events-notifications-v2-notification-config-notifications.context.ts
|
|
472
469
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
473
470
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
471
|
+
var triggerNotification4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(triggerNotification3);
|
|
474
472
|
var resolveNotificationConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(resolveNotificationConfig3);
|
|
475
473
|
var upsertNotificationConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(upsertNotificationConfig3);
|
|
476
|
-
var triggerNotification4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(triggerNotification3);
|
|
477
474
|
var onNotificationConfigCreated2 = (0, import_event_definition_modules.createEventModule)(
|
|
478
475
|
onNotificationConfigCreated
|
|
479
476
|
);
|