@wix/auto_sdk_events_notifications 1.0.63 → 1.0.64
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 +99 -99
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +980 -971
- package/build/cjs/index.typings.js +91 -91
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +936 -936
- package/build/cjs/meta.js +77 -77
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +9 -9
- package/build/es/index.mjs +99 -99
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +980 -971
- package/build/es/index.typings.mjs +91 -91
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +936 -936
- package/build/es/meta.mjs +77 -77
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +9 -9
- package/build/internal/cjs/index.js +99 -99
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +980 -971
- package/build/internal/cjs/index.typings.js +91 -91
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +936 -936
- package/build/internal/cjs/meta.js +77 -77
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +9 -9
- package/build/internal/es/index.mjs +99 -99
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +980 -971
- package/build/internal/es/index.typings.mjs +91 -91
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +936 -936
- package/build/internal/es/meta.mjs +77 -77
- 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, 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,27 +218,6 @@ 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) => {
|
|
@@ -241,11 +241,14 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
|
|
|
241
241
|
EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
|
|
242
242
|
return EmailNotificationReminderTime2;
|
|
243
243
|
})(EmailNotificationReminderTime || {});
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
245
|
+
PushNotificationType2["UNKNOWN_PUSH_TYPE"] = "UNKNOWN_PUSH_TYPE";
|
|
246
|
+
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
247
|
+
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
248
|
+
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
249
|
+
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
250
|
+
return PushNotificationType2;
|
|
251
|
+
})(PushNotificationType || {});
|
|
249
252
|
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
250
253
|
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
251
254
|
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
@@ -256,37 +259,6 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
|
256
259
|
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
257
260
|
return SubdivisionType2;
|
|
258
261
|
})(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
262
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
291
263
|
OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
|
|
292
264
|
OrderStatus2["FREE"] = "FREE";
|
|
@@ -317,39 +289,78 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
|
|
|
317
289
|
FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
|
|
318
290
|
return FeeType2;
|
|
319
291
|
})(FeeType || {});
|
|
320
|
-
|
|
292
|
+
var LocationType = /* @__PURE__ */ ((LocationType2) => {
|
|
293
|
+
LocationType2["VENUE"] = "VENUE";
|
|
294
|
+
LocationType2["ONLINE"] = "ONLINE";
|
|
295
|
+
return LocationType2;
|
|
296
|
+
})(LocationType || {});
|
|
297
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
298
|
+
Status2["ONE_TIME"] = "ONE_TIME";
|
|
299
|
+
Status2["RECURRING"] = "RECURRING";
|
|
300
|
+
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
301
|
+
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
302
|
+
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
303
|
+
return Status2;
|
|
304
|
+
})(Status || {});
|
|
305
|
+
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
306
|
+
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
307
|
+
EventStatus2["STARTED"] = "STARTED";
|
|
308
|
+
EventStatus2["ENDED"] = "ENDED";
|
|
309
|
+
EventStatus2["CANCELED"] = "CANCELED";
|
|
310
|
+
return EventStatus2;
|
|
311
|
+
})(EventStatus || {});
|
|
312
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
313
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
314
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
315
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
316
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
317
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
318
|
+
return WebhookIdentityType2;
|
|
319
|
+
})(WebhookIdentityType || {});
|
|
320
|
+
async function triggerNotification2(options) {
|
|
321
321
|
const { httpClient, sideEffects } = arguments[1];
|
|
322
322
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
323
|
-
|
|
323
|
+
emailNotificationType: options?.emailNotificationType,
|
|
324
|
+
pushNotificationType: options?.pushNotificationType,
|
|
325
|
+
rsvpGuest: options?.rsvpGuest,
|
|
326
|
+
orderGuest: options?.orderGuest,
|
|
327
|
+
eventGuests: options?.eventGuests,
|
|
328
|
+
ticketGuest: options?.ticketGuest
|
|
324
329
|
});
|
|
325
|
-
const reqOpts =
|
|
330
|
+
const reqOpts = triggerNotification(
|
|
326
331
|
payload
|
|
327
332
|
);
|
|
328
333
|
sideEffects?.onSiteCall?.();
|
|
329
334
|
try {
|
|
330
335
|
const result = await httpClient.request(reqOpts);
|
|
331
336
|
sideEffects?.onSuccess?.(result);
|
|
332
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
333
337
|
} catch (err) {
|
|
334
338
|
const transformedError = (0, import_transform_error.transformError)(
|
|
335
339
|
err,
|
|
336
340
|
{
|
|
337
341
|
spreadPathsToArguments: {},
|
|
338
|
-
explicitPathsToArguments: {
|
|
342
|
+
explicitPathsToArguments: {
|
|
343
|
+
emailNotificationType: "$[0].emailNotificationType",
|
|
344
|
+
pushNotificationType: "$[0].pushNotificationType",
|
|
345
|
+
rsvpGuest: "$[0].rsvpGuest",
|
|
346
|
+
orderGuest: "$[0].orderGuest",
|
|
347
|
+
eventGuests: "$[0].eventGuests",
|
|
348
|
+
ticketGuest: "$[0].ticketGuest"
|
|
349
|
+
},
|
|
339
350
|
singleArgumentUnchanged: false
|
|
340
351
|
},
|
|
341
|
-
["
|
|
352
|
+
["options"]
|
|
342
353
|
);
|
|
343
354
|
sideEffects?.onError?.(err);
|
|
344
355
|
throw transformedError;
|
|
345
356
|
}
|
|
346
357
|
}
|
|
347
|
-
async function
|
|
348
|
-
const { httpClient, sideEffects } = arguments[
|
|
358
|
+
async function resolveNotificationConfig2(notificationConfigId) {
|
|
359
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
349
360
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
350
|
-
|
|
361
|
+
notificationConfigId
|
|
351
362
|
});
|
|
352
|
-
const reqOpts =
|
|
363
|
+
const reqOpts = resolveNotificationConfig(
|
|
353
364
|
payload
|
|
354
365
|
);
|
|
355
366
|
sideEffects?.onSiteCall?.();
|
|
@@ -361,49 +372,38 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
|
361
372
|
const transformedError = (0, import_transform_error.transformError)(
|
|
362
373
|
err,
|
|
363
374
|
{
|
|
364
|
-
spreadPathsToArguments: {
|
|
365
|
-
explicitPathsToArguments: {
|
|
375
|
+
spreadPathsToArguments: {},
|
|
376
|
+
explicitPathsToArguments: { notificationConfigId: "$[0]" },
|
|
366
377
|
singleArgumentUnchanged: false
|
|
367
378
|
},
|
|
368
|
-
["
|
|
379
|
+
["notificationConfigId"]
|
|
369
380
|
);
|
|
370
381
|
sideEffects?.onError?.(err);
|
|
371
382
|
throw transformedError;
|
|
372
383
|
}
|
|
373
384
|
}
|
|
374
|
-
async function
|
|
375
|
-
const { httpClient, sideEffects } = arguments[
|
|
385
|
+
async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
386
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
376
387
|
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
|
|
388
|
+
notificationConfig: { ...notificationConfig, id: _id }
|
|
383
389
|
});
|
|
384
|
-
const reqOpts =
|
|
390
|
+
const reqOpts = upsertNotificationConfig(
|
|
385
391
|
payload
|
|
386
392
|
);
|
|
387
393
|
sideEffects?.onSiteCall?.();
|
|
388
394
|
try {
|
|
389
395
|
const result = await httpClient.request(reqOpts);
|
|
390
396
|
sideEffects?.onSuccess?.(result);
|
|
397
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
391
398
|
} catch (err) {
|
|
392
399
|
const transformedError = (0, import_transform_error.transformError)(
|
|
393
400
|
err,
|
|
394
401
|
{
|
|
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
|
-
},
|
|
402
|
+
spreadPathsToArguments: { notificationConfig: "$[1]" },
|
|
403
|
+
explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
|
|
404
404
|
singleArgumentUnchanged: false
|
|
405
405
|
},
|
|
406
|
-
["
|
|
406
|
+
["_id", "notificationConfig"]
|
|
407
407
|
);
|
|
408
408
|
sideEffects?.onError?.(err);
|
|
409
409
|
throw transformedError;
|
|
@@ -411,6 +411,13 @@ async function triggerNotification2(options) {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// src/events-notifications-v2-notification-config-notifications.public.ts
|
|
414
|
+
function triggerNotification3(httpClient) {
|
|
415
|
+
return (options) => triggerNotification2(
|
|
416
|
+
options,
|
|
417
|
+
// @ts-ignore
|
|
418
|
+
{ httpClient }
|
|
419
|
+
);
|
|
420
|
+
}
|
|
414
421
|
function resolveNotificationConfig3(httpClient) {
|
|
415
422
|
return (notificationConfigId) => resolveNotificationConfig2(
|
|
416
423
|
notificationConfigId,
|
|
@@ -426,13 +433,6 @@ function upsertNotificationConfig3(httpClient) {
|
|
|
426
433
|
{ httpClient }
|
|
427
434
|
);
|
|
428
435
|
}
|
|
429
|
-
function triggerNotification3(httpClient) {
|
|
430
|
-
return (options) => triggerNotification2(
|
|
431
|
-
options,
|
|
432
|
-
// @ts-ignore
|
|
433
|
-
{ httpClient }
|
|
434
|
-
);
|
|
435
|
-
}
|
|
436
436
|
var onNotificationConfigCreated = (0, import_sdk_types.EventDefinition)(
|
|
437
437
|
"wix.events.notifications.v2.notification_config_created",
|
|
438
438
|
true,
|
|
@@ -471,9 +471,9 @@ var onNotificationConfigUpdated = (0, import_sdk_types.EventDefinition)(
|
|
|
471
471
|
// src/events-notifications-v2-notification-config-notifications.context.ts
|
|
472
472
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
473
473
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
474
|
+
var triggerNotification4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(triggerNotification3);
|
|
474
475
|
var resolveNotificationConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(resolveNotificationConfig3);
|
|
475
476
|
var upsertNotificationConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(upsertNotificationConfig3);
|
|
476
|
-
var triggerNotification4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(triggerNotification3);
|
|
477
477
|
var onNotificationConfigCreated2 = (0, import_event_definition_modules.createEventModule)(
|
|
478
478
|
onNotificationConfigCreated
|
|
479
479
|
);
|