@wix/notifications 1.0.19 → 1.0.20

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 (40) hide show
  1. package/build/cjs/context.d.ts +1 -0
  2. package/build/cjs/context.js +28 -0
  3. package/build/cjs/context.js.map +1 -0
  4. package/build/cjs/index.js +5 -1
  5. package/build/cjs/index.js.map +1 -1
  6. package/build/cjs/index.typings.js +5 -1
  7. package/build/cjs/index.typings.js.map +1 -1
  8. package/build/cjs/meta.js +5 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/src/ping-notifications-v1-public-notification.context.d.ts +3 -0
  11. package/build/cjs/src/ping-notifications-v1-public-notification.context.js +16 -0
  12. package/build/cjs/src/ping-notifications-v1-public-notification.context.js.map +1 -0
  13. package/build/cjs/src/ping-notifications-v1-public-notification.http.d.ts +10 -1
  14. package/build/cjs/src/ping-notifications-v1-public-notification.http.js +12 -11
  15. package/build/cjs/src/ping-notifications-v1-public-notification.http.js.map +1 -1
  16. package/build/cjs/src/ping-notifications-v1-public-notification.meta.d.ts +1 -1
  17. package/build/cjs/src/ping-notifications-v1-public-notification.meta.js +5 -1
  18. package/build/cjs/src/ping-notifications-v1-public-notification.meta.js.map +1 -1
  19. package/build/cjs/src/ping-notifications-v1-public-notification.public.d.ts +1 -1
  20. package/build/cjs/src/ping-notifications-v1-public-notification.types.js +3 -3
  21. package/build/cjs/src/ping-notifications-v1-public-notification.types.js.map +1 -1
  22. package/build/cjs/src/ping-notifications-v1-public-notification.universal.d.ts +74 -28
  23. package/build/cjs/src/ping-notifications-v1-public-notification.universal.js +42 -12
  24. package/build/cjs/src/ping-notifications-v1-public-notification.universal.js.map +1 -1
  25. package/build/es/context.d.ts +1 -0
  26. package/build/es/context.js +2 -0
  27. package/build/es/context.js.map +1 -0
  28. package/build/es/src/ping-notifications-v1-public-notification.context.d.ts +3 -0
  29. package/build/es/src/ping-notifications-v1-public-notification.context.js +12 -0
  30. package/build/es/src/ping-notifications-v1-public-notification.context.js.map +1 -0
  31. package/build/es/src/ping-notifications-v1-public-notification.http.d.ts +10 -1
  32. package/build/es/src/ping-notifications-v1-public-notification.http.js +12 -11
  33. package/build/es/src/ping-notifications-v1-public-notification.http.js.map +1 -1
  34. package/build/es/src/ping-notifications-v1-public-notification.meta.d.ts +1 -1
  35. package/build/es/src/ping-notifications-v1-public-notification.public.d.ts +1 -1
  36. package/build/es/src/ping-notifications-v1-public-notification.universal.d.ts +74 -28
  37. package/build/es/src/ping-notifications-v1-public-notification.universal.js +35 -9
  38. package/build/es/src/ping-notifications-v1-public-notification.universal.js.map +1 -1
  39. package/context/package.json +6 -0
  40. package/package.json +12 -6
@@ -0,0 +1 @@
1
+ export * as notifications from './src/ping-notifications-v1-public-notification.context';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.notifications = void 0;
27
+ exports.notifications = __importStar(require("./src/ping-notifications-v1-public-notification.context"));
28
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yGAAyF"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,wGAAwF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wGAAwF"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2GAA2F"}
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2GAA2F"}
package/build/cjs/meta.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,sGAAsF"}
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sGAAsF"}
@@ -0,0 +1,3 @@
1
+ import { notify as publicNotify } from './ping-notifications-v1-public-notification.public';
2
+ import { BuildRESTFunction } from '@wix/sdk-types';
3
+ export declare const notify: BuildRESTFunction<typeof publicNotify>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.notify = void 0;
4
+ const ping_notifications_v1_public_notification_public_1 = require("./ping-notifications-v1-public-notification.public");
5
+ const notify = (...args) => {
6
+ // @ts-expect-error
7
+ if (!globalThis.__wix_context__) {
8
+ throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
9
+ }
10
+ // @ts-expect-error
11
+ return globalThis.__wix_context__
12
+ .initWixModules(ping_notifications_v1_public_notification_public_1.notify)
13
+ .apply(undefined, args);
14
+ };
15
+ exports.notify = notify;
16
+ //# sourceMappingURL=ping-notifications-v1-public-notification.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.context.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.context.ts"],"names":[],"mappings":";;;AAAA,yHAA4F;AAGrF,MAAM,MAAM,GAA2C,CAC5D,GAAG,IAAS,EACZ,EAAE;IACF,mBAAmB;IACnB,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,mBAAmB;IACnB,OAAO,UAAU,CAAC,eAAe;SAC9B,cAAc,CAAC,yDAAY,CAAC;SAC5B,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC;AAbW,QAAA,MAAM,UAajB"}
@@ -1,4 +1,13 @@
1
1
  import { RequestOptionsFactory } from '@wix/sdk-types';
2
2
  import { PublicNotifyRequest, Empty } from './ping-notifications-v1-public-notification.types';
3
- /** This endpoint allows you to send notifications */
3
+ /**
4
+ * Sends a notification.
5
+ *
6
+ *
7
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
8
+ *
9
+ * List the the channels for the notification in the `channels` parameter .
10
+ *
11
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
12
+ */
4
13
  export declare function notify(payload: PublicNotifyRequest): RequestOptionsFactory<Empty>;
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.notify = void 0;
4
- const ambassador_1 = require("@wix/metro-runtime/ambassador");
5
4
  const metro_runtime_1 = require("@wix/metro-runtime");
6
- const _empty = {};
7
- const _publicNotifyRequest = {};
8
5
  function resolveComWixpressPingHubApiPublicNotificationsServiceUrl(opts) {
9
6
  const domainToMappings = {
10
7
  'api._api_base_domain_': [
@@ -42,27 +39,31 @@ function resolveComWixpressPingHubApiPublicNotificationsServiceUrl(opts) {
42
39
  };
43
40
  return (0, metro_runtime_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
44
41
  }
45
- /** This endpoint allows you to send notifications */
42
+ /**
43
+ * Sends a notification.
44
+ *
45
+ *
46
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
47
+ *
48
+ * List the the channels for the notification in the `channels` parameter .
49
+ *
50
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
51
+ */
46
52
  function notify(payload) {
47
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_publicNotifyRequest, {});
48
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_empty, {});
49
53
  function __notify({ host }) {
50
- const serializedData = toReq(payload);
51
54
  const metadata = {
52
55
  entityFqdn: 'wix.ping.notifications.v1.public_notification',
53
56
  method: 'POST',
54
57
  methodFqn: 'com.wixpress.ping.hub.api.PublicNotificationsService.Notify',
55
58
  url: resolveComWixpressPingHubApiPublicNotificationsServiceUrl({
56
59
  protoPath: '/api/v1/notify',
57
- data: serializedData,
60
+ data: payload,
58
61
  host,
59
62
  }),
60
- data: serializedData,
61
- transformResponse: fromRes,
63
+ data: payload,
62
64
  };
63
65
  return metadata;
64
66
  }
65
- __notify.fromReq = fromReq;
66
67
  return __notify;
67
68
  }
68
69
  exports.notify = notify;
@@ -1 +1 @@
1
- {"version":3,"file":"ping-notifications-v1-public-notification.http.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;AAQhD,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SA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aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC;AA9BD,wBA8BC"}
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.http.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.http.ts"],"names":[],"mappings":";;;AAAA,sDAAgD;AAQhD,SAAS,yDAAyD,CAChE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,2BAA2B;gBACpC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,YAAY;aACvB;SACF;KACF,CAAC;IAEF,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,MAAM,CACpB,OAA4B;IAE5B,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAO;QAC7B,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,+CAA+C;YAC3D,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,6DAA6D;YACxE,GAAG,EAAE,yDAAyD,CAAC;gBAC7D,SAAS,EAAE,gBAAgB;gBAC3B,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AApBD,wBAoBC"}
@@ -1,6 +1,6 @@
1
1
  import * as ambassadorWixPingNotificationsV1PublicNotificationTypes from './ping-notifications-v1-public-notification.types';
2
2
  import * as ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes from './ping-notifications-v1-public-notification.universal';
3
- export declare type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
4
  getUrl: (context: any) => string;
5
5
  httpMethod: K;
6
6
  path: string;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"ping-notifications-v1-public-notification.meta.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qIAAuH;AAsBvH,SAAgB,MAAM;IAQpB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,kDAAkD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA5BD,wBA4BC"}
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.meta.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qIAAuH;AAsBvH,SAAgB,MAAM;IAQpB,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,kDAAkD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA5BD,wBA4BC"}
@@ -3,6 +3,6 @@ import { Channel, NotifyOptions } from './ping-notifications-v1-public-notificat
3
3
  export declare const __metadata: {
4
4
  PACKAGE_NAME: string;
5
5
  };
6
- export declare function notify(httpClient: HttpClient): (body: string | null, channels: Channel[], options?: NotifyOptions | undefined) => Promise<void>;
6
+ export declare function notify(httpClient: HttpClient): (body: string | null, channels: Channel[], options?: NotifyOptions) => Promise<void>;
7
7
  export { Role, Channel, DashboardPages, } from './ping-notifications-v1-public-notification.universal';
8
8
  export { Public_notification, PublicNotifyRequest, PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf, ToSiteContributors, ToContacts, ToTopicsSubscribers, Empty, NotifyOptions, } from './ping-notifications-v1-public-notification.universal';
@@ -7,7 +7,7 @@ var Role;
7
7
  Role["All_Contributors"] = "All_Contributors";
8
8
  /** Only the owner */
9
9
  Role["Owner"] = "Owner";
10
- })(Role = exports.Role || (exports.Role = {}));
10
+ })(Role || (exports.Role = Role = {}));
11
11
  var Channel;
12
12
  (function (Channel) {
13
13
  /** No Default Channel - need to expilicitly decide on channel */
@@ -18,11 +18,11 @@ var Channel;
18
18
  Channel["Mobile"] = "Mobile";
19
19
  /** Browser push to the active browser (Chrome/Safari only) */
20
20
  Channel["Browser"] = "Browser";
21
- })(Channel = exports.Channel || (exports.Channel = {}));
21
+ })(Channel || (exports.Channel = Channel = {}));
22
22
  var DashboardPages;
23
23
  (function (DashboardPages) {
24
24
  DashboardPages["Undefined_Page"] = "Undefined_Page";
25
25
  /** goes to business manager home */
26
26
  DashboardPages["Home"] = "Home";
27
- })(DashboardPages = exports.DashboardPages || (exports.DashboardPages = {}));
27
+ })(DashboardPages || (exports.DashboardPages = DashboardPages = {}));
28
28
  //# sourceMappingURL=ping-notifications-v1-public-notification.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ping-notifications-v1-public-notification.types.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.types.ts"],"names":[],"mappings":";;;AAmDA,IAAY,IAKX;AALD,WAAY,IAAI;IACd,qCAAqC;IACrC,6CAAqC,CAAA;IACrC,qBAAqB;IACrB,uBAAe,CAAA;AACjB,CAAC,EALW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAKf;AAcD,IAAY,OASX;AATD,WAAY,OAAO;IACjB,iEAAiE;IACjE,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,4BAAiB,CAAA;IACjB,8DAA8D;IAC9D,8BAAmB,CAAA;AACrB,CAAC,EATW,OAAO,GAAP,eAAO,KAAP,eAAO,QASlB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mDAAiC,CAAA;IACjC,oCAAoC;IACpC,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.types.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.types.ts"],"names":[],"mappings":";;;AAmDA,IAAY,IAKX;AALD,WAAY,IAAI;IACd,qCAAqC;IACrC,6CAAqC,CAAA;IACrC,qBAAqB;IACrB,uBAAe,CAAA;AACjB,CAAC,EALW,IAAI,oBAAJ,IAAI,QAKf;AAcD,IAAY,OASX;AATD,WAAY,OAAO;IACjB,iEAAiE;IACjE,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,4BAAiB,CAAA;IACjB,8DAA8D;IAC9D,8BAAmB,CAAA;AACrB,CAAC,EATW,OAAO,uBAAP,OAAO,QASlB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mDAAiC,CAAA;IACjC,oCAAoC;IACpC,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB"}
@@ -9,43 +9,66 @@ export interface Public_notification {
9
9
  _id?: string | null;
10
10
  }
11
11
  export interface PublicNotifyRequest extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
12
- /** Send to site contributors */
12
+ /** List of site contributors to notify. */
13
13
  toSiteContributors?: ToSiteContributors;
14
- /** Send to contacts */
14
+ /** List of contacts to notify. */
15
15
  toContacts?: ToContacts;
16
- /** Send to topic subscribers */
16
+ /** Notify contacts who are subscribed to specific topics. */
17
17
  toTopicsSubscribers?: ToTopicsSubscribers;
18
- /** an open url as an action target */
18
+ /** URL to navigate to when the `action` text is clicked. */
19
19
  targetUrl?: string | null;
20
- /** target_dashboard_page */
20
+ /** URL of Dashboard page to navigate to when the `action` text is clicked. */
21
21
  targetDashboardPage?: DashboardPages;
22
- /** The title of the notification */
22
+ /**
23
+ * Notification title. Only displayed on mobile and browser notifications.
24
+ *
25
+ * Max: 512 characters
26
+ */
23
27
  title?: string | null;
24
- /** The body of the notification */
28
+ /**
29
+ * Contents of the notification.
30
+ *
31
+ * Max: 512 characters
32
+ */
25
33
  body?: string | null;
26
- /** The Action of the notification */
34
+ /**
35
+ * Clickable text that links to the `targetUrl` or `targetDashboardPage`. For example, "Click this!".
36
+ *
37
+ * Max: 512 characters
38
+ */
27
39
  action?: string | null;
28
- /** The channel to which send the notification */
40
+ /**
41
+ * The channels to send the notification on. One or more of:
42
+ *
43
+ * - `"Mobile"`: Sends the notification to the Wix App.
44
+ * - `"Dashboard"`: Sends the notification to the contributor's Wix Dashboard.
45
+ * - `"Browser"`: Sends the notification to the contributor's browser.
46
+ */
29
47
  channels?: Channel[];
30
48
  }
31
49
  /** @oneof */
32
50
  export interface PublicNotifyRequestRecipientsFilterOneOf {
33
- /** Send to site contributors */
51
+ /** List of site contributors to notify. */
34
52
  toSiteContributors?: ToSiteContributors;
35
- /** Send to contacts */
53
+ /** List of contacts to notify. */
36
54
  toContacts?: ToContacts;
37
- /** Send to topic subscribers */
55
+ /** Notify contacts who are subscribed to specific topics. */
38
56
  toTopicsSubscribers?: ToTopicsSubscribers;
39
57
  }
40
58
  /** @oneof */
41
59
  export interface PublicNotifyRequestActionTargetOneOf {
42
- /** an open url as an action target */
60
+ /** URL to navigate to when the `action` text is clicked. */
43
61
  targetUrl?: string | null;
44
- /** target_dashboard_page */
62
+ /** URL of Dashboard page to navigate to when the `action` text is clicked. */
45
63
  targetDashboardPage?: DashboardPages;
46
64
  }
47
65
  export interface ToSiteContributors {
48
- /** with_role */
66
+ /**
67
+ * Roles to receive the notification. One of:
68
+ *
69
+ * - `"All_Contributors"`: All site contributors (default).
70
+ * - `"Owner"`: Only the site owner.
71
+ */
49
72
  withRole?: Role;
50
73
  }
51
74
  export declare enum Role {
@@ -55,13 +78,13 @@ export declare enum Role {
55
78
  Owner = "Owner"
56
79
  }
57
80
  export interface ToContacts {
58
- /** contact_ids */
81
+ /** List of contact IDs. */
59
82
  contactIds?: string[];
60
83
  }
61
84
  export interface ToTopicsSubscribers {
62
- /** topics */
85
+ /** List of topics. */
63
86
  topics?: string[];
64
- /** excluded_contact_ids */
87
+ /** List of contact IDs to exclude from notification. */
65
88
  excludedContactIds?: string[];
66
89
  }
67
90
  export declare enum Channel {
@@ -82,28 +105,51 @@ export declare enum DashboardPages {
82
105
  export interface Empty {
83
106
  }
84
107
  /**
85
- * This endpoint allows you to send notifications
86
- * @param body - The body of the notification
87
- * @param channels - The channel to which send the notification
108
+ * Sends a notification.
109
+ *
110
+ *
111
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
112
+ *
113
+ * List the the channels for the notification in the `channels` parameter .
114
+ *
115
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
88
116
  * @public
89
117
  * @documentationMaturity preview
90
118
  * @requiredField body
91
119
  * @requiredField channels
120
+ * @param options - Notification options.
121
+ * @param body - The body of the notification.
122
+ *
123
+ * Max: 512 characters
124
+ * @param channels - The channels to send the notification on. One or more of:
125
+ *
126
+ * - `"Mobile"`: Sends the notification to the Wix App.
127
+ * - `"Dashboard"`: Sends the notification to the contributor's Wix Dashboard.
128
+ * - `"Browser"`: Sends the notification to the contributor's browser.
129
+ * @returns Fulfilled when the send notification request is received.
92
130
  */
93
131
  export declare function notify(body: string | null, channels: Channel[], options?: NotifyOptions): Promise<void>;
94
132
  export interface NotifyOptions extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
95
- /** Send to site contributors */
133
+ /** List of site contributors to notify. */
96
134
  toSiteContributors?: ToSiteContributors;
97
- /** Send to contacts */
135
+ /** List of contacts to notify. */
98
136
  toContacts?: ToContacts;
99
- /** Send to topic subscribers */
137
+ /** Notify contacts who are subscribed to specific topics. */
100
138
  toTopicsSubscribers?: ToTopicsSubscribers;
101
- /** The title of the notification */
139
+ /**
140
+ * Notification title. Only displayed on mobile and browser notifications.
141
+ *
142
+ * Max: 512 characters
143
+ */
102
144
  title?: string | null;
103
- /** The Action of the notification */
145
+ /**
146
+ * Clickable text that links to the `targetUrl` or `targetDashboardPage`. For example, "Click this!".
147
+ *
148
+ * Max: 512 characters
149
+ */
104
150
  action?: string | null;
105
- /** an open url as an action target */
151
+ /** URL to navigate to when the `action` text is clicked. */
106
152
  targetUrl?: string | null;
107
- /** target_dashboard_page */
153
+ /** URL of Dashboard page to navigate to when the `action` text is clicked. */
108
154
  targetDashboardPage?: DashboardPages;
109
155
  }
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -30,6 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30
34
  Object.defineProperty(exports, "__esModule", { value: true });
31
35
  exports.notify = exports.DashboardPages = exports.Channel = exports.Role = exports.__debug = void 0;
32
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
33
38
  const ambassadorWixPingNotificationsV1PublicNotification = __importStar(require("./ping-notifications-v1-public-notification.http"));
34
39
  let __verbose = false;
35
40
  function __log(...args) {
@@ -52,7 +57,7 @@ var Role;
52
57
  Role["All_Contributors"] = "All_Contributors";
53
58
  /** Only the owner */
54
59
  Role["Owner"] = "Owner";
55
- })(Role = exports.Role || (exports.Role = {}));
60
+ })(Role || (exports.Role = Role = {}));
56
61
  var Channel;
57
62
  (function (Channel) {
58
63
  /** No Default Channel - need to expilicitly decide on channel */
@@ -63,23 +68,38 @@ var Channel;
63
68
  Channel["Mobile"] = "Mobile";
64
69
  /** Browser push to the active browser (Chrome/Safari only) */
65
70
  Channel["Browser"] = "Browser";
66
- })(Channel = exports.Channel || (exports.Channel = {}));
71
+ })(Channel || (exports.Channel = Channel = {}));
67
72
  var DashboardPages;
68
73
  (function (DashboardPages) {
69
74
  DashboardPages["Undefined_Page"] = "Undefined_Page";
70
75
  /** goes to business manager home */
71
76
  DashboardPages["Home"] = "Home";
72
- })(DashboardPages = exports.DashboardPages || (exports.DashboardPages = {}));
77
+ })(DashboardPages || (exports.DashboardPages = DashboardPages = {}));
73
78
  const _empty = {};
74
79
  const _publicNotifyRequest = {};
75
80
  /**
76
- * This endpoint allows you to send notifications
77
- * @param body - The body of the notification
78
- * @param channels - The channel to which send the notification
81
+ * Sends a notification.
82
+ *
83
+ *
84
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
85
+ *
86
+ * List the the channels for the notification in the `channels` parameter .
87
+ *
88
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
79
89
  * @public
80
90
  * @documentationMaturity preview
81
91
  * @requiredField body
82
92
  * @requiredField channels
93
+ * @param options - Notification options.
94
+ * @param body - The body of the notification.
95
+ *
96
+ * Max: 512 characters
97
+ * @param channels - The channels to send the notification on. One or more of:
98
+ *
99
+ * - `"Mobile"`: Sends the notification to the Wix App.
100
+ * - `"Dashboard"`: Sends the notification to the contributor's Wix Dashboard.
101
+ * - `"Browser"`: Sends the notification to the contributor's browser.
102
+ * @returns Fulfilled when the send notification request is received.
83
103
  */
84
104
  function notify(body, channels, options) {
85
105
  var _a, _b, _c;
@@ -125,11 +145,21 @@ function notify(body, channels, options) {
125
145
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
126
146
  }
127
147
  catch (err) {
128
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
129
- 'body',
130
- 'channels',
131
- 'options',
132
- ]);
148
+ const transformedError = (0, transform_error_1.transformError)(err, {
149
+ spreadPathsToArguments: {},
150
+ explicitPathsToArguments: {
151
+ body: '$[0]',
152
+ channels: '$[1]',
153
+ toSiteContributors: '$[2].toSiteContributors',
154
+ toContacts: '$[2].toContacts',
155
+ toTopicsSubscribers: '$[2].toTopicsSubscribers',
156
+ title: '$[2].title',
157
+ action: '$[2].action',
158
+ targetUrl: '$[2].targetUrl',
159
+ targetDashboardPage: '$[2].targetDashboardPage',
160
+ },
161
+ singleArgumentUnchanged: false,
162
+ }, ['body', 'channels', 'options']);
133
163
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
134
164
  throw transformedError;
135
165
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ping-notifications-v1-public-notification.universal.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,qIAAuH;AAEvH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC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E;gBAClE,MAAM;gBACN,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AAjED,wBAiEC"}
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.universal.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqD;AACrD,sEAAuF;AAEvF,qIAAuH;AAEvH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AA4E5B,IAAY,IAKX;AALD,WAAY,IAAI;IACd,qCAAqC;IACrC,6CAAqC,CAAA;IACrC,qBAAqB;IACrB,uBAAe,CAAA;AACjB,CAAC,EALW,IAAI,oBAAJ,IAAI,QAKf;AAcD,IAAY,OASX;AATD,WAAY,OAAO;IACjB,iEAAiE;IACjE,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,kCAAuB,CAAA;IACvB,4BAA4B;IAC5B,4BAAiB,CAAA;IACjB,8DAA8D;IAC9D,8BAAmB,CAAA;AACrB,CAAC,EATW,OAAO,uBAAP,O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,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAE/D,MAAM,OAAO,GACX,kDAAkD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAErE,KAAK,CAAC,kCAAkC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE9D,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,2DAAI,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,4DAAG,MAAM,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;gBACE,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE;oBACxB,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,MAAM;oBAChB,kBAAkB,EAAE,yBAAyB;oBAC7C,UAAU,EAAE,iBAAiB;oBAC7B,mBAAmB,EAAE,0BAA0B;oBAC/C,KAAK,EAAE,YAAY;oBACnB,MAAM,EAAE,aAAa;oBACrB,SAAS,EAAE,gBAAgB;oBAC3B,mBAAmB,EAAE,0BAA0B;iBAChD;gBACD,uBAAuB,EAAE,KAAK;aAC/B,EACD,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAChC,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF;AA/ED,wBA+EC"}
@@ -0,0 +1 @@
1
+ export * as notifications from './src/ping-notifications-v1-public-notification.context';
@@ -0,0 +1,2 @@
1
+ export * as notifications from './src/ping-notifications-v1-public-notification.context';
2
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,yDAAyD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { notify as publicNotify } from './ping-notifications-v1-public-notification.public';
2
+ import { BuildRESTFunction } from '@wix/sdk-types';
3
+ export declare const notify: BuildRESTFunction<typeof publicNotify>;
@@ -0,0 +1,12 @@
1
+ import { notify as publicNotify } from './ping-notifications-v1-public-notification.public';
2
+ export const notify = (...args) => {
3
+ // @ts-expect-error
4
+ if (!globalThis.__wix_context__) {
5
+ throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
6
+ }
7
+ // @ts-expect-error
8
+ return globalThis.__wix_context__
9
+ .initWixModules(publicNotify)
10
+ .apply(undefined, args);
11
+ };
12
+ //# sourceMappingURL=ping-notifications-v1-public-notification.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.context.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAG5F,MAAM,CAAC,MAAM,MAAM,GAA2C,CAC5D,GAAG,IAAS,EACZ,EAAE;IACF,mBAAmB;IACnB,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IACD,mBAAmB;IACnB,OAAO,UAAU,CAAC,eAAe;SAC9B,cAAc,CAAC,YAAY,CAAC;SAC5B,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC"}
@@ -1,4 +1,13 @@
1
1
  import { RequestOptionsFactory } from '@wix/sdk-types';
2
2
  import { PublicNotifyRequest, Empty } from './ping-notifications-v1-public-notification.types';
3
- /** This endpoint allows you to send notifications */
3
+ /**
4
+ * Sends a notification.
5
+ *
6
+ *
7
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
8
+ *
9
+ * List the the channels for the notification in the `channels` parameter .
10
+ *
11
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
12
+ */
4
13
  export declare function notify(payload: PublicNotifyRequest): RequestOptionsFactory<Empty>;
@@ -1,7 +1,4 @@
1
- import { serializer } from '@wix/metro-runtime/ambassador';
2
1
  import { resolveUrl } from '@wix/metro-runtime';
3
- const _empty = {};
4
- const _publicNotifyRequest = {};
5
2
  function resolveComWixpressPingHubApiPublicNotificationsServiceUrl(opts) {
6
3
  const domainToMappings = {
7
4
  'api._api_base_domain_': [
@@ -39,27 +36,31 @@ function resolveComWixpressPingHubApiPublicNotificationsServiceUrl(opts) {
39
36
  };
40
37
  return resolveUrl(Object.assign(opts, { domainToMappings }));
41
38
  }
42
- /** This endpoint allows you to send notifications */
39
+ /**
40
+ * Sends a notification.
41
+ *
42
+ *
43
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
44
+ *
45
+ * List the the channels for the notification in the `channels` parameter .
46
+ *
47
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
48
+ */
43
49
  export function notify(payload) {
44
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_publicNotifyRequest, {});
45
- const { fromJSON: fromRes } = serializer(_empty, {});
46
50
  function __notify({ host }) {
47
- const serializedData = toReq(payload);
48
51
  const metadata = {
49
52
  entityFqdn: 'wix.ping.notifications.v1.public_notification',
50
53
  method: 'POST',
51
54
  methodFqn: 'com.wixpress.ping.hub.api.PublicNotificationsService.Notify',
52
55
  url: resolveComWixpressPingHubApiPublicNotificationsServiceUrl({
53
56
  protoPath: '/api/v1/notify',
54
- data: serializedData,
57
+ data: payload,
55
58
  host,
56
59
  }),
57
- data: serializedData,
58
- transformResponse: fromRes,
60
+ data: payload,
59
61
  };
60
62
  return metadata;
61
63
  }
62
- __notify.fromReq = fromReq;
63
64
  return __notify;
64
65
  }
65
66
  //# sourceMappingURL=ping-notifications-v1-public-notification.http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ping-notifications-v1-public-notification.http.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQhD,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,yDAAyD,CAChE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,2BAA2B;gBACpC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,YAAY;aACvB;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,MAAM,CACpB,OAA4B;IAE5B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CACrD,oBAAoB,EACpB,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAErD,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAO;QAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,+CAA+C;YAC3D,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,6DAA6D;YACxE,GAAG,EAAE,yDAAyD,CAAC;gBAC7D,SAAS,EAAE,gBAAgB;gBAC3B,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.http.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQhD,SAAS,yDAAyD,CAChE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,2BAA2B;gBACpC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,YAAY;aACvB;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CACpB,OAA4B;IAE5B,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAO;QAC7B,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,+CAA+C;YAC3D,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,6DAA6D;YACxE,GAAG,EAAE,yDAAyD,CAAC;gBAC7D,SAAS,EAAE,gBAAgB;gBAC3B,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as ambassadorWixPingNotificationsV1PublicNotificationTypes from './ping-notifications-v1-public-notification.types';
2
2
  import * as ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes from './ping-notifications-v1-public-notification.universal';
3
- export declare type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
4
  getUrl: (context: any) => string;
5
5
  httpMethod: K;
6
6
  path: string;
@@ -3,6 +3,6 @@ import { Channel, NotifyOptions } from './ping-notifications-v1-public-notificat
3
3
  export declare const __metadata: {
4
4
  PACKAGE_NAME: string;
5
5
  };
6
- export declare function notify(httpClient: HttpClient): (body: string | null, channels: Channel[], options?: NotifyOptions | undefined) => Promise<void>;
6
+ export declare function notify(httpClient: HttpClient): (body: string | null, channels: Channel[], options?: NotifyOptions) => Promise<void>;
7
7
  export { Role, Channel, DashboardPages, } from './ping-notifications-v1-public-notification.universal';
8
8
  export { Public_notification, PublicNotifyRequest, PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf, ToSiteContributors, ToContacts, ToTopicsSubscribers, Empty, NotifyOptions, } from './ping-notifications-v1-public-notification.universal';
@@ -9,43 +9,66 @@ export interface Public_notification {
9
9
  _id?: string | null;
10
10
  }
11
11
  export interface PublicNotifyRequest extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
12
- /** Send to site contributors */
12
+ /** List of site contributors to notify. */
13
13
  toSiteContributors?: ToSiteContributors;
14
- /** Send to contacts */
14
+ /** List of contacts to notify. */
15
15
  toContacts?: ToContacts;
16
- /** Send to topic subscribers */
16
+ /** Notify contacts who are subscribed to specific topics. */
17
17
  toTopicsSubscribers?: ToTopicsSubscribers;
18
- /** an open url as an action target */
18
+ /** URL to navigate to when the `action` text is clicked. */
19
19
  targetUrl?: string | null;
20
- /** target_dashboard_page */
20
+ /** URL of Dashboard page to navigate to when the `action` text is clicked. */
21
21
  targetDashboardPage?: DashboardPages;
22
- /** The title of the notification */
22
+ /**
23
+ * Notification title. Only displayed on mobile and browser notifications.
24
+ *
25
+ * Max: 512 characters
26
+ */
23
27
  title?: string | null;
24
- /** The body of the notification */
28
+ /**
29
+ * Contents of the notification.
30
+ *
31
+ * Max: 512 characters
32
+ */
25
33
  body?: string | null;
26
- /** The Action of the notification */
34
+ /**
35
+ * Clickable text that links to the `targetUrl` or `targetDashboardPage`. For example, "Click this!".
36
+ *
37
+ * Max: 512 characters
38
+ */
27
39
  action?: string | null;
28
- /** The channel to which send the notification */
40
+ /**
41
+ * The channels to send the notification on. One or more of:
42
+ *
43
+ * - `"Mobile"`: Sends the notification to the Wix App.
44
+ * - `"Dashboard"`: Sends the notification to the contributor's Wix Dashboard.
45
+ * - `"Browser"`: Sends the notification to the contributor's browser.
46
+ */
29
47
  channels?: Channel[];
30
48
  }
31
49
  /** @oneof */
32
50
  export interface PublicNotifyRequestRecipientsFilterOneOf {
33
- /** Send to site contributors */
51
+ /** List of site contributors to notify. */
34
52
  toSiteContributors?: ToSiteContributors;
35
- /** Send to contacts */
53
+ /** List of contacts to notify. */
36
54
  toContacts?: ToContacts;
37
- /** Send to topic subscribers */
55
+ /** Notify contacts who are subscribed to specific topics. */
38
56
  toTopicsSubscribers?: ToTopicsSubscribers;
39
57
  }
40
58
  /** @oneof */
41
59
  export interface PublicNotifyRequestActionTargetOneOf {
42
- /** an open url as an action target */
60
+ /** URL to navigate to when the `action` text is clicked. */
43
61
  targetUrl?: string | null;
44
- /** target_dashboard_page */
62
+ /** URL of Dashboard page to navigate to when the `action` text is clicked. */
45
63
  targetDashboardPage?: DashboardPages;
46
64
  }
47
65
  export interface ToSiteContributors {
48
- /** with_role */
66
+ /**
67
+ * Roles to receive the notification. One of:
68
+ *
69
+ * - `"All_Contributors"`: All site contributors (default).
70
+ * - `"Owner"`: Only the site owner.
71
+ */
49
72
  withRole?: Role;
50
73
  }
51
74
  export declare enum Role {
@@ -55,13 +78,13 @@ export declare enum Role {
55
78
  Owner = "Owner"
56
79
  }
57
80
  export interface ToContacts {
58
- /** contact_ids */
81
+ /** List of contact IDs. */
59
82
  contactIds?: string[];
60
83
  }
61
84
  export interface ToTopicsSubscribers {
62
- /** topics */
85
+ /** List of topics. */
63
86
  topics?: string[];
64
- /** excluded_contact_ids */
87
+ /** List of contact IDs to exclude from notification. */
65
88
  excludedContactIds?: string[];
66
89
  }
67
90
  export declare enum Channel {
@@ -82,28 +105,51 @@ export declare enum DashboardPages {
82
105
  export interface Empty {
83
106
  }
84
107
  /**
85
- * This endpoint allows you to send notifications
86
- * @param body - The body of the notification
87
- * @param channels - The channel to which send the notification
108
+ * Sends a notification.
109
+ *
110
+ *
111
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
112
+ *
113
+ * List the the channels for the notification in the `channels` parameter .
114
+ *
115
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
88
116
  * @public
89
117
  * @documentationMaturity preview
90
118
  * @requiredField body
91
119
  * @requiredField channels
120
+ * @param options - Notification options.
121
+ * @param body - The body of the notification.
122
+ *
123
+ * Max: 512 characters
124
+ * @param channels - The channels to send the notification on. One or more of:
125
+ *
126
+ * - `"Mobile"`: Sends the notification to the Wix App.
127
+ * - `"Dashboard"`: Sends the notification to the contributor's Wix Dashboard.
128
+ * - `"Browser"`: Sends the notification to the contributor's browser.
129
+ * @returns Fulfilled when the send notification request is received.
92
130
  */
93
131
  export declare function notify(body: string | null, channels: Channel[], options?: NotifyOptions): Promise<void>;
94
132
  export interface NotifyOptions extends PublicNotifyRequestRecipientsFilterOneOf, PublicNotifyRequestActionTargetOneOf {
95
- /** Send to site contributors */
133
+ /** List of site contributors to notify. */
96
134
  toSiteContributors?: ToSiteContributors;
97
- /** Send to contacts */
135
+ /** List of contacts to notify. */
98
136
  toContacts?: ToContacts;
99
- /** Send to topic subscribers */
137
+ /** Notify contacts who are subscribed to specific topics. */
100
138
  toTopicsSubscribers?: ToTopicsSubscribers;
101
- /** The title of the notification */
139
+ /**
140
+ * Notification title. Only displayed on mobile and browser notifications.
141
+ *
142
+ * Max: 512 characters
143
+ */
102
144
  title?: string | null;
103
- /** The Action of the notification */
145
+ /**
146
+ * Clickable text that links to the `targetUrl` or `targetDashboardPage`. For example, "Click this!".
147
+ *
148
+ * Max: 512 characters
149
+ */
104
150
  action?: string | null;
105
- /** an open url as an action target */
151
+ /** URL to navigate to when the `action` text is clicked. */
106
152
  targetUrl?: string | null;
107
- /** target_dashboard_page */
153
+ /** URL of Dashboard page to navigate to when the `action` text is clicked. */
108
154
  targetDashboardPage?: DashboardPages;
109
155
  }
@@ -7,7 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { serializer, transformError } from '@wix/metro-runtime/velo';
10
+ import { serializer } from '@wix/metro-runtime/velo';
11
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
11
12
  import * as ambassadorWixPingNotificationsV1PublicNotification from './ping-notifications-v1-public-notification.http';
12
13
  let __verbose = false;
13
14
  function __log(...args) {
@@ -51,13 +52,28 @@ export var DashboardPages;
51
52
  const _empty = {};
52
53
  const _publicNotifyRequest = {};
53
54
  /**
54
- * This endpoint allows you to send notifications
55
- * @param body - The body of the notification
56
- * @param channels - The channel to which send the notification
55
+ * Sends a notification.
56
+ *
57
+ *
58
+ * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.
59
+ *
60
+ * List the the channels for the notification in the `channels` parameter .
61
+ *
62
+ * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.
57
63
  * @public
58
64
  * @documentationMaturity preview
59
65
  * @requiredField body
60
66
  * @requiredField channels
67
+ * @param options - Notification options.
68
+ * @param body - The body of the notification.
69
+ *
70
+ * Max: 512 characters
71
+ * @param channels - The channels to send the notification on. One or more of:
72
+ *
73
+ * - `"Mobile"`: Sends the notification to the Wix App.
74
+ * - `"Dashboard"`: Sends the notification to the contributor's Wix Dashboard.
75
+ * - `"Browser"`: Sends the notification to the contributor's browser.
76
+ * @returns Fulfilled when the send notification request is received.
61
77
  */
62
78
  export function notify(body, channels, options) {
63
79
  var _a, _b, _c;
@@ -103,11 +119,21 @@ export function notify(body, channels, options) {
103
119
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
104
120
  }
105
121
  catch (err) {
106
- const transformedError = transformError(err, requestTransformation, [
107
- 'body',
108
- 'channels',
109
- 'options',
110
- ]);
122
+ const transformedError = sdkTransformError(err, {
123
+ spreadPathsToArguments: {},
124
+ explicitPathsToArguments: {
125
+ body: '$[0]',
126
+ channels: '$[1]',
127
+ toSiteContributors: '$[2].toSiteContributors',
128
+ toContacts: '$[2].toContacts',
129
+ toTopicsSubscribers: '$[2].toTopicsSubscribers',
130
+ title: '$[2].title',
131
+ action: '$[2].action',
132
+ targetUrl: '$[2].targetUrl',
133
+ targetDashboardPage: '$[2].targetDashboardPage',
134
+ },
135
+ singleArgumentUnchanged: false,
136
+ }, ['body', 'channels', 'options']);
111
137
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
112
138
  throw transformedError;
113
139
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ping-notifications-v1-public-notification.universal.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,kDAAkD,MAAM,kDAAkD,CAAC;AAEvH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAqD5B,MAAM,CAAN,IAAY,IAKX;AALD,WAAY,IAAI;IACd,qCAAqC;IACrC,6CAAqC,CAAA;IACrC,qBAAqB;IACrB,uBAAe,CAAA;AACjB,CAAC,EALW,IAAI,KAAJ,IAAI,QAKf;AAcD,M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AAM;YAClB,UAAU,EAAE,EAAE;YACd,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAE;gBACT,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAE/D,MAAM,OAAO,GACX,kDAAkD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAErE,KAAK,CAAC,kCAAkC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE9D,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;SAClC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,MAAM;gBACN,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
1
+ {"version":3,"file":"ping-notifications-v1-public-notification.universal.js","sourceRoot":"","sources":["../../../src/ping-notifications-v1-public-notification.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,KAAK,kDAAkD,MAAM,kDAAkD,CAAC;AAEvH,IAAI,SAAS,GAAG,KA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WAAW,CAAE,SAAS,4DAAG,MAAM,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;gBACE,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE;oBACxB,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,MAAM;oBAChB,kBAAkB,EAAE,yBAAyB;oBAC7C,UAAU,EAAE,iBAAiB;oBAC7B,mBAAmB,EAAE,0BAA0B;oBAC/C,KAAK,EAAE,YAAY;oBACnB,MAAM,EAAE,aAAa;oBACrB,SAAS,EAAE,gBAAgB;oBAC3B,mBAAmB,EAAE,0BAA0B;iBAChD;gBACD,uBAAuB,EAAE,KAAK;aAC/B,EACD,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAChC,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF"}
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../build/es/context.js",
4
+ "main": "../build/cjs/context.js",
5
+ "typings": "../build/cjs/context.d.ts"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/notifications",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -12,12 +12,18 @@
12
12
  "files": [
13
13
  "build",
14
14
  "frontend/package.json",
15
- "meta"
15
+ "meta",
16
+ "context"
16
17
  ],
17
18
  "dependencies": {
18
- "@wix/metro-runtime": "^1.0.0",
19
- "@wix/motion-edm-autogen-query-wrapper": "^1.0.0",
20
- "@wix/sdk-types": "^1.0.0"
19
+ "@wix/metro-runtime": "^1.1528.0",
20
+ "@wix/sdk-types": "^1.5.3",
21
+ "@wix/sdk-runtime": "^0.2.7",
22
+ "@wix/motion-edm-autogen-query-wrapper": "^1.0.37"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.3.2",
26
+ "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz"
21
27
  },
22
28
  "scripts": {
23
29
  "build": "tsc -b tsconfig.json tsconfig.esm.json",
@@ -29,5 +35,5 @@
29
35
  "groupId": "com.wixpress.public-sdk-autogen"
30
36
  }
31
37
  },
32
- "falconPackageHash": "1cf134568a11c401bf514999b183a0c24f7a5a734896845b6aa6bf6e"
38
+ "falconPackageHash": "4595bd0be8aa35a2c3bae9e199ac95f747bdf0e72c799914516cf9d8"
33
39
  }