@wix/auto_sdk_events_notifications 1.0.58 → 1.0.59
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 +956 -956
- package/build/cjs/index.typings.js +91 -91
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +610 -610
- 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 +956 -956
- package/build/es/index.typings.mjs +91 -91
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +610 -610
- 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 +956 -956
- 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 +610 -610
- 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 +956 -956
- 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 +610 -610
- package/build/internal/es/meta.mjs +77 -77
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transform
|
|
|
18
18
|
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
19
19
|
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
20
20
|
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
21
|
-
function
|
|
21
|
+
function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
|
|
22
22
|
const domainToMappings = {
|
|
23
23
|
"api._api_base_domain_": [
|
|
24
24
|
{
|
|
@@ -51,7 +51,7 @@ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
|
|
|
51
51
|
};
|
|
52
52
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
|
|
55
55
|
const domainToMappings = {
|
|
56
56
|
"api._api_base_domain_": [
|
|
57
57
|
{
|
|
@@ -85,27 +85,6 @@ function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
|
|
|
85
85
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
86
86
|
}
|
|
87
87
|
var PACKAGE_NAME = "@wix/auto_sdk_events_notifications";
|
|
88
|
-
function triggerNotification(payload) {
|
|
89
|
-
function __triggerNotification({ host }) {
|
|
90
|
-
const metadata = {
|
|
91
|
-
entityFqdn: "wix.events.notifications.v2.notification_config",
|
|
92
|
-
method: "POST",
|
|
93
|
-
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
94
|
-
packageName: PACKAGE_NAME,
|
|
95
|
-
migrationOptions: {
|
|
96
|
-
optInTransformResponse: true
|
|
97
|
-
},
|
|
98
|
-
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
99
|
-
protoPath: "/v2/notifications/trigger",
|
|
100
|
-
data: payload,
|
|
101
|
-
host
|
|
102
|
-
}),
|
|
103
|
-
data: payload
|
|
104
|
-
};
|
|
105
|
-
return metadata;
|
|
106
|
-
}
|
|
107
|
-
return __triggerNotification;
|
|
108
|
-
}
|
|
109
88
|
function resolveNotificationConfig(payload) {
|
|
110
89
|
function __resolveNotificationConfig({ host }) {
|
|
111
90
|
const metadata = {
|
|
@@ -179,6 +158,27 @@ function upsertNotificationConfig(payload) {
|
|
|
179
158
|
}
|
|
180
159
|
return __upsertNotificationConfig;
|
|
181
160
|
}
|
|
161
|
+
function triggerNotification(payload) {
|
|
162
|
+
function __triggerNotification({ host }) {
|
|
163
|
+
const metadata = {
|
|
164
|
+
entityFqdn: "wix.events.notifications.v2.notification_config",
|
|
165
|
+
method: "POST",
|
|
166
|
+
methodFqn: "wix.events.notifications.v2.NotificationService.TriggerNotification",
|
|
167
|
+
packageName: PACKAGE_NAME,
|
|
168
|
+
migrationOptions: {
|
|
169
|
+
optInTransformResponse: true
|
|
170
|
+
},
|
|
171
|
+
url: resolveWixEventsNotificationsV2NotificationServiceUrl({
|
|
172
|
+
protoPath: "/v2/notifications/trigger",
|
|
173
|
+
data: payload,
|
|
174
|
+
host
|
|
175
|
+
}),
|
|
176
|
+
data: payload
|
|
177
|
+
};
|
|
178
|
+
return metadata;
|
|
179
|
+
}
|
|
180
|
+
return __triggerNotification;
|
|
181
|
+
}
|
|
182
182
|
|
|
183
183
|
// src/events-notifications-v2-notification-config-notifications.universal.ts
|
|
184
184
|
var EmailNotificationType = /* @__PURE__ */ ((EmailNotificationType2) => {
|
|
@@ -202,14 +202,11 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
|
|
|
202
202
|
EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
|
|
203
203
|
return EmailNotificationReminderTime2;
|
|
204
204
|
})(EmailNotificationReminderTime || {});
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
211
|
-
return PushNotificationType2;
|
|
212
|
-
})(PushNotificationType || {});
|
|
205
|
+
var LocationType = /* @__PURE__ */ ((LocationType2) => {
|
|
206
|
+
LocationType2["VENUE"] = "VENUE";
|
|
207
|
+
LocationType2["ONLINE"] = "ONLINE";
|
|
208
|
+
return LocationType2;
|
|
209
|
+
})(LocationType || {});
|
|
213
210
|
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
214
211
|
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
215
212
|
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
@@ -220,6 +217,37 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
|
220
217
|
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
221
218
|
return SubdivisionType2;
|
|
222
219
|
})(SubdivisionType || {});
|
|
220
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
221
|
+
Status2["ONE_TIME"] = "ONE_TIME";
|
|
222
|
+
Status2["RECURRING"] = "RECURRING";
|
|
223
|
+
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
224
|
+
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
225
|
+
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
226
|
+
return Status2;
|
|
227
|
+
})(Status || {});
|
|
228
|
+
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
229
|
+
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
230
|
+
EventStatus2["STARTED"] = "STARTED";
|
|
231
|
+
EventStatus2["ENDED"] = "ENDED";
|
|
232
|
+
EventStatus2["CANCELED"] = "CANCELED";
|
|
233
|
+
return EventStatus2;
|
|
234
|
+
})(EventStatus || {});
|
|
235
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
236
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
237
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
238
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
239
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
240
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
241
|
+
return WebhookIdentityType2;
|
|
242
|
+
})(WebhookIdentityType || {});
|
|
243
|
+
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
244
|
+
PushNotificationType2["UNKNOWN_PUSH_TYPE"] = "UNKNOWN_PUSH_TYPE";
|
|
245
|
+
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
246
|
+
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
247
|
+
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
248
|
+
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
249
|
+
return PushNotificationType2;
|
|
250
|
+
})(PushNotificationType || {});
|
|
223
251
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
224
252
|
OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
|
|
225
253
|
OrderStatus2["FREE"] = "FREE";
|
|
@@ -250,78 +278,39 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
|
|
|
250
278
|
FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
|
|
251
279
|
return FeeType2;
|
|
252
280
|
})(FeeType || {});
|
|
253
|
-
|
|
254
|
-
LocationType2["VENUE"] = "VENUE";
|
|
255
|
-
LocationType2["ONLINE"] = "ONLINE";
|
|
256
|
-
return LocationType2;
|
|
257
|
-
})(LocationType || {});
|
|
258
|
-
var Status = /* @__PURE__ */ ((Status2) => {
|
|
259
|
-
Status2["ONE_TIME"] = "ONE_TIME";
|
|
260
|
-
Status2["RECURRING"] = "RECURRING";
|
|
261
|
-
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
262
|
-
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
263
|
-
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
264
|
-
return Status2;
|
|
265
|
-
})(Status || {});
|
|
266
|
-
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
267
|
-
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
268
|
-
EventStatus2["STARTED"] = "STARTED";
|
|
269
|
-
EventStatus2["ENDED"] = "ENDED";
|
|
270
|
-
EventStatus2["CANCELED"] = "CANCELED";
|
|
271
|
-
return EventStatus2;
|
|
272
|
-
})(EventStatus || {});
|
|
273
|
-
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
274
|
-
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
275
|
-
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
276
|
-
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
277
|
-
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
278
|
-
WebhookIdentityType2["APP"] = "APP";
|
|
279
|
-
return WebhookIdentityType2;
|
|
280
|
-
})(WebhookIdentityType || {});
|
|
281
|
-
async function triggerNotification2(options) {
|
|
281
|
+
async function resolveNotificationConfig2(notificationConfigId) {
|
|
282
282
|
const { httpClient, sideEffects } = arguments[1];
|
|
283
283
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
284
|
-
|
|
285
|
-
pushNotificationType: options?.pushNotificationType,
|
|
286
|
-
rsvpGuest: options?.rsvpGuest,
|
|
287
|
-
orderGuest: options?.orderGuest,
|
|
288
|
-
eventGuests: options?.eventGuests,
|
|
289
|
-
ticketGuest: options?.ticketGuest
|
|
284
|
+
notificationConfigId
|
|
290
285
|
});
|
|
291
|
-
const reqOpts =
|
|
286
|
+
const reqOpts = resolveNotificationConfig(
|
|
292
287
|
payload
|
|
293
288
|
);
|
|
294
289
|
sideEffects?.onSiteCall?.();
|
|
295
290
|
try {
|
|
296
291
|
const result = await httpClient.request(reqOpts);
|
|
297
292
|
sideEffects?.onSuccess?.(result);
|
|
293
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
298
294
|
} catch (err) {
|
|
299
295
|
const transformedError = sdkTransformError(
|
|
300
296
|
err,
|
|
301
297
|
{
|
|
302
298
|
spreadPathsToArguments: {},
|
|
303
|
-
explicitPathsToArguments: {
|
|
304
|
-
emailNotificationType: "$[0].emailNotificationType",
|
|
305
|
-
pushNotificationType: "$[0].pushNotificationType",
|
|
306
|
-
rsvpGuest: "$[0].rsvpGuest",
|
|
307
|
-
orderGuest: "$[0].orderGuest",
|
|
308
|
-
eventGuests: "$[0].eventGuests",
|
|
309
|
-
ticketGuest: "$[0].ticketGuest"
|
|
310
|
-
},
|
|
299
|
+
explicitPathsToArguments: { notificationConfigId: "$[0]" },
|
|
311
300
|
singleArgumentUnchanged: false
|
|
312
301
|
},
|
|
313
|
-
["
|
|
302
|
+
["notificationConfigId"]
|
|
314
303
|
);
|
|
315
304
|
sideEffects?.onError?.(err);
|
|
316
305
|
throw transformedError;
|
|
317
306
|
}
|
|
318
307
|
}
|
|
319
|
-
async function
|
|
320
|
-
const { httpClient, sideEffects } = arguments[
|
|
308
|
+
async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
309
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
321
310
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
322
|
-
|
|
311
|
+
notificationConfig: { ...notificationConfig, id: _id }
|
|
323
312
|
});
|
|
324
|
-
const reqOpts =
|
|
313
|
+
const reqOpts = upsertNotificationConfig(
|
|
325
314
|
payload
|
|
326
315
|
);
|
|
327
316
|
sideEffects?.onSiteCall?.();
|
|
@@ -333,38 +322,49 @@ async function resolveNotificationConfig2(notificationConfigId) {
|
|
|
333
322
|
const transformedError = sdkTransformError(
|
|
334
323
|
err,
|
|
335
324
|
{
|
|
336
|
-
spreadPathsToArguments: {},
|
|
337
|
-
explicitPathsToArguments: {
|
|
325
|
+
spreadPathsToArguments: { notificationConfig: "$[1]" },
|
|
326
|
+
explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
|
|
338
327
|
singleArgumentUnchanged: false
|
|
339
328
|
},
|
|
340
|
-
["
|
|
329
|
+
["_id", "notificationConfig"]
|
|
341
330
|
);
|
|
342
331
|
sideEffects?.onError?.(err);
|
|
343
332
|
throw transformedError;
|
|
344
333
|
}
|
|
345
334
|
}
|
|
346
|
-
async function
|
|
347
|
-
const { httpClient, sideEffects } = arguments[
|
|
335
|
+
async function triggerNotification2(options) {
|
|
336
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
348
337
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
349
|
-
|
|
338
|
+
emailNotificationType: options?.emailNotificationType,
|
|
339
|
+
pushNotificationType: options?.pushNotificationType,
|
|
340
|
+
rsvpGuest: options?.rsvpGuest,
|
|
341
|
+
orderGuest: options?.orderGuest,
|
|
342
|
+
eventGuests: options?.eventGuests,
|
|
343
|
+
ticketGuest: options?.ticketGuest
|
|
350
344
|
});
|
|
351
|
-
const reqOpts =
|
|
345
|
+
const reqOpts = triggerNotification(
|
|
352
346
|
payload
|
|
353
347
|
);
|
|
354
348
|
sideEffects?.onSiteCall?.();
|
|
355
349
|
try {
|
|
356
350
|
const result = await httpClient.request(reqOpts);
|
|
357
351
|
sideEffects?.onSuccess?.(result);
|
|
358
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
359
352
|
} catch (err) {
|
|
360
353
|
const transformedError = sdkTransformError(
|
|
361
354
|
err,
|
|
362
355
|
{
|
|
363
|
-
spreadPathsToArguments: {
|
|
364
|
-
explicitPathsToArguments: {
|
|
356
|
+
spreadPathsToArguments: {},
|
|
357
|
+
explicitPathsToArguments: {
|
|
358
|
+
emailNotificationType: "$[0].emailNotificationType",
|
|
359
|
+
pushNotificationType: "$[0].pushNotificationType",
|
|
360
|
+
rsvpGuest: "$[0].rsvpGuest",
|
|
361
|
+
orderGuest: "$[0].orderGuest",
|
|
362
|
+
eventGuests: "$[0].eventGuests",
|
|
363
|
+
ticketGuest: "$[0].ticketGuest"
|
|
364
|
+
},
|
|
365
365
|
singleArgumentUnchanged: false
|
|
366
366
|
},
|
|
367
|
-
["
|
|
367
|
+
["options"]
|
|
368
368
|
);
|
|
369
369
|
sideEffects?.onError?.(err);
|
|
370
370
|
throw transformedError;
|
|
@@ -372,13 +372,6 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
// src/events-notifications-v2-notification-config-notifications.public.ts
|
|
375
|
-
function triggerNotification3(httpClient) {
|
|
376
|
-
return (options) => triggerNotification2(
|
|
377
|
-
options,
|
|
378
|
-
// @ts-ignore
|
|
379
|
-
{ httpClient }
|
|
380
|
-
);
|
|
381
|
-
}
|
|
382
375
|
function resolveNotificationConfig3(httpClient) {
|
|
383
376
|
return (notificationConfigId) => resolveNotificationConfig2(
|
|
384
377
|
notificationConfigId,
|
|
@@ -394,6 +387,13 @@ function upsertNotificationConfig3(httpClient) {
|
|
|
394
387
|
{ httpClient }
|
|
395
388
|
);
|
|
396
389
|
}
|
|
390
|
+
function triggerNotification3(httpClient) {
|
|
391
|
+
return (options) => triggerNotification2(
|
|
392
|
+
options,
|
|
393
|
+
// @ts-ignore
|
|
394
|
+
{ httpClient }
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
397
|
var onNotificationConfigCreated = EventDefinition(
|
|
398
398
|
"wix.events.notifications.v2.notification_config_created",
|
|
399
399
|
true,
|
|
@@ -432,9 +432,9 @@ var onNotificationConfigUpdated = EventDefinition(
|
|
|
432
432
|
// src/events-notifications-v2-notification-config-notifications.context.ts
|
|
433
433
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
434
434
|
import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
|
|
435
|
-
var triggerNotification4 = /* @__PURE__ */ createRESTModule(triggerNotification3);
|
|
436
435
|
var resolveNotificationConfig4 = /* @__PURE__ */ createRESTModule(resolveNotificationConfig3);
|
|
437
436
|
var upsertNotificationConfig4 = /* @__PURE__ */ createRESTModule(upsertNotificationConfig3);
|
|
437
|
+
var triggerNotification4 = /* @__PURE__ */ createRESTModule(triggerNotification3);
|
|
438
438
|
var onNotificationConfigCreated2 = createEventModule(
|
|
439
439
|
onNotificationConfigCreated
|
|
440
440
|
);
|