@wix/auto_sdk_intake-forms_intake-forms 1.0.0

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 (39) hide show
  1. package/build/cjs/index.d.ts +105 -0
  2. package/build/cjs/index.js +507 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +474 -0
  5. package/build/cjs/index.typings.js +450 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +366 -0
  8. package/build/cjs/meta.js +389 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/es/index.d.mts +105 -0
  11. package/build/es/index.mjs +477 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/index.typings.d.mts +474 -0
  14. package/build/es/index.typings.mjs +420 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +366 -0
  17. package/build/es/meta.mjs +356 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/es/package.json +3 -0
  20. package/build/internal/cjs/index.d.ts +105 -0
  21. package/build/internal/cjs/index.js +507 -0
  22. package/build/internal/cjs/index.js.map +1 -0
  23. package/build/internal/cjs/index.typings.d.ts +474 -0
  24. package/build/internal/cjs/index.typings.js +450 -0
  25. package/build/internal/cjs/index.typings.js.map +1 -0
  26. package/build/internal/cjs/meta.d.ts +366 -0
  27. package/build/internal/cjs/meta.js +389 -0
  28. package/build/internal/cjs/meta.js.map +1 -0
  29. package/build/internal/es/index.d.mts +105 -0
  30. package/build/internal/es/index.mjs +477 -0
  31. package/build/internal/es/index.mjs.map +1 -0
  32. package/build/internal/es/index.typings.d.mts +474 -0
  33. package/build/internal/es/index.typings.mjs +420 -0
  34. package/build/internal/es/index.typings.mjs.map +1 -0
  35. package/build/internal/es/meta.d.mts +366 -0
  36. package/build/internal/es/meta.mjs +356 -0
  37. package/build/internal/es/meta.mjs.map +1 -0
  38. package/meta/package.json +3 -0
  39. package/package.json +54 -0
@@ -0,0 +1,474 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface IntakeForm {
4
+ /**
5
+ * Intake form ID.
6
+ * @format GUID
7
+ * @readonly
8
+ */
9
+ _id?: string | null;
10
+ /**
11
+ * Expiration period in months. If not set, submissions don't expire.
12
+ * @min 1
13
+ * @max 60
14
+ */
15
+ expirationPeriodInMonths?: number | null;
16
+ /**
17
+ * Whether the intake form is archived and disabled from accepting new submissions.
18
+ * @readonly
19
+ */
20
+ archived?: boolean | null;
21
+ /**
22
+ * Intake form name.
23
+ * @minLength 1
24
+ * @maxLength 100
25
+ * @readonly
26
+ */
27
+ name?: string | null;
28
+ /**
29
+ * Date and time the intake form was created in UTC datetime `YYYY-MM-DDThh:mm:ssZ` format.
30
+ * @readonly
31
+ */
32
+ _createdDate?: Date | null;
33
+ /**
34
+ * Date and time the intake form was updated in UTC datetime `YYYY-MM-DDThh:mm:ssZ` format.
35
+ * @readonly
36
+ */
37
+ _updatedDate?: Date | null;
38
+ /**
39
+ * Revision number, which increments by 1 each time the intake form is updated.
40
+ * To prevent conflicting changes, the current revision must be passed when updating the intake form.
41
+ * @readonly
42
+ */
43
+ revision?: string | null;
44
+ }
45
+ interface QueryIntakeFormsRequest {
46
+ /**
47
+ * Filter object.
48
+ * See @API Query Language
49
+ * for more information.
50
+ *
51
+ * For a detailed list of supported filters, see
52
+ * @Supported Filters.
53
+ */
54
+ query?: CursorQuery;
55
+ }
56
+ interface CursorQuery extends CursorQueryPagingMethodOneOf {
57
+ /**
58
+ * Cursor paging options.
59
+ *
60
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
61
+ */
62
+ cursorPaging?: CursorPaging;
63
+ /**
64
+ * Filter object.
65
+ *
66
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
67
+ */
68
+ filter?: Record<string, any> | null;
69
+ /**
70
+ * Sort object.
71
+ *
72
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
73
+ * @maxSize 5
74
+ */
75
+ sort?: Sorting[];
76
+ }
77
+ /** @oneof */
78
+ interface CursorQueryPagingMethodOneOf {
79
+ /**
80
+ * Cursor paging options.
81
+ *
82
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
83
+ */
84
+ cursorPaging?: CursorPaging;
85
+ }
86
+ interface Sorting {
87
+ /**
88
+ * Name of the field to sort by.
89
+ * @maxLength 512
90
+ */
91
+ fieldName?: string;
92
+ /** Sort order. */
93
+ order?: SortOrderWithLiterals;
94
+ }
95
+ declare enum SortOrder {
96
+ ASC = "ASC",
97
+ DESC = "DESC"
98
+ }
99
+ /** @enumType */
100
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
101
+ interface CursorPaging {
102
+ /**
103
+ * Maximum number of items to return in the results.
104
+ * @max 100
105
+ */
106
+ limit?: number | null;
107
+ /**
108
+ * Pointer to the next or previous page in the list of results.
109
+ *
110
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
111
+ * Not relevant for the first request.
112
+ * @maxLength 16000
113
+ */
114
+ cursor?: string | null;
115
+ }
116
+ interface QueryIntakeFormsResponse {
117
+ /** Retrieved intake forms. */
118
+ intakeForms?: IntakeForm[];
119
+ /** Paging metadata. */
120
+ pagingMetadata?: CursorPagingMetadata;
121
+ }
122
+ interface CursorPagingMetadata {
123
+ /** Number of items returned in current page. */
124
+ count?: number | null;
125
+ /** Cursor strings that point to the next page, previous page, or both. */
126
+ cursors?: Cursors;
127
+ /**
128
+ * Whether there are more pages to retrieve following the current page.
129
+ *
130
+ * + `true`: Another page of results can be retrieved.
131
+ * + `false`: This is the last page.
132
+ */
133
+ hasNext?: boolean | null;
134
+ }
135
+ interface Cursors {
136
+ /**
137
+ * Cursor string pointing to the next page in the list of results.
138
+ * @maxLength 16000
139
+ */
140
+ next?: string | null;
141
+ /**
142
+ * Cursor pointing to the previous page in the list of results.
143
+ * @maxLength 16000
144
+ */
145
+ prev?: string | null;
146
+ }
147
+ interface UpdateIntakeFormExpirationPeriodRequest {
148
+ /**
149
+ * Intake form ID.
150
+ * @format GUID
151
+ */
152
+ intakeFormId: string | null;
153
+ /**
154
+ * New expiration period in months. If not set, submissions don't expire.
155
+ * @min 1
156
+ * @max 60
157
+ */
158
+ expirationPeriodInMonths?: number | null;
159
+ /**
160
+ * Revision number, which increments by 1 each time the intake form is updated.
161
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
162
+ */
163
+ formRevision: string | null;
164
+ }
165
+ interface UpdateIntakeFormExpirationPeriodResponse {
166
+ /** Updated intake form. */
167
+ intakeForm?: IntakeForm;
168
+ }
169
+ interface CreateCustomerSubmissionLinkRequest {
170
+ /**
171
+ * Intake form ID.
172
+ * @format GUID
173
+ */
174
+ intakeFormId: string | null;
175
+ /**
176
+ * [Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/introduction) ID to personalize and pre-fill the submission with the contact's information.
177
+ * @format GUID
178
+ */
179
+ contactId?: string | null;
180
+ }
181
+ interface CreateCustomerSubmissionLinkResponse {
182
+ /**
183
+ * Generated link URL for the intake form submission.
184
+ * @minLength 1
185
+ * @maxLength 2048
186
+ */
187
+ intakeFormUrl?: string | null;
188
+ /**
189
+ * Encrypted token containing contact details. Available only if you specified `contactId` in request.
190
+ * @maxLength 2048
191
+ */
192
+ token?: string | null;
193
+ }
194
+ interface DeleteIntakeFormRequest {
195
+ /**
196
+ * Intake form ID.
197
+ * @format GUID
198
+ */
199
+ intakeFormId: string | null;
200
+ }
201
+ interface DeleteIntakeFormResponse {
202
+ }
203
+ interface ArchiveIntakeFormRequest {
204
+ /**
205
+ * Intake form ID.
206
+ * @format GUID
207
+ */
208
+ intakeFormId: string | null;
209
+ /**
210
+ * Revision number, which increments by 1 each time the intake form is updated.
211
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
212
+ */
213
+ formRevision: string | null;
214
+ }
215
+ interface ArchiveIntakeFormResponse {
216
+ /** Archived intake form. */
217
+ intakeForm?: IntakeForm;
218
+ }
219
+ interface UnarchiveIntakeFormRequest {
220
+ /**
221
+ * Intake form ID.
222
+ * @format GUID
223
+ */
224
+ intakeFormId: string | null;
225
+ /**
226
+ * Revision number, which increments by 1 each time the intake form is updated.
227
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
228
+ */
229
+ formRevision: string | null;
230
+ }
231
+ interface UnarchiveIntakeFormResponse {
232
+ /** Unarchived intake form. */
233
+ intakeForm?: IntakeForm;
234
+ }
235
+ interface DomainEvent extends DomainEventBodyOneOf {
236
+ createdEvent?: EntityCreatedEvent;
237
+ updatedEvent?: EntityUpdatedEvent;
238
+ deletedEvent?: EntityDeletedEvent;
239
+ actionEvent?: ActionEvent;
240
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
241
+ _id?: string;
242
+ /**
243
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
244
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
245
+ */
246
+ entityFqdn?: string;
247
+ /**
248
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
249
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
250
+ */
251
+ slug?: string;
252
+ /** ID of the entity associated with the event. */
253
+ entityId?: string;
254
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
255
+ eventTime?: Date | null;
256
+ /**
257
+ * Whether the event was triggered as a result of a privacy regulation application
258
+ * (for example, GDPR).
259
+ */
260
+ triggeredByAnonymizeRequest?: boolean | null;
261
+ /** If present, indicates the action that triggered the event. */
262
+ originatedFrom?: string | null;
263
+ /**
264
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
265
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
266
+ */
267
+ entityEventSequence?: string | null;
268
+ }
269
+ /** @oneof */
270
+ interface DomainEventBodyOneOf {
271
+ createdEvent?: EntityCreatedEvent;
272
+ updatedEvent?: EntityUpdatedEvent;
273
+ deletedEvent?: EntityDeletedEvent;
274
+ actionEvent?: ActionEvent;
275
+ }
276
+ interface EntityCreatedEvent {
277
+ entity?: string;
278
+ }
279
+ interface RestoreInfo {
280
+ deletedDate?: Date | null;
281
+ }
282
+ interface EntityUpdatedEvent {
283
+ /**
284
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
285
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
286
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
287
+ */
288
+ currentEntity?: string;
289
+ }
290
+ interface EntityDeletedEvent {
291
+ /** Entity that was deleted. */
292
+ deletedEntity?: string | null;
293
+ }
294
+ interface ActionEvent {
295
+ body?: string;
296
+ }
297
+ interface Empty {
298
+ }
299
+ interface DecryptContactDetailsFromTokenRequest {
300
+ /**
301
+ * Encrypted token containing contact details and creation timestamp.
302
+ * Generated by [Create Customer Submission Link](TODO) when a `contactId` is provided.
303
+ * @minLength 1
304
+ * @maxLength 2048
305
+ */
306
+ token?: string;
307
+ }
308
+ interface DecryptContactDetailsFromTokenResponse {
309
+ /** Contact details extracted from the token. */
310
+ contactDetails?: ContactDetails;
311
+ }
312
+ interface ContactDetails {
313
+ /**
314
+ * Contact email address. Always present.
315
+ * @format EMAIL
316
+ */
317
+ email?: string;
318
+ /**
319
+ * Contact first name. Present when the contact record has a first name.
320
+ * @maxLength 200
321
+ */
322
+ firstName?: string | null;
323
+ /**
324
+ * Contact last name. Present when the contact record has a last name.
325
+ * @maxLength 200
326
+ */
327
+ lastName?: string | null;
328
+ }
329
+ /** @docsIgnore */
330
+ type CreateCustomerSubmissionLinkApplicationErrors = {
331
+ code?: 'MISSING_SITE_URL';
332
+ description?: string;
333
+ data?: Record<string, any>;
334
+ };
335
+ /**
336
+ * Retrieves a list of intake forms, with the specified paging, filtering, and sorting.
337
+ *
338
+ *
339
+ * QueryIntakeForms runs with these defaults, which you can override:
340
+ *
341
+ * - `createdDate` is sorted in `DESC` order.
342
+ * - `paging.limit` is `50`.
343
+ * - `paging.offset` is `0`.
344
+ *
345
+ * For field support for filters and sorting, see [Supported Filters and Sorting](TODO: Add link).
346
+ *
347
+ * Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language).
348
+ * @public
349
+ * @documentationMaturity preview
350
+ * @permissionId INTAKE_FORM.INTAKE_FORM_READ
351
+ * @fqn wix.intakeforms.v1.IntakeFormsService.QueryIntakeForms
352
+ */
353
+ declare function queryIntakeForms(options?: QueryIntakeFormsOptions): Promise<NonNullablePaths<QueryIntakeFormsResponse, `intakeForms`, 2>>;
354
+ interface QueryIntakeFormsOptions {
355
+ /**
356
+ * Filter object.
357
+ * See
358
+ * @API Query Language
359
+ * for more information.
360
+ *
361
+ * For a detailed list of supported filters, see
362
+ * @Supported Filters.
363
+ */
364
+ query?: CursorQuery;
365
+ }
366
+ /**
367
+ * Updates the expiration period of a specific intake form.
368
+ *
369
+ *
370
+ * Each time the intake form is updated, `revision` increments by 1.
371
+ * You must specify the current `revision` when updating the intake form.
372
+ * This ensures you're working with the latest intake form and prevents unintended overwrites.
373
+ * @param intakeFormId - Intake form ID.
374
+ * @public
375
+ * @documentationMaturity preview
376
+ * @requiredField intakeFormId
377
+ * @requiredField options.formRevision
378
+ * @permissionId INTAKE_FORM.INTAKE_FORM_UPDATE
379
+ * @fqn wix.intakeforms.v1.IntakeFormsService.UpdateIntakeFormExpirationPeriod
380
+ */
381
+ declare function updateIntakeFormExpirationPeriod(intakeFormId: string, options?: NonNullablePaths<UpdateIntakeFormExpirationPeriodOptions, `formRevision`, 2>): Promise<UpdateIntakeFormExpirationPeriodResponse>;
382
+ interface UpdateIntakeFormExpirationPeriodOptions {
383
+ /**
384
+ * New expiration period in months. If not set, submissions don't expire.
385
+ * @min 1
386
+ * @max 60
387
+ */
388
+ expirationPeriodInMonths?: number | null;
389
+ /**
390
+ * Revision number, which increments by 1 each time the intake form is updated.
391
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
392
+ */
393
+ formRevision: string | null;
394
+ }
395
+ /**
396
+ * Creates a shareable link for customers to submit an intake form.
397
+ *
398
+ *
399
+ * The link allows customers to submit their intake form submission.
400
+ *
401
+ * If you specify `contactId`, the link is personalized and pre-fills the submission with the [contact's](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/introduction) information.
402
+ * @param intakeFormId - Intake form ID.
403
+ * @public
404
+ * @documentationMaturity preview
405
+ * @requiredField intakeFormId
406
+ * @permissionId INTAKE_FORMS.CUSTOMER_SUBMISSION_LINK_CREATE
407
+ * @fqn wix.intakeforms.v1.IntakeFormsService.CreateCustomerSubmissionLink
408
+ */
409
+ declare function createCustomerSubmissionLink(intakeFormId: string, options?: CreateCustomerSubmissionLinkOptions): Promise<CreateCustomerSubmissionLinkResponse & {
410
+ __applicationErrorsType?: CreateCustomerSubmissionLinkApplicationErrors;
411
+ }>;
412
+ interface CreateCustomerSubmissionLinkOptions {
413
+ /**
414
+ * [Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/introduction) ID to personalize and pre-fill the submission with the contact's information.
415
+ * @format GUID
416
+ */
417
+ contactId?: string | null;
418
+ }
419
+ /**
420
+ * Deletes an intake form.
421
+ *
422
+ *
423
+ * Also deletes the underlying [Wix form](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/introduction).
424
+ *
425
+ * Existing [submissions](TODO) for the intake form aren't automatically deleted but become orphaned.
426
+ * When [querying submissions](TODO), orphaned submissions aren't returned.
427
+ * @param intakeFormId - Intake form ID.
428
+ * @public
429
+ * @documentationMaturity preview
430
+ * @requiredField intakeFormId
431
+ * @permissionId INTAKE_FORM.INTAKE_FORM_DELETE
432
+ * @fqn wix.intakeforms.v1.IntakeFormsService.DeleteIntakeForm
433
+ */
434
+ declare function deleteIntakeForm(intakeFormId: string): Promise<void>;
435
+ /**
436
+ * Archives an intake form, disabling it from accepting new submissions.
437
+ *
438
+ *
439
+ * Each time the intake form is updated, `revision` increments by 1.
440
+ * You must specify the current `revision` when updating the intake form.
441
+ * This ensures you're working with the latest intake form and prevents unintended overwrites.
442
+ *
443
+ * You can [unarchive](TODO) the form later to resume accepting submissions.
444
+ * @param intakeFormId - Intake form ID.
445
+ * @param formRevision - Revision number, which increments by 1 each time the intake form is updated.
446
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
447
+ * @public
448
+ * @documentationMaturity preview
449
+ * @requiredField formRevision
450
+ * @requiredField intakeFormId
451
+ * @permissionId INTAKE_FORM.INTAKE_FORM_UPDATE
452
+ * @fqn wix.intakeforms.v1.IntakeFormsService.ArchiveIntakeForm
453
+ */
454
+ declare function archiveIntakeForm(intakeFormId: string, formRevision: string): Promise<ArchiveIntakeFormResponse>;
455
+ /**
456
+ * Unarchives an intake form, enabling it to accept new submissions.
457
+ *
458
+ *
459
+ * Each time the intake form is updated, `revision` increments by 1.
460
+ * You must specify the current `revision` when updating the intake form.
461
+ * This ensures you're working with the latest intake form and prevents unintended overwrites.
462
+ * @param intakeFormId - Intake form ID.
463
+ * @param formRevision - Revision number, which increments by 1 each time the intake form is updated.
464
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
465
+ * @public
466
+ * @documentationMaturity preview
467
+ * @requiredField formRevision
468
+ * @requiredField intakeFormId
469
+ * @permissionId INTAKE_FORM.INTAKE_FORM_UPDATE
470
+ * @fqn wix.intakeforms.v1.IntakeFormsService.UnarchiveIntakeForm
471
+ */
472
+ declare function unarchiveIntakeForm(intakeFormId: string, formRevision: string): Promise<UnarchiveIntakeFormResponse>;
473
+
474
+ export { type ActionEvent, type ArchiveIntakeFormRequest, type ArchiveIntakeFormResponse, type ContactDetails, type CreateCustomerSubmissionLinkApplicationErrors, type CreateCustomerSubmissionLinkOptions, type CreateCustomerSubmissionLinkRequest, type CreateCustomerSubmissionLinkResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DecryptContactDetailsFromTokenRequest, type DecryptContactDetailsFromTokenResponse, type DeleteIntakeFormRequest, type DeleteIntakeFormResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IntakeForm, type QueryIntakeFormsOptions, type QueryIntakeFormsRequest, type QueryIntakeFormsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type UnarchiveIntakeFormRequest, type UnarchiveIntakeFormResponse, type UpdateIntakeFormExpirationPeriodOptions, type UpdateIntakeFormExpirationPeriodRequest, type UpdateIntakeFormExpirationPeriodResponse, archiveIntakeForm, createCustomerSubmissionLink, deleteIntakeForm, queryIntakeForms, unarchiveIntakeForm, updateIntakeFormExpirationPeriod };