@wix/auto_sdk_forms_form-submissions 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +2 -2
- package/build/cjs/index.js +0 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -2
- package/build/cjs/index.typings.js +0 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/{interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.ts → interfaces-forms-v4-submission-extension.public-BbcLa35Y.d.ts} +0 -1
- package/build/es/index.d.mts +2 -2
- package/build/es/index.mjs +0 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +2 -2
- package/build/es/index.typings.mjs +0 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/{interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.mts → interfaces-forms-v4-submission-extension.public-BbcLa35Y.d.mts} +0 -1
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.js +0 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +2 -2
- package/build/internal/cjs/index.typings.js +0 -1
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/{interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.ts → interfaces-forms-v4-submission-extension.public-BbcLa35Y.d.ts} +0 -1
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.mjs +0 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +2 -2
- package/build/internal/es/index.typings.mjs +0 -1
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/{interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.mts → interfaces-forms-v4-submission-extension.public-BbcLa35Y.d.mts} +0 -1
- package/package.json +4 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
package/build/cjs/index.js
CHANGED
|
@@ -31,7 +31,6 @@ module.exports = __toCommonJS(index_exports);
|
|
|
31
31
|
|
|
32
32
|
// src/service-plugins-types.ts
|
|
33
33
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
34
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
35
34
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
36
35
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
37
36
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-forms-v4-submission-extension.public.ts","../../src/interfaces-forms-v4-submission-extension.context.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-forms-v4-submission-extension.context.js';\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AChYZ,uBAAwC;AAMxC,uBAAqD;AACrD,6BAA+B;AAC/B,oCAGO;AAOA,IAAM,sBAAkB,0CAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,sBAAkB,uCAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;","names":["provideHandlers","SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-forms-v4-submission-extension.public.ts","../../src/interfaces-forms-v4-submission-extension.context.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-forms-v4-submission-extension.context.js';\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKC,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AC/XZ,uBAAwC;AAMxC,uBAAqD;AACrD,6BAA+B;AAC/B,oCAGO;AAOA,IAAM,sBAAkB,0CAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,sBAAkB,uCAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;","names":["provideHandlers","SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
3
3
|
import '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -29,7 +29,6 @@ module.exports = __toCommonJS(index_typings_exports);
|
|
|
29
29
|
|
|
30
30
|
// src/service-plugins-types.ts
|
|
31
31
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
32
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
33
32
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
34
33
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
35
34
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import { ValidateSubmissionResponse } from './src/service-plugins-types.js';\nimport { ValidateSubmissionEnvelope } from './src/interfaces-forms-v4-submission-extension.public.js';\n\nexport * from './src/service-plugins-types';\nexport { ValidateSubmissionEnvelope };\n\n/**\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red.\n */\nexport declare function validateSubmission(\n payload: ValidateSubmissionEnvelope\n): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import { ValidateSubmissionResponse } from './src/service-plugins-types.js';\nimport { ValidateSubmissionEnvelope } from './src/interfaces-forms-v4-submission-extension.public.js';\n\nexport * from './src/service-plugins-types';\nexport { ValidateSubmissionEnvelope };\n\n/**\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red.\n */\nexport declare function validateSubmission(\n payload: ValidateSubmissionEnvelope\n): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
@@ -83,7 +83,6 @@ interface FormSubmission {
|
|
|
83
83
|
tags?: PublicTags;
|
|
84
84
|
}
|
|
85
85
|
declare enum SubmissionStatus {
|
|
86
|
-
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
87
86
|
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
88
87
|
PENDING = "PENDING",
|
|
89
88
|
/** A submission is recorded in the Wix Forms collection. */
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
package/build/es/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/service-plugins-types.ts
|
|
2
2
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
3
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
4
3
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
5
4
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
6
5
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/service-plugins-types.ts","../../src/interfaces-forms-v4-submission-extension.public.ts","../../src/interfaces-forms-v4-submission-extension.context.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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AChYZ,SAAS,+BAA+B;AAMxC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB,eAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;","names":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
1
|
+
{"version":3,"sources":["../../src/service-plugins-types.ts","../../src/interfaces-forms-v4-submission-extension.public.ts","../../src/interfaces-forms-v4-submission-extension.context.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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AC/XZ,SAAS,+BAA+B;AAMxC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB,eAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;","names":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
3
3
|
import '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/service-plugins-types.ts
|
|
2
2
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
3
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
4
3
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
5
4
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
6
5
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
1
|
+
{"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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
@@ -83,7 +83,6 @@ interface FormSubmission {
|
|
|
83
83
|
tags?: PublicTags;
|
|
84
84
|
}
|
|
85
85
|
declare enum SubmissionStatus {
|
|
86
|
-
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
87
86
|
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
88
87
|
PENDING = "PENDING",
|
|
89
88
|
/** A submission is recorded in the Wix Forms collection. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
|
@@ -31,7 +31,6 @@ module.exports = __toCommonJS(index_exports);
|
|
|
31
31
|
|
|
32
32
|
// src/service-plugins-types.ts
|
|
33
33
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
34
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
35
34
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
36
35
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
37
36
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.ts","../../../src/service-plugins-types.ts","../../../src/interfaces-forms-v4-submission-extension.public.ts","../../../src/interfaces-forms-v4-submission-extension.context.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-forms-v4-submission-extension.context.js';\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AChYZ,uBAAwC;AAMxC,uBAAqD;AACrD,6BAA+B;AAC/B,oCAGO;AAOA,IAAM,sBAAkB,0CAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,sBAAkB,uCAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;","names":["provideHandlers","SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
1
|
+
{"version":3,"sources":["../../../index.ts","../../../src/service-plugins-types.ts","../../../src/interfaces-forms-v4-submission-extension.public.ts","../../../src/interfaces-forms-v4-submission-extension.context.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-forms-v4-submission-extension.context.js';\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKC,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AC/XZ,uBAAwC;AAMxC,uBAAqD;AACrD,6BAA+B;AAC/B,oCAGO;AAOA,IAAM,sBAAkB,0CAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,sBAAkB,uCAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;","names":["provideHandlers","SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.js';
|
|
3
3
|
import '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -29,7 +29,6 @@ module.exports = __toCommonJS(index_typings_exports);
|
|
|
29
29
|
|
|
30
30
|
// src/service-plugins-types.ts
|
|
31
31
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
32
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
33
32
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
34
33
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
35
34
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.typings.ts","../../../src/service-plugins-types.ts"],"sourcesContent":["import { ValidateSubmissionResponse } from './src/service-plugins-types.js';\nimport { ValidateSubmissionEnvelope } from './src/interfaces-forms-v4-submission-extension.public.js';\n\nexport * from './src/service-plugins-types';\nexport { ValidateSubmissionEnvelope };\n\n/**\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red.\n */\nexport declare function validateSubmission(\n payload: ValidateSubmissionEnvelope\n): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
1
|
+
{"version":3,"sources":["../../../index.typings.ts","../../../src/service-plugins-types.ts"],"sourcesContent":["import { ValidateSubmissionResponse } from './src/service-plugins-types.js';\nimport { ValidateSubmissionEnvelope } from './src/interfaces-forms-v4-submission-extension.public.js';\n\nexport * from './src/service-plugins-types';\nexport { ValidateSubmissionEnvelope };\n\n/**\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red.\n */\nexport declare function validateSubmission(\n payload: ValidateSubmissionEnvelope\n): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n","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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACsFO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
@@ -83,7 +83,6 @@ interface FormSubmission {
|
|
|
83
83
|
tags?: PublicTags;
|
|
84
84
|
}
|
|
85
85
|
declare enum SubmissionStatus {
|
|
86
|
-
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
87
86
|
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
88
87
|
PENDING = "PENDING",
|
|
89
88
|
/** A submission is recorded in the Wix Forms collection. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { p as provideHandlers$1 } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
3
3
|
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/service-plugins-types.ts
|
|
2
2
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
3
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
4
3
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
5
4
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
6
5
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/service-plugins-types.ts","../../../src/interfaces-forms-v4-submission-extension.public.ts","../../../src/interfaces-forms-v4-submission-extension.context.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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AChYZ,SAAS,+BAA+B;AAMxC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB,eAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;","names":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/service-plugins-types.ts","../../../src/interfaces-forms-v4-submission-extension.public.ts","../../../src/interfaces-forms-v4-submission-extension.context.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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n ValidateSubmissionRequest,\n ValidateSubmissionResponse,\n} from './service-plugins-types.js';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface ValidateSubmissionEnvelope {\n request: ValidateSubmissionRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * > **Note:** The Form Submission service plugin only works with the Wix Forms app.\n *\n * Validates a submission.\n *\n * Validates a site visitor's form submission and returns any validation violations. Site visitors can see the validation violations on their forms. For example, invalid fields are highlighted in red. */\n validateSubmission(\n payload: ValidateSubmissionEnvelope\n ): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;\n}>('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [\n {\n name: 'validateSubmission',\n primaryHttpMappingPath: '/v4/submissions/validate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'request.updateOptions.currentSubmission.createdDate' },\n { path: 'request.updateOptions.currentSubmission.updatedDate' },\n { path: 'request.submission.createdDate' },\n { path: 'request.submission.updatedDate' },\n ],\n },\n ]);\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-forms-v4-submission-extension.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n"],"mappings":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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;;;AC/XZ,SAAS,+BAA+B;AAMxC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOA,IAAM,kBAAkB,wBAW5B,wCAAwC;AAAA,EACzC;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,eAAO,sCAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB,eAAe,SAAS;AAAA,UAC9C;AAAA,YACE,aAAa;AAAA,YACb,OAAO;AAAA,cACL,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,sDAAsD;AAAA,cAC9D,EAAE,MAAM,iCAAiC;AAAA,cACzC,EAAE,MAAM,iCAAiC;AAAA,YAC3C;AAAA,UACF;AAAA,QACF,CAAC;AAED,eAAO,wCAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACvDD,SAAS,iCAAiC;AAMnC,IAAMC,mBAGoB;AAAA,EAC/B;AACF;","names":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType","provideHandlers"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-
|
|
2
|
-
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-
|
|
1
|
+
import { n as ValidateSubmissionEnvelope, d as ValidateSubmissionResponse } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
2
|
+
export { A as ActionType, j as AlternativeUri, C as Context, E as ExtendedFields, F as FormSubmission, h as FormSubmissionSpiExtensionConfig, k as FormsSubmissionsExtensionNamespaceConfig, l as IdentificationData, m as IdentificationDataIdOneOf, I as IdentityType, O as OrderDetails, P as PublicTags, i as SpiBaseUri, g as SubmissionErrorType, S as SubmissionStatus, e as SubmissionValidationError, f as SubmissionValidationErrorErrorMessageOneOf, b as Submitter, c as SubmitterSubmitterOneOf, T as TagList, U as UpdateOptions, V as ValidateSubmissionRequest, a as ValidateSubmissionRequestActionsOneOf } from './interfaces-forms-v4-submission-extension.public-BbcLa35Y.mjs';
|
|
3
3
|
import '@wix/sdk-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/service-plugins-types.ts
|
|
2
2
|
var SubmissionStatus = /* @__PURE__ */ ((SubmissionStatus2) => {
|
|
3
|
-
SubmissionStatus2["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
4
3
|
SubmissionStatus2["PENDING"] = "PENDING";
|
|
5
4
|
SubmissionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
6
5
|
SubmissionStatus2["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\nexport enum SubmissionStatus {\n UNKNOWN_SUBMISSION_STATUS = 'UNKNOWN_SUBMISSION_STATUS',\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,+BAA4B;AAE5B,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AATT,SAAAA;AAAA,GAAA;AAqHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
1
|
+
{"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. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace.\n * @minLength 10\n * @maxLength 50\n * @readonly\n */\n namespace?: string;\n /** Status of the submission. */\n status?: SubmissionStatus;\n /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */\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 * @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\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 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}\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\nexport interface SpiBaseUri {\n /**\n * Base URI where the methods are called. Wix appends the path to the `baseUri`.\n * For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */\n alternativeUris?: AlternativeUri[];\n}\n\nexport interface AlternativeUri {\n /**\n * Name of the method to create a custom URI for.\n *\n * For `methodName`, use the name of the method in PascalCase.\n * For example, for Get Shipping Rates use `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.\n * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.\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\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":";AAsFO,IAAK,mBAAL,kBAAKA,sBAAL;AAEL,EAAAA,kBAAA,aAAU;AAEV,EAAAA,kBAAA,eAAY;AAEZ,EAAAA,kBAAA,qBAAkB;AAElB,EAAAA,kBAAA,sBAAmB;AART,SAAAA;AAAA,GAAA;AAoHL,IAAK,aAAL,kBAAKC,gBAAL;AAEL,EAAAA,YAAA,oBAAiB;AAEjB,EAAAA,YAAA,YAAS;AAET,EAAAA,YAAA,YAAS;AANC,SAAAA;AAAA,GAAA;AAoDL,IAAK,sBAAL,kBAAKC,yBAAL;AAEL,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,gBAAa;AAEb,EAAAA,qBAAA,0BAAuB;AAEvB,EAAAA,qBAAA,yBAAsB;AAEtB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,sBAAmB;AAEnB,EAAAA,qBAAA,mBAAgB;AAEhB,EAAAA,qBAAA,kBAAe;AAEf,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,qBAAkB;AAElB,EAAAA,qBAAA,6BAA0B;AAE1B,EAAAA,qBAAA,yBAAsB;AA9BZ,SAAAA;AAAA,GAAA;AAiIL,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":["SubmissionStatus","ActionType","SubmissionErrorType","IdentityType"]}
|
|
@@ -83,7 +83,6 @@ interface FormSubmission {
|
|
|
83
83
|
tags?: PublicTags;
|
|
84
84
|
}
|
|
85
85
|
declare enum SubmissionStatus {
|
|
86
|
-
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
87
86
|
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
88
87
|
PENDING = "PENDING",
|
|
89
88
|
/** A submission is recorded in the Wix Forms collection. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_forms_form-submissions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"service-plugins"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@wix/sdk-runtime": "^1.0.
|
|
33
|
-
"@wix/sdk-types": "^1.17.
|
|
32
|
+
"@wix/sdk-runtime": "^1.0.8",
|
|
33
|
+
"@wix/sdk-types": "^1.17.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"tsup": "^8.4.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"fqdn": "wix.interfaces.forms.v4.submission_extension"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "d1c2c394c446214be7df4780679aeddfa1b71196002061fdf49902e9"
|
|
54
54
|
}
|