{"version":3,"sources":["../../src/service-plugins-types.ts"],"sourcesContent":["export interface ValidateSubmissionRequest\n  extends ValidateSubmissionRequestActionsOneOf {\n  /** Data for updating an existing submission. */\n  updateOptions?: UpdateOptions;\n  /** Submission to validate. */\n  submission: FormSubmission;\n  /** Whether to create or update the submission. */\n  actionType: ActionType;\n}\n\n/** @oneof */\nexport interface ValidateSubmissionRequestActionsOneOf {\n  /** Data for updating an existing submission. */\n  updateOptions?: UpdateOptions;\n}\n\n/** Form submission that was created or retrieved. */\nexport interface FormSubmission {\n  /**\n   * Submission ID.\n   * @format GUID\n   * @readonly\n   */\n  _id?: string | null;\n  /**\n   * ID of the form which the submission belongs to.\n   * @format GUID\n   * @immutable\n   */\n  formId?: string;\n  /**\n   * The app which the form submissions belong to. A submission inherits the namespace from its form schema, so you can't set it directly.\n   *\n   * For example, a submission of a form visible in the Wix Forms app has the namespace `wix.form_app.form`, the namespace of the Wix Forms app, whose app ID is `225dd912-7dea-4738-8688-4b8c6955ffc2`.\n   *\n   * See a list of namespaces for [apps made by Wix](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/introduction#namespaces-of-apps-made-by-wix) section.\n   * To retrieve the ID for a Wix app, see [Apps Created By Wix](https://dev.wix.com/docs/rest/articles/get-started/apps-created-by-wix).\n   * @minLength 10\n   * @maxLength 50\n   * @readonly\n   */\n  namespace?: string;\n  /**\n   * Status of the submission.\n   *\n   * The status a submission is created with depends on the form's namespace and on whether the form collects payment, so read it from the response rather than assuming.\n   *\n   * A submission for a form that collects payment starts as `PAYMENT_WAITING`. Otherwise, most namespaces record the submission immediately as `CONFIRMED`. Namespaces that need to complete another step first, such as taking payment for a pricing plan, create the submission as `PENDING` and confirm it later with Confirm Submission.\n   *\n   * A `PENDING` submission isn't recorded yet, and is deleted automatically if it isn't confirmed in time.\n   */\n  status?: SubmissionStatus;\n  /**\n   * Values the visitor submitted.\n   *\n   * Each key is the `target` of a field in the form schema, which is the field's stable storage key rather than its ID or label. Only keys matching a field target are accepted.\n   *\n   * Each value's shape follows that field's `inputType`: `STRING` fields submit a string, `NUMBER` a number, `BOOLEAN` a boolean, and `ARRAY` an array of the selected option values. Date and time fields are strings. A choice field submits an option's `value`, not its ID or its label.\n   *\n   * 3 input types submit structured values: `ADDRESS` submits an address object, `PAYMENT` an array holding 1 product object per item bought, and `SCHEDULING` an appointment object.\n   *\n   * For the full mapping, see [About Submission Values](https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/about-submission-values).\n   */\n  submissions?: Record<string, any>;\n  /**\n   * Date and time the form submission was created.\n   * @immutable\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time the form submission was updated.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission.\n   * @readonly\n   */\n  revision?: string | null;\n  /**\n   * ID of the visitor that submitted the form.\n   * @readonly\n   */\n  submitter?: Submitter;\n  /** Whether a site owner marked a submission as \"seen\". */\n  seen?: boolean;\n  /** Data extension object that holds users' and apps' fields. */\n  extendedFields?: ExtendedFields;\n  /**\n   * Order details. <br>\n   * <b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app.\n   */\n  orderDetails?: OrderDetails;\n  /**\n   * Contact ID of a site visitor who created the submission.\n   * @format GUID\n   * @readonly\n   * @immutable\n   */\n  contactId?: string | null;\n  /**\n   * Authorized viewer ID.\n   * @format GUID\n   * @immutable\n   */\n  accessRestriction?: string | null;\n  /** Tag IDs collections associated with the current entity. */\n  tags?: PublicTags;\n  /**\n   * Appointment details.\n   * This object is only applicable when submitting a form that creates a booking appointment.\n   */\n  appointmentDetails?: AppointmentDetails;\n  /**\n   * ID of the child site the submission was made on.\n   *\n   * Only present when the form was submitted on a site that shares its data with a parent site. In that case submissions from every child site are stored on the parent site, and this field identifies which child site the submission came from.\n   * @format GUID\n   * @readonly\n   */\n  childMetaSiteId?: string | null;\n}\n\nexport enum SubmissionStatus {\n  /** A submission is created, but has not yet been recorded in the Wix Forms collection. */\n  PENDING = 'PENDING',\n  /** A submission is recorded in the Wix Forms collection. */\n  CONFIRMED = 'CONFIRMED',\n  /** A form submission requiring payment is created. */\n  PAYMENT_WAITING = 'PAYMENT_WAITING',\n  /** An order of a form submission is canceled. */\n  PAYMENT_CANCELED = 'PAYMENT_CANCELED',\n}\n\nexport interface Submitter extends SubmitterSubmitterOneOf {\n  /**\n   * Member ID.\n   * @format GUID\n   */\n  memberId?: string | null;\n  /**\n   * Visitor ID.\n   * @format GUID\n   */\n  visitorId?: string | null;\n  /**\n   * Application ID.\n   * @maxLength 36\n   */\n  applicationId?: string | null;\n  /**\n   * User ID.\n   * @format GUID\n   */\n  userId?: string | null;\n}\n\n/** @oneof */\nexport interface SubmitterSubmitterOneOf {\n  /**\n   * Member ID.\n   * @format GUID\n   */\n  memberId?: string | null;\n  /**\n   * Visitor ID.\n   * @format GUID\n   */\n  visitorId?: string | null;\n  /**\n   * Application ID.\n   * @maxLength 36\n   */\n  applicationId?: string | null;\n  /**\n   * User ID.\n   * @format GUID\n   */\n  userId?: string | null;\n}\n\nexport interface ExtendedFields {\n  /**\n   * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n   * The value of each key is structured according to the schema defined when the extended fields were configured.\n   *\n   * You can only access fields for which you have the appropriate permissions.\n   *\n   * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n   */\n  namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface OrderDetails {\n  /**\n   * ID of the order related to submission (only applicable if a form has payments).\n   * @format GUID\n   * @readonly\n   */\n  orderId?: string | null;\n  /**\n   * Order number.\n   * @readonly\n   */\n  number?: string | null;\n  /**\n   * Currency.\n   * @format CURRENCY\n   * @readonly\n   */\n  currency?: string | null;\n  /**\n   * Item subtotal.\n   * @decimalValue options { gte:0.00, maxScale:2 }\n   * @readonly\n   */\n  itemSubtotal?: string;\n  /**\n   * ID of the checkout related to submission (only applicable if a form has payments).\n   * @format GUID\n   * @readonly\n   */\n  checkoutId?: string;\n}\n\nexport interface PublicTags {\n  /** Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. */\n  tags?: TagList;\n}\n\nexport interface TagList {\n  /**\n   * List of tag IDs\n   * @maxSize 100\n   * @maxLength 5\n   */\n  tagIds?: string[];\n}\n\nexport interface AppointmentDetails {\n  /**\n   * ID of the staff member assigned to the appointment.\n   * @format GUID\n   */\n  staffMemberId?: string | null;\n  /**\n   * Name of the staff member assigned to the appointment.\n   * @minLength 1\n   * @maxLength 40\n   */\n  staffMemberName?: string | null;\n}\n\nexport enum ActionType {\n  /** Unknown action type. */\n  UNKNOWN_ACTION = 'UNKNOWN_ACTION',\n  /** Update submission. */\n  UPDATE = 'UPDATE',\n  /** Create submission. */\n  CREATE = 'CREATE',\n}\n\nexport interface UpdateOptions {\n  /** Submission to update. */\n  currentSubmission?: FormSubmission;\n}\n\nexport interface ValidateSubmissionResponse {\n  /**\n   * List of validation errors. <br>\n   * If there are no validation errors, returns an empty array.\n   * @maxSize 100\n   */\n  errors?: SubmissionValidationError[];\n}\n\nexport interface SubmissionValidationError\n  extends SubmissionValidationErrorErrorMessageOneOf {\n  /** Predefined error type. */\n  errorType?: SubmissionErrorType;\n  /**\n   * Custom error message. The message is displayed instead of an error type.\n   * @maxLength 500\n   */\n  customErrorMessage?: string;\n  /**\n   * Path indicating the source of the error, such as `form.fields.target`.\n   * @maxLength 500\n   */\n  errorPath?: string;\n  /** Additional error parameters. */\n  params?: Record<string, any> | null;\n}\n\n/** @oneof */\nexport interface SubmissionValidationErrorErrorMessageOneOf {\n  /** Predefined error type. */\n  errorType?: SubmissionErrorType;\n  /**\n   * Custom error message. The message is displayed instead of an error type.\n   * @maxLength 500\n   */\n  customErrorMessage?: string;\n}\n\nexport enum SubmissionErrorType {\n  /** Error is unknown or unsuitable for any of the options below. */\n  UNKNOWN_ERROR = 'UNKNOWN_ERROR',\n  /** Type of submitted value is incorrect. */\n  TYPE_ERROR = 'TYPE_ERROR',\n  /** Value is required to be provided. */\n  REQUIRED_VALUE_ERROR = 'REQUIRED_VALUE_ERROR',\n  /** Value contains additional properties not expected in schema. */\n  UNKNOWN_VALUE_ERROR = 'UNKNOWN_VALUE_ERROR',\n  /** Text value exceeds max length. */\n  MAX_LENGTH_ERROR = 'MAX_LENGTH_ERROR',\n  /** Text value does not reach min length. */\n  MIN_LENGTH_ERROR = 'MIN_LENGTH_ERROR',\n  /** Text value is not applicable for expected pattern. */\n  PATTERN_ERROR = 'PATTERN_ERROR',\n  /** Text value is not applicable for expected format. */\n  FORMAT_ERROR = 'FORMAT_ERROR',\n  /** Number value is too big. */\n  MAX_VALUE_ERROR = 'MAX_VALUE_ERROR',\n  /** Number value is too small. */\n  MIN_VALUE_ERROR = 'MIN_VALUE_ERROR',\n  /** Number value is not a multiple of expected number. */\n  MULTIPLE_OF_VALUE_ERROR = 'MULTIPLE_OF_VALUE_ERROR',\n  /** Array value has too many items. */\n  MIN_ITEMS_ERROR = 'MIN_ITEMS_ERROR',\n  /** Array value has not enough items. */\n  MAX_ITEMS_ERROR = 'MAX_ITEMS_ERROR',\n  /** Value is not in the list of allowed values. */\n  NOT_ALLOWED_VALUE_ERROR = 'NOT_ALLOWED_VALUE_ERROR',\n  /** Submitted form is disabled. */\n  DISABLED_FORM_ERROR = 'DISABLED_FORM_ERROR',\n  /** Country code is not correct or missing from the phone number. */\n  INVALID_PHONE_COUNTRY_CODE_ERROR = 'INVALID_PHONE_COUNTRY_CODE_ERROR',\n  /** Invalid staff member ID on appointment. */\n  INVALID_STAFF_ID_ERROR = 'INVALID_STAFF_ID_ERROR',\n  /** Invalid business location ID on appointment. */\n  INVALID_LOCATION_ID_ERROR = 'INVALID_LOCATION_ID_ERROR',\n  /** Missing service option on service picker field. */\n  MISSING_SERVICE_OPTION_ERROR = 'MISSING_SERVICE_OPTION_ERROR',\n  /** Some of the service options on service picker field are deleted or unavailable. */\n  INVALID_SERVICE_OPTIONS_ERROR = 'INVALID_SERVICE_OPTIONS_ERROR',\n  /** All of the service options on service picker field are deleted or unavailable. */\n  NO_AVAILABLE_SERVICE_OPTIONS_ERROR = 'NO_AVAILABLE_SERVICE_OPTIONS_ERROR',\n  /** Text value does not match the exact required length. */\n  EXACT_CHARACTER_LENGTH_ERROR = 'EXACT_CHARACTER_LENGTH_ERROR',\n  /** Character count is not within the required range. */\n  CHARACTER_LENGTH_RANGE_ERROR = 'CHARACTER_LENGTH_RANGE_ERROR',\n  /** Number is not within the required range. */\n  VALUE_RANGE_ERROR = 'VALUE_RANGE_ERROR',\n  /** Array value does not have the exact number of items selected. */\n  EXACT_ITEMS_NUMBER_ERROR = 'EXACT_ITEMS_NUMBER_ERROR',\n  /** Number has incorrect number of decimal places. */\n  DECIMAL_POINT_ERROR = 'DECIMAL_POINT_ERROR',\n  /** Date value is incomplete or missing required parts. */\n  INCOMPLETE_DATE_ERROR = 'INCOMPLETE_DATE_ERROR',\n  /** Value does not match the required pattern format. */\n  INVALID_VALUE_FOR_PATTERN_ERROR = 'INVALID_VALUE_FOR_PATTERN_ERROR',\n  /** No resource on the site is connected to a video conferencing provider, so the appointment's online meeting format can't be offered. */\n  NO_CONNECTED_CONFERENCING_RESOURCE_ERROR = 'NO_CONNECTED_CONFERENCING_RESOURCE_ERROR',\n}\n\nexport interface FormSubmissionSpiExtensionConfig {\n  /**\n   * Deployment URI where the endpoints are called. Wix Forms appends the endpoint path to the deployment URI.\n   * For example, to call the Validate Submission endpoint at `https://my-form-submissions.com/v1/validateSubmission`,\n   * the `deploymentUri` you provide here is `https://my-form-submissions.com/`.\n   */\n  deploymentUri?: SpiBaseUri;\n  /**\n   * Namespace names.\n   * @maxSize 10\n   */\n  namespaceConfigs?: FormsSubmissionsExtensionNamespaceConfig[];\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\nexport interface FormsSubmissionsExtensionNamespaceConfig {\n  /**\n   * The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`.\n   *\n   * Call `Get Submission` to retrieve the namespace.\n   * @minLength 10\n   * @maxLength 50\n   */\n  namespace?: string;\n  /**\n   * The ID of the specific form that will trigger the defined methods when a submission is made.\n   * This field is optional. If not provided, submissions from all forms will trigger the methods.\n   * @format GUID\n   */\n  formId?: string | null;\n  /** Enable submission validation. */\n  submissionValidationEnabled?: boolean;\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":";AA2HO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAA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