@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,105 @@
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { QueryIntakeFormsOptions, QueryIntakeFormsResponse, UpdateIntakeFormExpirationPeriodOptions, UpdateIntakeFormExpirationPeriodResponse, CreateCustomerSubmissionLinkOptions, CreateCustomerSubmissionLinkResponse, CreateCustomerSubmissionLinkApplicationErrors, ArchiveIntakeFormResponse, UnarchiveIntakeFormResponse } from './index.typings.js';
3
+ export { ActionEvent, ArchiveIntakeFormRequest, ContactDetails, CreateCustomerSubmissionLinkRequest, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DecryptContactDetailsFromTokenRequest, DecryptContactDetailsFromTokenResponse, DeleteIntakeFormRequest, DeleteIntakeFormResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, IntakeForm, QueryIntakeFormsRequest, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, UnarchiveIntakeFormRequest, UpdateIntakeFormExpirationPeriodRequest } from './index.typings.js';
4
+
5
+ declare function queryIntakeForms$1(httpClient: HttpClient): QueryIntakeFormsSignature;
6
+ interface QueryIntakeFormsSignature {
7
+ /**
8
+ * Retrieves a list of intake forms, with the specified paging, filtering, and sorting.
9
+ *
10
+ *
11
+ * QueryIntakeForms runs with these defaults, which you can override:
12
+ *
13
+ * - `createdDate` is sorted in `DESC` order.
14
+ * - `paging.limit` is `50`.
15
+ * - `paging.offset` is `0`.
16
+ *
17
+ * For field support for filters and sorting, see [Supported Filters and Sorting](TODO: Add link).
18
+ *
19
+ * 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).
20
+ */
21
+ (options?: QueryIntakeFormsOptions): Promise<NonNullablePaths<QueryIntakeFormsResponse, `intakeForms`, 2>>;
22
+ }
23
+ declare function updateIntakeFormExpirationPeriod$1(httpClient: HttpClient): UpdateIntakeFormExpirationPeriodSignature;
24
+ interface UpdateIntakeFormExpirationPeriodSignature {
25
+ /**
26
+ * Updates the expiration period of a specific intake form.
27
+ *
28
+ *
29
+ * Each time the intake form is updated, `revision` increments by 1.
30
+ * You must specify the current `revision` when updating the intake form.
31
+ * This ensures you're working with the latest intake form and prevents unintended overwrites.
32
+ * @param - Intake form ID.
33
+ */
34
+ (intakeFormId: string, options?: NonNullablePaths<UpdateIntakeFormExpirationPeriodOptions, `formRevision`, 2>): Promise<UpdateIntakeFormExpirationPeriodResponse>;
35
+ }
36
+ declare function createCustomerSubmissionLink$1(httpClient: HttpClient): CreateCustomerSubmissionLinkSignature;
37
+ interface CreateCustomerSubmissionLinkSignature {
38
+ /**
39
+ * Creates a shareable link for customers to submit an intake form.
40
+ *
41
+ *
42
+ * The link allows customers to submit their intake form submission.
43
+ *
44
+ * 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.
45
+ * @param - Intake form ID.
46
+ */
47
+ (intakeFormId: string, options?: CreateCustomerSubmissionLinkOptions): Promise<CreateCustomerSubmissionLinkResponse & {
48
+ __applicationErrorsType?: CreateCustomerSubmissionLinkApplicationErrors;
49
+ }>;
50
+ }
51
+ declare function deleteIntakeForm$1(httpClient: HttpClient): DeleteIntakeFormSignature;
52
+ interface DeleteIntakeFormSignature {
53
+ /**
54
+ * Deletes an intake form.
55
+ *
56
+ *
57
+ * Also deletes the underlying [Wix form](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/introduction).
58
+ *
59
+ * Existing [submissions](TODO) for the intake form aren't automatically deleted but become orphaned.
60
+ * When [querying submissions](TODO), orphaned submissions aren't returned.
61
+ * @param - Intake form ID.
62
+ */
63
+ (intakeFormId: string): Promise<void>;
64
+ }
65
+ declare function archiveIntakeForm$1(httpClient: HttpClient): ArchiveIntakeFormSignature;
66
+ interface ArchiveIntakeFormSignature {
67
+ /**
68
+ * Archives an intake form, disabling it from accepting new submissions.
69
+ *
70
+ *
71
+ * Each time the intake form is updated, `revision` increments by 1.
72
+ * You must specify the current `revision` when updating the intake form.
73
+ * This ensures you're working with the latest intake form and prevents unintended overwrites.
74
+ *
75
+ * You can [unarchive](TODO) the form later to resume accepting submissions.
76
+ * @param - Intake form ID.
77
+ * @param - Revision number, which increments by 1 each time the intake form is updated.
78
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
79
+ */
80
+ (intakeFormId: string, formRevision: string): Promise<ArchiveIntakeFormResponse>;
81
+ }
82
+ declare function unarchiveIntakeForm$1(httpClient: HttpClient): UnarchiveIntakeFormSignature;
83
+ interface UnarchiveIntakeFormSignature {
84
+ /**
85
+ * Unarchives an intake form, enabling it to accept new submissions.
86
+ *
87
+ *
88
+ * Each time the intake form is updated, `revision` increments by 1.
89
+ * You must specify the current `revision` when updating the intake form.
90
+ * This ensures you're working with the latest intake form and prevents unintended overwrites.
91
+ * @param - Intake form ID.
92
+ * @param - Revision number, which increments by 1 each time the intake form is updated.
93
+ * To prevent conflicting changes, you must specify the current revision when updating the intake form.
94
+ */
95
+ (intakeFormId: string, formRevision: string): Promise<UnarchiveIntakeFormResponse>;
96
+ }
97
+
98
+ declare const queryIntakeForms: MaybeContext<BuildRESTFunction<typeof queryIntakeForms$1> & typeof queryIntakeForms$1>;
99
+ declare const updateIntakeFormExpirationPeriod: MaybeContext<BuildRESTFunction<typeof updateIntakeFormExpirationPeriod$1> & typeof updateIntakeFormExpirationPeriod$1>;
100
+ declare const createCustomerSubmissionLink: MaybeContext<BuildRESTFunction<typeof createCustomerSubmissionLink$1> & typeof createCustomerSubmissionLink$1>;
101
+ declare const deleteIntakeForm: MaybeContext<BuildRESTFunction<typeof deleteIntakeForm$1> & typeof deleteIntakeForm$1>;
102
+ declare const archiveIntakeForm: MaybeContext<BuildRESTFunction<typeof archiveIntakeForm$1> & typeof archiveIntakeForm$1>;
103
+ declare const unarchiveIntakeForm: MaybeContext<BuildRESTFunction<typeof unarchiveIntakeForm$1> & typeof unarchiveIntakeForm$1>;
104
+
105
+ export { ArchiveIntakeFormResponse, CreateCustomerSubmissionLinkApplicationErrors, CreateCustomerSubmissionLinkOptions, CreateCustomerSubmissionLinkResponse, QueryIntakeFormsOptions, QueryIntakeFormsResponse, UnarchiveIntakeFormResponse, UpdateIntakeFormExpirationPeriodOptions, UpdateIntakeFormExpirationPeriodResponse, archiveIntakeForm, createCustomerSubmissionLink, deleteIntakeForm, queryIntakeForms, unarchiveIntakeForm, updateIntakeFormExpirationPeriod };
@@ -0,0 +1,507 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ SortOrder: () => SortOrder,
24
+ archiveIntakeForm: () => archiveIntakeForm4,
25
+ createCustomerSubmissionLink: () => createCustomerSubmissionLink4,
26
+ deleteIntakeForm: () => deleteIntakeForm4,
27
+ queryIntakeForms: () => queryIntakeForms4,
28
+ unarchiveIntakeForm: () => unarchiveIntakeForm4,
29
+ updateIntakeFormExpirationPeriod: () => updateIntakeFormExpirationPeriod4
30
+ });
31
+ module.exports = __toCommonJS(index_exports);
32
+
33
+ // src/intake-forms-v1-intake-form-intake-forms.universal.ts
34
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
35
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
36
+
37
+ // src/intake-forms-v1-intake-form-intake-forms.http.ts
38
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
39
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
40
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
41
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
42
+ function resolveWixIntakeformsV1IntakeFormsServiceUrl(opts) {
43
+ const domainToMappings = {
44
+ "manage._base_domain_": [
45
+ {
46
+ srcPath: "/_api/intake-forms/v1/intake-forms",
47
+ destPath: "/v1/intake-forms"
48
+ }
49
+ ],
50
+ "bo._base_domain_": [
51
+ {
52
+ srcPath: "/_api/intake-forms",
53
+ destPath: ""
54
+ }
55
+ ],
56
+ "wixbo.ai": [
57
+ {
58
+ srcPath: "/_api/intake-forms",
59
+ destPath: ""
60
+ }
61
+ ],
62
+ "wix-bo.com": [
63
+ {
64
+ srcPath: "/_api/intake-forms",
65
+ destPath: ""
66
+ }
67
+ ],
68
+ _: [
69
+ {
70
+ srcPath: "/_api/intake-forms/v1/intake-forms",
71
+ destPath: "/v1/intake-forms"
72
+ }
73
+ ],
74
+ "editor._base_domain_": [
75
+ {
76
+ srcPath: "/_api/intake-forms/v1/intake-forms",
77
+ destPath: "/v1/intake-forms"
78
+ }
79
+ ],
80
+ "blocks._base_domain_": [
81
+ {
82
+ srcPath: "/_api/intake-forms/v1/intake-forms",
83
+ destPath: "/v1/intake-forms"
84
+ }
85
+ ],
86
+ "create.editorx": [
87
+ {
88
+ srcPath: "/_api/intake-forms/v1/intake-forms",
89
+ destPath: "/v1/intake-forms"
90
+ }
91
+ ],
92
+ "*.dev.wix-code.com": [
93
+ {
94
+ srcPath: "/_api/intake-forms/v1/intake-forms",
95
+ destPath: "/v1/intake-forms"
96
+ }
97
+ ]
98
+ };
99
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
100
+ }
101
+ var PACKAGE_NAME = "@wix/auto_sdk_intake-forms_intake-forms";
102
+ function queryIntakeForms(payload) {
103
+ function __queryIntakeForms({ host }) {
104
+ const metadata = {
105
+ entityFqdn: "wix.intake_forms.v1.intake_form",
106
+ method: "POST",
107
+ methodFqn: "wix.intakeforms.v1.IntakeFormsService.QueryIntakeForms",
108
+ packageName: PACKAGE_NAME,
109
+ migrationOptions: {
110
+ optInTransformResponse: true
111
+ },
112
+ url: resolveWixIntakeformsV1IntakeFormsServiceUrl({
113
+ protoPath: "/v1/intake-forms/query",
114
+ data: payload,
115
+ host
116
+ }),
117
+ data: payload,
118
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
119
+ {
120
+ transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
121
+ paths: [
122
+ { path: "intakeForms.createdDate" },
123
+ { path: "intakeForms.updatedDate" }
124
+ ]
125
+ }
126
+ ])
127
+ };
128
+ return metadata;
129
+ }
130
+ return __queryIntakeForms;
131
+ }
132
+ function updateIntakeFormExpirationPeriod(payload) {
133
+ function __updateIntakeFormExpirationPeriod({ host }) {
134
+ const metadata = {
135
+ entityFqdn: "wix.intake_forms.v1.intake_form",
136
+ method: "PATCH",
137
+ methodFqn: "wix.intakeforms.v1.IntakeFormsService.UpdateIntakeFormExpirationPeriod",
138
+ packageName: PACKAGE_NAME,
139
+ migrationOptions: {
140
+ optInTransformResponse: true
141
+ },
142
+ url: resolveWixIntakeformsV1IntakeFormsServiceUrl({
143
+ protoPath: "/v1/intake-forms/{intakeFormId}",
144
+ data: payload,
145
+ host
146
+ }),
147
+ data: payload,
148
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
149
+ {
150
+ transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
151
+ paths: [
152
+ { path: "intakeForm.createdDate" },
153
+ { path: "intakeForm.updatedDate" }
154
+ ]
155
+ }
156
+ ])
157
+ };
158
+ return metadata;
159
+ }
160
+ return __updateIntakeFormExpirationPeriod;
161
+ }
162
+ function createCustomerSubmissionLink(payload) {
163
+ function __createCustomerSubmissionLink({ host }) {
164
+ const metadata = {
165
+ entityFqdn: "wix.intake_forms.v1.intake_form",
166
+ method: "GET",
167
+ methodFqn: "wix.intakeforms.v1.IntakeFormsService.CreateCustomerSubmissionLink",
168
+ packageName: PACKAGE_NAME,
169
+ migrationOptions: {
170
+ optInTransformResponse: true
171
+ },
172
+ url: resolveWixIntakeformsV1IntakeFormsServiceUrl({
173
+ protoPath: "/v1/intake-forms/{intakeFormId}/link",
174
+ data: payload,
175
+ host
176
+ }),
177
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
178
+ };
179
+ return metadata;
180
+ }
181
+ return __createCustomerSubmissionLink;
182
+ }
183
+ function deleteIntakeForm(payload) {
184
+ function __deleteIntakeForm({ host }) {
185
+ const metadata = {
186
+ entityFqdn: "wix.intake_forms.v1.intake_form",
187
+ method: "DELETE",
188
+ methodFqn: "wix.intakeforms.v1.IntakeFormsService.DeleteIntakeForm",
189
+ packageName: PACKAGE_NAME,
190
+ migrationOptions: {
191
+ optInTransformResponse: true
192
+ },
193
+ url: resolveWixIntakeformsV1IntakeFormsServiceUrl({
194
+ protoPath: "/v1/intake-forms/{intakeFormId}",
195
+ data: payload,
196
+ host
197
+ }),
198
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
199
+ };
200
+ return metadata;
201
+ }
202
+ return __deleteIntakeForm;
203
+ }
204
+ function archiveIntakeForm(payload) {
205
+ function __archiveIntakeForm({ host }) {
206
+ const metadata = {
207
+ entityFqdn: "wix.intake_forms.v1.intake_form",
208
+ method: "POST",
209
+ methodFqn: "wix.intakeforms.v1.IntakeFormsService.ArchiveIntakeForm",
210
+ packageName: PACKAGE_NAME,
211
+ migrationOptions: {
212
+ optInTransformResponse: true
213
+ },
214
+ url: resolveWixIntakeformsV1IntakeFormsServiceUrl({
215
+ protoPath: "/v1/intake-forms/{intakeFormId}/archive",
216
+ data: payload,
217
+ host
218
+ }),
219
+ data: payload,
220
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
221
+ {
222
+ transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
223
+ paths: [
224
+ { path: "intakeForm.createdDate" },
225
+ { path: "intakeForm.updatedDate" }
226
+ ]
227
+ }
228
+ ])
229
+ };
230
+ return metadata;
231
+ }
232
+ return __archiveIntakeForm;
233
+ }
234
+ function unarchiveIntakeForm(payload) {
235
+ function __unarchiveIntakeForm({ host }) {
236
+ const metadata = {
237
+ entityFqdn: "wix.intake_forms.v1.intake_form",
238
+ method: "POST",
239
+ methodFqn: "wix.intakeforms.v1.IntakeFormsService.UnarchiveIntakeForm",
240
+ packageName: PACKAGE_NAME,
241
+ migrationOptions: {
242
+ optInTransformResponse: true
243
+ },
244
+ url: resolveWixIntakeformsV1IntakeFormsServiceUrl({
245
+ protoPath: "/v1/intake-forms/{intakeFormId}/unarchive",
246
+ data: payload,
247
+ host
248
+ }),
249
+ data: payload,
250
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
251
+ {
252
+ transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
253
+ paths: [
254
+ { path: "intakeForm.createdDate" },
255
+ { path: "intakeForm.updatedDate" }
256
+ ]
257
+ }
258
+ ])
259
+ };
260
+ return metadata;
261
+ }
262
+ return __unarchiveIntakeForm;
263
+ }
264
+
265
+ // src/intake-forms-v1-intake-form-intake-forms.universal.ts
266
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
267
+ SortOrder2["ASC"] = "ASC";
268
+ SortOrder2["DESC"] = "DESC";
269
+ return SortOrder2;
270
+ })(SortOrder || {});
271
+ async function queryIntakeForms2(options) {
272
+ const { httpClient, sideEffects } = arguments[1];
273
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
274
+ query: options?.query
275
+ });
276
+ const reqOpts = queryIntakeForms(payload);
277
+ sideEffects?.onSiteCall?.();
278
+ try {
279
+ const result = await httpClient.request(reqOpts);
280
+ sideEffects?.onSuccess?.(result);
281
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
282
+ } catch (err) {
283
+ const transformedError = (0, import_transform_error.transformError)(
284
+ err,
285
+ {
286
+ spreadPathsToArguments: {},
287
+ explicitPathsToArguments: { query: "$[0].query" },
288
+ singleArgumentUnchanged: false
289
+ },
290
+ ["options"]
291
+ );
292
+ sideEffects?.onError?.(err);
293
+ throw transformedError;
294
+ }
295
+ }
296
+ async function updateIntakeFormExpirationPeriod2(intakeFormId, options) {
297
+ const { httpClient, sideEffects } = arguments[2];
298
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
299
+ intakeFormId,
300
+ expirationPeriodInMonths: options?.expirationPeriodInMonths,
301
+ formRevision: options?.formRevision
302
+ });
303
+ const reqOpts = updateIntakeFormExpirationPeriod(
304
+ payload
305
+ );
306
+ sideEffects?.onSiteCall?.();
307
+ try {
308
+ const result = await httpClient.request(reqOpts);
309
+ sideEffects?.onSuccess?.(result);
310
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
311
+ } catch (err) {
312
+ const transformedError = (0, import_transform_error.transformError)(
313
+ err,
314
+ {
315
+ spreadPathsToArguments: {},
316
+ explicitPathsToArguments: {
317
+ intakeFormId: "$[0]",
318
+ expirationPeriodInMonths: "$[1].expirationPeriodInMonths",
319
+ formRevision: "$[1].formRevision"
320
+ },
321
+ singleArgumentUnchanged: false
322
+ },
323
+ ["intakeFormId", "options"]
324
+ );
325
+ sideEffects?.onError?.(err);
326
+ throw transformedError;
327
+ }
328
+ }
329
+ async function createCustomerSubmissionLink2(intakeFormId, options) {
330
+ const { httpClient, sideEffects } = arguments[2];
331
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
332
+ intakeFormId,
333
+ contactId: options?.contactId
334
+ });
335
+ const reqOpts = createCustomerSubmissionLink(payload);
336
+ sideEffects?.onSiteCall?.();
337
+ try {
338
+ const result = await httpClient.request(reqOpts);
339
+ sideEffects?.onSuccess?.(result);
340
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
341
+ } catch (err) {
342
+ const transformedError = (0, import_transform_error.transformError)(
343
+ err,
344
+ {
345
+ spreadPathsToArguments: {},
346
+ explicitPathsToArguments: {
347
+ intakeFormId: "$[0]",
348
+ contactId: "$[1].contactId"
349
+ },
350
+ singleArgumentUnchanged: false
351
+ },
352
+ ["intakeFormId", "options"]
353
+ );
354
+ sideEffects?.onError?.(err);
355
+ throw transformedError;
356
+ }
357
+ }
358
+ async function deleteIntakeForm2(intakeFormId) {
359
+ const { httpClient, sideEffects } = arguments[1];
360
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
361
+ intakeFormId
362
+ });
363
+ const reqOpts = deleteIntakeForm(payload);
364
+ sideEffects?.onSiteCall?.();
365
+ try {
366
+ const result = await httpClient.request(reqOpts);
367
+ sideEffects?.onSuccess?.(result);
368
+ } catch (err) {
369
+ const transformedError = (0, import_transform_error.transformError)(
370
+ err,
371
+ {
372
+ spreadPathsToArguments: {},
373
+ explicitPathsToArguments: { intakeFormId: "$[0]" },
374
+ singleArgumentUnchanged: false
375
+ },
376
+ ["intakeFormId"]
377
+ );
378
+ sideEffects?.onError?.(err);
379
+ throw transformedError;
380
+ }
381
+ }
382
+ async function archiveIntakeForm2(intakeFormId, formRevision) {
383
+ const { httpClient, sideEffects } = arguments[2];
384
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
385
+ intakeFormId,
386
+ formRevision
387
+ });
388
+ const reqOpts = archiveIntakeForm(payload);
389
+ sideEffects?.onSiteCall?.();
390
+ try {
391
+ const result = await httpClient.request(reqOpts);
392
+ sideEffects?.onSuccess?.(result);
393
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
394
+ } catch (err) {
395
+ const transformedError = (0, import_transform_error.transformError)(
396
+ err,
397
+ {
398
+ spreadPathsToArguments: {},
399
+ explicitPathsToArguments: {
400
+ intakeFormId: "$[0]",
401
+ formRevision: "$[1]"
402
+ },
403
+ singleArgumentUnchanged: false
404
+ },
405
+ ["intakeFormId", "formRevision"]
406
+ );
407
+ sideEffects?.onError?.(err);
408
+ throw transformedError;
409
+ }
410
+ }
411
+ async function unarchiveIntakeForm2(intakeFormId, formRevision) {
412
+ const { httpClient, sideEffects } = arguments[2];
413
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
414
+ intakeFormId,
415
+ formRevision
416
+ });
417
+ const reqOpts = unarchiveIntakeForm(payload);
418
+ sideEffects?.onSiteCall?.();
419
+ try {
420
+ const result = await httpClient.request(reqOpts);
421
+ sideEffects?.onSuccess?.(result);
422
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
423
+ } catch (err) {
424
+ const transformedError = (0, import_transform_error.transformError)(
425
+ err,
426
+ {
427
+ spreadPathsToArguments: {},
428
+ explicitPathsToArguments: {
429
+ intakeFormId: "$[0]",
430
+ formRevision: "$[1]"
431
+ },
432
+ singleArgumentUnchanged: false
433
+ },
434
+ ["intakeFormId", "formRevision"]
435
+ );
436
+ sideEffects?.onError?.(err);
437
+ throw transformedError;
438
+ }
439
+ }
440
+
441
+ // src/intake-forms-v1-intake-form-intake-forms.public.ts
442
+ function queryIntakeForms3(httpClient) {
443
+ return (options) => queryIntakeForms2(
444
+ options,
445
+ // @ts-ignore
446
+ { httpClient }
447
+ );
448
+ }
449
+ function updateIntakeFormExpirationPeriod3(httpClient) {
450
+ return (intakeFormId, options) => updateIntakeFormExpirationPeriod2(
451
+ intakeFormId,
452
+ options,
453
+ // @ts-ignore
454
+ { httpClient }
455
+ );
456
+ }
457
+ function createCustomerSubmissionLink3(httpClient) {
458
+ return (intakeFormId, options) => createCustomerSubmissionLink2(
459
+ intakeFormId,
460
+ options,
461
+ // @ts-ignore
462
+ { httpClient }
463
+ );
464
+ }
465
+ function deleteIntakeForm3(httpClient) {
466
+ return (intakeFormId) => deleteIntakeForm2(
467
+ intakeFormId,
468
+ // @ts-ignore
469
+ { httpClient }
470
+ );
471
+ }
472
+ function archiveIntakeForm3(httpClient) {
473
+ return (intakeFormId, formRevision) => archiveIntakeForm2(
474
+ intakeFormId,
475
+ formRevision,
476
+ // @ts-ignore
477
+ { httpClient }
478
+ );
479
+ }
480
+ function unarchiveIntakeForm3(httpClient) {
481
+ return (intakeFormId, formRevision) => unarchiveIntakeForm2(
482
+ intakeFormId,
483
+ formRevision,
484
+ // @ts-ignore
485
+ { httpClient }
486
+ );
487
+ }
488
+
489
+ // src/intake-forms-v1-intake-form-intake-forms.context.ts
490
+ var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
491
+ var queryIntakeForms4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryIntakeForms3);
492
+ var updateIntakeFormExpirationPeriod4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateIntakeFormExpirationPeriod3);
493
+ var createCustomerSubmissionLink4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createCustomerSubmissionLink3);
494
+ var deleteIntakeForm4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteIntakeForm3);
495
+ var archiveIntakeForm4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(archiveIntakeForm3);
496
+ var unarchiveIntakeForm4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(unarchiveIntakeForm3);
497
+ // Annotate the CommonJS export names for ESM import in node:
498
+ 0 && (module.exports = {
499
+ SortOrder,
500
+ archiveIntakeForm,
501
+ createCustomerSubmissionLink,
502
+ deleteIntakeForm,
503
+ queryIntakeForms,
504
+ unarchiveIntakeForm,
505
+ updateIntakeFormExpirationPeriod
506
+ });
507
+ //# sourceMappingURL=index.js.map