@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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +9 -9
  2. package/build/cjs/index.js +98 -101
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +973 -979
  5. package/build/cjs/index.typings.js +90 -93
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +938 -944
  8. package/build/cjs/meta.js +76 -79
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +9 -9
  11. package/build/es/index.mjs +98 -101
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +973 -979
  14. package/build/es/index.typings.mjs +90 -93
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +938 -944
  17. package/build/es/meta.mjs +76 -79
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +9 -9
  20. package/build/internal/cjs/index.js +98 -101
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +973 -979
  23. package/build/internal/cjs/index.typings.js +90 -93
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +938 -944
  26. package/build/internal/cjs/meta.js +76 -79
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +9 -9
  29. package/build/internal/es/index.mjs +98 -101
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +973 -979
  32. package/build/internal/es/index.typings.mjs +90 -93
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +938 -944
  35. package/build/internal/es/meta.mjs +76 -79
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. 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 resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
21
+ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
22
22
  const domainToMappings = {
23
23
  "api._api_base_domain_": [
24
24
  {
@@ -51,7 +51,7 @@ function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
51
51
  };
52
52
  return resolveUrl(Object.assign(opts, { domainToMappings }));
53
53
  }
54
- function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
54
+ function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
55
55
  const domainToMappings = {
56
56
  "api._api_base_domain_": [
57
57
  {
@@ -85,6 +85,27 @@ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(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
+ }
88
109
  function resolveNotificationConfig(payload) {
89
110
  function __resolveNotificationConfig({ host }) {
90
111
  const metadata = {
@@ -158,31 +179,9 @@ function upsertNotificationConfig(payload) {
158
179
  }
159
180
  return __upsertNotificationConfig;
160
181
  }
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) => {
185
- EmailNotificationType2["UNKNOWN_NOTIFICATION_TYPE"] = "UNKNOWN_NOTIFICATION_TYPE";
186
185
  EmailNotificationType2["EMAIL_RSVP_CONFIRMATION"] = "EMAIL_RSVP_CONFIRMATION";
187
186
  EmailNotificationType2["EMAIL_NEW_SPOTS_AVAILABLE"] = "EMAIL_NEW_SPOTS_AVAILABLE";
188
187
  EmailNotificationType2["EMAIL_EVENT_CANCELATION"] = "EMAIL_EVENT_CANCELATION";
@@ -193,7 +192,6 @@ var EmailNotificationType = /* @__PURE__ */ ((EmailNotificationType2) => {
193
192
  return EmailNotificationType2;
194
193
  })(EmailNotificationType || {});
195
194
  var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderTime2) => {
196
- EmailNotificationReminderTime2["UNKNOWN_REMINDER_TIME"] = "UNKNOWN_REMINDER_TIME";
197
195
  EmailNotificationReminderTime2["INSTANT"] = "INSTANT";
198
196
  EmailNotificationReminderTime2["BEFORE_1_DAY"] = "BEFORE_1_DAY";
199
197
  EmailNotificationReminderTime2["BEFORE_3_DAYS"] = "BEFORE_3_DAYS";
@@ -202,11 +200,13 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
202
200
  EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
203
201
  return EmailNotificationReminderTime2;
204
202
  })(EmailNotificationReminderTime || {});
205
- var LocationType = /* @__PURE__ */ ((LocationType2) => {
206
- LocationType2["VENUE"] = "VENUE";
207
- LocationType2["ONLINE"] = "ONLINE";
208
- return LocationType2;
209
- })(LocationType || {});
203
+ var PushNotificationType = /* @__PURE__ */ ((PushNotificationType2) => {
204
+ PushNotificationType2["PUSH_EVENT_UPDATED"] = "PUSH_EVENT_UPDATED";
205
+ PushNotificationType2["PUSH_EVENT_CANCELATION"] = "PUSH_EVENT_CANCELATION";
206
+ PushNotificationType2["PUSH_UPCOMING_EVENT_REMINDER"] = "PUSH_UPCOMING_EVENT_REMINDER";
207
+ PushNotificationType2["PUSH_EVENT_CREATED"] = "PUSH_EVENT_CREATED";
208
+ return PushNotificationType2;
209
+ })(PushNotificationType || {});
210
210
  var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
211
211
  SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
212
212
  SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
@@ -217,37 +217,6 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
217
217
  SubdivisionType2["COUNTRY"] = "COUNTRY";
218
218
  return SubdivisionType2;
219
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 || {});
251
220
  var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
252
221
  OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
253
222
  OrderStatus2["FREE"] = "FREE";
@@ -278,39 +247,78 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
278
247
  FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
279
248
  return FeeType2;
280
249
  })(FeeType || {});
281
- async function resolveNotificationConfig2(notificationConfigId) {
250
+ var LocationType = /* @__PURE__ */ ((LocationType2) => {
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) {
282
279
  const { httpClient, sideEffects } = arguments[1];
283
280
  const payload = renameKeysFromSDKRequestToRESTRequest({
284
- notificationConfigId
281
+ emailNotificationType: options?.emailNotificationType,
282
+ pushNotificationType: options?.pushNotificationType,
283
+ rsvpGuest: options?.rsvpGuest,
284
+ orderGuest: options?.orderGuest,
285
+ eventGuests: options?.eventGuests,
286
+ ticketGuest: options?.ticketGuest
285
287
  });
286
- const reqOpts = resolveNotificationConfig(
288
+ const reqOpts = triggerNotification(
287
289
  payload
288
290
  );
289
291
  sideEffects?.onSiteCall?.();
290
292
  try {
291
293
  const result = await httpClient.request(reqOpts);
292
294
  sideEffects?.onSuccess?.(result);
293
- return renameKeysFromRESTResponseToSDKResponse(result.data);
294
295
  } catch (err) {
295
296
  const transformedError = sdkTransformError(
296
297
  err,
297
298
  {
298
299
  spreadPathsToArguments: {},
299
- explicitPathsToArguments: { notificationConfigId: "$[0]" },
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
+ },
300
308
  singleArgumentUnchanged: false
301
309
  },
302
- ["notificationConfigId"]
310
+ ["options"]
303
311
  );
304
312
  sideEffects?.onError?.(err);
305
313
  throw transformedError;
306
314
  }
307
315
  }
308
- async function upsertNotificationConfig2(_id, notificationConfig) {
309
- const { httpClient, sideEffects } = arguments[2];
316
+ async function resolveNotificationConfig2(notificationConfigId) {
317
+ const { httpClient, sideEffects } = arguments[1];
310
318
  const payload = renameKeysFromSDKRequestToRESTRequest({
311
- notificationConfig: { ...notificationConfig, id: _id }
319
+ notificationConfigId
312
320
  });
313
- const reqOpts = upsertNotificationConfig(
321
+ const reqOpts = resolveNotificationConfig(
314
322
  payload
315
323
  );
316
324
  sideEffects?.onSiteCall?.();
@@ -322,49 +330,38 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
322
330
  const transformedError = sdkTransformError(
323
331
  err,
324
332
  {
325
- spreadPathsToArguments: { notificationConfig: "$[1]" },
326
- explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
333
+ spreadPathsToArguments: {},
334
+ explicitPathsToArguments: { notificationConfigId: "$[0]" },
327
335
  singleArgumentUnchanged: false
328
336
  },
329
- ["_id", "notificationConfig"]
337
+ ["notificationConfigId"]
330
338
  );
331
339
  sideEffects?.onError?.(err);
332
340
  throw transformedError;
333
341
  }
334
342
  }
335
- async function triggerNotification2(options) {
336
- const { httpClient, sideEffects } = arguments[1];
343
+ async function upsertNotificationConfig2(_id, notificationConfig) {
344
+ const { httpClient, sideEffects } = arguments[2];
337
345
  const payload = renameKeysFromSDKRequestToRESTRequest({
338
- emailNotificationType: options?.emailNotificationType,
339
- pushNotificationType: options?.pushNotificationType,
340
- rsvpGuest: options?.rsvpGuest,
341
- orderGuest: options?.orderGuest,
342
- eventGuests: options?.eventGuests,
343
- ticketGuest: options?.ticketGuest
346
+ notificationConfig: { ...notificationConfig, id: _id }
344
347
  });
345
- const reqOpts = triggerNotification(
348
+ const reqOpts = upsertNotificationConfig(
346
349
  payload
347
350
  );
348
351
  sideEffects?.onSiteCall?.();
349
352
  try {
350
353
  const result = await httpClient.request(reqOpts);
351
354
  sideEffects?.onSuccess?.(result);
355
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
352
356
  } catch (err) {
353
357
  const transformedError = sdkTransformError(
354
358
  err,
355
359
  {
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
- },
360
+ spreadPathsToArguments: { notificationConfig: "$[1]" },
361
+ explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
365
362
  singleArgumentUnchanged: false
366
363
  },
367
- ["options"]
364
+ ["_id", "notificationConfig"]
368
365
  );
369
366
  sideEffects?.onError?.(err);
370
367
  throw transformedError;
@@ -372,6 +369,13 @@ async function triggerNotification2(options) {
372
369
  }
373
370
 
374
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
+ }
375
379
  function resolveNotificationConfig3(httpClient) {
376
380
  return (notificationConfigId) => resolveNotificationConfig2(
377
381
  notificationConfigId,
@@ -387,13 +391,6 @@ function upsertNotificationConfig3(httpClient) {
387
391
  { httpClient }
388
392
  );
389
393
  }
390
- function triggerNotification3(httpClient) {
391
- return (options) => triggerNotification2(
392
- options,
393
- // @ts-ignore
394
- { httpClient }
395
- );
396
- }
397
394
  var onNotificationConfigCreated = EventDefinition(
398
395
  "wix.events.notifications.v2.notification_config_created",
399
396
  true,
@@ -432,9 +429,9 @@ var onNotificationConfigUpdated = EventDefinition(
432
429
  // src/events-notifications-v2-notification-config-notifications.context.ts
433
430
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
434
431
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
432
+ var triggerNotification4 = /* @__PURE__ */ createRESTModule(triggerNotification3);
435
433
  var resolveNotificationConfig4 = /* @__PURE__ */ createRESTModule(resolveNotificationConfig3);
436
434
  var upsertNotificationConfig4 = /* @__PURE__ */ createRESTModule(upsertNotificationConfig3);
437
- var triggerNotification4 = /* @__PURE__ */ createRESTModule(triggerNotification3);
438
435
  var onNotificationConfigCreated2 = createEventModule(
439
436
  onNotificationConfigCreated
440
437
  );