{"version":3,"sources":["../../src/service-plugins-types.ts"],"sourcesContent":["/** Request from Wix asking for a badge for a specific event. */\nexport interface GetEventBadgeRequest {\n  /**\n   * Event for which Wix is requesting a badge.\n   *\n   * Contains the event ID, title, publication date, and optional ticket summary.\n   */\n  event?: Event;\n}\n\n/** Event for which a badge is being requested. */\nexport interface Event {\n  /**\n   * Event ID.\n   * Identifies the Wix Events event being evaluated for a badge.\n   * @format GUID\n   */\n  _id?: string | null;\n  /**\n   * Event title.\n   * Contains the title configured by the site owner.\n   * @minLength 1\n   * @maxLength 120\n   */\n  title?: string | null;\n  /**\n   * Date and time the event was published.\n   * Represents the publish timestamp for the event.\n   */\n  publishedDate?: Date | null;\n  /**\n   * Summary of ticket pricing and availability for the event.\n   *\n   * Present only for ticketed events.\n   */\n  ticketsSummary?: TicketsSummary;\n}\n\n/** Snapshot of ticket pricing and availability for the event, calculated at the time of the call. */\nexport interface TicketsSummary {\n  /**\n   * Number of tickets still available for purchase across all on-sale ticket\n   * definitions on the event. Unset when availability is unlimited.\n   * @readonly\n   */\n  availableTicketsCount?: number | null;\n  /**\n   * Lowest ticket price for the event.\n   * Calculated across all ticket definitions on the event.\n   * @readonly\n   */\n  lowestTicketPrice?: Money;\n  /**\n   * Highest ticket price for the event.\n   * Calculated across all ticket definitions on the event.\n   * @readonly\n   */\n  highestTicketPrice?: Money;\n  /**\n   * Formatted lowest ticket price.\n   * Includes the event currency for site-visitor display.\n   * @maxLength 50\n   * @readonly\n   */\n  lowestTicketPriceFormatted?: string | null;\n  /**\n   * Formatted highest ticket price.\n   * Includes the event currency for site-visitor display.\n   * @maxLength 50\n   * @readonly\n   */\n  highestTicketPriceFormatted?: string | null;\n  /**\n   * Whether ticket availability is limited for this event.\n   *\n   * `false` when availability is unlimited or the event has no ticket definitions.\n   * @readonly\n   */\n  hasLimitedTickets?: boolean | null;\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}\n\n/** Response returned by your implementation. */\nexport interface GetEventBadgeResponse {\n  /**\n   * Badge returned for the event card.\n   *\n   * Omit the field, or leave it unset, when no badge applies to the event.\n   */\n  badge?: Badge;\n}\n\n/** Badge returned by the service plugin implementer for display on an event card. */\nexport interface Badge {\n  /** Rendering priority used to rank badges when multiple implementers return a badge for the same event. The downstream UI selects the badge with the highest priority and uses the implementer's most recent edit time as the tie-breaker. */\n  badgeType?: BadgeType;\n  /**\n   * Text shown on the event card. Returned as-is in whatever language the implementer chooses, with no translation by Wix.\n   * @maxLength 50\n   */\n  text?: string | null;\n}\n\n/** Rendering priority bucket used by the storefront UI to rank multiple badges on the same event. */\nexport enum BadgeType {\n  /** Highest priority. Use for badges that should outrank all others, such as \"Sold out\" or \"Cancelled\". */\n  FIRST_PRIORITY = 'FIRST_PRIORITY',\n  /** Medium priority. Use for major contextual labels, such as \"Selling fast\" or \"Early bird\". */\n  SECOND_PRIORITY = 'SECOND_PRIORITY',\n  /** Lowest priority. Use for nice-to-have hints, such as \"New\" or \"Featured\". */\n  THIRD_PRIORITY = 'THIRD_PRIORITY',\n}\n\n/** Configuration provided when installing the Event Badges service plugin extension. */\nexport interface EventBadgesSpiConfig {\n  /**\n   * Base URI where the service plugin implementation is deployed.\n   *\n   * Wix appends the method path to this URI when calling the implementation.\n   */\n  baseUri?: SpiBaseUri;\n  /**\n   * List of event IDs this extension applies to.\n   *\n   * When empty, Wix considers the extension applicable to every event on the site.\n   * @maxSize 100\n   * @format GUID\n   */\n  eventId?: string[];\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   * Extension ID in Dev Center.\n   * @internal\n   * @maxLength 256\n   */\n  appExtensionId?: string | null;\n  /**\n   * Extension type in Dev Center.\n   * @internal\n   * @maxLength 256\n   */\n  appExtensionType?: string | null;\n  /**\n   * Invoked function.\n   * @internal\n   * @maxLength 256\n   */\n  functionName?: 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":";AAwHO,IAAK,YAAL,kBAAKA,eAAL;AAEL,EAAAA,WAAA,oBAAiB;AAEjB,EAAAA,WAAA,qBAAkB;AAElB,EAAAA,WAAA,oBAAiB;AANP,SAAAA;AAAA,GAAA;AA6GL,IAAK,eAAL,kBAAKC,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":["BadgeType","IdentityType"]}