@wix/auto_sdk_events_notifications 1.0.71 → 1.0.73
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 +4 -4
|
@@ -49,7 +49,7 @@ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
|
49
49
|
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
50
50
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
51
51
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
52
|
-
function
|
|
52
|
+
function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
|
|
53
53
|
const domainToMappings = {
|
|
54
54
|
"api._api_base_domain_": [
|
|
55
55
|
{
|
|
@@ -82,7 +82,7 @@ function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
|
|
|
82
82
|
};
|
|
83
83
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
|
|
86
86
|
const domainToMappings = {
|
|
87
87
|
"api._api_base_domain_": [
|
|
88
88
|
{
|
|
@@ -116,6 +116,27 @@ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
|
|
|
116
116
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
117
117
|
}
|
|
118
118
|
var PACKAGE_NAME = "@wix/auto_sdk_events_notifications";
|
|
119
|
+
function triggerNotification(payload) {
|
|
120
|
+
function __triggerNotification({ host }) {
|
|
121
|
+
const metadata = {
|
|
122
|
+
entityFqdn: "wix.events.notifications.v2.notification_config",
|
|
123
|
+
method: "POST",
|
|
124
|
+
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
125
|
+
packageName: PACKAGE_NAME,
|
|
126
|
+
migrationOptions: {
|
|
127
|
+
optInTransformResponse: true
|
|
128
|
+
},
|
|
129
|
+
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
130
|
+
protoPath: "/v2/notifications/trigger",
|
|
131
|
+
data: payload,
|
|
132
|
+
host
|
|
133
|
+
}),
|
|
134
|
+
data: payload
|
|
135
|
+
};
|
|
136
|
+
return metadata;
|
|
137
|
+
}
|
|
138
|
+
return __triggerNotification;
|
|
139
|
+
}
|
|
119
140
|
function resolveNotificationConfig(payload) {
|
|
120
141
|
function __resolveNotificationConfig({ host }) {
|
|
121
142
|
const metadata = {
|
|
@@ -189,31 +210,9 @@ function upsertNotificationConfig(payload) {
|
|
|
189
210
|
}
|
|
190
211
|
return __upsertNotificationConfig;
|
|
191
212
|
}
|
|
192
|
-
function triggerNotification(payload) {
|
|
193
|
-
function __triggerNotification({ host }) {
|
|
194
|
-
const metadata = {
|
|
195
|
-
entityFqdn: "wix.events.notifications.v2.notification_config",
|
|
196
|
-
method: "POST",
|
|
197
|
-
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
198
|
-
packageName: PACKAGE_NAME,
|
|
199
|
-
migrationOptions: {
|
|
200
|
-
optInTransformResponse: true
|
|
201
|
-
},
|
|
202
|
-
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
203
|
-
protoPath: "/v2/notifications/trigger",
|
|
204
|
-
data: payload,
|
|
205
|
-
host
|
|
206
|
-
}),
|
|
207
|
-
data: payload
|
|
208
|
-
};
|
|
209
|
-
return metadata;
|
|
210
|
-
}
|
|
211
|
-
return __triggerNotification;
|
|
212
|
-
}
|
|
213
213
|
|
|
214
214
|
// src/events-notifications-v2-notification-config-notifications.universal.ts
|
|
215
215
|
var EmailNotificationType = /* @__PURE__ */ ((EmailNotificationType2) => {
|
|
216
|
-
EmailNotificationType2["UNKNOWN_NOTIFICATION_TYPE"] = "UNKNOWN_NOTIFICATION_TYPE";
|
|
217
216
|
EmailNotificationType2["EMAIL_RSVP_CONFIRMATION"] = "EMAIL_RSVP_CONFIRMATION";
|
|
218
217
|
EmailNotificationType2["EMAIL_NEW_SPOTS_AVAILABLE"] = "EMAIL_NEW_SPOTS_AVAILABLE";
|
|
219
218
|
EmailNotificationType2["EMAIL_EVENT_CANCELATION"] = "EMAIL_EVENT_CANCELATION";
|
|
@@ -224,7 +223,6 @@ var EmailNotificationType = /* @__PURE__ */ ((EmailNotificationType2) => {
|
|
|
224
223
|
return EmailNotificationType2;
|
|
225
224
|
})(EmailNotificationType || {});
|
|
226
225
|
var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderTime2) => {
|
|
227
|
-
EmailNotificationReminderTime2["UNKNOWN_REMINDER_TIME"] = "UNKNOWN_REMINDER_TIME";
|
|
228
226
|
EmailNotificationReminderTime2["INSTANT"] = "INSTANT";
|
|
229
227
|
EmailNotificationReminderTime2["BEFORE_1_DAY"] = "BEFORE_1_DAY";
|
|
230
228
|
EmailNotificationReminderTime2["BEFORE_3_DAYS"] = "BEFORE_3_DAYS";
|
|
@@ -233,11 +231,13 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
|
|
|
233
231
|
EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
|
|
234
232
|
return EmailNotificationReminderTime2;
|
|
235
233
|
})(EmailNotificationReminderTime || {});
|
|
236
|
-
var
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
235
|
+
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
236
|
+
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
237
|
+
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
238
|
+
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
239
|
+
return PushNotificationType2;
|
|
240
|
+
})(PushNotificationType || {});
|
|
241
241
|
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
242
242
|
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
243
243
|
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
@@ -248,37 +248,6 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
|
248
248
|
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
249
249
|
return SubdivisionType2;
|
|
250
250
|
})(SubdivisionType || {});
|
|
251
|
-
var Status = /* @__PURE__ */ ((Status2) => {
|
|
252
|
-
Status2["ONE_TIME"] = "ONE_TIME";
|
|
253
|
-
Status2["RECURRING"] = "RECURRING";
|
|
254
|
-
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
255
|
-
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
256
|
-
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
257
|
-
return Status2;
|
|
258
|
-
})(Status || {});
|
|
259
|
-
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
260
|
-
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
261
|
-
EventStatus2["STARTED"] = "STARTED";
|
|
262
|
-
EventStatus2["ENDED"] = "ENDED";
|
|
263
|
-
EventStatus2["CANCELED"] = "CANCELED";
|
|
264
|
-
return EventStatus2;
|
|
265
|
-
})(EventStatus || {});
|
|
266
|
-
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
267
|
-
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
268
|
-
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
269
|
-
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
270
|
-
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
271
|
-
WebhookIdentityType2["APP"] = "APP";
|
|
272
|
-
return WebhookIdentityType2;
|
|
273
|
-
})(WebhookIdentityType || {});
|
|
274
|
-
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
275
|
-
PushNotificationType2["UNKNOWN_PUSH_TYPE"] = "UNKNOWN_PUSH_TYPE";
|
|
276
|
-
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
277
|
-
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
278
|
-
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
279
|
-
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
280
|
-
return PushNotificationType2;
|
|
281
|
-
})(PushNotificationType || {});
|
|
282
251
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
283
252
|
OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
|
|
284
253
|
OrderStatus2["FREE"] = "FREE";
|
|
@@ -309,39 +278,78 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
|
|
|
309
278
|
FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
|
|
310
279
|
return FeeType2;
|
|
311
280
|
})(FeeType || {});
|
|
312
|
-
|
|
281
|
+
var LocationType = /* @__PURE__ */ ((LocationType2) => {
|
|
282
|
+
LocationType2["VENUE"] = "VENUE";
|
|
283
|
+
LocationType2["ONLINE"] = "ONLINE";
|
|
284
|
+
return LocationType2;
|
|
285
|
+
})(LocationType || {});
|
|
286
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
287
|
+
Status2["ONE_TIME"] = "ONE_TIME";
|
|
288
|
+
Status2["RECURRING"] = "RECURRING";
|
|
289
|
+
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
290
|
+
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
291
|
+
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
292
|
+
return Status2;
|
|
293
|
+
})(Status || {});
|
|
294
|
+
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
295
|
+
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
296
|
+
EventStatus2["STARTED"] = "STARTED";
|
|
297
|
+
EventStatus2["ENDED"] = "ENDED";
|
|
298
|
+
EventStatus2["CANCELED"] = "CANCELED";
|
|
299
|
+
return EventStatus2;
|
|
300
|
+
})(EventStatus || {});
|
|
301
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
302
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
303
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
304
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
305
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
306
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
307
|
+
return WebhookIdentityType2;
|
|
308
|
+
})(WebhookIdentityType || {});
|
|
309
|
+
async function triggerNotification2(options) {
|
|
313
310
|
const { httpClient, sideEffects } = arguments[1];
|
|
314
311
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
315
|
-
|
|
312
|
+
emailNotificationType: options?.emailNotificationType,
|
|
313
|
+
pushNotificationType: options?.pushNotificationType,
|
|
314
|
+
rsvpGuest: options?.rsvpGuest,
|
|
315
|
+
orderGuest: options?.orderGuest,
|
|
316
|
+
eventGuests: options?.eventGuests,
|
|
317
|
+
ticketGuest: options?.ticketGuest
|
|
316
318
|
});
|
|
317
|
-
const reqOpts =
|
|
319
|
+
const reqOpts = triggerNotification(
|
|
318
320
|
payload
|
|
319
321
|
);
|
|
320
322
|
sideEffects?.onSiteCall?.();
|
|
321
323
|
try {
|
|
322
324
|
const result = await httpClient.request(reqOpts);
|
|
323
325
|
sideEffects?.onSuccess?.(result);
|
|
324
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
325
326
|
} catch (err) {
|
|
326
327
|
const transformedError = (0, import_transform_error.transformError)(
|
|
327
328
|
err,
|
|
328
329
|
{
|
|
329
330
|
spreadPathsToArguments: {},
|
|
330
|
-
explicitPathsToArguments: {
|
|
331
|
+
explicitPathsToArguments: {
|
|
332
|
+
emailNotificationType: "$[0].emailNotificationType",
|
|
333
|
+
pushNotificationType: "$[0].pushNotificationType",
|
|
334
|
+
rsvpGuest: "$[0].rsvpGuest",
|
|
335
|
+
orderGuest: "$[0].orderGuest",
|
|
336
|
+
eventGuests: "$[0].eventGuests",
|
|
337
|
+
ticketGuest: "$[0].ticketGuest"
|
|
338
|
+
},
|
|
331
339
|
singleArgumentUnchanged: false
|
|
332
340
|
},
|
|
333
|
-
["
|
|
341
|
+
["options"]
|
|
334
342
|
);
|
|
335
343
|
sideEffects?.onError?.(err);
|
|
336
344
|
throw transformedError;
|
|
337
345
|
}
|
|
338
346
|
}
|
|
339
|
-
async function
|
|
340
|
-
const { httpClient, sideEffects } = arguments[
|
|
347
|
+
async function resolveNotificationConfig2(notificationConfigId) {
|
|
348
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
341
349
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
342
|
-
|
|
350
|
+
notificationConfigId
|
|
343
351
|
});
|
|
344
|
-
const reqOpts =
|
|
352
|
+
const reqOpts = resolveNotificationConfig(
|
|
345
353
|
payload
|
|
346
354
|
);
|
|
347
355
|
sideEffects?.onSiteCall?.();
|
|
@@ -353,49 +361,38 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
|
353
361
|
const transformedError = (0, import_transform_error.transformError)(
|
|
354
362
|
err,
|
|
355
363
|
{
|
|
356
|
-
spreadPathsToArguments: {
|
|
357
|
-
explicitPathsToArguments: {
|
|
364
|
+
spreadPathsToArguments: {},
|
|
365
|
+
explicitPathsToArguments: { notificationConfigId: "$[0]" },
|
|
358
366
|
singleArgumentUnchanged: false
|
|
359
367
|
},
|
|
360
|
-
["
|
|
368
|
+
["notificationConfigId"]
|
|
361
369
|
);
|
|
362
370
|
sideEffects?.onError?.(err);
|
|
363
371
|
throw transformedError;
|
|
364
372
|
}
|
|
365
373
|
}
|
|
366
|
-
async function
|
|
367
|
-
const { httpClient, sideEffects } = arguments[
|
|
374
|
+
async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
375
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
368
376
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
369
|
-
|
|
370
|
-
pushNotificationType: options?.pushNotificationType,
|
|
371
|
-
rsvpGuest: options?.rsvpGuest,
|
|
372
|
-
orderGuest: options?.orderGuest,
|
|
373
|
-
eventGuests: options?.eventGuests,
|
|
374
|
-
ticketGuest: options?.ticketGuest
|
|
377
|
+
notificationConfig: { ...notificationConfig, id: _id }
|
|
375
378
|
});
|
|
376
|
-
const reqOpts =
|
|
379
|
+
const reqOpts = upsertNotificationConfig(
|
|
377
380
|
payload
|
|
378
381
|
);
|
|
379
382
|
sideEffects?.onSiteCall?.();
|
|
380
383
|
try {
|
|
381
384
|
const result = await httpClient.request(reqOpts);
|
|
382
385
|
sideEffects?.onSuccess?.(result);
|
|
386
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
383
387
|
} catch (err) {
|
|
384
388
|
const transformedError = (0, import_transform_error.transformError)(
|
|
385
389
|
err,
|
|
386
390
|
{
|
|
387
|
-
spreadPathsToArguments: {},
|
|
388
|
-
explicitPathsToArguments: {
|
|
389
|
-
emailNotificationType: "$[0].emailNotificationType",
|
|
390
|
-
pushNotificationType: "$[0].pushNotificationType",
|
|
391
|
-
rsvpGuest: "$[0].rsvpGuest",
|
|
392
|
-
orderGuest: "$[0].orderGuest",
|
|
393
|
-
eventGuests: "$[0].eventGuests",
|
|
394
|
-
ticketGuest: "$[0].ticketGuest"
|
|
395
|
-
},
|
|
391
|
+
spreadPathsToArguments: { notificationConfig: "$[1]" },
|
|
392
|
+
explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
|
|
396
393
|
singleArgumentUnchanged: false
|
|
397
394
|
},
|
|
398
|
-
["
|
|
395
|
+
["_id", "notificationConfig"]
|
|
399
396
|
);
|
|
400
397
|
sideEffects?.onError?.(err);
|
|
401
398
|
throw transformedError;
|