@wix/auto_sdk_events_notifications 1.0.74 → 1.0.76
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 -98
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +973 -973
- package/build/cjs/index.typings.js +90 -90
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +935 -935
- package/build/cjs/meta.js +76 -76
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +975 -0
- package/build/cjs/schemas.js +1256 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/index.d.mts +9 -9
- package/build/es/index.mjs +98 -98
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +973 -973
- package/build/es/index.typings.mjs +90 -90
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +935 -935
- package/build/es/meta.mjs +76 -76
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +975 -0
- package/build/es/schemas.mjs +1214 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +9 -9
- package/build/internal/cjs/index.js +98 -98
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +973 -973
- package/build/internal/cjs/index.typings.js +90 -90
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +935 -935
- package/build/internal/cjs/meta.js +76 -76
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +975 -0
- package/build/internal/cjs/schemas.js +1256 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/index.d.mts +9 -9
- package/build/internal/es/index.mjs +98 -98
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +973 -973
- package/build/internal/es/index.typings.mjs +90 -90
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +935 -935
- package/build/internal/es/meta.mjs +76 -76
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +975 -0
- package/build/internal/es/schemas.mjs +1214 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/package.json +12 -5
- package/schemas/package.json +3 -0
package/build/es/index.mjs
CHANGED
|
@@ -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) => {
|
|
@@ -200,13 +200,11 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
|
|
|
200
200
|
EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
|
|
201
201
|
return EmailNotificationReminderTime2;
|
|
202
202
|
})(EmailNotificationReminderTime || {});
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return PushNotificationType2;
|
|
209
|
-
})(PushNotificationType || {});
|
|
203
|
+
var LocationType = /* @__PURE__ */ ((LocationType2) => {
|
|
204
|
+
LocationType2["VENUE"] = "VENUE";
|
|
205
|
+
LocationType2["ONLINE"] = "ONLINE";
|
|
206
|
+
return LocationType2;
|
|
207
|
+
})(LocationType || {});
|
|
210
208
|
var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
211
209
|
SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
212
210
|
SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
@@ -217,6 +215,36 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
|
|
|
217
215
|
SubdivisionType2["COUNTRY"] = "COUNTRY";
|
|
218
216
|
return SubdivisionType2;
|
|
219
217
|
})(SubdivisionType || {});
|
|
218
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
219
|
+
Status2["ONE_TIME"] = "ONE_TIME";
|
|
220
|
+
Status2["RECURRING"] = "RECURRING";
|
|
221
|
+
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
222
|
+
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
223
|
+
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
224
|
+
return Status2;
|
|
225
|
+
})(Status || {});
|
|
226
|
+
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
227
|
+
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
228
|
+
EventStatus2["STARTED"] = "STARTED";
|
|
229
|
+
EventStatus2["ENDED"] = "ENDED";
|
|
230
|
+
EventStatus2["CANCELED"] = "CANCELED";
|
|
231
|
+
return EventStatus2;
|
|
232
|
+
})(EventStatus || {});
|
|
233
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
234
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
235
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
236
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
237
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
238
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
239
|
+
return WebhookIdentityType2;
|
|
240
|
+
})(WebhookIdentityType || {});
|
|
241
|
+
var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
|
|
242
|
+
PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
|
|
243
|
+
PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
|
|
244
|
+
PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
|
|
245
|
+
PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
|
|
246
|
+
return PushNotificationType2;
|
|
247
|
+
})(PushNotificationType || {});
|
|
220
248
|
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
221
249
|
OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
|
|
222
250
|
OrderStatus2["FREE"] = "FREE";
|
|
@@ -247,78 +275,39 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
|
|
|
247
275
|
FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
|
|
248
276
|
return FeeType2;
|
|
249
277
|
})(FeeType || {});
|
|
250
|
-
|
|
251
|
-
LocationType2["VENUE"] = "VENUE";
|
|
252
|
-
LocationType2["ONLINE"] = "ONLINE";
|
|
253
|
-
return LocationType2;
|
|
254
|
-
})(LocationType || {});
|
|
255
|
-
var Status = /* @__PURE__ */ ((Status2) => {
|
|
256
|
-
Status2["ONE_TIME"] = "ONE_TIME";
|
|
257
|
-
Status2["RECURRING"] = "RECURRING";
|
|
258
|
-
Status2["RECURRING_NEXT"] = "RECURRING_NEXT";
|
|
259
|
-
Status2["RECURRING_LAST_ENDED"] = "RECURRING_LAST_ENDED";
|
|
260
|
-
Status2["RECURRING_LAST_CANCELED"] = "RECURRING_LAST_CANCELED";
|
|
261
|
-
return Status2;
|
|
262
|
-
})(Status || {});
|
|
263
|
-
var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
|
|
264
|
-
EventStatus2["SCHEDULED"] = "SCHEDULED";
|
|
265
|
-
EventStatus2["STARTED"] = "STARTED";
|
|
266
|
-
EventStatus2["ENDED"] = "ENDED";
|
|
267
|
-
EventStatus2["CANCELED"] = "CANCELED";
|
|
268
|
-
return EventStatus2;
|
|
269
|
-
})(EventStatus || {});
|
|
270
|
-
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
271
|
-
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
272
|
-
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
273
|
-
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
274
|
-
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
275
|
-
WebhookIdentityType2["APP"] = "APP";
|
|
276
|
-
return WebhookIdentityType2;
|
|
277
|
-
})(WebhookIdentityType || {});
|
|
278
|
-
async function triggerNotification2(options) {
|
|
278
|
+
async function resolveNotificationConfig2(notificationConfigId) {
|
|
279
279
|
const { httpClient, sideEffects } = arguments[1];
|
|
280
280
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
281
|
-
|
|
282
|
-
pushNotificationType: options?.pushNotificationType,
|
|
283
|
-
rsvpGuest: options?.rsvpGuest,
|
|
284
|
-
orderGuest: options?.orderGuest,
|
|
285
|
-
eventGuests: options?.eventGuests,
|
|
286
|
-
ticketGuest: options?.ticketGuest
|
|
281
|
+
notificationConfigId
|
|
287
282
|
});
|
|
288
|
-
const reqOpts =
|
|
283
|
+
const reqOpts = resolveNotificationConfig(
|
|
289
284
|
payload
|
|
290
285
|
);
|
|
291
286
|
sideEffects?.onSiteCall?.();
|
|
292
287
|
try {
|
|
293
288
|
const result = await httpClient.request(reqOpts);
|
|
294
289
|
sideEffects?.onSuccess?.(result);
|
|
290
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
295
291
|
} catch (err) {
|
|
296
292
|
const transformedError = sdkTransformError(
|
|
297
293
|
err,
|
|
298
294
|
{
|
|
299
295
|
spreadPathsToArguments: {},
|
|
300
|
-
explicitPathsToArguments: {
|
|
301
|
-
emailNotificationType: "$[0].emailNotificationType",
|
|
302
|
-
pushNotificationType: "$[0].pushNotificationType",
|
|
303
|
-
rsvpGuest: "$[0].rsvpGuest",
|
|
304
|
-
orderGuest: "$[0].orderGuest",
|
|
305
|
-
eventGuests: "$[0].eventGuests",
|
|
306
|
-
ticketGuest: "$[0].ticketGuest"
|
|
307
|
-
},
|
|
296
|
+
explicitPathsToArguments: { notificationConfigId: "$[0]" },
|
|
308
297
|
singleArgumentUnchanged: false
|
|
309
298
|
},
|
|
310
|
-
["
|
|
299
|
+
["notificationConfigId"]
|
|
311
300
|
);
|
|
312
301
|
sideEffects?.onError?.(err);
|
|
313
302
|
throw transformedError;
|
|
314
303
|
}
|
|
315
304
|
}
|
|
316
|
-
async function
|
|
317
|
-
const { httpClient, sideEffects } = arguments[
|
|
305
|
+
async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
306
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
318
307
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
319
|
-
|
|
308
|
+
notificationConfig: { ...notificationConfig, id: _id }
|
|
320
309
|
});
|
|
321
|
-
const reqOpts =
|
|
310
|
+
const reqOpts = upsertNotificationConfig(
|
|
322
311
|
payload
|
|
323
312
|
);
|
|
324
313
|
sideEffects?.onSiteCall?.();
|
|
@@ -330,38 +319,49 @@ async function resolveNotificationConfig2(notificationConfigId) {
|
|
|
330
319
|
const transformedError = sdkTransformError(
|
|
331
320
|
err,
|
|
332
321
|
{
|
|
333
|
-
spreadPathsToArguments: {},
|
|
334
|
-
explicitPathsToArguments: {
|
|
322
|
+
spreadPathsToArguments: { notificationConfig: "$[1]" },
|
|
323
|
+
explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
|
|
335
324
|
singleArgumentUnchanged: false
|
|
336
325
|
},
|
|
337
|
-
["
|
|
326
|
+
["_id", "notificationConfig"]
|
|
338
327
|
);
|
|
339
328
|
sideEffects?.onError?.(err);
|
|
340
329
|
throw transformedError;
|
|
341
330
|
}
|
|
342
331
|
}
|
|
343
|
-
async function
|
|
344
|
-
const { httpClient, sideEffects } = arguments[
|
|
332
|
+
async function triggerNotification2(options) {
|
|
333
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
345
334
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
346
|
-
|
|
335
|
+
emailNotificationType: options?.emailNotificationType,
|
|
336
|
+
pushNotificationType: options?.pushNotificationType,
|
|
337
|
+
rsvpGuest: options?.rsvpGuest,
|
|
338
|
+
orderGuest: options?.orderGuest,
|
|
339
|
+
eventGuests: options?.eventGuests,
|
|
340
|
+
ticketGuest: options?.ticketGuest
|
|
347
341
|
});
|
|
348
|
-
const reqOpts =
|
|
342
|
+
const reqOpts = triggerNotification(
|
|
349
343
|
payload
|
|
350
344
|
);
|
|
351
345
|
sideEffects?.onSiteCall?.();
|
|
352
346
|
try {
|
|
353
347
|
const result = await httpClient.request(reqOpts);
|
|
354
348
|
sideEffects?.onSuccess?.(result);
|
|
355
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
356
349
|
} catch (err) {
|
|
357
350
|
const transformedError = sdkTransformError(
|
|
358
351
|
err,
|
|
359
352
|
{
|
|
360
|
-
spreadPathsToArguments: {
|
|
361
|
-
explicitPathsToArguments: {
|
|
353
|
+
spreadPathsToArguments: {},
|
|
354
|
+
explicitPathsToArguments: {
|
|
355
|
+
emailNotificationType: "$[0].emailNotificationType",
|
|
356
|
+
pushNotificationType: "$[0].pushNotificationType",
|
|
357
|
+
rsvpGuest: "$[0].rsvpGuest",
|
|
358
|
+
orderGuest: "$[0].orderGuest",
|
|
359
|
+
eventGuests: "$[0].eventGuests",
|
|
360
|
+
ticketGuest: "$[0].ticketGuest"
|
|
361
|
+
},
|
|
362
362
|
singleArgumentUnchanged: false
|
|
363
363
|
},
|
|
364
|
-
["
|
|
364
|
+
["options"]
|
|
365
365
|
);
|
|
366
366
|
sideEffects?.onError?.(err);
|
|
367
367
|
throw transformedError;
|
|
@@ -369,13 +369,6 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
// src/events-notifications-v2-notification-config-notifications.public.ts
|
|
372
|
-
function triggerNotification3(httpClient) {
|
|
373
|
-
return (options) => triggerNotification2(
|
|
374
|
-
options,
|
|
375
|
-
// @ts-ignore
|
|
376
|
-
{ httpClient }
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
372
|
function resolveNotificationConfig3(httpClient) {
|
|
380
373
|
return (notificationConfigId) => resolveNotificationConfig2(
|
|
381
374
|
notificationConfigId,
|
|
@@ -391,6 +384,13 @@ function upsertNotificationConfig3(httpClient) {
|
|
|
391
384
|
{ httpClient }
|
|
392
385
|
);
|
|
393
386
|
}
|
|
387
|
+
function triggerNotification3(httpClient) {
|
|
388
|
+
return (options) => triggerNotification2(
|
|
389
|
+
options,
|
|
390
|
+
// @ts-ignore
|
|
391
|
+
{ httpClient }
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
394
|
var onNotificationConfigCreated = EventDefinition(
|
|
395
395
|
"wix.events.notifications.v2.notification_config_created",
|
|
396
396
|
true,
|
|
@@ -429,9 +429,9 @@ var onNotificationConfigUpdated = EventDefinition(
|
|
|
429
429
|
// src/events-notifications-v2-notification-config-notifications.context.ts
|
|
430
430
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
431
431
|
import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
|
|
432
|
-
var triggerNotification4 = /* @__PURE__ */ createRESTModule(triggerNotification3);
|
|
433
432
|
var resolveNotificationConfig4 = /* @__PURE__ */ createRESTModule(resolveNotificationConfig3);
|
|
434
433
|
var upsertNotificationConfig4 = /* @__PURE__ */ createRESTModule(upsertNotificationConfig3);
|
|
434
|
+
var triggerNotification4 = /* @__PURE__ */ createRESTModule(triggerNotification3);
|
|
435
435
|
var onNotificationConfigCreated2 = createEventModule(
|
|
436
436
|
onNotificationConfigCreated
|
|
437
437
|
);
|