@wix/auto_sdk_forms_form-submissions 1.0.2 → 1.0.3
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 +7 -2
- package/build/cjs/index.js +115 -16
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +7 -5
- package/build/cjs/index.typings.js +75 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/{src/service-plugins-types.d.ts → interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.ts} +43 -24
- package/build/es/index.d.mts +7 -0
- package/build/es/index.mjs +89 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +14 -0
- package/build/es/index.typings.mjs +48 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/{src/service-plugins-types.d.ts → interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.mts} +43 -24
- package/build/internal/cjs/index.d.ts +7 -2
- package/build/internal/cjs/index.js +115 -16
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +7 -5
- package/build/internal/cjs/index.typings.js +75 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/{src/service-plugins-types.d.ts → interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.ts} +43 -24
- package/build/internal/es/index.d.mts +7 -0
- package/build/internal/es/index.mjs +89 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +14 -0
- package/build/internal/es/index.typings.mjs +48 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/{src/service-plugins-types.d.ts → interfaces-forms-v4-submission-extension.public-D5K55Vtm.d.mts} +43 -24
- package/package.json +12 -10
- package/build/cjs/src/interfaces-forms-v4-submission-extension.context.d.ts +0 -5
- package/build/cjs/src/interfaces-forms-v4-submission-extension.context.js +0 -9
- package/build/cjs/src/interfaces-forms-v4-submission-extension.context.js.map +0 -1
- package/build/cjs/src/interfaces-forms-v4-submission-extension.public.d.ts +0 -16
- package/build/cjs/src/interfaces-forms-v4-submission-extension.public.js +0 -34
- package/build/cjs/src/interfaces-forms-v4-submission-extension.public.js.map +0 -1
- package/build/cjs/src/service-plugins-types.js +0 -66
- package/build/cjs/src/service-plugins-types.js.map +0 -1
- package/build/es/index.d.ts +0 -2
- package/build/es/index.js +0 -3
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -12
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/interfaces-forms-v4-submission-extension.context.d.ts +0 -5
- package/build/es/src/interfaces-forms-v4-submission-extension.context.js +0 -6
- package/build/es/src/interfaces-forms-v4-submission-extension.context.js.map +0 -1
- package/build/es/src/interfaces-forms-v4-submission-extension.public.d.ts +0 -16
- package/build/es/src/interfaces-forms-v4-submission-extension.public.js +0 -31
- package/build/es/src/interfaces-forms-v4-submission-extension.public.js.map +0 -1
- package/build/es/src/service-plugins-types.js +0 -63
- package/build/es/src/service-plugins-types.js.map +0 -1
- package/build/internal/cjs/src/interfaces-forms-v4-submission-extension.context.d.ts +0 -5
- package/build/internal/cjs/src/interfaces-forms-v4-submission-extension.context.js +0 -9
- package/build/internal/cjs/src/interfaces-forms-v4-submission-extension.context.js.map +0 -1
- package/build/internal/cjs/src/interfaces-forms-v4-submission-extension.public.d.ts +0 -16
- package/build/internal/cjs/src/interfaces-forms-v4-submission-extension.public.js +0 -34
- package/build/internal/cjs/src/interfaces-forms-v4-submission-extension.public.js.map +0 -1
- package/build/internal/cjs/src/service-plugins-types.js +0 -66
- package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -2
- package/build/internal/es/index.js +0 -3
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -12
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/src/interfaces-forms-v4-submission-extension.context.d.ts +0 -5
- package/build/internal/es/src/interfaces-forms-v4-submission-extension.context.js +0 -6
- package/build/internal/es/src/interfaces-forms-v4-submission-extension.context.js.map +0 -1
- package/build/internal/es/src/interfaces-forms-v4-submission-extension.public.d.ts +0 -16
- package/build/internal/es/src/interfaces-forms-v4-submission-extension.public.js +0 -31
- package/build/internal/es/src/interfaces-forms-v4-submission-extension.public.js.map +0 -1
- package/build/internal/es/src/service-plugins-types.js +0 -63
- package/build/internal/es/src/service-plugins-types.js.map +0 -1
|
@@ -0,0 +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,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
interface ValidateSubmissionRequest extends ValidateSubmissionRequestActionsOneOf {
|
|
2
4
|
/** Data for updating an existing submission. */
|
|
3
5
|
updateOptions?: UpdateOptions;
|
|
4
6
|
/** Submission to validate. */
|
|
@@ -7,12 +9,12 @@ export interface ValidateSubmissionRequest extends ValidateSubmissionRequestActi
|
|
|
7
9
|
actionType: ActionType;
|
|
8
10
|
}
|
|
9
11
|
/** @oneof */
|
|
10
|
-
|
|
12
|
+
interface ValidateSubmissionRequestActionsOneOf {
|
|
11
13
|
/** Data for updating an existing submission. */
|
|
12
14
|
updateOptions?: UpdateOptions;
|
|
13
15
|
}
|
|
14
16
|
/** Form submission that was created or retrieved. */
|
|
15
|
-
|
|
17
|
+
interface FormSubmission {
|
|
16
18
|
/**
|
|
17
19
|
* Submission ID.
|
|
18
20
|
* @format GUID
|
|
@@ -80,7 +82,7 @@ export interface FormSubmission {
|
|
|
80
82
|
/** Tag IDs collections associated with the current entity. */
|
|
81
83
|
tags?: PublicTags;
|
|
82
84
|
}
|
|
83
|
-
|
|
85
|
+
declare enum SubmissionStatus {
|
|
84
86
|
UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
|
|
85
87
|
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
86
88
|
PENDING = "PENDING",
|
|
@@ -91,7 +93,7 @@ export declare enum SubmissionStatus {
|
|
|
91
93
|
/** An order of a form submission is canceled. */
|
|
92
94
|
PAYMENT_CANCELED = "PAYMENT_CANCELED"
|
|
93
95
|
}
|
|
94
|
-
|
|
96
|
+
interface Submitter extends SubmitterSubmitterOneOf {
|
|
95
97
|
/**
|
|
96
98
|
* Member ID.
|
|
97
99
|
* @format GUID
|
|
@@ -114,7 +116,7 @@ export interface Submitter extends SubmitterSubmitterOneOf {
|
|
|
114
116
|
userId?: string | null;
|
|
115
117
|
}
|
|
116
118
|
/** @oneof */
|
|
117
|
-
|
|
119
|
+
interface SubmitterSubmitterOneOf {
|
|
118
120
|
/**
|
|
119
121
|
* Member ID.
|
|
120
122
|
* @format GUID
|
|
@@ -136,7 +138,7 @@ export interface SubmitterSubmitterOneOf {
|
|
|
136
138
|
*/
|
|
137
139
|
userId?: string | null;
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
interface ExtendedFields {
|
|
140
142
|
/**
|
|
141
143
|
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
142
144
|
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
@@ -147,7 +149,7 @@ export interface ExtendedFields {
|
|
|
147
149
|
*/
|
|
148
150
|
namespaces?: Record<string, Record<string, any>>;
|
|
149
151
|
}
|
|
150
|
-
|
|
152
|
+
interface OrderDetails {
|
|
151
153
|
/**
|
|
152
154
|
* ID of the order related to submission (only applicable if a form has payments).
|
|
153
155
|
* @format GUID
|
|
@@ -178,11 +180,11 @@ export interface OrderDetails {
|
|
|
178
180
|
*/
|
|
179
181
|
checkoutId?: string;
|
|
180
182
|
}
|
|
181
|
-
|
|
183
|
+
interface PublicTags {
|
|
182
184
|
/** Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. */
|
|
183
185
|
tags?: TagList;
|
|
184
186
|
}
|
|
185
|
-
|
|
187
|
+
interface TagList {
|
|
186
188
|
/**
|
|
187
189
|
* List of tag IDs
|
|
188
190
|
* @maxSize 100
|
|
@@ -190,7 +192,7 @@ export interface TagList {
|
|
|
190
192
|
*/
|
|
191
193
|
tagIds?: string[];
|
|
192
194
|
}
|
|
193
|
-
|
|
195
|
+
declare enum ActionType {
|
|
194
196
|
/** Unknown action type. */
|
|
195
197
|
UNKNOWN_ACTION = "UNKNOWN_ACTION",
|
|
196
198
|
/** Update submission. */
|
|
@@ -198,11 +200,11 @@ export declare enum ActionType {
|
|
|
198
200
|
/** Create submission. */
|
|
199
201
|
CREATE = "CREATE"
|
|
200
202
|
}
|
|
201
|
-
|
|
203
|
+
interface UpdateOptions {
|
|
202
204
|
/** Submission to update. */
|
|
203
205
|
currentSubmission?: FormSubmission;
|
|
204
206
|
}
|
|
205
|
-
|
|
207
|
+
interface ValidateSubmissionResponse {
|
|
206
208
|
/**
|
|
207
209
|
* List of validation errors. <br>
|
|
208
210
|
* If there are no validation errors, returns an empty array.
|
|
@@ -210,7 +212,7 @@ export interface ValidateSubmissionResponse {
|
|
|
210
212
|
*/
|
|
211
213
|
errors?: SubmissionValidationError[];
|
|
212
214
|
}
|
|
213
|
-
|
|
215
|
+
interface SubmissionValidationError extends SubmissionValidationErrorErrorMessageOneOf {
|
|
214
216
|
/** Predefined error type. */
|
|
215
217
|
errorType?: SubmissionErrorType;
|
|
216
218
|
/**
|
|
@@ -227,7 +229,7 @@ export interface SubmissionValidationError extends SubmissionValidationErrorErro
|
|
|
227
229
|
params?: Record<string, any> | null;
|
|
228
230
|
}
|
|
229
231
|
/** @oneof */
|
|
230
|
-
|
|
232
|
+
interface SubmissionValidationErrorErrorMessageOneOf {
|
|
231
233
|
/** Predefined error type. */
|
|
232
234
|
errorType?: SubmissionErrorType;
|
|
233
235
|
/**
|
|
@@ -236,7 +238,7 @@ export interface SubmissionValidationErrorErrorMessageOneOf {
|
|
|
236
238
|
*/
|
|
237
239
|
customErrorMessage?: string;
|
|
238
240
|
}
|
|
239
|
-
|
|
241
|
+
declare enum SubmissionErrorType {
|
|
240
242
|
/** Error is unknown or unsuitable for any of the options below. */
|
|
241
243
|
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
242
244
|
/** Type of submitted value is incorrect. */
|
|
@@ -268,7 +270,7 @@ export declare enum SubmissionErrorType {
|
|
|
268
270
|
/** Submitted form is disabled. */
|
|
269
271
|
DISABLED_FORM_ERROR = "DISABLED_FORM_ERROR"
|
|
270
272
|
}
|
|
271
|
-
|
|
273
|
+
interface FormSubmissionSpiExtensionConfig {
|
|
272
274
|
/**
|
|
273
275
|
* Deployment URI where the endpoints are called. Wix Forms appends the endpoint path to the deployment URI.
|
|
274
276
|
* For example, to call the Validate Submission endpoint at `https://my-form-submissions.com/v1/validateSubmission`,
|
|
@@ -281,7 +283,7 @@ export interface FormSubmissionSpiExtensionConfig {
|
|
|
281
283
|
*/
|
|
282
284
|
namespaceConfigs?: FormsSubmissionsExtensionNamespaceConfig[];
|
|
283
285
|
}
|
|
284
|
-
|
|
286
|
+
interface SpiBaseUri {
|
|
285
287
|
/**
|
|
286
288
|
* Base URI where the methods are called. Wix appends the path to the `baseUri`.
|
|
287
289
|
* 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/`.
|
|
@@ -292,7 +294,7 @@ export interface SpiBaseUri {
|
|
|
292
294
|
/** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */
|
|
293
295
|
alternativeUris?: AlternativeUri[];
|
|
294
296
|
}
|
|
295
|
-
|
|
297
|
+
interface AlternativeUri {
|
|
296
298
|
/**
|
|
297
299
|
* Name of the method to create a custom URI for.
|
|
298
300
|
*
|
|
@@ -310,7 +312,7 @@ export interface AlternativeUri {
|
|
|
310
312
|
*/
|
|
311
313
|
absoluteUri?: string;
|
|
312
314
|
}
|
|
313
|
-
|
|
315
|
+
interface FormsSubmissionsExtensionNamespaceConfig {
|
|
314
316
|
/**
|
|
315
317
|
* The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`.
|
|
316
318
|
*
|
|
@@ -341,7 +343,7 @@ export interface FormsSubmissionsExtensionNamespaceConfig {
|
|
|
341
343
|
* }
|
|
342
344
|
* ```
|
|
343
345
|
*/
|
|
344
|
-
|
|
346
|
+
interface Context {
|
|
345
347
|
/** 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. */
|
|
346
348
|
requestId?: string | null;
|
|
347
349
|
/**
|
|
@@ -359,14 +361,14 @@ export interface Context {
|
|
|
359
361
|
*/
|
|
360
362
|
instanceId?: string | null;
|
|
361
363
|
}
|
|
362
|
-
|
|
364
|
+
declare enum IdentityType {
|
|
363
365
|
UNKNOWN = "UNKNOWN",
|
|
364
366
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
365
367
|
MEMBER = "MEMBER",
|
|
366
368
|
WIX_USER = "WIX_USER",
|
|
367
369
|
APP = "APP"
|
|
368
370
|
}
|
|
369
|
-
|
|
371
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
370
372
|
/**
|
|
371
373
|
* ID of a site visitor that has not logged in to the site.
|
|
372
374
|
* @format GUID
|
|
@@ -391,7 +393,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
391
393
|
identityType?: IdentityType;
|
|
392
394
|
}
|
|
393
395
|
/** @oneof */
|
|
394
|
-
|
|
396
|
+
interface IdentificationDataIdOneOf {
|
|
395
397
|
/**
|
|
396
398
|
* ID of a site visitor that has not logged in to the site.
|
|
397
399
|
* @format GUID
|
|
@@ -413,3 +415,20 @@ export interface IdentificationDataIdOneOf {
|
|
|
413
415
|
*/
|
|
414
416
|
appId?: string;
|
|
415
417
|
}
|
|
418
|
+
|
|
419
|
+
interface ValidateSubmissionEnvelope {
|
|
420
|
+
request: ValidateSubmissionRequest;
|
|
421
|
+
metadata: Context;
|
|
422
|
+
}
|
|
423
|
+
declare const provideHandlers: ServicePluginDefinition<{
|
|
424
|
+
/**
|
|
425
|
+
*
|
|
426
|
+
* > **Note:** The Form Submission service plugin only works with the Wix Forms app.
|
|
427
|
+
*
|
|
428
|
+
* Validates a submission.
|
|
429
|
+
*
|
|
430
|
+
* 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. */
|
|
431
|
+
validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
|
|
432
|
+
}>;
|
|
433
|
+
|
|
434
|
+
export { ActionType as A, type Context as C, type ExtendedFields as E, type FormSubmission as F, IdentityType as I, type OrderDetails as O, type PublicTags as P, SubmissionStatus as S, type TagList as T, type UpdateOptions as U, type ValidateSubmissionRequest as V, type ValidateSubmissionRequestActionsOneOf as a, type Submitter as b, type SubmitterSubmitterOneOf as c, type ValidateSubmissionResponse as d, type SubmissionValidationError as e, type SubmissionValidationErrorErrorMessageOneOf as f, SubmissionErrorType as g, type FormSubmissionSpiExtensionConfig as h, type SpiBaseUri as i, type AlternativeUri as j, type FormsSubmissionsExtensionNamespaceConfig as k, type IdentificationData as l, type IdentificationDataIdOneOf as m, type ValidateSubmissionEnvelope as n, provideHandlers as p };
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_forms_form-submissions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"registry": "https://registry.npmjs.org/",
|
|
6
7
|
"access": "public"
|
|
@@ -8,18 +9,18 @@
|
|
|
8
9
|
"keywords": [],
|
|
9
10
|
"sideEffects": false,
|
|
10
11
|
"main": "./build/cjs/index.js",
|
|
11
|
-
"types": "./build/
|
|
12
|
+
"types": "./build/cjs/index.d.ts",
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
|
-
"import": "./build/es/index.
|
|
15
|
+
"import": "./build/es/index.mjs",
|
|
15
16
|
"require": "./build/cjs/index.js",
|
|
16
|
-
"types": "./build/es/index.d.
|
|
17
|
+
"types": "./build/es/index.d.mts"
|
|
17
18
|
},
|
|
18
19
|
"./package.json": "./package.json",
|
|
19
20
|
"./meta": {
|
|
20
|
-
"import": "./build/es/meta.
|
|
21
|
+
"import": "./build/es/meta.mjs",
|
|
21
22
|
"require": "./build/cjs/meta.js",
|
|
22
|
-
"types": "./build/es/meta.d.
|
|
23
|
+
"types": "./build/es/meta.d.mts"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
@@ -28,14 +29,15 @@
|
|
|
28
29
|
"service-plugins"
|
|
29
30
|
],
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@wix/sdk-runtime": "^0.3.
|
|
32
|
-
"@wix/sdk-types": "^1.13.
|
|
32
|
+
"@wix/sdk-runtime": "^0.3.55",
|
|
33
|
+
"@wix/sdk-types": "^1.13.35"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
36
|
+
"tsup": "^8.4.0",
|
|
35
37
|
"typescript": "^5.3.2"
|
|
36
38
|
},
|
|
37
39
|
"scripts": {
|
|
38
|
-
"build": "
|
|
40
|
+
"build": "tsup",
|
|
39
41
|
"test": ":"
|
|
40
42
|
},
|
|
41
43
|
"wix": {
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"fqdn": "wix.interfaces.forms.v4.submission_extension"
|
|
49
51
|
}
|
|
50
52
|
},
|
|
51
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "49704d375c89d81882abd6c422c9c875e42a7fe2588e386bb20d966c"
|
|
52
54
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './interfaces-forms-v4-submission-extension.public.js';
|
|
2
|
-
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
3
|
-
import { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';
|
|
4
|
-
export { publicProvideHandlers };
|
|
5
|
-
export declare const provideHandlers: ReturnType<typeof createServicePluginModule<typeof publicProvideHandlers>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.provideHandlers = exports.publicProvideHandlers = void 0;
|
|
4
|
-
require("./interfaces-forms-v4-submission-extension.public.js");
|
|
5
|
-
const service_plugin_modules_1 = require("@wix/sdk-runtime/service-plugin-modules");
|
|
6
|
-
const interfaces_forms_v4_submission_extension_public_js_1 = require("./interfaces-forms-v4-submission-extension.public.js");
|
|
7
|
-
Object.defineProperty(exports, "publicProvideHandlers", { enumerable: true, get: function () { return interfaces_forms_v4_submission_extension_public_js_1.provideHandlers; } });
|
|
8
|
-
exports.provideHandlers = (0, service_plugin_modules_1.createServicePluginModule)(interfaces_forms_v4_submission_extension_public_js_1.provideHandlers);
|
|
9
|
-
//# sourceMappingURL=interfaces-forms-v4-submission-extension.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces-forms-v4-submission-extension.context.js","sourceRoot":"","sources":["../../../src/interfaces-forms-v4-submission-extension.context.ts"],"names":[],"mappings":";;;AAAA,gEAA8D;AAC9D,oFAAoF;AACpF,6HAAgH;AAEvG,sGAFmB,oEAAqB,OAEnB;AAEjB,QAAA,eAAe,GAExB,IAAA,kDAAyB,EAAC,oEAAqB,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { Context, ValidateSubmissionRequest, ValidateSubmissionResponse } from './service-plugins-types.js';
|
|
3
|
-
export interface ValidateSubmissionEnvelope {
|
|
4
|
-
request: ValidateSubmissionRequest;
|
|
5
|
-
metadata: Context;
|
|
6
|
-
}
|
|
7
|
-
export declare const provideHandlers: ServicePluginDefinition<{
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* > **Note:** The Form Submission service plugin only works with the Wix Forms app.
|
|
11
|
-
*
|
|
12
|
-
* Validates a submission.
|
|
13
|
-
*
|
|
14
|
-
* 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. */
|
|
15
|
-
validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
|
|
16
|
-
}>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.provideHandlers = void 0;
|
|
4
|
-
const sdk_types_1 = require("@wix/sdk-types");
|
|
5
|
-
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
6
|
-
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
7
|
-
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
8
|
-
exports.provideHandlers = (0, sdk_types_1.ServicePluginDefinition)('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [
|
|
9
|
-
{
|
|
10
|
-
name: 'validateSubmission',
|
|
11
|
-
primaryHttpMappingPath: '/v4/submissions/validate',
|
|
12
|
-
transformations: {
|
|
13
|
-
toREST: (payload) => {
|
|
14
|
-
const toRestResponse = payload;
|
|
15
|
-
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
16
|
-
},
|
|
17
|
-
fromREST: (payload) => {
|
|
18
|
-
const fromRestRequest = (0, transform_paths_1.transformPaths)(payload, [
|
|
19
|
-
{
|
|
20
|
-
transformFn: timestamp_1.transformRESTTimestampToSDKTimestamp,
|
|
21
|
-
paths: [
|
|
22
|
-
{ path: 'request.updateOptions.currentSubmission.createdDate' },
|
|
23
|
-
{ path: 'request.updateOptions.currentSubmission.updatedDate' },
|
|
24
|
-
{ path: 'request.submission.createdDate' },
|
|
25
|
-
{ path: 'request.submission.updatedDate' },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
]);
|
|
29
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
]);
|
|
34
|
-
//# sourceMappingURL=interfaces-forms-v4-submission-extension.public.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces-forms-v4-submission-extension.public.js","sourceRoot":"","sources":["../../../src/interfaces-forms-v4-submission-extension.public.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AAMzD,0EAAkG;AAClG,sFAAkF;AAClF,oFAGiD;AAOpC,QAAA,eAAe,GAAG,IAAA,mCAAuB,EAWnD,sCAAsC,EAAE;IACzC;QACE,IAAI,EAAE,oBAAoB;QAC1B,sBAAsB,EAAE,0BAA0B;QAClD,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,IAAA,8DAAqC,EAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE;oBAC9C;wBACE,WAAW,EAAE,gDAAoC;wBACjD,KAAK,EAAE;4BACL,EAAE,IAAI,EAAE,qDAAqD,EAAE;4BAC/D,EAAE,IAAI,EAAE,qDAAqD,EAAE;4BAC/D,EAAE,IAAI,EAAE,gCAAgC,EAAE;4BAC1C,EAAE,IAAI,EAAE,gCAAgC,EAAE;yBAC3C;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdentityType = exports.SubmissionErrorType = exports.ActionType = exports.SubmissionStatus = void 0;
|
|
4
|
-
var SubmissionStatus;
|
|
5
|
-
(function (SubmissionStatus) {
|
|
6
|
-
SubmissionStatus["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
7
|
-
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
8
|
-
SubmissionStatus["PENDING"] = "PENDING";
|
|
9
|
-
/** A submission is recorded in the Wix Forms collection. */
|
|
10
|
-
SubmissionStatus["CONFIRMED"] = "CONFIRMED";
|
|
11
|
-
/** A form submission requiring payment is created. */
|
|
12
|
-
SubmissionStatus["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
13
|
-
/** An order of a form submission is canceled. */
|
|
14
|
-
SubmissionStatus["PAYMENT_CANCELED"] = "PAYMENT_CANCELED";
|
|
15
|
-
})(SubmissionStatus || (exports.SubmissionStatus = SubmissionStatus = {}));
|
|
16
|
-
var ActionType;
|
|
17
|
-
(function (ActionType) {
|
|
18
|
-
/** Unknown action type. */
|
|
19
|
-
ActionType["UNKNOWN_ACTION"] = "UNKNOWN_ACTION";
|
|
20
|
-
/** Update submission. */
|
|
21
|
-
ActionType["UPDATE"] = "UPDATE";
|
|
22
|
-
/** Create submission. */
|
|
23
|
-
ActionType["CREATE"] = "CREATE";
|
|
24
|
-
})(ActionType || (exports.ActionType = ActionType = {}));
|
|
25
|
-
var SubmissionErrorType;
|
|
26
|
-
(function (SubmissionErrorType) {
|
|
27
|
-
/** Error is unknown or unsuitable for any of the options below. */
|
|
28
|
-
SubmissionErrorType["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
29
|
-
/** Type of submitted value is incorrect. */
|
|
30
|
-
SubmissionErrorType["TYPE_ERROR"] = "TYPE_ERROR";
|
|
31
|
-
/** Value is required to be provided. */
|
|
32
|
-
SubmissionErrorType["REQUIRED_VALUE_ERROR"] = "REQUIRED_VALUE_ERROR";
|
|
33
|
-
/** Value contains additional properties not expected in schema. */
|
|
34
|
-
SubmissionErrorType["UNKNOWN_VALUE_ERROR"] = "UNKNOWN_VALUE_ERROR";
|
|
35
|
-
/** Text value exceeds max length. */
|
|
36
|
-
SubmissionErrorType["MAX_LENGTH_ERROR"] = "MAX_LENGTH_ERROR";
|
|
37
|
-
/** Text value does not reach min length. */
|
|
38
|
-
SubmissionErrorType["MIN_LENGTH_ERROR"] = "MIN_LENGTH_ERROR";
|
|
39
|
-
/** Text value is not applicable for expected pattern. */
|
|
40
|
-
SubmissionErrorType["PATTERN_ERROR"] = "PATTERN_ERROR";
|
|
41
|
-
/** Text value is not applicable for expected format. */
|
|
42
|
-
SubmissionErrorType["FORMAT_ERROR"] = "FORMAT_ERROR";
|
|
43
|
-
/** Number value is too big. */
|
|
44
|
-
SubmissionErrorType["MAX_VALUE_ERROR"] = "MAX_VALUE_ERROR";
|
|
45
|
-
/** Number value is too small. */
|
|
46
|
-
SubmissionErrorType["MIN_VALUE_ERROR"] = "MIN_VALUE_ERROR";
|
|
47
|
-
/** Number value is not a multiple of expected number. */
|
|
48
|
-
SubmissionErrorType["MULTIPLE_OF_VALUE_ERROR"] = "MULTIPLE_OF_VALUE_ERROR";
|
|
49
|
-
/** Array value has too many items. */
|
|
50
|
-
SubmissionErrorType["MIN_ITEMS_ERROR"] = "MIN_ITEMS_ERROR";
|
|
51
|
-
/** Array value has not enough items. */
|
|
52
|
-
SubmissionErrorType["MAX_ITEMS_ERROR"] = "MAX_ITEMS_ERROR";
|
|
53
|
-
/** Value is not in the list of allowed values. */
|
|
54
|
-
SubmissionErrorType["NOT_ALLOWED_VALUE_ERROR"] = "NOT_ALLOWED_VALUE_ERROR";
|
|
55
|
-
/** Submitted form is disabled. */
|
|
56
|
-
SubmissionErrorType["DISABLED_FORM_ERROR"] = "DISABLED_FORM_ERROR";
|
|
57
|
-
})(SubmissionErrorType || (exports.SubmissionErrorType = SubmissionErrorType = {}));
|
|
58
|
-
var IdentityType;
|
|
59
|
-
(function (IdentityType) {
|
|
60
|
-
IdentityType["UNKNOWN"] = "UNKNOWN";
|
|
61
|
-
IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
62
|
-
IdentityType["MEMBER"] = "MEMBER";
|
|
63
|
-
IdentityType["WIX_USER"] = "WIX_USER";
|
|
64
|
-
IdentityType["APP"] = "APP";
|
|
65
|
-
})(IdentityType || (exports.IdentityType = IdentityType = {}));
|
|
66
|
-
//# sourceMappingURL=service-plugins-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../src/service-plugins-types.ts"],"names":[],"mappings":";;;AAsFA,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,2EAAuD,CAAA;IACvD,0FAA0F;IAC1F,uCAAmB,CAAA;IACnB,4DAA4D;IAC5D,2CAAuB,CAAA;IACvB,sDAAsD;IACtD,uDAAmC,CAAA;IACnC,iDAAiD;IACjD,yDAAqC,CAAA;AACvC,CAAC,EAVW,gBAAgB,gCAAhB,gBAAgB,QAU3B;AA2GD,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,2BAA2B;IAC3B,+CAAiC,CAAA;IACjC,yBAAyB;IACzB,+BAAiB,CAAA;IACjB,yBAAyB;IACzB,+BAAiB,CAAA;AACnB,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB;AA6CD,IAAY,mBA+BX;AA/BD,WAAY,mBAAmB;IAC7B,mEAAmE;IACnE,sDAA+B,CAAA;IAC/B,4CAA4C;IAC5C,gDAAyB,CAAA;IACzB,wCAAwC;IACxC,oEAA6C,CAAA;IAC7C,mEAAmE;IACnE,kEAA2C,CAAA;IAC3C,qCAAqC;IACrC,4DAAqC,CAAA;IACrC,4CAA4C;IAC5C,4DAAqC,CAAA;IACrC,yDAAyD;IACzD,sDAA+B,CAAA;IAC/B,wDAAwD;IACxD,oDAA6B,CAAA;IAC7B,+BAA+B;IAC/B,0DAAmC,CAAA;IACnC,iCAAiC;IACjC,0DAAmC,CAAA;IACnC,yDAAyD;IACzD,0EAAmD,CAAA;IACnD,sCAAsC;IACtC,0DAAmC,CAAA;IACnC,wCAAwC;IACxC,0DAAmC,CAAA;IACnC,kDAAkD;IAClD,0EAAmD,CAAA;IACnD,kCAAkC;IAClC,kEAA2C,CAAA;AAC7C,CAAC,EA/BW,mBAAmB,mCAAnB,mBAAmB,QA+B9B;AAkGD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB"}
|
package/build/es/index.d.ts
DELETED
package/build/es/index.js
DELETED
package/build/es/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wDAAwD,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ValidateSubmissionResponse } from './src/service-plugins-types.js';
|
|
2
|
-
import { ValidateSubmissionEnvelope } from './src/interfaces-forms-v4-submission-extension.public.js';
|
|
3
|
-
export * from './src/service-plugins-types';
|
|
4
|
-
export { ValidateSubmissionEnvelope };
|
|
5
|
-
/**
|
|
6
|
-
* > **Note:** The Form Submission service plugin only works with the Wix Forms app.
|
|
7
|
-
*
|
|
8
|
-
* Validates a submission.
|
|
9
|
-
*
|
|
10
|
-
* 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.
|
|
11
|
-
*/
|
|
12
|
-
export declare function validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './interfaces-forms-v4-submission-extension.public.js';
|
|
2
|
-
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
3
|
-
import { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';
|
|
4
|
-
export { publicProvideHandlers };
|
|
5
|
-
export declare const provideHandlers: ReturnType<typeof createServicePluginModule<typeof publicProvideHandlers>>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import './interfaces-forms-v4-submission-extension.public.js';
|
|
2
|
-
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
3
|
-
import { provideHandlers as publicProvideHandlers } from './interfaces-forms-v4-submission-extension.public.js';
|
|
4
|
-
export { publicProvideHandlers };
|
|
5
|
-
export const provideHandlers = createServicePluginModule(publicProvideHandlers);
|
|
6
|
-
//# sourceMappingURL=interfaces-forms-v4-submission-extension.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces-forms-v4-submission-extension.context.js","sourceRoot":"","sources":["../../../src/interfaces-forms-v4-submission-extension.context.ts"],"names":[],"mappings":"AAAA,OAAO,sDAAsD,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAEhH,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,CAAC,MAAM,eAAe,GAExB,yBAAyB,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { Context, ValidateSubmissionRequest, ValidateSubmissionResponse } from './service-plugins-types.js';
|
|
3
|
-
export interface ValidateSubmissionEnvelope {
|
|
4
|
-
request: ValidateSubmissionRequest;
|
|
5
|
-
metadata: Context;
|
|
6
|
-
}
|
|
7
|
-
export declare const provideHandlers: ServicePluginDefinition<{
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* > **Note:** The Form Submission service plugin only works with the Wix Forms app.
|
|
11
|
-
*
|
|
12
|
-
* Validates a submission.
|
|
13
|
-
*
|
|
14
|
-
* 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. */
|
|
15
|
-
validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
|
|
16
|
-
}>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
|
|
3
|
-
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
|
|
4
|
-
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
|
5
|
-
export const provideHandlers = ServicePluginDefinition('FORMS_SUBMISSIONS_EXTENSION_PROVIDER', [
|
|
6
|
-
{
|
|
7
|
-
name: 'validateSubmission',
|
|
8
|
-
primaryHttpMappingPath: '/v4/submissions/validate',
|
|
9
|
-
transformations: {
|
|
10
|
-
toREST: (payload) => {
|
|
11
|
-
const toRestResponse = payload;
|
|
12
|
-
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
13
|
-
},
|
|
14
|
-
fromREST: (payload) => {
|
|
15
|
-
const fromRestRequest = transformPaths(payload, [
|
|
16
|
-
{
|
|
17
|
-
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
18
|
-
paths: [
|
|
19
|
-
{ path: 'request.updateOptions.currentSubmission.createdDate' },
|
|
20
|
-
{ path: 'request.updateOptions.currentSubmission.updatedDate' },
|
|
21
|
-
{ path: 'request.submission.createdDate' },
|
|
22
|
-
{ path: 'request.submission.updatedDate' },
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
]);
|
|
26
|
-
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
]);
|
|
31
|
-
//# sourceMappingURL=interfaces-forms-v4-submission-extension.public.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces-forms-v4-submission-extension.public.js","sourceRoot":"","sources":["../../../src/interfaces-forms-v4-submission-extension.public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAOjD,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAWnD,sCAAsC,EAAE;IACzC;QACE,IAAI,EAAE,oBAAoB;QAC1B,sBAAsB,EAAE,0BAA0B;QAClD,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,EAAE;oBAC9C;wBACE,WAAW,EAAE,oCAAoC;wBACjD,KAAK,EAAE;4BACL,EAAE,IAAI,EAAE,qDAAqD,EAAE;4BAC/D,EAAE,IAAI,EAAE,qDAAqD,EAAE;4BAC/D,EAAE,IAAI,EAAE,gCAAgC,EAAE;4BAC1C,EAAE,IAAI,EAAE,gCAAgC,EAAE;yBAC3C;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export var SubmissionStatus;
|
|
2
|
-
(function (SubmissionStatus) {
|
|
3
|
-
SubmissionStatus["UNKNOWN_SUBMISSION_STATUS"] = "UNKNOWN_SUBMISSION_STATUS";
|
|
4
|
-
/** A submission is created, but has not yet been recorded in the Wix Forms collection. */
|
|
5
|
-
SubmissionStatus["PENDING"] = "PENDING";
|
|
6
|
-
/** A submission is recorded in the Wix Forms collection. */
|
|
7
|
-
SubmissionStatus["CONFIRMED"] = "CONFIRMED";
|
|
8
|
-
/** A form submission requiring payment is created. */
|
|
9
|
-
SubmissionStatus["PAYMENT_WAITING"] = "PAYMENT_WAITING";
|
|
10
|
-
/** An order of a form submission is canceled. */
|
|
11
|
-
SubmissionStatus["PAYMENT_CANCELED"] = "PAYMENT_CANCELED";
|
|
12
|
-
})(SubmissionStatus || (SubmissionStatus = {}));
|
|
13
|
-
export var ActionType;
|
|
14
|
-
(function (ActionType) {
|
|
15
|
-
/** Unknown action type. */
|
|
16
|
-
ActionType["UNKNOWN_ACTION"] = "UNKNOWN_ACTION";
|
|
17
|
-
/** Update submission. */
|
|
18
|
-
ActionType["UPDATE"] = "UPDATE";
|
|
19
|
-
/** Create submission. */
|
|
20
|
-
ActionType["CREATE"] = "CREATE";
|
|
21
|
-
})(ActionType || (ActionType = {}));
|
|
22
|
-
export var SubmissionErrorType;
|
|
23
|
-
(function (SubmissionErrorType) {
|
|
24
|
-
/** Error is unknown or unsuitable for any of the options below. */
|
|
25
|
-
SubmissionErrorType["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
26
|
-
/** Type of submitted value is incorrect. */
|
|
27
|
-
SubmissionErrorType["TYPE_ERROR"] = "TYPE_ERROR";
|
|
28
|
-
/** Value is required to be provided. */
|
|
29
|
-
SubmissionErrorType["REQUIRED_VALUE_ERROR"] = "REQUIRED_VALUE_ERROR";
|
|
30
|
-
/** Value contains additional properties not expected in schema. */
|
|
31
|
-
SubmissionErrorType["UNKNOWN_VALUE_ERROR"] = "UNKNOWN_VALUE_ERROR";
|
|
32
|
-
/** Text value exceeds max length. */
|
|
33
|
-
SubmissionErrorType["MAX_LENGTH_ERROR"] = "MAX_LENGTH_ERROR";
|
|
34
|
-
/** Text value does not reach min length. */
|
|
35
|
-
SubmissionErrorType["MIN_LENGTH_ERROR"] = "MIN_LENGTH_ERROR";
|
|
36
|
-
/** Text value is not applicable for expected pattern. */
|
|
37
|
-
SubmissionErrorType["PATTERN_ERROR"] = "PATTERN_ERROR";
|
|
38
|
-
/** Text value is not applicable for expected format. */
|
|
39
|
-
SubmissionErrorType["FORMAT_ERROR"] = "FORMAT_ERROR";
|
|
40
|
-
/** Number value is too big. */
|
|
41
|
-
SubmissionErrorType["MAX_VALUE_ERROR"] = "MAX_VALUE_ERROR";
|
|
42
|
-
/** Number value is too small. */
|
|
43
|
-
SubmissionErrorType["MIN_VALUE_ERROR"] = "MIN_VALUE_ERROR";
|
|
44
|
-
/** Number value is not a multiple of expected number. */
|
|
45
|
-
SubmissionErrorType["MULTIPLE_OF_VALUE_ERROR"] = "MULTIPLE_OF_VALUE_ERROR";
|
|
46
|
-
/** Array value has too many items. */
|
|
47
|
-
SubmissionErrorType["MIN_ITEMS_ERROR"] = "MIN_ITEMS_ERROR";
|
|
48
|
-
/** Array value has not enough items. */
|
|
49
|
-
SubmissionErrorType["MAX_ITEMS_ERROR"] = "MAX_ITEMS_ERROR";
|
|
50
|
-
/** Value is not in the list of allowed values. */
|
|
51
|
-
SubmissionErrorType["NOT_ALLOWED_VALUE_ERROR"] = "NOT_ALLOWED_VALUE_ERROR";
|
|
52
|
-
/** Submitted form is disabled. */
|
|
53
|
-
SubmissionErrorType["DISABLED_FORM_ERROR"] = "DISABLED_FORM_ERROR";
|
|
54
|
-
})(SubmissionErrorType || (SubmissionErrorType = {}));
|
|
55
|
-
export var IdentityType;
|
|
56
|
-
(function (IdentityType) {
|
|
57
|
-
IdentityType["UNKNOWN"] = "UNKNOWN";
|
|
58
|
-
IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
59
|
-
IdentityType["MEMBER"] = "MEMBER";
|
|
60
|
-
IdentityType["WIX_USER"] = "WIX_USER";
|
|
61
|
-
IdentityType["APP"] = "APP";
|
|
62
|
-
})(IdentityType || (IdentityType = {}));
|
|
63
|
-
//# sourceMappingURL=service-plugins-types.js.map
|