@wix/forms 1.0.186 → 1.0.188

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.
Files changed (35) hide show
  1. package/context.js.map +1 -0
  2. package/context.ts +3 -0
  3. package/index.js.map +1 -0
  4. package/index.ts +5 -0
  5. package/meta.js.map +1 -0
  6. package/meta.ts +3 -0
  7. package/package.json +34 -22
  8. package/service-plugins-context.js.map +1 -0
  9. package/service-plugins-context.ts +1 -0
  10. package/service-plugins.js.map +1 -0
  11. package/service-plugins.ts +1 -0
  12. package/build/cjs/context.js.map +0 -1
  13. package/build/cjs/index.js.map +0 -1
  14. package/build/cjs/meta.js.map +0 -1
  15. package/build/cjs/service-plugins-context.js.map +0 -1
  16. package/build/cjs/service-plugins.js.map +0 -1
  17. package/context/package.json +0 -7
  18. package/meta/package.json +0 -7
  19. package/service-plugins/context/package.json +0 -7
  20. package/service-plugins/package.json +0 -7
  21. package/type-bundles/context.bundle.d.ts +0 -11979
  22. package/type-bundles/index.bundle.d.ts +0 -11979
  23. package/type-bundles/meta.bundle.d.ts +0 -11463
  24. package/type-bundles/service-plugins-context.bundle.d.ts +0 -389
  25. package/type-bundles/service-plugins.bundle.d.ts +0 -389
  26. /package/{build/cjs/context.d.ts → context.d.ts} +0 -0
  27. /package/{build/cjs/context.js → context.js} +0 -0
  28. /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
  29. /package/{build/cjs/index.js → index.js} +0 -0
  30. /package/{build/cjs/meta.d.ts → meta.d.ts} +0 -0
  31. /package/{build/cjs/meta.js → meta.js} +0 -0
  32. /package/{build/cjs/service-plugins-context.d.ts → service-plugins-context.d.ts} +0 -0
  33. /package/{build/cjs/service-plugins-context.js → service-plugins-context.js} +0 -0
  34. /package/{build/cjs/service-plugins.d.ts → service-plugins.d.ts} +0 -0
  35. /package/{build/cjs/service-plugins.js → service-plugins.js} +0 -0
@@ -1,389 +0,0 @@
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
- /** Status of the submission. */
29
- status?: SubmissionStatus;
30
- /** Submission values where `key` is the form field and `value` is the data submitted for the given field. */
31
- submissions?: Record<string, any>;
32
- /** Date and time the form submission was created. */
33
- _createdDate?: Date | null;
34
- /**
35
- * Date and time the form submission was updated.
36
- * @readonly
37
- */
38
- _updatedDate?: Date | null;
39
- /**
40
- * 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.
41
- * @readonly
42
- */
43
- revision?: string | null;
44
- /**
45
- * ID of the visitor that submitted the form.
46
- * @readonly
47
- */
48
- submitter?: Submitter;
49
- /** Whether a site owner marked a submission as "seen". */
50
- seen?: boolean;
51
- /** Data extension object that holds users' and apps' fields. */
52
- extendedFields?: ExtendedFields;
53
- /**
54
- * Order details. <br>
55
- * <b>Note</b>: This object is only applicable when submittng a form in the Wix Payments app.
56
- */
57
- orderDetails?: OrderDetails;
58
- /** Contact ID of a site visitor who created the submission. */
59
- contactId?: string | null;
60
- }
61
- declare enum SubmissionStatus {
62
- UNKNOWN_SUBMISSION_STATUS = "UNKNOWN_SUBMISSION_STATUS",
63
- /** A submission is created, but has not yet been recorded in the Wix Forms collection. */
64
- PENDING = "PENDING",
65
- /** A submission is recorded in the Wix Forms collection. */
66
- CONFIRMED = "CONFIRMED",
67
- /** A form submission requiring payment is created. */
68
- PAYMENT_WAITING = "PAYMENT_WAITING",
69
- /** An order of a form submission is canceled. */
70
- PAYMENT_CANCELED = "PAYMENT_CANCELED"
71
- }
72
- interface Submitter extends SubmitterSubmitterOneOf {
73
- /** Member ID. */
74
- memberId?: string | null;
75
- /** Visitor ID. */
76
- visitorId?: string | null;
77
- /** Application ID. */
78
- applicationId?: string | null;
79
- /** User ID. */
80
- userId?: string | null;
81
- }
82
- /** @oneof */
83
- interface SubmitterSubmitterOneOf {
84
- /** Member ID. */
85
- memberId?: string | null;
86
- /** Visitor ID. */
87
- visitorId?: string | null;
88
- /** Application ID. */
89
- applicationId?: string | null;
90
- /** User ID. */
91
- userId?: string | null;
92
- }
93
- interface ExtendedFields {
94
- /**
95
- * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
96
- * The value of each key is structured according to the schema defined when the extended fields were configured.
97
- *
98
- * You can only access fields for which you have the appropriate permissions.
99
- *
100
- * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
101
- */
102
- namespaces?: Record<string, Record<string, any>>;
103
- }
104
- interface OrderDetails {
105
- /**
106
- * ID of the order related to submission (only applicable if a form has payments).
107
- * @readonly
108
- */
109
- orderId?: string | null;
110
- /**
111
- * Order number.
112
- * @readonly
113
- */
114
- number?: string | null;
115
- /**
116
- * Currency.
117
- * @readonly
118
- */
119
- currency?: string | null;
120
- /**
121
- * Item subtotal.
122
- * @readonly
123
- */
124
- itemSubtotal?: string;
125
- /**
126
- * ID of the checkout related to submission (only applicable if a form has payments).
127
- * @readonly
128
- */
129
- checkoutId?: string;
130
- }
131
- declare enum ActionType {
132
- /** Unknown action type. */
133
- UNKNOWN_ACTION = "UNKNOWN_ACTION",
134
- /** Update submission. */
135
- UPDATE = "UPDATE",
136
- /** Create submission. */
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 unsuitable for any of the options below. */
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 does not reach min length. */
179
- MIN_LENGTH_ERROR = "MIN_LENGTH_ERROR",
180
- /** Text value is not applicable for expected pattern. */
181
- PATTERN_ERROR = "PATTERN_ERROR",
182
- /** Text value is 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 a multiple of expected number. */
189
- MULTIPLE_OF_VALUE_ERROR = "MULTIPLE_OF_VALUE_ERROR",
190
- /** Array value has too many 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 the 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
- /**
201
- * Deployment URI where the endpoints are called. Wix Forms appends the endpoint path to the deployment URI.
202
- * For example, to call the Validate Submission endpoint at `https://my-form-submissions.com/v1/validateSubmission`,
203
- * the `deploymentUri` you provide here is `https://my-form-submissions.com/`.
204
- */
205
- deploymentUri?: SpiBaseUri;
206
- /** Namespace names. */
207
- namespaceConfigs?: FormsSubmissionsExtensionNamespaceConfig[];
208
- }
209
- interface SpiBaseUri {
210
- /**
211
- * Base URI where the methods are called. Wix appends the path to the `baseUri`.
212
- * 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/`.
213
- */
214
- baseUri?: string;
215
- /** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */
216
- alternativeUris?: AlternativeUri[];
217
- }
218
- interface AlternativeUri {
219
- /**
220
- * Name of the method to create a custom URI for.
221
- *
222
- * For `methodName`, use the name of the method in PascalCase.
223
- * For example, for Get Shipping Rates use `GetShippingRates`.
224
- */
225
- methodName?: string;
226
- /**
227
- * 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.
228
- * Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.
229
- */
230
- absoluteUri?: string;
231
- }
232
- interface FormsSubmissionsExtensionNamespaceConfig {
233
- /**
234
- * The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`.
235
- *
236
- * Call `Get Submission` to retrieve the namespace.
237
- */
238
- namespace?: string;
239
- /**
240
- * The ID of the specific form that will trigger the defined methods when a submission is made.
241
- * This field is optional. If not provided, submissions from all forms will trigger the methods.
242
- */
243
- formId?: string | null;
244
- /** Enable submission validation. */
245
- submissionValidationEnabled?: boolean;
246
- }
247
- /**
248
- * this message is not directly used by any service,
249
- * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
250
- * e.g. SPIs, event-handlers, etc..
251
- * NOTE: this context object MUST be provided as the last argument in each Velo method signature.
252
- *
253
- * Example:
254
- * ```typescript
255
- * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
256
- * ...
257
- * }
258
- * ```
259
- */
260
- interface Context {
261
- /** 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. */
262
- requestId?: string | null;
263
- /** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. */
264
- currency?: string | null;
265
- /** An object that describes the identity that triggered this request. */
266
- identity?: IdentificationData;
267
- /** 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"`. */
268
- languages?: string[];
269
- /** The service provider app's instance ID. */
270
- instanceId?: string | null;
271
- }
272
- declare enum IdentityType {
273
- UNKNOWN = "UNKNOWN",
274
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
275
- MEMBER = "MEMBER",
276
- WIX_USER = "WIX_USER",
277
- APP = "APP"
278
- }
279
- interface IdentificationData extends IdentificationDataIdOneOf {
280
- /** ID of a site visitor that has not logged in to the site. */
281
- anonymousVisitorId?: string;
282
- /** ID of a site visitor that has logged in to the site. */
283
- memberId?: string;
284
- /** ID of a Wix user (site owner, contributor, etc.). */
285
- wixUserId?: string;
286
- /** ID of an app. */
287
- appId?: string;
288
- /** @readonly */
289
- identityType?: IdentityType;
290
- }
291
- /** @oneof */
292
- interface IdentificationDataIdOneOf {
293
- /** ID of a site visitor that has not logged in to the site. */
294
- anonymousVisitorId?: string;
295
- /** ID of a site visitor that has logged in to the site. */
296
- memberId?: string;
297
- /** ID of a Wix user (site owner, contributor, etc.). */
298
- wixUserId?: string;
299
- /** ID of an app. */
300
- appId?: string;
301
- }
302
-
303
- type ServicePluginMethodInput = {
304
- request: any;
305
- metadata: any;
306
- };
307
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
308
- type ServicePluginMethodMetadata = {
309
- name: string;
310
- primaryHttpMappingPath: string;
311
- transformations: {
312
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
313
- toREST: (...args: unknown[]) => unknown;
314
- };
315
- };
316
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
317
- __type: 'service-plugin-definition';
318
- componentType: string;
319
- methods: ServicePluginMethodMetadata[];
320
- __contract: Contract;
321
- };
322
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
323
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
324
-
325
- declare global {
326
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
327
- interface SymbolConstructor {
328
- readonly observable: symbol;
329
- }
330
- }
331
-
332
- declare global {
333
- interface ContextualClient {
334
- }
335
- }
336
-
337
- interface ValidateSubmissionEnvelope {
338
- request: ValidateSubmissionRequest;
339
- metadata: Context;
340
- }
341
- declare const provideHandlers$1: ServicePluginDefinition<{
342
- /**
343
- *
344
- * > **Note:** The Form Submission service plugin only works with the Wix Forms app.
345
- *
346
- * Validates a submission.
347
- *
348
- * 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. */
349
- validateSubmission(payload: ValidateSubmissionEnvelope): ValidateSubmissionResponse | Promise<ValidateSubmissionResponse>;
350
- }>;
351
-
352
- declare function createServicePluginModule<T extends ServicePluginDefinition<any>>(servicePluginDefinition: T): BuildServicePluginDefinition<T> & T;
353
-
354
- type _publicProvideHandlersType = typeof provideHandlers$1;
355
- declare const provideHandlers: ReturnType<typeof createServicePluginModule<_publicProvideHandlersType>>;
356
-
357
- type context_ActionType = ActionType;
358
- declare const context_ActionType: typeof ActionType;
359
- type context_AlternativeUri = AlternativeUri;
360
- type context_Context = Context;
361
- type context_ExtendedFields = ExtendedFields;
362
- type context_FormSubmission = FormSubmission;
363
- type context_FormSubmissionSpiExtensionConfig = FormSubmissionSpiExtensionConfig;
364
- type context_FormsSubmissionsExtensionNamespaceConfig = FormsSubmissionsExtensionNamespaceConfig;
365
- type context_IdentificationData = IdentificationData;
366
- type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
367
- type context_IdentityType = IdentityType;
368
- declare const context_IdentityType: typeof IdentityType;
369
- type context_OrderDetails = OrderDetails;
370
- type context_SpiBaseUri = SpiBaseUri;
371
- type context_SubmissionErrorType = SubmissionErrorType;
372
- declare const context_SubmissionErrorType: typeof SubmissionErrorType;
373
- type context_SubmissionStatus = SubmissionStatus;
374
- declare const context_SubmissionStatus: typeof SubmissionStatus;
375
- type context_SubmissionValidationError = SubmissionValidationError;
376
- type context_SubmissionValidationErrorErrorMessageOneOf = SubmissionValidationErrorErrorMessageOneOf;
377
- type context_Submitter = Submitter;
378
- type context_SubmitterSubmitterOneOf = SubmitterSubmitterOneOf;
379
- type context_UpdateOptions = UpdateOptions;
380
- type context_ValidateSubmissionRequest = ValidateSubmissionRequest;
381
- type context_ValidateSubmissionRequestActionsOneOf = ValidateSubmissionRequestActionsOneOf;
382
- type context_ValidateSubmissionResponse = ValidateSubmissionResponse;
383
- type context__publicProvideHandlersType = _publicProvideHandlersType;
384
- declare const context_provideHandlers: typeof provideHandlers;
385
- declare namespace context {
386
- 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, type context__publicProvideHandlersType as _publicProvideHandlersType, context_provideHandlers as provideHandlers, provideHandlers$1 as publicProvideHandlers };
387
- }
388
-
389
- export { context as formSubmissions };