{"version":3,"sources":["../../src/service-plugins-types.ts"],"sourcesContent":["export interface ApplyPointsLimitRequest {\n  /**\n   * Loyalty account of the contact who would earn points. If the contact\n   * doesn't have a loyalty account yet, all `points` totals on the account\n   * are `0`.\n   */\n  account?: LoyaltyAccount;\n  /**\n   * ID of the contact who would earn loyalty points for the order.\n   * @format GUID\n   */\n  contactId?: string | null;\n  /**\n   * Number of loyalty points the contact would earn for the order before any\n   * limit is applied.\n   * @min 1\n   * @max 9999999\n   */\n  pointsToEarn?: number | null;\n  /**\n   * Total number of loyalty points the contact has earned since the start of\n   * the current calendar month, in UTC.\n   */\n  earnedThisMonth?: number | null;\n  /**\n   * Total number of loyalty points the contact has earned since the start of\n   * the current calendar year, in UTC.\n   */\n  earnedThisYear?: number | null;\n}\n\n/**\n * Subset of a contact's loyalty account information passed to service plugin\n * implementers.\n */\nexport interface LoyaltyAccount {\n  /**\n   * Loyalty account ID.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string;\n  /**\n   * Points balance and totals for the loyalty account.\n   * @readonly\n   */\n  points?: Points;\n  /**\n   * Whether the contact has enough points to redeem at least one reward\n   * available on the site.\n   * @readonly\n   */\n  rewardAvailable?: boolean;\n  /**\n   * Date and time the loyalty account was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n}\n\n/** Loyalty points balance and totals for a loyalty account. */\nexport interface Points {\n  /**\n   * Current points balance available to spend.\n   * @readonly\n   */\n  balance?: number | null;\n  /**\n   * Total number of points the contact has earned over the lifetime of the\n   * account.\n   * @readonly\n   */\n  earned?: number | null;\n  /**\n   * Total number of points the contact has redeemed over the lifetime of the\n   * account.\n   * @readonly\n   */\n  redeemed?: number | null;\n  /**\n   * Total points adjustments the site owner has applied to the account over\n   * its lifetime.\n   * @readonly\n   */\n  adjusted?: number | null;\n  /**\n   * Total number of points that have expired in the account over its lifetime.\n   * @readonly\n   */\n  expired?: number | null;\n}\n\nexport interface ApplyPointsLimitResponse {\n  /**\n   * Number of points to assign for the order, after applying the limit logic.\n   * Must be less than or equal to `pointsToEarn`. Higher values are capped at\n   * `pointsToEarn`. Set to `0` to block the contact from earning points for\n   * the order. Leave unset to assign `pointsToEarn` unchanged.\n   * @max 9999999\n   */\n  adjustedPointsToEarn?: number | null;\n}\n\n/** Configuration provided by each installed implementer of the service plugin. */\nexport interface EarnPointsLimitProviderConfig {\n  /**\n   * Base URI where the implementer is deployed. Wix sends `ApplyPointsLimit`\n   * requests to this URI.\n   */\n  baseUri?: SpiBaseUri;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n  /**\n   * Base URI for your service plugin. Wix appends each method's path to this URI.\n   *\n   * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n   * @minLength 6\n   * @maxLength 2048\n   */\n  baseUri?: string;\n  /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n  alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n  /**\n   * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n   * @minLength 3\n   * @maxLength 128\n   */\n  methodName?: string;\n  /**\n   * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n   *\n   * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\n   * @minLength 6\n   * @maxLength 2048\n   */\n  absoluteUri?: 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":";AAgLO,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"]}