{"version":3,"sources":["../../src/service-plugins-types.ts"],"sourcesContent":["export interface ListTriggersRequest {}\n\nexport interface ListTriggersResponse {\n  /** Custom triggers. */\n  customTriggers?: ListTriggersResponseCustomTrigger[];\n}\n\nexport interface ListTriggersResponseCustomTrigger {\n  /**\n   * Custom trigger ID.\n   * @minLength 1\n   * @maxLength 100\n   */\n  _id?: string;\n  /**\n   * Custom trigger name to display in the dashboard.\n   * @minLength 1\n   * @maxLength 200\n   */\n  name?: string;\n}\n\nexport interface GetEligibleTriggersRequest {\n  /**\n   * List of line items in the cart/checkout.\n   * @maxSize 1000\n   */\n  lineItems?: LineItem[];\n  /**\n   * List of triggers to be checked for discount eligibility.\n   * @minSize 1\n   * @maxSize 1000\n   */\n  triggers?: TriggerToFilterBy[];\n  /**\n   * Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.\n   * @format GUID\n   */\n  purchaseFlowId?: string | null;\n  /** Shipping information. */\n  shippingInfo?: ShippingInfo;\n}\n\nexport interface LineItem {\n  /**\n   * Line item ID.\n   * @minLength 1\n   * @maxLength 100\n   */\n  _id?: string;\n  /**\n   * Item quantity in this line item.\n   * @max 100000\n   */\n  quantity?: number | null;\n  /**\n   * Catalog and item reference. Holds IDs for the item and the catalog it came from, as well as further optional info.\n   * This field may be empty in the case of a custom line item.\n   */\n  catalogReference?: CatalogReference;\n  /**\n   * Price of a single item.\n   * @decimalValue options { gte:0 }\n   */\n  price?: string;\n}\n\n/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */\nexport interface CatalogReference {\n  /**\n   * ID of the item within the catalog it belongs to.\n   * @minLength 1\n   * @maxLength 36\n   */\n  catalogItemId?: string;\n  /**\n   * ID of the app providing the catalog.\n   *\n   * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n   *\n   * For items from Wix catalogs, the following values always apply:\n   * + Wix Stores: `\"215238eb-22a5-4c36-9e7b-e7c08025e04e\"`\n   * + Wix Bookings: `\"13d21c63-b5ec-5912-8397-c3a5ddb27a97\"`\n   * + Wix Restaurants: `\"9a5d83fd-8570-482e-81ab-cfa88942ee60\"`\n   * @minLength 1\n   */\n  appId?: string;\n  /**\n   * Additional item details in `key:value` pairs.\n   *\n   * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n   *\n   * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\n   * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction).\n   */\n  options?: Record<string, any> | null;\n}\n\nexport interface TriggerToFilterBy {\n  /** Custom trigger info. */\n  customTrigger?: CustomTrigger;\n  /**\n   * Unique trigger identifier. The same value must be returned in `eligibleTriggers[i].identifier`.\n   * @minLength 1\n   * @maxLength 120\n   */\n  identifier?: string | null;\n}\n\nexport interface CustomTrigger {\n  /**\n   * Custom trigger ID.\n   * @minLength 1\n   * @maxLength 100\n   */\n  _id?: string;\n}\n\nexport interface ShippingInfo {\n  /** Address (if applicable). */\n  address?: Address;\n  /**\n   * Preferred shipping option code. For example, \"usps_std_overnight\".\n   * @minLength 1\n   * @maxLength 100\n   */\n  preferredShippingOptionCode?: string | null;\n}\n\nexport interface Address {\n  /**\n   * Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.\n   * @format COUNTRY\n   */\n  country?: string | null;\n  /**\n   * Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.\n   * @maxLength 50\n   */\n  subdivision?: string | null;\n  /**\n   * City name.\n   * @maxLength 50\n   */\n  city?: string | null;\n}\n\nexport interface GetEligibleTriggersResponse {\n  /**\n   * List of eligible triggers. These are used by the Discount Rules API and Wix eCommerce to apply the relevant discount.\n   * @maxSize 1000\n   */\n  eligibleTriggers?: EligibleTrigger[];\n}\n\nexport interface EligibleTrigger {\n  /**\n   * Custom trigger ID. Must be passed with relevant `identifier`.\n   * @minLength 1\n   * @maxLength 100\n   */\n  customTriggerId?: string;\n  /**\n   * Unique trigger identifier. The value must be the same as its equivalent in `triggers[i].identifier` in the request payload.\n   * @minLength 1\n   * @maxLength 120\n   */\n  identifier?: string | null;\n}\n\nexport interface CustomTriggerConfig {\n  /**\n   * Required. Base URI where the endpoints are called.\n   * Wix appends the endpoint path to the base URI. For example, to call the Get Eligible Triggers endpoint at `https://my-discount-app.com/v1/getEligibleTriggers`, the base URI you provide here is `https://my-discount-app.com/`.\n   */\n  deploymentUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n  /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n  requestId?: string | null;\n  /**\n   * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n   * @format CURRENCY\n   */\n  currency?: string | null;\n  /** An object that describes the identity that triggered this request. */\n  identity?: IdentificationData;\n  /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n  languages?: string[];\n  /**\n   * The service provider app's instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n}\n\nexport enum IdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n"],"mappings":";AAkNO,IAAK,eAAL,kBAAKA,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["IdentityType"]}