@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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +9 -9
  2. package/build/cjs/index.js +99 -99
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +956 -956
  5. package/build/cjs/index.typings.js +91 -91
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +610 -610
  8. package/build/cjs/meta.js +77 -77
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +9 -9
  11. package/build/es/index.mjs +99 -99
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +956 -956
  14. package/build/es/index.typings.mjs +91 -91
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +610 -610
  17. package/build/es/meta.mjs +77 -77
  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 +99 -99
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +956 -956
  23. package/build/internal/cjs/index.typings.js +91 -91
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +610 -610
  26. package/build/internal/cjs/meta.js +77 -77
  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 +99 -99
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +956 -956
  32. package/build/internal/es/index.typings.mjs +91 -91
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +610 -610
  35. package/build/internal/es/meta.mjs +77 -77
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -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 resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
60
+ function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
61
61
  const domainToMappings = {
62
62
  "api._api_base_domain_": [
63
63
  {
@@ -90,7 +90,7 @@ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
90
90
  };
91
91
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
92
92
  }
93
- function resolveWixEventsNotificationsV2NotificationServiceUrl(opts) {
93
+ function resolveWixEventsNotificationsV2NotificationConfigManagementUrl(opts) {
94
94
  const domainToMappings = {
95
95
  "api._api_base_domain_": [
96
96
  {
@@ -124,27 +124,6 @@ function resolveWixEventsNotificationsV2NotificationServiceUrl(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
- }
148
127
  function resolveNotificationConfig(payload) {
149
128
  function __resolveNotificationConfig({ host }) {
150
129
  const metadata = {
@@ -218,6 +197,27 @@ function upsertNotificationConfig(payload) {
218
197
  }
219
198
  return __upsertNotificationConfig;
220
199
  }
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,14 +241,11 @@ var EmailNotificationReminderTime = /* @__PURE__ */ ((EmailNotificationReminderT
241
241
  EmailNotificationReminderTime2["BEFORE_30_MINUTES"] = "BEFORE_30_MINUTES";
242
242
  return EmailNotificationReminderTime2;
243
243
  })(EmailNotificationReminderTime || {});
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 || {});
244
+ var LocationType = /* @__PURE__ */ ((LocationType2) => {
245
+ LocationType2["VENUE"] = "VENUE";
246
+ LocationType2["ONLINE"] = "ONLINE";
247
+ return LocationType2;
248
+ })(LocationType || {});
252
249
  var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
253
250
  SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
254
251
  SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
@@ -259,6 +256,37 @@ var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
259
256
  SubdivisionType2["COUNTRY"] = "COUNTRY";
260
257
  return SubdivisionType2;
261
258
  })(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 || {});
262
290
  var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
263
291
  OrderStatus2["NA_ORDER_STATUS"] = "NA_ORDER_STATUS";
264
292
  OrderStatus2["FREE"] = "FREE";
@@ -289,78 +317,39 @@ var FeeType = /* @__PURE__ */ ((FeeType2) => {
289
317
  FeeType2["FEE_ADDED_AT_CHECKOUT"] = "FEE_ADDED_AT_CHECKOUT";
290
318
  return FeeType2;
291
319
  })(FeeType || {});
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) {
320
+ async function resolveNotificationConfig2(notificationConfigId) {
321
321
  const { httpClient, sideEffects } = arguments[1];
322
322
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
323
- emailNotificationType: options?.emailNotificationType,
324
- pushNotificationType: options?.pushNotificationType,
325
- rsvpGuest: options?.rsvpGuest,
326
- orderGuest: options?.orderGuest,
327
- eventGuests: options?.eventGuests,
328
- ticketGuest: options?.ticketGuest
323
+ notificationConfigId
329
324
  });
330
- const reqOpts = triggerNotification(
325
+ const reqOpts = resolveNotificationConfig(
331
326
  payload
332
327
  );
333
328
  sideEffects?.onSiteCall?.();
334
329
  try {
335
330
  const result = await httpClient.request(reqOpts);
336
331
  sideEffects?.onSuccess?.(result);
332
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
337
333
  } catch (err) {
338
334
  const transformedError = (0, import_transform_error.transformError)(
339
335
  err,
340
336
  {
341
337
  spreadPathsToArguments: {},
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
- },
338
+ explicitPathsToArguments: { notificationConfigId: "$[0]" },
350
339
  singleArgumentUnchanged: false
351
340
  },
352
- ["options"]
341
+ ["notificationConfigId"]
353
342
  );
354
343
  sideEffects?.onError?.(err);
355
344
  throw transformedError;
356
345
  }
357
346
  }
358
- async function resolveNotificationConfig2(notificationConfigId) {
359
- const { httpClient, sideEffects } = arguments[1];
347
+ async function upsertNotificationConfig2(_id, notificationConfig) {
348
+ const { httpClient, sideEffects } = arguments[2];
360
349
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
361
- notificationConfigId
350
+ notificationConfig: { ...notificationConfig, id: _id }
362
351
  });
363
- const reqOpts = resolveNotificationConfig(
352
+ const reqOpts = upsertNotificationConfig(
364
353
  payload
365
354
  );
366
355
  sideEffects?.onSiteCall?.();
@@ -372,38 +361,49 @@ async function resolveNotificationConfig2(notificationConfigId) {
372
361
  const transformedError = (0, import_transform_error.transformError)(
373
362
  err,
374
363
  {
375
- spreadPathsToArguments: {},
376
- explicitPathsToArguments: { notificationConfigId: "$[0]" },
364
+ spreadPathsToArguments: { notificationConfig: "$[1]" },
365
+ explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
377
366
  singleArgumentUnchanged: false
378
367
  },
379
- ["notificationConfigId"]
368
+ ["_id", "notificationConfig"]
380
369
  );
381
370
  sideEffects?.onError?.(err);
382
371
  throw transformedError;
383
372
  }
384
373
  }
385
- async function upsertNotificationConfig2(_id, notificationConfig) {
386
- const { httpClient, sideEffects } = arguments[2];
374
+ async function triggerNotification2(options) {
375
+ const { httpClient, sideEffects } = arguments[1];
387
376
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
388
- notificationConfig: { ...notificationConfig, id: _id }
377
+ emailNotificationType: options?.emailNotificationType,
378
+ pushNotificationType: options?.pushNotificationType,
379
+ rsvpGuest: options?.rsvpGuest,
380
+ orderGuest: options?.orderGuest,
381
+ eventGuests: options?.eventGuests,
382
+ ticketGuest: options?.ticketGuest
389
383
  });
390
- const reqOpts = upsertNotificationConfig(
384
+ const reqOpts = triggerNotification(
391
385
  payload
392
386
  );
393
387
  sideEffects?.onSiteCall?.();
394
388
  try {
395
389
  const result = await httpClient.request(reqOpts);
396
390
  sideEffects?.onSuccess?.(result);
397
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
398
391
  } catch (err) {
399
392
  const transformedError = (0, import_transform_error.transformError)(
400
393
  err,
401
394
  {
402
- spreadPathsToArguments: { notificationConfig: "$[1]" },
403
- explicitPathsToArguments: { "notificationConfig.id": "$[0]" },
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
+ },
404
404
  singleArgumentUnchanged: false
405
405
  },
406
- ["_id", "notificationConfig"]
406
+ ["options"]
407
407
  );
408
408
  sideEffects?.onError?.(err);
409
409
  throw transformedError;
@@ -411,13 +411,6 @@ async function upsertNotificationConfig2(_id, notificationConfig) {
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
- }
421
414
  function resolveNotificationConfig3(httpClient) {
422
415
  return (notificationConfigId) => resolveNotificationConfig2(
423
416
  notificationConfigId,
@@ -433,6 +426,13 @@ function upsertNotificationConfig3(httpClient) {
433
426
  { httpClient }
434
427
  );
435
428
  }
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);
475
474
  var resolveNotificationConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(resolveNotificationConfig3);
476
475
  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
  );