{"version":3,"sources":["../../src/ping-notifications-v3-notification-notifications-v-3.http.ts","../../src/ping-notifications-v3-notification-notifications-v-3.types.ts","../../src/ping-notifications-v3-notification-notifications-v-3.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 resolveComWixpressPingHubApiV3NotificationsServiceV3Url(\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-v-3';\n\n/**\n * Sends notifications based on the template and dynamic values provided.\n *\n * > **Note**: An app can call this method up to 100,000 times per month for each site.\n *\n * When you create a [notification template](https://dev.wix.com/docs/rest/business-management/notifications/notifications/creating-a-notification-template), you are provided with a notification template ID. Call the Notify method with this ID as `notificationTemplateID` to trigger notifications based on that template.\n *\n * If the notification template contains placeholders for dynamic values, provide those values as key-value pairs in the `dynamicValues` array. The values you specify are incorporated in the notifications sent out.\n */\nexport function notify(payload: object): RequestOptionsFactory<any> {\n  function __notify({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ping.notifications.v3.notification',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.ping.hub.api.v3.NotificationsServiceV3.Notify',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressPingHubApiV3NotificationsServiceV3Url({\n        protoPath: '/v3/notify',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __notify;\n}\n","export interface Notification {\n  /**\n   * The id of the notification\n   * @immutable\n   */\n  id?: string;\n}\n\nexport interface NotifyRequest {\n  /**\n   * Notification template ID. A notification template specifies the text and recipients for notifications.\n   * To obtain a notification template ID, create a notification template in your [app's dashboard](https://dev.wix.com/docs/build-apps/develop-your-app/app-dashboard-setup/about-the-app-dashboard).\n   * @format GUID\n   */\n  notificationTemplateId: string;\n  /**\n   * Each key is a placeholder name you specify when creating a notification template.\n   * The value is an object containing the text to replace the placeholder in the notifications.\n   */\n  dynamicValues?: Record<string, DynamicValue>;\n}\n\nexport interface DynamicValue extends DynamicValueOfTypeOneOf {\n  /** Text to be integrated into the notification. */\n  text?: string;\n}\n\n/** @oneof */\nexport interface DynamicValueOfTypeOneOf {\n  /** Text to be integrated into the notification. */\n  text?: string;\n}\n\n/**\n * Money.\n * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.\n */\nexport interface Money {\n  /**\n   * Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.\n   * @format DECIMAL_VALUE\n   */\n  value?: string;\n  /**\n   * Currency code. Must be valid ISO 4217 currency code (e.g., USD).\n   * @format CURRENCY\n   */\n  currency?: string;\n  /** Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. */\n  formattedValue?: string | null;\n}\n\nexport interface MapDynamicValue {\n  /** items */\n  items?: Record<string, DynamicValue>;\n}\n\nexport interface ArrayDynamicValue {\n  /**\n   * items\n   * @maxSize 100\n   */\n  items?: DynamicValue[];\n}\n\nexport interface AttachmentDynamicValue {\n  /** file name */\n  fileName?: string;\n  /** download url */\n  downloadUrl?: string;\n}\n\nexport interface NotifyResponse {\n  /** ID of the batch of notifications triggered by one request. */\n  notificationBatchId?: string;\n}\n\nexport interface NotifyByAppRequest {\n  /**\n   * notification_template_id\n   * @format GUID\n   */\n  notificationTemplateId?: string;\n  /**\n   * app_def_id\n   * @format GUID\n   */\n  appDefId?: string;\n  /** dynamic_values */\n  dynamicValues?: Record<string, DynamicValue>;\n  /** template tenant */\n  templateTenant?: string | null;\n  /** overrides */\n  overrides?: Overrides;\n  /** channels content */\n  channelsData?: ChannelsData;\n}\n\nexport interface Overrides {\n  /**\n   * excluded_channels\n   * @maxSize 20\n   */\n  excludedChannels?: TemplateChannelWithLiterals[];\n  /** excluded_audiences */\n  excludedAudiences?: ExcludedAudiences;\n  /** content overrides */\n  content?: ChannelsContent;\n}\n\nexport enum TemplateChannel {\n  WEB_FEED = 'WEB_FEED',\n  MOBILE_FEED = 'MOBILE_FEED',\n  MOBILE_PUSH = 'MOBILE_PUSH',\n  BROWSER = 'BROWSER',\n  SMS = 'SMS',\n  EMAIL = 'EMAIL',\n  KAFKA = 'KAFKA',\n  VOICE = 'VOICE',\n}\n\n/** @enumType */\nexport type TemplateChannelWithLiterals =\n  | TemplateChannel\n  | 'WEB_FEED'\n  | 'MOBILE_FEED'\n  | 'MOBILE_PUSH'\n  | 'BROWSER'\n  | 'SMS'\n  | 'EMAIL'\n  | 'KAFKA'\n  | 'VOICE';\n\nexport interface ExcludedAudiences {\n  /**\n   * audience_key\n   * @maxSize 20\n   */\n  audienceKey?: string[];\n}\n\nexport interface ChannelsContent {\n  /** mobile push override */\n  mobileContent?: MobileContent;\n}\n\nexport interface MobileContent {\n  /** title override of mobile push content */\n  title?: string;\n  /** body override of mobile push content */\n  body?: string;\n}\n\nexport interface ChannelsData {\n  /** email data */\n  emailData?: EmailData;\n}\n\nexport interface EmailData {\n  /** shoutout action config */\n  shoutoutActionConfig?: Record<string, any> | null;\n}\n\nexport interface NotifyByAppResponse {\n  /** notification_batch_id */\n  notificationBatchId?: string;\n}\n\nexport interface ResolveRequest {\n  /**\n   * template id\n   * @format GUID\n   */\n  notificationTemplateId?: string;\n  /** values */\n  dynamicValues?: Record<string, DynamicValue>;\n}\n\nexport interface ResolveResponse {}\n","import * as ambassadorWixPingNotificationsV3Notification from './ping-notifications-v3-notification-notifications-v-3.http.js';\nimport * as ambassadorWixPingNotificationsV3NotificationTypes from './ping-notifications-v3-notification-notifications-v-3.types.js';\nimport * as ambassadorWixPingNotificationsV3NotificationUniversalTypes from './ping-notifications-v3-notification-notifications-v-3.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  ambassadorWixPingNotificationsV3NotificationUniversalTypes.NotifyRequest,\n  ambassadorWixPingNotificationsV3NotificationTypes.NotifyRequest,\n  ambassadorWixPingNotificationsV3NotificationUniversalTypes.NotifyResponse,\n  ambassadorWixPingNotificationsV3NotificationTypes.NotifyResponse\n> {\n  const payload = {} as any;\n\n  const getRequestOptions =\n    ambassadorWixPingNotificationsV3Notification.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: '/v3/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  Notification as NotificationOriginal,\n  NotifyRequest as NotifyRequestOriginal,\n  DynamicValue as DynamicValueOriginal,\n  DynamicValueOfTypeOneOf as DynamicValueOfTypeOneOfOriginal,\n  Money as MoneyOriginal,\n  MapDynamicValue as MapDynamicValueOriginal,\n  ArrayDynamicValue as ArrayDynamicValueOriginal,\n  AttachmentDynamicValue as AttachmentDynamicValueOriginal,\n  NotifyResponse as NotifyResponseOriginal,\n  NotifyByAppRequest as NotifyByAppRequestOriginal,\n  Overrides as OverridesOriginal,\n  TemplateChannel as TemplateChannelOriginal,\n  TemplateChannelWithLiterals as TemplateChannelWithLiteralsOriginal,\n  ExcludedAudiences as ExcludedAudiencesOriginal,\n  ChannelsContent as ChannelsContentOriginal,\n  MobileContent as MobileContentOriginal,\n  ChannelsData as ChannelsDataOriginal,\n  EmailData as EmailDataOriginal,\n  NotifyByAppResponse as NotifyByAppResponseOriginal,\n  ResolveRequest as ResolveRequestOriginal,\n  ResolveResponse as ResolveResponseOriginal,\n} from './ping-notifications-v3-notification-notifications-v-3.types.js';\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,wDACP,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,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