{"version":3,"sources":["../../src/ping-notifications-v1-public-notification-notifications.http.ts","../../src/ping-notifications-v1-public-notification-notifications.types.ts","../../src/ping-notifications-v1-public-notification-notifications.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPingHubApiPublicNotificationsServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/notifications-hub-server',\n        destPath: '',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/ping/hub',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/ping/notifications',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/ping/hub',\n        destPath: '',\n      },\n      {\n        srcPath: '/_api/ping/notifications',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/notifications/v3/notify',\n        destPath: '/v3/notify',\n      },\n      {\n        srcPath: '/notifications/v2/notify',\n        destPath: '/v2/notifications/notify',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/ping/notifications/v3/notify',\n        destPath: '/v3/notify',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/ping/notifications/v3/notify',\n        destPath: '/v3/notify',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_notifications_notifications';\n\n/**\n * Sends a notification.\n *\n *\n * The `notify()` function sends a [notification](https://support.wix.com/en/article/about-your-dashboard-notifications) to the specified recipients on the specified channels.\n *\n * List the the channels for the notification in the `channels` parameter .\n *\n * List the recipients for the notification in the `toContacts`, `toSiteContributors`, and `toTopicsSubscribers` parameters.\n */\nexport function notify(payload: object): RequestOptionsFactory<any> {\n  function __notify({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ping.notifications.v1.public_notification',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.ping.hub.api.PublicNotificationsService.Notify',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressPingHubApiPublicNotificationsServiceUrl({\n        protoPath: '/api/v1/notify',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __notify;\n}\n","export interface Public_notification {\n  /** Notification ID. */\n  id?: string | null;\n}\n\nexport interface PublicNotifyRequest\n  extends PublicNotifyRequestRecipientsFilterOneOf,\n    PublicNotifyRequestActionTargetOneOf {\n  /** Send to [site contributors]((https://support.wix.com/en/article/roles-permissions-overview)). This includes site administrators, website managers, and back office managers. */\n  toSiteContributors?: ToSiteContributors;\n  /** Send to [site contacts](https://support.wix.com/en/article/about-your-contact-list). */\n  toContacts?: ToContacts;\n  /**\n   * Send to site members who subscribed to a [notification topic](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/notifications/add-notification-extensions#step-1--create-a-notification-topic-extension).\n   * @internal\n   */\n  toTopicsSubscribers?: ToTopicsSubscribers;\n  /** External URL to open when the notification action is clicked. */\n  targetUrl?: string | null;\n  /** Dashboard page to open when the notification action is clicked. */\n  targetDashboardPage?: DashboardPagesWithLiterals;\n  /** Title of the notification. */\n  title?: string | null;\n  /** Body of the notification. This contains the main content of the notification. */\n  body?: string | null;\n  /** Title of the notification action. Clicking the action refers the user to a target URL or a dashboard page. */\n  action?: string | null;\n  /**\n   * Channel through which users receive the notification.\n   * @maxSize 20\n   */\n  channels?: ChannelWithLiterals[];\n}\n\n/** @oneof */\nexport interface PublicNotifyRequestRecipientsFilterOneOf {\n  /** Send to [site contributors]((https://support.wix.com/en/article/roles-permissions-overview)). This includes site administrators, website managers, and back office managers. */\n  toSiteContributors?: ToSiteContributors;\n  /** Send to [site contacts](https://support.wix.com/en/article/about-your-contact-list). */\n  toContacts?: ToContacts;\n  /**\n   * Send to site members who subscribed to a [notification topic](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/notifications/add-notification-extensions#step-1--create-a-notification-topic-extension).\n   * @internal\n   */\n  toTopicsSubscribers?: ToTopicsSubscribers;\n}\n\n/** @oneof */\nexport interface PublicNotifyRequestActionTargetOneOf {\n  /** External URL to open when the notification action is clicked. */\n  targetUrl?: string | null;\n  /** Dashboard page to open when the notification action is clicked. */\n  targetDashboardPage?: DashboardPagesWithLiterals;\n}\n\nexport interface ToSiteContributors {\n  /** Role assigned to site contributors. Only contributors with the specified roles receive the notification. */\n  withRole?: RoleWithLiterals;\n}\n\nexport enum Role {\n  /** All site contributors. */\n  All_Contributors = 'All_Contributors',\n  /** Site owner only. */\n  Owner = 'Owner',\n}\n\n/** @enumType */\nexport type RoleWithLiterals = Role | 'All_Contributors' | 'Owner';\n\nexport interface ToContacts {\n  /**\n   * Contacts that receive the notification.\n   * @format GUID\n   * @maxSize 1000\n   */\n  contactIds?: string[];\n}\n\nexport interface ToTopicsSubscribers {\n  /**\n   * Notification topics to which the recipients have subscribed. Only contacts who subscribed to the specified topics receive the notification.\n   * @maxSize 100\n   */\n  topics?: string[];\n  /**\n   * Excluded contact IDs. Contacts with these IDs don't receive the notification.\n   * @maxSize 1000\n   */\n  excludedContactIds?: string[];\n}\n\nexport enum Channel {\n  /** No default channel. */\n  Undefined = 'Undefined',\n  /** Site dashboard. */\n  Dashboard = 'Dashboard',\n  /** [Wix Owner](https://www.wix.com/mobile/wix-app) mobile app. */\n  Mobile = 'Mobile',\n  /** Active browser. Supported on Chrome and Safari only. */\n  Browser = 'Browser',\n}\n\n/** @enumType */\nexport type ChannelWithLiterals =\n  | Channel\n  | 'Undefined'\n  | 'Dashboard'\n  | 'Mobile'\n  | 'Browser';\n\nexport enum DashboardPages {\n  Undefined_Page = 'Undefined_Page',\n  /** Site dashboard home. */\n  Home = 'Home',\n}\n\n/** @enumType */\nexport type DashboardPagesWithLiterals =\n  | DashboardPages\n  | 'Undefined_Page'\n  | 'Home';\n\nexport interface Empty {}\n","import * as ambassadorWixPingNotificationsV1PublicNotification from './ping-notifications-v1-public-notification-notifications.http.js';\nimport * as ambassadorWixPingNotificationsV1PublicNotificationTypes from './ping-notifications-v1-public-notification-notifications.types.js';\nimport * as ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes from './ping-notifications-v1-public-notification-notifications.universal.js';\n\nexport type __PublicMethodMetaInfo<\n  K = string,\n  M = unknown,\n  T = unknown,\n  S = unknown,\n  Q = unknown,\n  R = unknown\n> = {\n  getUrl: (context: any) => string;\n  httpMethod: K;\n  path: string;\n  pathParams: M;\n  __requestType: T;\n  __originalRequestType: S;\n  __responseType: Q;\n  __originalResponseType: R;\n};\n\nexport function notify(): __PublicMethodMetaInfo<\n  'POST',\n  {},\n  ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes.PublicNotifyRequest,\n  ambassadorWixPingNotificationsV1PublicNotificationTypes.PublicNotifyRequest,\n  ambassadorWixPingNotificationsV1PublicNotificationUniversalTypes.Empty,\n  ambassadorWixPingNotificationsV1PublicNotificationTypes.Empty\n> {\n  const payload = {} as any;\n\n  const getRequestOptions =\n    ambassadorWixPingNotificationsV1PublicNotification.notify(payload);\n\n  const getUrl = (context: any): string => {\n    const { url } = getRequestOptions(context);\n    return url!;\n  };\n\n  return {\n    getUrl,\n    httpMethod: 'POST',\n    path: '/api/v1/notify',\n    pathParams: {},\n    __requestType: null as any,\n    __originalRequestType: null as any,\n    __responseType: null as any,\n    __originalResponseType: null as any,\n  };\n}\n\nexport {\n  Public_notification as Public_notificationOriginal,\n  PublicNotifyRequest as PublicNotifyRequestOriginal,\n  PublicNotifyRequestRecipientsFilterOneOf as PublicNotifyRequestRecipientsFilterOneOfOriginal,\n  PublicNotifyRequestActionTargetOneOf as PublicNotifyRequestActionTargetOneOfOriginal,\n  ToSiteContributors as ToSiteContributorsOriginal,\n  Role as RoleOriginal,\n  RoleWithLiterals as RoleWithLiteralsOriginal,\n  ToContacts as ToContactsOriginal,\n  ToTopicsSubscribers as ToTopicsSubscribersOriginal,\n  Channel as ChannelOriginal,\n  ChannelWithLiterals as ChannelWithLiteralsOriginal,\n  DashboardPages as DashboardPagesOriginal,\n  DashboardPagesWithLiterals as DashboardPagesWithLiteralsOriginal,\n  Empty as EmptyOriginal,\n} from './ping-notifications-v1-public-notification-notifications.types.js';\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,0DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAYd,SAAS,OAAO,SAA6C;AAClE,WAAS,SAAS,EAAE,KAAK,GAAQ;AAC/B,UAAM,WAAW;AAAA,MACf,YAAY;AAA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