@wix/forms 1.0.93 → 1.0.95

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.
@@ -0,0 +1,342 @@
1
+ interface ValidateSubmissionRequest extends ValidateSubmissionRequestActionsOneOf {
2
+ /** Data for updating an existing submission. */
3
+ updateOptions?: UpdateOptions;
4
+ /** Submission to validate. */
5
+ submission: FormSubmission;
6
+ /** Whether to create or update the submission. */
7
+ actionType: ActionType;
8
+ }
9
+ /** @oneof */
10
+ interface ValidateSubmissionRequestActionsOneOf {
11
+ /** Data for updating an existing submission. */
12
+ updateOptions?: UpdateOptions;
13
+ }
14
+ /** Form submission that was created or retrieved. */
15
+ interface FormSubmission {
16
+ /**
17
+ * Submission ID.
18
+ * @readonly
19
+ */
20
+ _id?: string | null;
21
+ /** ID of the form which the submission belongs to. */
22
+ formId?: string;
23
+ /**
24
+ * 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.
25
+ * @readonly
26
+ */
27
+ namespace?: string;
28
+ /**
29
+ * Status of the submission.
30
+ * - `PENDING`: A submission is created, but has not yet been recorded in the Wix Forms collection.
31
+ * - `PAYMENT_WAITING`: A form submission requiring payment is created.
32
+ * - `PAYMENT_CANCELED`: An order of a form submission is canceled.
33
+ * - `CONFIRMED`: A submission is recorded in the Wix Forms collection.
34
+ */
35
+ status?: SubmissionStatus;
36
+ /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */
37
+ submissions?: Record<string, any>;
38
+ /**
39
+ * Date and time the form submission was created.
40
+ * @readonly
41
+ */
42
+ _createdDate?: Date;
43
+ /**
44
+ * Date and time the form submission was updated.
45
+ * @readonly
46
+ */
47
+ _updatedDate?: Date;
48
+ /**
49
+ * 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.
50
+ * @readonly
51
+ */
52
+ revision?: string | null;
53
+ /**
54
+ * ID of the visitor that submitted the form.
55
+ * @readonly
56
+ */
57
+ submitter?: Submitter;
58
+ /** Whether a site owner marked a submission as "seen". */
59
+ seen?: boolean;
60
+ /** Data extension object that holds users' and apps' fields. */
61
+ extendedFields?: ExtendedFields;
62
+ /**
63
+ * Order details. <br>
64
+ * <b>Note</b>: This object is only applicable when submittng a form in the Wix Payments app.
65
+ */
66
+ orderDetails?: OrderDetails;
67
+ }
68
+ declare enum SubmissionStatus {
69
+ UNDEFINED = "UNDEFINED",
70
+ PENDING = "PENDING",
71
+ CONFIRMED = "CONFIRMED",
72
+ PAYMENT_WAITING = "PAYMENT_WAITING",
73
+ PAYMENT_CANCELED = "PAYMENT_CANCELED"
74
+ }
75
+ interface Submitter extends SubmitterSubmitterOneOf {
76
+ /** Member ID. */
77
+ memberId?: string | null;
78
+ /** Visitor ID. */
79
+ visitorId?: string | null;
80
+ /** Application ID. */
81
+ applicationId?: string | null;
82
+ /** User ID. */
83
+ userId?: string | null;
84
+ }
85
+ /** @oneof */
86
+ interface SubmitterSubmitterOneOf {
87
+ /** Member ID. */
88
+ memberId?: string | null;
89
+ /** Visitor ID. */
90
+ visitorId?: string | null;
91
+ /** Application ID. */
92
+ applicationId?: string | null;
93
+ /** User ID. */
94
+ userId?: string | null;
95
+ }
96
+ interface ExtendedFields {
97
+ /**
98
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
99
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
100
+ *
101
+ * You can only access fields for which you have the appropriate permissions.
102
+ *
103
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
104
+ */
105
+ namespaces?: Record<string, Record<string, any>>;
106
+ }
107
+ interface OrderDetails {
108
+ /**
109
+ * ID of the order related to submission (only applicable if a form has payments).
110
+ * @readonly
111
+ */
112
+ orderId?: string | null;
113
+ /**
114
+ * Order number.
115
+ * @readonly
116
+ */
117
+ number?: string | null;
118
+ /**
119
+ * Currency.
120
+ * @readonly
121
+ */
122
+ currency?: string | null;
123
+ /**
124
+ * Item subtotal.
125
+ * @readonly
126
+ */
127
+ itemSubtotal?: string;
128
+ /**
129
+ * ID of the checkout related to submission (only applicable if a form has payments).
130
+ * @readonly
131
+ */
132
+ checkoutId?: string;
133
+ }
134
+ declare enum ActionType {
135
+ UNKNOWN_ACTION = "UNKNOWN_ACTION",
136
+ UPDATE = "UPDATE",
137
+ CREATE = "CREATE"
138
+ }
139
+ interface UpdateOptions {
140
+ /** Submission to update. */
141
+ currentSubmission?: FormSubmission;
142
+ }
143
+ interface ValidateSubmissionResponse {
144
+ /**
145
+ * List of validation errors. <br>
146
+ * If there are no validation errors, returns an empty array.
147
+ */
148
+ errors?: SubmissionValidationError[];
149
+ }
150
+ interface SubmissionValidationError extends SubmissionValidationErrorErrorMessageOneOf {
151
+ /** Predefined error type. */
152
+ errorType?: SubmissionErrorType;
153
+ /** Custom error message. The message is displayed instead of an error type. */
154
+ customErrorMessage?: string;
155
+ /** Path indicating the source of the error, such as `form.fields.target`. */
156
+ errorPath?: string;
157
+ /** Additional error parameters. */
158
+ params?: Record<string, any> | null;
159
+ }
160
+ /** @oneof */
161
+ interface SubmissionValidationErrorErrorMessageOneOf {
162
+ /** Predefined error type. */
163
+ errorType?: SubmissionErrorType;
164
+ /** Custom error message. The message is displayed instead of an error type. */
165
+ customErrorMessage?: string;
166
+ }
167
+ declare enum SubmissionErrorType {
168
+ /** Error is unknown or not suitable for any of options bellow */
169
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
170
+ /** Type of submitted value is incorrect */
171
+ TYPE_ERROR = "TYPE_ERROR",
172
+ /** Value is required to be provided */
173
+ REQUIRED_VALUE_ERROR = "REQUIRED_VALUE_ERROR",
174
+ /** Value contains additional properties not expected in schema */
175
+ UNKNOWN_VALUE_ERROR = "UNKNOWN_VALUE_ERROR",
176
+ /** Text value exceeds max length */
177
+ MAX_LENGTH_ERROR = "MAX_LENGTH_ERROR",
178
+ /** Text value not reaches min length */
179
+ MIN_LENGTH_ERROR = "MIN_LENGTH_ERROR",
180
+ /** Text value not applicable for expected pattern */
181
+ PATTERN_ERROR = "PATTERN_ERROR",
182
+ /** Text value not applicable for expected format */
183
+ FORMAT_ERROR = "FORMAT_ERROR",
184
+ /** Number value is too big */
185
+ MAX_VALUE_ERROR = "MAX_VALUE_ERROR",
186
+ /** Number value is too small */
187
+ MIN_VALUE_ERROR = "MIN_VALUE_ERROR",
188
+ /** Number value is not multiple of expected number */
189
+ MULTIPLE_OF_VALUE_ERROR = "MULTIPLE_OF_VALUE_ERROR",
190
+ /** Array value has too much items */
191
+ MIN_ITEMS_ERROR = "MIN_ITEMS_ERROR",
192
+ /** Array value has not enough items */
193
+ MAX_ITEMS_ERROR = "MAX_ITEMS_ERROR",
194
+ /** Value is not in list of allowed values */
195
+ NOT_ALLOWED_VALUE_ERROR = "NOT_ALLOWED_VALUE_ERROR",
196
+ /** Submitted form is disabled */
197
+ DISABLED_FORM_ERROR = "DISABLED_FORM_ERROR"
198
+ }
199
+ interface FormSubmissionSpiExtensionConfig {
200
+ /** URI where the service plugin Implementer is deployed */
201
+ deploymentUri?: SpiBaseUri;
202
+ /** Namespace names. */
203
+ namespaceConfigs?: FormsSubmissionsExtensionNamespaceConfig[];
204
+ }
205
+ interface SpiBaseUri {
206
+ /** URI that will be used by the host to call the implementer. The path-suffix defined on the method will be appended to it */
207
+ baseUri?: string;
208
+ /** override method mappings per method */
209
+ alternativeUris?: AlternativeUri[];
210
+ }
211
+ interface AlternativeUri {
212
+ /** name of the method as it appears in the proto */
213
+ methodName?: string;
214
+ /** absolute uri that will be used by the host to call that method. The path-suffix mapped from the method http option will NOT be appended to this URI. For TPAs. it must be https */
215
+ absoluteUri?: string;
216
+ }
217
+ interface FormsSubmissionsExtensionNamespaceConfig {
218
+ /** Targeted namespace, with what submissions should trigger defined methods. */
219
+ namespace?: string;
220
+ /** Enable submission validation. */
221
+ submissionValidationEnabled?: boolean;
222
+ }
223
+ /**
224
+ * this message is not directly used by any service,
225
+ * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
226
+ * e.g. SPIs, event-handlers, etc..
227
+ * NOTE: this context object MUST be provided as the last argument in each Velo method signature.
228
+ *
229
+ * Example:
230
+ * ```typescript
231
+ * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
232
+ * ...
233
+ * }
234
+ * ```
235
+ */
236
+ interface Context {
237
+ /** A unique identifier for each request. Can be used for logging / troubleshooting */
238
+ requestId?: string | null;
239
+ /** 3 capital letters string representing a currency according to ISO-4217 */
240
+ currency?: string | null;
241
+ /** The identification type and identity data */
242
+ identity?: IdentificationData;
243
+ /** 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 */
244
+ languages?: string[];
245
+ /** App instance ID of SPI in context */
246
+ instanceId?: string | null;
247
+ }
248
+ declare enum IdentityType {
249
+ UNKNOWN = "UNKNOWN",
250
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
251
+ MEMBER = "MEMBER",
252
+ WIX_USER = "WIX_USER",
253
+ APP = "APP"
254
+ }
255
+ interface IdentificationData extends IdentificationDataIdOneOf {
256
+ /** ID of a site visitor that has not logged in to the site. */
257
+ anonymousVisitorId?: string;
258
+ /** ID of a site visitor that has logged in to the site. */
259
+ memberId?: string;
260
+ /** ID of a Wix user (site owner, contributor, etc.). */
261
+ wixUserId?: string;
262
+ /** ID of an app. */
263
+ appId?: string;
264
+ /** @readonly */
265
+ identityType?: IdentityType;
266
+ }
267
+ /** @oneof */
268
+ interface IdentificationDataIdOneOf {
269
+ /** ID of a site visitor that has not logged in to the site. */
270
+ anonymousVisitorId?: string;
271
+ /** ID of a site visitor that has logged in to the site. */
272
+ memberId?: string;
273
+ /** ID of a Wix user (site owner, contributor, etc.). */
274
+ wixUserId?: string;
275
+ /** ID of an app. */
276
+ appId?: string;
277
+ }
278
+
279
+ type ServicePluginMethodInput = {
280
+ request: any;
281
+ metadata: any;
282
+ };
283
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
284
+ type ServicePluginMethodMetadata = {
285
+ name: string;
286
+ primaryHttpMappingPath: string;
287
+ transformations: {
288
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
289
+ toREST: (...args: unknown[]) => unknown;
290
+ };
291
+ };
292
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
293
+ __type: 'service-plugin-definition';
294
+ componentType: string;
295
+ methods: ServicePluginMethodMetadata[];
296
+ __contract: Contract;
297
+ };
298
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
299
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
300
+
301
+ interface ValidateSubmissionEnvelope {
302
+ request: ValidateSubmissionRequest;
303
+ metadata: Context;
304
+ }
305
+ declare const provideHandlers$1: ServicePluginDefinition<{
306
+ validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
307
+ }>;
308
+
309
+ declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1>;
310
+
311
+ type context_ActionType = ActionType;
312
+ declare const context_ActionType: typeof ActionType;
313
+ type context_AlternativeUri = AlternativeUri;
314
+ type context_Context = Context;
315
+ type context_ExtendedFields = ExtendedFields;
316
+ type context_FormSubmission = FormSubmission;
317
+ type context_FormSubmissionSpiExtensionConfig = FormSubmissionSpiExtensionConfig;
318
+ type context_FormsSubmissionsExtensionNamespaceConfig = FormsSubmissionsExtensionNamespaceConfig;
319
+ type context_IdentificationData = IdentificationData;
320
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
321
+ type context_IdentityType = IdentityType;
322
+ declare const context_IdentityType: typeof IdentityType;
323
+ type context_OrderDetails = OrderDetails;
324
+ type context_SpiBaseUri = SpiBaseUri;
325
+ type context_SubmissionErrorType = SubmissionErrorType;
326
+ declare const context_SubmissionErrorType: typeof SubmissionErrorType;
327
+ type context_SubmissionStatus = SubmissionStatus;
328
+ declare const context_SubmissionStatus: typeof SubmissionStatus;
329
+ type context_SubmissionValidationError = SubmissionValidationError;
330
+ type context_SubmissionValidationErrorErrorMessageOneOf = SubmissionValidationErrorErrorMessageOneOf;
331
+ type context_Submitter = Submitter;
332
+ type context_SubmitterSubmitterOneOf = SubmitterSubmitterOneOf;
333
+ type context_UpdateOptions = UpdateOptions;
334
+ type context_ValidateSubmissionRequest = ValidateSubmissionRequest;
335
+ type context_ValidateSubmissionRequestActionsOneOf = ValidateSubmissionRequestActionsOneOf;
336
+ type context_ValidateSubmissionResponse = ValidateSubmissionResponse;
337
+ declare const context_provideHandlers: typeof provideHandlers;
338
+ declare namespace context {
339
+ export { context_ActionType as ActionType, type context_AlternativeUri as AlternativeUri, type context_Context as Context, type context_ExtendedFields as ExtendedFields, type context_FormSubmission as FormSubmission, type context_FormSubmissionSpiExtensionConfig as FormSubmissionSpiExtensionConfig, type context_FormsSubmissionsExtensionNamespaceConfig as FormsSubmissionsExtensionNamespaceConfig, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_IdentityType as IdentityType, type context_OrderDetails as OrderDetails, type context_SpiBaseUri as SpiBaseUri, context_SubmissionErrorType as SubmissionErrorType, context_SubmissionStatus as SubmissionStatus, type context_SubmissionValidationError as SubmissionValidationError, type context_SubmissionValidationErrorErrorMessageOneOf as SubmissionValidationErrorErrorMessageOneOf, type context_Submitter as Submitter, type context_SubmitterSubmitterOneOf as SubmitterSubmitterOneOf, type context_UpdateOptions as UpdateOptions, type context_ValidateSubmissionRequest as ValidateSubmissionRequest, type context_ValidateSubmissionRequestActionsOneOf as ValidateSubmissionRequestActionsOneOf, type context_ValidateSubmissionResponse as ValidateSubmissionResponse, context_provideHandlers as provideHandlers };
340
+ }
341
+
342
+ export { context as submissionsExtensionSpi };
@@ -0,0 +1,340 @@
1
+ interface ValidateSubmissionRequest extends ValidateSubmissionRequestActionsOneOf {
2
+ /** Data for updating an existing submission. */
3
+ updateOptions?: UpdateOptions;
4
+ /** Submission to validate. */
5
+ submission: FormSubmission;
6
+ /** Whether to create or update the submission. */
7
+ actionType: ActionType;
8
+ }
9
+ /** @oneof */
10
+ interface ValidateSubmissionRequestActionsOneOf {
11
+ /** Data for updating an existing submission. */
12
+ updateOptions?: UpdateOptions;
13
+ }
14
+ /** Form submission that was created or retrieved. */
15
+ interface FormSubmission {
16
+ /**
17
+ * Submission ID.
18
+ * @readonly
19
+ */
20
+ _id?: string | null;
21
+ /** ID of the form which the submission belongs to. */
22
+ formId?: string;
23
+ /**
24
+ * 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.
25
+ * @readonly
26
+ */
27
+ namespace?: string;
28
+ /**
29
+ * Status of the submission.
30
+ * - `PENDING`: A submission is created, but has not yet been recorded in the Wix Forms collection.
31
+ * - `PAYMENT_WAITING`: A form submission requiring payment is created.
32
+ * - `PAYMENT_CANCELED`: An order of a form submission is canceled.
33
+ * - `CONFIRMED`: A submission is recorded in the Wix Forms collection.
34
+ */
35
+ status?: SubmissionStatus;
36
+ /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */
37
+ submissions?: Record<string, any>;
38
+ /**
39
+ * Date and time the form submission was created.
40
+ * @readonly
41
+ */
42
+ _createdDate?: Date;
43
+ /**
44
+ * Date and time the form submission was updated.
45
+ * @readonly
46
+ */
47
+ _updatedDate?: Date;
48
+ /**
49
+ * 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.
50
+ * @readonly
51
+ */
52
+ revision?: string | null;
53
+ /**
54
+ * ID of the visitor that submitted the form.
55
+ * @readonly
56
+ */
57
+ submitter?: Submitter;
58
+ /** Whether a site owner marked a submission as "seen". */
59
+ seen?: boolean;
60
+ /** Data extension object that holds users' and apps' fields. */
61
+ extendedFields?: ExtendedFields;
62
+ /**
63
+ * Order details. <br>
64
+ * <b>Note</b>: This object is only applicable when submittng a form in the Wix Payments app.
65
+ */
66
+ orderDetails?: OrderDetails;
67
+ }
68
+ declare enum SubmissionStatus {
69
+ UNDEFINED = "UNDEFINED",
70
+ PENDING = "PENDING",
71
+ CONFIRMED = "CONFIRMED",
72
+ PAYMENT_WAITING = "PAYMENT_WAITING",
73
+ PAYMENT_CANCELED = "PAYMENT_CANCELED"
74
+ }
75
+ interface Submitter extends SubmitterSubmitterOneOf {
76
+ /** Member ID. */
77
+ memberId?: string | null;
78
+ /** Visitor ID. */
79
+ visitorId?: string | null;
80
+ /** Application ID. */
81
+ applicationId?: string | null;
82
+ /** User ID. */
83
+ userId?: string | null;
84
+ }
85
+ /** @oneof */
86
+ interface SubmitterSubmitterOneOf {
87
+ /** Member ID. */
88
+ memberId?: string | null;
89
+ /** Visitor ID. */
90
+ visitorId?: string | null;
91
+ /** Application ID. */
92
+ applicationId?: string | null;
93
+ /** User ID. */
94
+ userId?: string | null;
95
+ }
96
+ interface ExtendedFields {
97
+ /**
98
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
99
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
100
+ *
101
+ * You can only access fields for which you have the appropriate permissions.
102
+ *
103
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
104
+ */
105
+ namespaces?: Record<string, Record<string, any>>;
106
+ }
107
+ interface OrderDetails {
108
+ /**
109
+ * ID of the order related to submission (only applicable if a form has payments).
110
+ * @readonly
111
+ */
112
+ orderId?: string | null;
113
+ /**
114
+ * Order number.
115
+ * @readonly
116
+ */
117
+ number?: string | null;
118
+ /**
119
+ * Currency.
120
+ * @readonly
121
+ */
122
+ currency?: string | null;
123
+ /**
124
+ * Item subtotal.
125
+ * @readonly
126
+ */
127
+ itemSubtotal?: string;
128
+ /**
129
+ * ID of the checkout related to submission (only applicable if a form has payments).
130
+ * @readonly
131
+ */
132
+ checkoutId?: string;
133
+ }
134
+ declare enum ActionType {
135
+ UNKNOWN_ACTION = "UNKNOWN_ACTION",
136
+ UPDATE = "UPDATE",
137
+ CREATE = "CREATE"
138
+ }
139
+ interface UpdateOptions {
140
+ /** Submission to update. */
141
+ currentSubmission?: FormSubmission;
142
+ }
143
+ interface ValidateSubmissionResponse {
144
+ /**
145
+ * List of validation errors. <br>
146
+ * If there are no validation errors, returns an empty array.
147
+ */
148
+ errors?: SubmissionValidationError[];
149
+ }
150
+ interface SubmissionValidationError extends SubmissionValidationErrorErrorMessageOneOf {
151
+ /** Predefined error type. */
152
+ errorType?: SubmissionErrorType;
153
+ /** Custom error message. The message is displayed instead of an error type. */
154
+ customErrorMessage?: string;
155
+ /** Path indicating the source of the error, such as `form.fields.target`. */
156
+ errorPath?: string;
157
+ /** Additional error parameters. */
158
+ params?: Record<string, any> | null;
159
+ }
160
+ /** @oneof */
161
+ interface SubmissionValidationErrorErrorMessageOneOf {
162
+ /** Predefined error type. */
163
+ errorType?: SubmissionErrorType;
164
+ /** Custom error message. The message is displayed instead of an error type. */
165
+ customErrorMessage?: string;
166
+ }
167
+ declare enum SubmissionErrorType {
168
+ /** Error is unknown or not suitable for any of options bellow */
169
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
170
+ /** Type of submitted value is incorrect */
171
+ TYPE_ERROR = "TYPE_ERROR",
172
+ /** Value is required to be provided */
173
+ REQUIRED_VALUE_ERROR = "REQUIRED_VALUE_ERROR",
174
+ /** Value contains additional properties not expected in schema */
175
+ UNKNOWN_VALUE_ERROR = "UNKNOWN_VALUE_ERROR",
176
+ /** Text value exceeds max length */
177
+ MAX_LENGTH_ERROR = "MAX_LENGTH_ERROR",
178
+ /** Text value not reaches min length */
179
+ MIN_LENGTH_ERROR = "MIN_LENGTH_ERROR",
180
+ /** Text value not applicable for expected pattern */
181
+ PATTERN_ERROR = "PATTERN_ERROR",
182
+ /** Text value not applicable for expected format */
183
+ FORMAT_ERROR = "FORMAT_ERROR",
184
+ /** Number value is too big */
185
+ MAX_VALUE_ERROR = "MAX_VALUE_ERROR",
186
+ /** Number value is too small */
187
+ MIN_VALUE_ERROR = "MIN_VALUE_ERROR",
188
+ /** Number value is not multiple of expected number */
189
+ MULTIPLE_OF_VALUE_ERROR = "MULTIPLE_OF_VALUE_ERROR",
190
+ /** Array value has too much items */
191
+ MIN_ITEMS_ERROR = "MIN_ITEMS_ERROR",
192
+ /** Array value has not enough items */
193
+ MAX_ITEMS_ERROR = "MAX_ITEMS_ERROR",
194
+ /** Value is not in list of allowed values */
195
+ NOT_ALLOWED_VALUE_ERROR = "NOT_ALLOWED_VALUE_ERROR",
196
+ /** Submitted form is disabled */
197
+ DISABLED_FORM_ERROR = "DISABLED_FORM_ERROR"
198
+ }
199
+ interface FormSubmissionSpiExtensionConfig {
200
+ /** URI where the service plugin Implementer is deployed */
201
+ deploymentUri?: SpiBaseUri;
202
+ /** Namespace names. */
203
+ namespaceConfigs?: FormsSubmissionsExtensionNamespaceConfig[];
204
+ }
205
+ interface SpiBaseUri {
206
+ /** URI that will be used by the host to call the implementer. The path-suffix defined on the method will be appended to it */
207
+ baseUri?: string;
208
+ /** override method mappings per method */
209
+ alternativeUris?: AlternativeUri[];
210
+ }
211
+ interface AlternativeUri {
212
+ /** name of the method as it appears in the proto */
213
+ methodName?: string;
214
+ /** absolute uri that will be used by the host to call that method. The path-suffix mapped from the method http option will NOT be appended to this URI. For TPAs. it must be https */
215
+ absoluteUri?: string;
216
+ }
217
+ interface FormsSubmissionsExtensionNamespaceConfig {
218
+ /** Targeted namespace, with what submissions should trigger defined methods. */
219
+ namespace?: string;
220
+ /** Enable submission validation. */
221
+ submissionValidationEnabled?: boolean;
222
+ }
223
+ /**
224
+ * this message is not directly used by any service,
225
+ * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
226
+ * e.g. SPIs, event-handlers, etc..
227
+ * NOTE: this context object MUST be provided as the last argument in each Velo method signature.
228
+ *
229
+ * Example:
230
+ * ```typescript
231
+ * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
232
+ * ...
233
+ * }
234
+ * ```
235
+ */
236
+ interface Context {
237
+ /** A unique identifier for each request. Can be used for logging / troubleshooting */
238
+ requestId?: string | null;
239
+ /** 3 capital letters string representing a currency according to ISO-4217 */
240
+ currency?: string | null;
241
+ /** The identification type and identity data */
242
+ identity?: IdentificationData;
243
+ /** 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 */
244
+ languages?: string[];
245
+ /** App instance ID of SPI in context */
246
+ instanceId?: string | null;
247
+ }
248
+ declare enum IdentityType {
249
+ UNKNOWN = "UNKNOWN",
250
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
251
+ MEMBER = "MEMBER",
252
+ WIX_USER = "WIX_USER",
253
+ APP = "APP"
254
+ }
255
+ interface IdentificationData extends IdentificationDataIdOneOf {
256
+ /** ID of a site visitor that has not logged in to the site. */
257
+ anonymousVisitorId?: string;
258
+ /** ID of a site visitor that has logged in to the site. */
259
+ memberId?: string;
260
+ /** ID of a Wix user (site owner, contributor, etc.). */
261
+ wixUserId?: string;
262
+ /** ID of an app. */
263
+ appId?: string;
264
+ /** @readonly */
265
+ identityType?: IdentityType;
266
+ }
267
+ /** @oneof */
268
+ interface IdentificationDataIdOneOf {
269
+ /** ID of a site visitor that has not logged in to the site. */
270
+ anonymousVisitorId?: string;
271
+ /** ID of a site visitor that has logged in to the site. */
272
+ memberId?: string;
273
+ /** ID of a Wix user (site owner, contributor, etc.). */
274
+ wixUserId?: string;
275
+ /** ID of an app. */
276
+ appId?: string;
277
+ }
278
+
279
+ type ServicePluginMethodInput = {
280
+ request: any;
281
+ metadata: any;
282
+ };
283
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
284
+ type ServicePluginMethodMetadata = {
285
+ name: string;
286
+ primaryHttpMappingPath: string;
287
+ transformations: {
288
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
289
+ toREST: (...args: unknown[]) => unknown;
290
+ };
291
+ };
292
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
293
+ __type: 'service-plugin-definition';
294
+ componentType: string;
295
+ methods: ServicePluginMethodMetadata[];
296
+ __contract: Contract;
297
+ };
298
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
299
+
300
+ interface ValidateSubmissionEnvelope {
301
+ request: ValidateSubmissionRequest;
302
+ metadata: Context;
303
+ }
304
+ declare const provideHandlers: ServicePluginDefinition<{
305
+ validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
306
+ }>;
307
+
308
+ type index_d_ActionType = ActionType;
309
+ declare const index_d_ActionType: typeof ActionType;
310
+ type index_d_AlternativeUri = AlternativeUri;
311
+ type index_d_Context = Context;
312
+ type index_d_ExtendedFields = ExtendedFields;
313
+ type index_d_FormSubmission = FormSubmission;
314
+ type index_d_FormSubmissionSpiExtensionConfig = FormSubmissionSpiExtensionConfig;
315
+ type index_d_FormsSubmissionsExtensionNamespaceConfig = FormsSubmissionsExtensionNamespaceConfig;
316
+ type index_d_IdentificationData = IdentificationData;
317
+ type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
318
+ type index_d_IdentityType = IdentityType;
319
+ declare const index_d_IdentityType: typeof IdentityType;
320
+ type index_d_OrderDetails = OrderDetails;
321
+ type index_d_SpiBaseUri = SpiBaseUri;
322
+ type index_d_SubmissionErrorType = SubmissionErrorType;
323
+ declare const index_d_SubmissionErrorType: typeof SubmissionErrorType;
324
+ type index_d_SubmissionStatus = SubmissionStatus;
325
+ declare const index_d_SubmissionStatus: typeof SubmissionStatus;
326
+ type index_d_SubmissionValidationError = SubmissionValidationError;
327
+ type index_d_SubmissionValidationErrorErrorMessageOneOf = SubmissionValidationErrorErrorMessageOneOf;
328
+ type index_d_Submitter = Submitter;
329
+ type index_d_SubmitterSubmitterOneOf = SubmitterSubmitterOneOf;
330
+ type index_d_UpdateOptions = UpdateOptions;
331
+ type index_d_ValidateSubmissionEnvelope = ValidateSubmissionEnvelope;
332
+ type index_d_ValidateSubmissionRequest = ValidateSubmissionRequest;
333
+ type index_d_ValidateSubmissionRequestActionsOneOf = ValidateSubmissionRequestActionsOneOf;
334
+ type index_d_ValidateSubmissionResponse = ValidateSubmissionResponse;
335
+ declare const index_d_provideHandlers: typeof provideHandlers;
336
+ declare namespace index_d {
337
+ export { index_d_ActionType as ActionType, type index_d_AlternativeUri as AlternativeUri, type index_d_Context as Context, type index_d_ExtendedFields as ExtendedFields, type index_d_FormSubmission as FormSubmission, type index_d_FormSubmissionSpiExtensionConfig as FormSubmissionSpiExtensionConfig, type index_d_FormsSubmissionsExtensionNamespaceConfig as FormsSubmissionsExtensionNamespaceConfig, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, index_d_IdentityType as IdentityType, type index_d_OrderDetails as OrderDetails, type index_d_SpiBaseUri as SpiBaseUri, index_d_SubmissionErrorType as SubmissionErrorType, index_d_SubmissionStatus as SubmissionStatus, type index_d_SubmissionValidationError as SubmissionValidationError, type index_d_SubmissionValidationErrorErrorMessageOneOf as SubmissionValidationErrorErrorMessageOneOf, type index_d_Submitter as Submitter, type index_d_SubmitterSubmitterOneOf as SubmitterSubmitterOneOf, type index_d_UpdateOptions as UpdateOptions, type index_d_ValidateSubmissionEnvelope as ValidateSubmissionEnvelope, type index_d_ValidateSubmissionRequest as ValidateSubmissionRequest, type index_d_ValidateSubmissionRequestActionsOneOf as ValidateSubmissionRequestActionsOneOf, type index_d_ValidateSubmissionResponse as ValidateSubmissionResponse, index_d_provideHandlers as provideHandlers };
338
+ }
339
+
340
+ export { index_d as submissionsExtensionSpi };