@wix/forms 1.0.66 → 1.0.67

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 (55) hide show
  1. package/build/cjs/context.d.ts +2 -0
  2. package/build/cjs/{index.typings.js → context.js} +4 -3
  3. package/build/cjs/context.js.map +1 -0
  4. package/build/cjs/index.d.ts +2 -1
  5. package/build/cjs/index.js +3 -2
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/cjs/meta.js +3 -2
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +2 -0
  11. package/build/es/context.js +3 -0
  12. package/build/es/context.js.map +1 -0
  13. package/build/es/index.d.ts +2 -1
  14. package/build/es/index.js +2 -1
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +2 -1
  17. package/build/es/meta.js +2 -1
  18. package/build/es/meta.js.map +1 -1
  19. package/context/package.json +6 -0
  20. package/package.json +13 -8
  21. package/build/cjs/index.typings.d.ts +0 -1
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/forms-v4-submission.http.d.ts +0 -96
  24. package/build/cjs/src/forms-v4-submission.http.js +0 -525
  25. package/build/cjs/src/forms-v4-submission.http.js.map +0 -1
  26. package/build/cjs/src/forms-v4-submission.meta.d.ts +0 -42
  27. package/build/cjs/src/forms-v4-submission.meta.js +0 -332
  28. package/build/cjs/src/forms-v4-submission.meta.js.map +0 -1
  29. package/build/cjs/src/forms-v4-submission.public.d.ts +0 -32
  30. package/build/cjs/src/forms-v4-submission.public.js +0 -160
  31. package/build/cjs/src/forms-v4-submission.public.js.map +0 -1
  32. package/build/cjs/src/forms-v4-submission.types.d.ts +0 -3352
  33. package/build/cjs/src/forms-v4-submission.types.js +0 -520
  34. package/build/cjs/src/forms-v4-submission.types.js.map +0 -1
  35. package/build/cjs/src/forms-v4-submission.universal.d.ts +0 -3750
  36. package/build/cjs/src/forms-v4-submission.universal.js +0 -1631
  37. package/build/cjs/src/forms-v4-submission.universal.js.map +0 -1
  38. package/build/es/index.typings.d.ts +0 -1
  39. package/build/es/index.typings.js +0 -2
  40. package/build/es/index.typings.js.map +0 -1
  41. package/build/es/src/forms-v4-submission.http.d.ts +0 -96
  42. package/build/es/src/forms-v4-submission.http.js +0 -506
  43. package/build/es/src/forms-v4-submission.http.js.map +0 -1
  44. package/build/es/src/forms-v4-submission.meta.d.ts +0 -42
  45. package/build/es/src/forms-v4-submission.meta.js +0 -290
  46. package/build/es/src/forms-v4-submission.meta.js.map +0 -1
  47. package/build/es/src/forms-v4-submission.public.d.ts +0 -32
  48. package/build/es/src/forms-v4-submission.public.js +0 -84
  49. package/build/es/src/forms-v4-submission.public.js.map +0 -1
  50. package/build/es/src/forms-v4-submission.types.d.ts +0 -3352
  51. package/build/es/src/forms-v4-submission.types.js +0 -516
  52. package/build/es/src/forms-v4-submission.types.js.map +0 -1
  53. package/build/es/src/forms-v4-submission.universal.d.ts +0 -3750
  54. package/build/es/src/forms-v4-submission.universal.js +0 -1588
  55. package/build/es/src/forms-v4-submission.universal.js.map +0 -1
@@ -1,1588 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
11
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
- import * as ambassadorWixFormsV4Submission from './forms-v4-submission.http';
13
- // @ts-ignore
14
- import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
15
- let __verbose = false;
16
- function __log(...args) {
17
- __verbose && console.log(...args);
18
- }
19
- function __inspect(obj) {
20
- return obj;
21
- }
22
- export const __debug = {
23
- verboseLogging: {
24
- on: () => (__verbose = true),
25
- off: () => (__verbose = false),
26
- },
27
- };
28
- const _toVeloEntity = '$';
29
- const _fromVeloEntity = '$';
30
- export var SubmissionStatus;
31
- (function (SubmissionStatus) {
32
- SubmissionStatus["UNDEFINED"] = "UNDEFINED";
33
- SubmissionStatus["PENDING"] = "PENDING";
34
- SubmissionStatus["CONFIRMED"] = "CONFIRMED";
35
- SubmissionStatus["PAYMENT_WAITING"] = "PAYMENT_WAITING";
36
- SubmissionStatus["PAYMENT_CANCELED"] = "PAYMENT_CANCELED";
37
- })(SubmissionStatus || (SubmissionStatus = {}));
38
- export var Format;
39
- (function (Format) {
40
- Format["UNDEFINED"] = "UNDEFINED";
41
- Format["DATE"] = "DATE";
42
- Format["TIME"] = "TIME";
43
- Format["DATE_TIME"] = "DATE_TIME";
44
- Format["EMAIL"] = "EMAIL";
45
- Format["URL"] = "URL";
46
- Format["UUID"] = "UUID";
47
- Format["PHONE"] = "PHONE";
48
- Format["URI"] = "URI";
49
- Format["HOSTNAME"] = "HOSTNAME";
50
- Format["COLOR_HEX"] = "COLOR_HEX";
51
- Format["CURRENCY"] = "CURRENCY";
52
- Format["LANGUAGE"] = "LANGUAGE";
53
- Format["DATE_OPTIONAL_TIME"] = "DATE_OPTIONAL_TIME";
54
- })(Format || (Format = {}));
55
- export var ValidationFormat;
56
- (function (ValidationFormat) {
57
- ValidationFormat["UNDEFINED"] = "UNDEFINED";
58
- /** File upload validation. */
59
- ValidationFormat["WIX_FILE"] = "WIX_FILE";
60
- /** Payment validation. */
61
- ValidationFormat["PAYMENT"] = "PAYMENT";
62
- })(ValidationFormat || (ValidationFormat = {}));
63
- export var ProductType;
64
- (function (ProductType) {
65
- ProductType["UNKNOWN"] = "UNKNOWN";
66
- /** Shippable (physical). */
67
- ProductType["SHIPPABLE"] = "SHIPPABLE";
68
- /** Digital. */
69
- ProductType["DIGITAL"] = "DIGITAL";
70
- })(ProductType || (ProductType = {}));
71
- export var PriceType;
72
- (function (PriceType) {
73
- PriceType["UNKNOWN"] = "UNKNOWN";
74
- /** Fixed price. */
75
- PriceType["FIXED_PRICE"] = "FIXED_PRICE";
76
- /** Dynamic price from price range. */
77
- PriceType["DYNAMIC_PRICE"] = "DYNAMIC_PRICE";
78
- })(PriceType || (PriceType = {}));
79
- export var FormatEnumFormat;
80
- (function (FormatEnumFormat) {
81
- FormatEnumFormat["UNDEFINED"] = "UNDEFINED";
82
- FormatEnumFormat["DATE"] = "DATE";
83
- FormatEnumFormat["TIME"] = "TIME";
84
- FormatEnumFormat["DATE_TIME"] = "DATE_TIME";
85
- FormatEnumFormat["EMAIL"] = "EMAIL";
86
- FormatEnumFormat["URL"] = "URL";
87
- FormatEnumFormat["UUID"] = "UUID";
88
- FormatEnumFormat["PHONE"] = "PHONE";
89
- FormatEnumFormat["URI"] = "URI";
90
- FormatEnumFormat["HOSTNAME"] = "HOSTNAME";
91
- FormatEnumFormat["COLOR_HEX"] = "COLOR_HEX";
92
- FormatEnumFormat["CURRENCY"] = "CURRENCY";
93
- FormatEnumFormat["LANGUAGE"] = "LANGUAGE";
94
- FormatEnumFormat["DATE_OPTIONAL_TIME"] = "DATE_OPTIONAL_TIME";
95
- })(FormatEnumFormat || (FormatEnumFormat = {}));
96
- export var StringComponentType;
97
- (function (StringComponentType) {
98
- StringComponentType["UNKNOWN"] = "UNKNOWN";
99
- StringComponentType["TEXT_INPUT"] = "TEXT_INPUT";
100
- StringComponentType["RADIO_GROUP"] = "RADIO_GROUP";
101
- StringComponentType["DROPDOWN"] = "DROPDOWN";
102
- StringComponentType["DATE_TIME"] = "DATE_TIME";
103
- })(StringComponentType || (StringComponentType = {}));
104
- export var NodeType;
105
- (function (NodeType) {
106
- NodeType["PARAGRAPH"] = "PARAGRAPH";
107
- NodeType["TEXT"] = "TEXT";
108
- NodeType["HEADING"] = "HEADING";
109
- NodeType["BULLETED_LIST"] = "BULLETED_LIST";
110
- NodeType["ORDERED_LIST"] = "ORDERED_LIST";
111
- NodeType["LIST_ITEM"] = "LIST_ITEM";
112
- NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
113
- NodeType["CODE_BLOCK"] = "CODE_BLOCK";
114
- NodeType["VIDEO"] = "VIDEO";
115
- NodeType["DIVIDER"] = "DIVIDER";
116
- NodeType["FILE"] = "FILE";
117
- NodeType["GALLERY"] = "GALLERY";
118
- NodeType["GIF"] = "GIF";
119
- NodeType["HTML"] = "HTML";
120
- NodeType["IMAGE"] = "IMAGE";
121
- NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
122
- NodeType["MAP"] = "MAP";
123
- NodeType["POLL"] = "POLL";
124
- NodeType["APP_EMBED"] = "APP_EMBED";
125
- NodeType["BUTTON"] = "BUTTON";
126
- NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
127
- NodeType["TABLE"] = "TABLE";
128
- NodeType["EMBED"] = "EMBED";
129
- NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
130
- NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
131
- NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
132
- NodeType["TABLE_CELL"] = "TABLE_CELL";
133
- NodeType["TABLE_ROW"] = "TABLE_ROW";
134
- NodeType["EXTERNAL"] = "EXTERNAL";
135
- NodeType["AUDIO"] = "AUDIO";
136
- })(NodeType || (NodeType = {}));
137
- export var WidthType;
138
- (function (WidthType) {
139
- /** Width matches the content width */
140
- WidthType["CONTENT"] = "CONTENT";
141
- /** Small Width */
142
- WidthType["SMALL"] = "SMALL";
143
- /** Width will match the original asset width */
144
- WidthType["ORIGINAL"] = "ORIGINAL";
145
- /** coast-to-coast display */
146
- WidthType["FULL_WIDTH"] = "FULL_WIDTH";
147
- })(WidthType || (WidthType = {}));
148
- export var PluginContainerDataAlignment;
149
- (function (PluginContainerDataAlignment) {
150
- /** Center Alignment */
151
- PluginContainerDataAlignment["CENTER"] = "CENTER";
152
- /** Left Alignment */
153
- PluginContainerDataAlignment["LEFT"] = "LEFT";
154
- /** Right Alignment */
155
- PluginContainerDataAlignment["RIGHT"] = "RIGHT";
156
- })(PluginContainerDataAlignment || (PluginContainerDataAlignment = {}));
157
- export var Type;
158
- (function (Type) {
159
- /** Regular link button */
160
- Type["LINK"] = "LINK";
161
- /** Triggers custom action that is defined in plugin configuration by the consumer */
162
- Type["ACTION"] = "ACTION";
163
- })(Type || (Type = {}));
164
- export var LinkTarget;
165
- (function (LinkTarget) {
166
- /** Opens the linked document in the same frame as it was clicked (this is default) */
167
- LinkTarget["SELF"] = "SELF";
168
- /** Opens the linked document in a new window or tab */
169
- LinkTarget["BLANK"] = "BLANK";
170
- /** Opens the linked document in the parent frame */
171
- LinkTarget["PARENT"] = "PARENT";
172
- /** Opens the linked document in the full body of the window */
173
- LinkTarget["TOP"] = "TOP";
174
- })(LinkTarget || (LinkTarget = {}));
175
- export var TextAlignment;
176
- (function (TextAlignment) {
177
- /** browser default, eqivalent to `initial` */
178
- TextAlignment["AUTO"] = "AUTO";
179
- /** Left align */
180
- TextAlignment["LEFT"] = "LEFT";
181
- /** Right align */
182
- TextAlignment["RIGHT"] = "RIGHT";
183
- /** Center align */
184
- TextAlignment["CENTER"] = "CENTER";
185
- /** Text is spaced to line up its left and right edges to the left and right edges of the line box, except for the last line. */
186
- TextAlignment["JUSTIFY"] = "JUSTIFY";
187
- })(TextAlignment || (TextAlignment = {}));
188
- export var LineStyle;
189
- (function (LineStyle) {
190
- /** Single Line */
191
- LineStyle["SINGLE"] = "SINGLE";
192
- /** Double Line */
193
- LineStyle["DOUBLE"] = "DOUBLE";
194
- /** Dashed Line */
195
- LineStyle["DASHED"] = "DASHED";
196
- /** Dotted Line */
197
- LineStyle["DOTTED"] = "DOTTED";
198
- })(LineStyle || (LineStyle = {}));
199
- export var Width;
200
- (function (Width) {
201
- /** Large line */
202
- Width["LARGE"] = "LARGE";
203
- /** Medium line */
204
- Width["MEDIUM"] = "MEDIUM";
205
- /** Small line */
206
- Width["SMALL"] = "SMALL";
207
- })(Width || (Width = {}));
208
- export var Alignment;
209
- (function (Alignment) {
210
- /** Center alignment */
211
- Alignment["CENTER"] = "CENTER";
212
- /** Left alignment */
213
- Alignment["LEFT"] = "LEFT";
214
- /** Right alignment */
215
- Alignment["RIGHT"] = "RIGHT";
216
- })(Alignment || (Alignment = {}));
217
- export var ViewMode;
218
- (function (ViewMode) {
219
- /** No PDF view */
220
- ViewMode["NONE"] = "NONE";
221
- /** Full PDF view */
222
- ViewMode["FULL"] = "FULL";
223
- /** Mini PDF view */
224
- ViewMode["MINI"] = "MINI";
225
- })(ViewMode || (ViewMode = {}));
226
- export var LayoutType;
227
- (function (LayoutType) {
228
- /** Collage type */
229
- LayoutType["COLLAGE"] = "COLLAGE";
230
- /** Masonry type */
231
- LayoutType["MASONRY"] = "MASONRY";
232
- /** Grid type */
233
- LayoutType["GRID"] = "GRID";
234
- /** Thumbnail type */
235
- LayoutType["THUMBNAIL"] = "THUMBNAIL";
236
- /** Slider type */
237
- LayoutType["SLIDER"] = "SLIDER";
238
- /** Slideshow type */
239
- LayoutType["SLIDESHOW"] = "SLIDESHOW";
240
- /** Panorama type */
241
- LayoutType["PANORAMA"] = "PANORAMA";
242
- /** Column type */
243
- LayoutType["COLUMN"] = "COLUMN";
244
- /** Magic type */
245
- LayoutType["MAGIC"] = "MAGIC";
246
- /** Fullsize images type */
247
- LayoutType["FULLSIZE"] = "FULLSIZE";
248
- })(LayoutType || (LayoutType = {}));
249
- export var Orientation;
250
- (function (Orientation) {
251
- /** Rows Orientation */
252
- Orientation["ROWS"] = "ROWS";
253
- /** Columns Orientation */
254
- Orientation["COLUMNS"] = "COLUMNS";
255
- })(Orientation || (Orientation = {}));
256
- export var Crop;
257
- (function (Crop) {
258
- /** Crop to fill */
259
- Crop["FILL"] = "FILL";
260
- /** Crop to fit */
261
- Crop["FIT"] = "FIT";
262
- })(Crop || (Crop = {}));
263
- export var ThumbnailsAlignment;
264
- (function (ThumbnailsAlignment) {
265
- /** Top alignment */
266
- ThumbnailsAlignment["TOP"] = "TOP";
267
- /** Right alignment */
268
- ThumbnailsAlignment["RIGHT"] = "RIGHT";
269
- /** Bottom alignment */
270
- ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
271
- /** Left alignment */
272
- ThumbnailsAlignment["LEFT"] = "LEFT";
273
- /** No thumbnail */
274
- ThumbnailsAlignment["NONE"] = "NONE";
275
- })(ThumbnailsAlignment || (ThumbnailsAlignment = {}));
276
- export var Source;
277
- (function (Source) {
278
- Source["HTML"] = "HTML";
279
- Source["ADSENSE"] = "ADSENSE";
280
- })(Source || (Source = {}));
281
- export var MapType;
282
- (function (MapType) {
283
- /** Roadmap map type */
284
- MapType["ROADMAP"] = "ROADMAP";
285
- /** Satellite map type */
286
- MapType["SATELITE"] = "SATELITE";
287
- /** Hybrid map type */
288
- MapType["HYBRID"] = "HYBRID";
289
- /** Terrain map type */
290
- MapType["TERRAIN"] = "TERRAIN";
291
- })(MapType || (MapType = {}));
292
- export var ViewRole;
293
- (function (ViewRole) {
294
- /** Only Poll creator can view the results */
295
- ViewRole["CREATOR"] = "CREATOR";
296
- /** Anyone who voted can see the results */
297
- ViewRole["VOTERS"] = "VOTERS";
298
- /** Anyone can see the results, even if one didn't vote */
299
- ViewRole["EVERYONE"] = "EVERYONE";
300
- })(ViewRole || (ViewRole = {}));
301
- export var VoteRole;
302
- (function (VoteRole) {
303
- /** Logged in member */
304
- VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
305
- /** Anyone */
306
- VoteRole["ALL"] = "ALL";
307
- })(VoteRole || (VoteRole = {}));
308
- export var PollLayoutType;
309
- (function (PollLayoutType) {
310
- /** List */
311
- PollLayoutType["LIST"] = "LIST";
312
- /** Grid */
313
- PollLayoutType["GRID"] = "GRID";
314
- })(PollLayoutType || (PollLayoutType = {}));
315
- export var PollLayoutDirection;
316
- (function (PollLayoutDirection) {
317
- /** Left-to-right */
318
- PollLayoutDirection["LTR"] = "LTR";
319
- /** Right-to-left */
320
- PollLayoutDirection["RTL"] = "RTL";
321
- })(PollLayoutDirection || (PollLayoutDirection = {}));
322
- export var BackgroundType;
323
- (function (BackgroundType) {
324
- /** Color background type */
325
- BackgroundType["COLOR"] = "COLOR";
326
- /** Image background type */
327
- BackgroundType["IMAGE"] = "IMAGE";
328
- /** Gradiant background type */
329
- BackgroundType["GRADIENT"] = "GRADIENT";
330
- })(BackgroundType || (BackgroundType = {}));
331
- export var DecorationType;
332
- (function (DecorationType) {
333
- DecorationType["BOLD"] = "BOLD";
334
- DecorationType["ITALIC"] = "ITALIC";
335
- DecorationType["UNDERLINE"] = "UNDERLINE";
336
- DecorationType["SPOILER"] = "SPOILER";
337
- DecorationType["ANCHOR"] = "ANCHOR";
338
- DecorationType["MENTION"] = "MENTION";
339
- DecorationType["LINK"] = "LINK";
340
- DecorationType["COLOR"] = "COLOR";
341
- DecorationType["FONT_SIZE"] = "FONT_SIZE";
342
- DecorationType["EXTERNAL"] = "EXTERNAL";
343
- })(DecorationType || (DecorationType = {}));
344
- export var FontType;
345
- (function (FontType) {
346
- FontType["PX"] = "PX";
347
- FontType["EM"] = "EM";
348
- })(FontType || (FontType = {}));
349
- export var AppType;
350
- (function (AppType) {
351
- AppType["PRODUCT"] = "PRODUCT";
352
- AppType["EVENT"] = "EVENT";
353
- AppType["BOOKING"] = "BOOKING";
354
- })(AppType || (AppType = {}));
355
- export var InitialExpandedItems;
356
- (function (InitialExpandedItems) {
357
- /** First item will be expended initally */
358
- InitialExpandedItems["FIRST"] = "FIRST";
359
- /** All items will expended initally */
360
- InitialExpandedItems["ALL"] = "ALL";
361
- /** All items collapsed initally */
362
- InitialExpandedItems["NONE"] = "NONE";
363
- })(InitialExpandedItems || (InitialExpandedItems = {}));
364
- export var Direction;
365
- (function (Direction) {
366
- /** Left-to-right */
367
- Direction["LTR"] = "LTR";
368
- /** Right-to-left */
369
- Direction["RTL"] = "RTL";
370
- })(Direction || (Direction = {}));
371
- export var VerticalAlignment;
372
- (function (VerticalAlignment) {
373
- /** Top alignment */
374
- VerticalAlignment["TOP"] = "TOP";
375
- /** Middle alignment */
376
- VerticalAlignment["MIDDLE"] = "MIDDLE";
377
- /** Bottom alignment */
378
- VerticalAlignment["BOTTOM"] = "BOTTOM";
379
- })(VerticalAlignment || (VerticalAlignment = {}));
380
- /**
381
- * `NullValue` is a singleton enumeration to represent the null value for the
382
- * `Value` type union.
383
- *
384
- * The JSON representation for `NullValue` is JSON `null`.
385
- */
386
- export var NullValue;
387
- (function (NullValue) {
388
- /** Null value. */
389
- NullValue["NULL_VALUE"] = "NULL_VALUE";
390
- })(NullValue || (NullValue = {}));
391
- export var DateFormatPart;
392
- (function (DateFormatPart) {
393
- DateFormatPart["YEAR"] = "YEAR";
394
- DateFormatPart["MONTH"] = "MONTH";
395
- DateFormatPart["DAY"] = "DAY";
396
- })(DateFormatPart || (DateFormatPart = {}));
397
- export var DateTimeInputType;
398
- (function (DateTimeInputType) {
399
- DateTimeInputType["UNKNOWN"] = "UNKNOWN";
400
- /** Show date and time input */
401
- DateTimeInputType["DATE_TIME"] = "DATE_TIME";
402
- /** Show only date input */
403
- DateTimeInputType["DATE"] = "DATE";
404
- /** Show only time input */
405
- DateTimeInputType["TIME"] = "TIME";
406
- })(DateTimeInputType || (DateTimeInputType = {}));
407
- export var NumberComponentType;
408
- (function (NumberComponentType) {
409
- NumberComponentType["UNKNOWN"] = "UNKNOWN";
410
- NumberComponentType["NUMBER_INPUT"] = "NUMBER_INPUT";
411
- })(NumberComponentType || (NumberComponentType = {}));
412
- export var BooleanComponentType;
413
- (function (BooleanComponentType) {
414
- BooleanComponentType["UNKNOWN"] = "UNKNOWN";
415
- BooleanComponentType["CHECKBOX"] = "CHECKBOX";
416
- })(BooleanComponentType || (BooleanComponentType = {}));
417
- export var ItemType;
418
- (function (ItemType) {
419
- ItemType["UNKNOWN"] = "UNKNOWN";
420
- ItemType["STRING"] = "STRING";
421
- ItemType["NUMBER"] = "NUMBER";
422
- ItemType["BOOLEAN"] = "BOOLEAN";
423
- ItemType["INTEGER"] = "INTEGER";
424
- ItemType["OBJECT"] = "OBJECT";
425
- })(ItemType || (ItemType = {}));
426
- export var PropertiesTypePropertiesType;
427
- (function (PropertiesTypePropertiesType) {
428
- PropertiesTypePropertiesType["UNKNOWN"] = "UNKNOWN";
429
- PropertiesTypePropertiesType["STRING"] = "STRING";
430
- PropertiesTypePropertiesType["NUMBER"] = "NUMBER";
431
- PropertiesTypePropertiesType["BOOLEAN"] = "BOOLEAN";
432
- PropertiesTypePropertiesType["INTEGER"] = "INTEGER";
433
- PropertiesTypePropertiesType["ARRAY"] = "ARRAY";
434
- })(PropertiesTypePropertiesType || (PropertiesTypePropertiesType = {}));
435
- export var ComponentType;
436
- (function (ComponentType) {
437
- ComponentType["UNKNOWN"] = "UNKNOWN";
438
- ComponentType["CHECKBOX_GROUP"] = "CHECKBOX_GROUP";
439
- })(ComponentType || (ComponentType = {}));
440
- export var WixFileComponentType;
441
- (function (WixFileComponentType) {
442
- WixFileComponentType["UNKNOWN"] = "UNKNOWN";
443
- WixFileComponentType["FILE_UPLOAD"] = "FILE_UPLOAD";
444
- })(WixFileComponentType || (WixFileComponentType = {}));
445
- export var UploadFileFormat;
446
- (function (UploadFileFormat) {
447
- UploadFileFormat["UNDEFINED"] = "UNDEFINED";
448
- /** Video files */
449
- UploadFileFormat["VIDEO"] = "VIDEO";
450
- /** Image files */
451
- UploadFileFormat["IMAGE"] = "IMAGE";
452
- /** Audio files */
453
- UploadFileFormat["AUDIO"] = "AUDIO";
454
- /** Document files */
455
- UploadFileFormat["DOCUMENT"] = "DOCUMENT";
456
- })(UploadFileFormat || (UploadFileFormat = {}));
457
- export var PaymentComponentType;
458
- (function (PaymentComponentType) {
459
- PaymentComponentType["UNKNOWN"] = "UNKNOWN";
460
- PaymentComponentType["CHECKBOX_GROUP"] = "CHECKBOX_GROUP";
461
- })(PaymentComponentType || (PaymentComponentType = {}));
462
- export var InputType;
463
- (function (InputType) {
464
- InputType["UNKNOWN"] = "UNKNOWN";
465
- InputType["STRING"] = "STRING";
466
- InputType["NUMBER"] = "NUMBER";
467
- InputType["BOOLEAN"] = "BOOLEAN";
468
- InputType["ARRAY"] = "ARRAY";
469
- InputType["OBJECT"] = "OBJECT";
470
- InputType["WIX_FILE"] = "WIX_FILE";
471
- InputType["PAYMENT"] = "PAYMENT";
472
- })(InputType || (InputType = {}));
473
- export var Target;
474
- (function (Target) {
475
- Target["UNDEFINED"] = "UNDEFINED";
476
- /** Opened in same browser tab */
477
- Target["SELF"] = "SELF";
478
- /** Url open in new tab */
479
- Target["BLANK"] = "BLANK";
480
- })(Target || (Target = {}));
481
- export var FieldType;
482
- (function (FieldType) {
483
- FieldType["UNKNOWN"] = "UNKNOWN";
484
- FieldType["INPUT"] = "INPUT";
485
- FieldType["DISPLAY"] = "DISPLAY";
486
- FieldType["SUBMIT"] = "SUBMIT";
487
- })(FieldType || (FieldType = {}));
488
- export var OverrideEntityType;
489
- (function (OverrideEntityType) {
490
- OverrideEntityType["UNKNOWN"] = "UNKNOWN";
491
- OverrideEntityType["FIELD"] = "FIELD";
492
- OverrideEntityType["FORM"] = "FORM";
493
- OverrideEntityType["NESTED_FORM_FIELD"] = "NESTED_FORM_FIELD";
494
- })(OverrideEntityType || (OverrideEntityType = {}));
495
- export var Kind;
496
- (function (Kind) {
497
- Kind["REGULAR"] = "REGULAR";
498
- Kind["EXTENSION"] = "EXTENSION";
499
- })(Kind || (Kind = {}));
500
- export var EmailInfoTag;
501
- (function (EmailInfoTag) {
502
- EmailInfoTag["UNTAGGED"] = "UNTAGGED";
503
- EmailInfoTag["MAIN"] = "MAIN";
504
- })(EmailInfoTag || (EmailInfoTag = {}));
505
- export var PhoneInfoTag;
506
- (function (PhoneInfoTag) {
507
- PhoneInfoTag["UNTAGGED"] = "UNTAGGED";
508
- PhoneInfoTag["MAIN"] = "MAIN";
509
- })(PhoneInfoTag || (PhoneInfoTag = {}));
510
- export var Tag;
511
- (function (Tag) {
512
- Tag["UNTAGGED"] = "UNTAGGED";
513
- Tag["HOME"] = "HOME";
514
- })(Tag || (Tag = {}));
515
- export var ContactField;
516
- (function (ContactField) {
517
- ContactField["UNDEFINED"] = "UNDEFINED";
518
- ContactField["FIRST_NAME"] = "FIRST_NAME";
519
- ContactField["LAST_NAME"] = "LAST_NAME";
520
- ContactField["COMPANY"] = "COMPANY";
521
- ContactField["POSITION"] = "POSITION";
522
- ContactField["EMAIL"] = "EMAIL";
523
- ContactField["PHONE"] = "PHONE";
524
- ContactField["ADDRESS"] = "ADDRESS";
525
- ContactField["BIRTHDATE"] = "BIRTHDATE";
526
- ContactField["CUSTOM_FIELD"] = "CUSTOM_FIELD";
527
- ContactField["SUBSCRIPTION"] = "SUBSCRIPTION";
528
- ContactField["VAT_ID"] = "VAT_ID";
529
- })(ContactField || (ContactField = {}));
530
- export var IdentityType;
531
- (function (IdentityType) {
532
- IdentityType["UNKNOWN"] = "UNKNOWN";
533
- /** Existing or new contact */
534
- IdentityType["CONTACT"] = "CONTACT";
535
- /** Member is logged in, matching logic skipped */
536
- IdentityType["MEMBER"] = "MEMBER";
537
- /** Matching contact is a member, Merge logic won't be applied */
538
- IdentityType["NOT_AUTHENTICATED_MEMBER"] = "NOT_AUTHENTICATED_MEMBER";
539
- })(IdentityType || (IdentityType = {}));
540
- export var SortOrder;
541
- (function (SortOrder) {
542
- SortOrder["ASC"] = "ASC";
543
- SortOrder["DESC"] = "DESC";
544
- })(SortOrder || (SortOrder = {}));
545
- const _bulkDeleteSubmissionRequest = {};
546
- const _bulkDeleteSubmissionResponse = {};
547
- const _bulkMarkSubmissionsAsSeenRequest = {};
548
- const _bulkMarkSubmissionsAsSeenResponse = {};
549
- const _bulkRemoveSubmissionFromTrashBinRequest = {};
550
- const _bulkRemoveSubmissionFromTrashBinResponse = {};
551
- const _confirmSubmissionRequest = {};
552
- const _confirmSubmissionResponse = {};
553
- const _countDeletedSubmissionsRequest = {};
554
- const _countDeletedSubmissionsResponse = {};
555
- const _countSubmissionsRequest = {};
556
- const _countSubmissionsResponse = {};
557
- const _createSubmissionRequest = {};
558
- const _createSubmissionResponse = {};
559
- const _deleteSubmissionRequest = {};
560
- const _deleteSubmissionResponse = {};
561
- const _getDeletedSubmissionRequest = {};
562
- const _getDeletedSubmissionResponse = {};
563
- const _getMediaUploadURLRequest = {};
564
- const _getMediaUploadURLResponse = {};
565
- const _getSubmissionRequest = {};
566
- const _getSubmissionResponse = {};
567
- const _listDeletedSubmissionsRequest = {};
568
- const _listDeletedSubmissionsResponse = {};
569
- const _querySubmissionsByNamespaceRequest = {};
570
- const _querySubmissionsByNamespaceResponse = {};
571
- const _removeSubmissionFromTrashBinRequest = {};
572
- const _removeSubmissionFromTrashBinResponse = {};
573
- const _restoreSubmissionFromTrashBinRequest = {};
574
- const _restoreSubmissionFromTrashBinResponse = {};
575
- const _updateSubmissionRequest = {};
576
- const _updateSubmissionResponse = {};
577
- /**
578
- * Creates a submission.
579
- * > **Note**:
580
- * > The Submissions API is only available in Wix Studio.
581
- * @param submission - Submission to create.
582
- * @public
583
- * @documentationMaturity preview
584
- * @requiredField submission
585
- * @requiredField submission.formId
586
- * @permissionScope Manage Submissions
587
- * @applicableIdentity APP
588
- * @applicableIdentity MEMBER
589
- * @applicableIdentity VISITOR
590
- */
591
- export function createSubmission(submission, options) {
592
- var _a, _b, _c;
593
- return __awaiter(this, arguments, void 0, function* () {
594
- const requestTransformation = {
595
- submission: '$[0]',
596
- captchaToken: '$[1].captchaToken',
597
- };
598
- const responseTransformation = '$';
599
- // @ts-ignore
600
- const { httpClient, sideEffects } = arguments[2];
601
- const { toAmbassadorRequest } = serializer({
602
- rootSchema: _createSubmissionRequest,
603
- depSchemas: {},
604
- fqdnTransformation: {
605
- paths: [...['submission']],
606
- transformation: _fromVeloEntity,
607
- },
608
- customTransformation: requestTransformation,
609
- });
610
- const { fromJSON } = serializer({
611
- rootSchema: _createSubmissionResponse,
612
- depSchemas: {},
613
- fqdnTransformation: {
614
- paths: [...['submission']],
615
- transformation: _toVeloEntity,
616
- },
617
- customTransformation: responseTransformation,
618
- });
619
- const payload = toAmbassadorRequest([submission, options]);
620
- const reqOpts = ambassadorWixFormsV4Submission.createSubmission(payload);
621
- __log(`"CreateSubmission" sending request with: ${__inspect(reqOpts)}`);
622
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
623
- try {
624
- const result = yield httpClient.request(reqOpts);
625
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
626
- return fromJSON(result.data);
627
- }
628
- catch (err) {
629
- const transformedError = sdkTransformError(err, {
630
- spreadPathsToArguments: {},
631
- explicitPathsToArguments: {
632
- submission: '$[0]',
633
- captchaToken: '$[1].captchaToken',
634
- },
635
- singleArgumentUnchanged: false,
636
- }, ['submission', 'options']);
637
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
638
- throw transformedError;
639
- }
640
- });
641
- }
642
- /**
643
- * Retrieves a submission by ID.
644
- * > **Note:**
645
- * > The Submissions API is only available in the Wix Studio editor.
646
- * @param submissionId - ID of the submission to retrieve.
647
- * @public
648
- * @documentationMaturity preview
649
- * @requiredField submissionId
650
- * @permissionScope Manage Submissions
651
- * @permissionScope Manage Orders
652
- * @permissionScope Read Orders
653
- * @permissionScope Read Submissions
654
- * @applicableIdentity APP
655
- */
656
- export function getSubmission(submissionId) {
657
- var _a, _b, _c;
658
- return __awaiter(this, arguments, void 0, function* () {
659
- const requestTransformation = { submissionId: '$[0]' };
660
- const responseTransformation = '$';
661
- // @ts-ignore
662
- const { httpClient, sideEffects } = arguments[1];
663
- const { toAmbassadorRequest } = serializer({
664
- rootSchema: _getSubmissionRequest,
665
- depSchemas: {},
666
- fqdnTransformation: {
667
- paths: [],
668
- transformation: _fromVeloEntity,
669
- },
670
- customTransformation: requestTransformation,
671
- });
672
- const { fromJSON } = serializer({
673
- rootSchema: _getSubmissionResponse,
674
- depSchemas: {},
675
- fqdnTransformation: {
676
- paths: [...['submission']],
677
- transformation: _toVeloEntity,
678
- },
679
- customTransformation: responseTransformation,
680
- });
681
- const payload = toAmbassadorRequest([submissionId]);
682
- const reqOpts = ambassadorWixFormsV4Submission.getSubmission(payload);
683
- __log(`"GetSubmission" sending request with: ${__inspect(reqOpts)}`);
684
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
685
- try {
686
- const result = yield httpClient.request(reqOpts);
687
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
688
- return fromJSON(result.data);
689
- }
690
- catch (err) {
691
- const transformedError = sdkTransformError(err, {
692
- spreadPathsToArguments: {},
693
- explicitPathsToArguments: { submissionId: '$[0]' },
694
- singleArgumentUnchanged: false,
695
- }, ['submissionId']);
696
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
697
- throw transformedError;
698
- }
699
- });
700
- }
701
- /**
702
- * Updates a submission.
703
- * > **Note**:
704
- * > The Submissions API is only available in Wix Studio.
705
- *
706
- *
707
- * Each time the submission is updated, `revision` increments by 1. The existing `revision` must be included when updating the submission. This ensures you're working with the latest submission information, and prevents unintended overwrites.
708
- * @param _id - Submission ID.
709
- * @public
710
- * @documentationMaturity preview
711
- * @requiredField _id
712
- * @requiredField submission
713
- * @requiredField submission.formId
714
- * @requiredField submission.revision
715
- * @param submission - Submission to update.
716
- * @permissionScope Manage Submissions
717
- * @applicableIdentity APP
718
- * @returns The updated submission.
719
- */
720
- export function updateSubmission(_id, submission) {
721
- var _a, _b, _c;
722
- return __awaiter(this, arguments, void 0, function* () {
723
- const requestTransformation = { submission: { '*': '$[1]', id: '$[0]' } };
724
- const responseTransformation = '$.submission';
725
- // @ts-ignore
726
- const { httpClient, sideEffects } = arguments[2];
727
- const { toAmbassadorRequest } = serializer({
728
- rootSchema: _updateSubmissionRequest,
729
- depSchemas: {},
730
- fqdnTransformation: {
731
- paths: [...['submission']],
732
- transformation: _fromVeloEntity,
733
- },
734
- customTransformation: requestTransformation,
735
- });
736
- const { fromJSON } = serializer({
737
- rootSchema: _updateSubmissionResponse,
738
- depSchemas: {},
739
- fqdnTransformation: {
740
- paths: [...['submission']],
741
- transformation: _toVeloEntity,
742
- },
743
- customTransformation: responseTransformation,
744
- });
745
- const payload = toAmbassadorRequest([_id, submission]);
746
- const reqOpts = ambassadorWixFormsV4Submission.updateSubmission(payload);
747
- __log(`"UpdateSubmission" sending request with: ${__inspect(reqOpts)}`);
748
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
749
- try {
750
- const result = yield httpClient.request(reqOpts);
751
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
752
- return fromJSON(result.data);
753
- }
754
- catch (err) {
755
- const transformedError = sdkTransformError(err, {
756
- spreadPathsToArguments: { submission: '$[1]' },
757
- explicitPathsToArguments: { 'submission.id': '$[0]' },
758
- singleArgumentUnchanged: false,
759
- }, ['_id', 'submission']);
760
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
761
- throw transformedError;
762
- }
763
- });
764
- }
765
- /**
766
- * Confirms a submission.
767
- * > **Note**:
768
- * > The Submissions API is only available in Wix Studio.
769
- *
770
- *
771
- * You can only confirm a submission that has a `PENDING` status.
772
- * When using forms from the [Wix Pricing Plans](https://www.wix.com/app-market/paid-plans?referral=collection&appIndex=42&referralTag=made-by-wix&referralSectionName=made-by-wix) app, the default submission status is `PENDING`.
773
- * When using forms from the [Wix Forms]() app, the default form submission status is `CONFIRMED`. You can change the default status for individual submissions using the `updateSubmission()` method.
774
- * @param submissionId - Submission ID to confirm.
775
- * @public
776
- * @documentationMaturity preview
777
- * @requiredField submissionId
778
- * @permissionScope Manage Submissions
779
- * @applicableIdentity APP
780
- */
781
- export function confirmSubmission(submissionId) {
782
- var _a, _b, _c;
783
- return __awaiter(this, arguments, void 0, function* () {
784
- const requestTransformation = { submissionId: '$[0]' };
785
- const responseTransformation = '$';
786
- // @ts-ignore
787
- const { httpClient, sideEffects } = arguments[1];
788
- const { toAmbassadorRequest } = serializer({
789
- rootSchema: _confirmSubmissionRequest,
790
- depSchemas: {},
791
- fqdnTransformation: {
792
- paths: [],
793
- transformation: _fromVeloEntity,
794
- },
795
- customTransformation: requestTransformation,
796
- });
797
- const { fromJSON } = serializer({
798
- rootSchema: _confirmSubmissionResponse,
799
- depSchemas: {},
800
- fqdnTransformation: {
801
- paths: [...['submission']],
802
- transformation: _toVeloEntity,
803
- },
804
- customTransformation: responseTransformation,
805
- });
806
- const payload = toAmbassadorRequest([submissionId]);
807
- const reqOpts = ambassadorWixFormsV4Submission.confirmSubmission(payload);
808
- __log(`"ConfirmSubmission" sending request with: ${__inspect(reqOpts)}`);
809
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
810
- try {
811
- const result = yield httpClient.request(reqOpts);
812
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
813
- return fromJSON(result.data);
814
- }
815
- catch (err) {
816
- const transformedError = sdkTransformError(err, {
817
- spreadPathsToArguments: {},
818
- explicitPathsToArguments: { submissionId: '$[0]' },
819
- singleArgumentUnchanged: false,
820
- }, ['submissionId']);
821
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
822
- throw transformedError;
823
- }
824
- });
825
- }
826
- /**
827
- * Deletes a submission.
828
- * > **Note:**
829
- * > The Submissions API is only available in Wix Studio.
830
- * @param submissionId - ID of the submission to delete.
831
- * @public
832
- * @documentationMaturity preview
833
- * @requiredField submissionId
834
- * @permissionScope Manage Submissions
835
- * @applicableIdentity APP
836
- */
837
- export function deleteSubmission(submissionId, options) {
838
- var _a, _b, _c;
839
- return __awaiter(this, arguments, void 0, function* () {
840
- const requestTransformation = {
841
- submissionId: '$[0]',
842
- permanent: '$[1].permanent',
843
- };
844
- const responseTransformation = '$';
845
- // @ts-ignore
846
- const { httpClient, sideEffects } = arguments[2];
847
- const { toAmbassadorRequest } = serializer({
848
- rootSchema: _deleteSubmissionRequest,
849
- depSchemas: {},
850
- fqdnTransformation: {
851
- paths: [],
852
- transformation: _fromVeloEntity,
853
- },
854
- customTransformation: requestTransformation,
855
- });
856
- const { fromJSON } = serializer({
857
- rootSchema: _deleteSubmissionResponse,
858
- depSchemas: {},
859
- fqdnTransformation: {
860
- paths: [],
861
- transformation: _toVeloEntity,
862
- },
863
- customTransformation: responseTransformation,
864
- });
865
- const payload = toAmbassadorRequest([submissionId, options]);
866
- const reqOpts = ambassadorWixFormsV4Submission.deleteSubmission(payload);
867
- __log(`"DeleteSubmission" sending request with: ${__inspect(reqOpts)}`);
868
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
869
- try {
870
- const result = yield httpClient.request(reqOpts);
871
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
872
- }
873
- catch (err) {
874
- const transformedError = sdkTransformError(err, {
875
- spreadPathsToArguments: {},
876
- explicitPathsToArguments: {
877
- submissionId: '$[0]',
878
- permanent: '$[1].permanent',
879
- },
880
- singleArgumentUnchanged: false,
881
- }, ['submissionId', 'options']);
882
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
883
- throw transformedError;
884
- }
885
- });
886
- }
887
- /**
888
- * Deletes submissions by IDS for specific form.
889
- * @param formId - Form ID.
890
- * @public
891
- * @documentationMaturity preview
892
- * @requiredField formId
893
- * @permissionScope Manage Submissions
894
- * @applicableIdentity APP
895
- */
896
- export function bulkDeleteSubmission(formId, options) {
897
- var _a, _b, _c;
898
- return __awaiter(this, arguments, void 0, function* () {
899
- const requestTransformation = {
900
- formId: '$[0]',
901
- submissionIds: '$[1].submissionIds',
902
- permanent: '$[1].permanent',
903
- };
904
- const responseTransformation = '$';
905
- // @ts-ignore
906
- const { httpClient, sideEffects } = arguments[2];
907
- const { toAmbassadorRequest } = serializer({
908
- rootSchema: _bulkDeleteSubmissionRequest,
909
- depSchemas: {},
910
- fqdnTransformation: {
911
- paths: [],
912
- transformation: _fromVeloEntity,
913
- },
914
- customTransformation: requestTransformation,
915
- });
916
- const { fromJSON } = serializer({
917
- rootSchema: _bulkDeleteSubmissionResponse,
918
- depSchemas: {},
919
- fqdnTransformation: {
920
- paths: [],
921
- transformation: _toVeloEntity,
922
- },
923
- customTransformation: responseTransformation,
924
- });
925
- const payload = toAmbassadorRequest([formId, options]);
926
- const reqOpts = ambassadorWixFormsV4Submission.bulkDeleteSubmission(payload);
927
- __log(`"BulkDeleteSubmission" sending request with: ${__inspect(reqOpts)}`);
928
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
929
- try {
930
- const result = yield httpClient.request(reqOpts);
931
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
932
- return fromJSON(result.data);
933
- }
934
- catch (err) {
935
- const transformedError = sdkTransformError(err, {
936
- spreadPathsToArguments: {},
937
- explicitPathsToArguments: {
938
- formId: '$[0]',
939
- submissionIds: '$[1].submissionIds',
940
- permanent: '$[1].permanent',
941
- },
942
- singleArgumentUnchanged: false,
943
- }, ['formId', 'options']);
944
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
945
- throw transformedError;
946
- }
947
- });
948
- }
949
- /**
950
- * Restores deleted submission
951
- * @param submissionId - ID of the submission to restore.
952
- * @public
953
- * @documentationMaturity preview
954
- * @requiredField submissionId
955
- * @permissionScope Manage Submissions
956
- * @applicableIdentity APP
957
- */
958
- export function restoreSubmissionFromTrashBin(submissionId) {
959
- var _a, _b, _c;
960
- return __awaiter(this, arguments, void 0, function* () {
961
- const requestTransformation = { submissionId: '$[0]' };
962
- const responseTransformation = '$';
963
- // @ts-ignore
964
- const { httpClient, sideEffects } = arguments[1];
965
- const { toAmbassadorRequest } = serializer({
966
- rootSchema: _restoreSubmissionFromTrashBinRequest,
967
- depSchemas: {},
968
- fqdnTransformation: {
969
- paths: [],
970
- transformation: _fromVeloEntity,
971
- },
972
- customTransformation: requestTransformation,
973
- });
974
- const { fromJSON } = serializer({
975
- rootSchema: _restoreSubmissionFromTrashBinResponse,
976
- depSchemas: {},
977
- fqdnTransformation: {
978
- paths: [...['submission']],
979
- transformation: _toVeloEntity,
980
- },
981
- customTransformation: responseTransformation,
982
- });
983
- const payload = toAmbassadorRequest([submissionId]);
984
- const reqOpts = ambassadorWixFormsV4Submission.restoreSubmissionFromTrashBin(payload);
985
- __log(`"RestoreSubmissionFromTrashBin" sending request with: ${__inspect(reqOpts)}`);
986
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
987
- try {
988
- const result = yield httpClient.request(reqOpts);
989
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
990
- return fromJSON(result.data);
991
- }
992
- catch (err) {
993
- const transformedError = sdkTransformError(err, {
994
- spreadPathsToArguments: {},
995
- explicitPathsToArguments: { submissionId: '$[0]' },
996
- singleArgumentUnchanged: false,
997
- }, ['submissionId']);
998
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
999
- throw transformedError;
1000
- }
1001
- });
1002
- }
1003
- /**
1004
- * Remove deleted submission
1005
- * @param submissionId - ID of the submission to restore.
1006
- * @public
1007
- * @documentationMaturity preview
1008
- * @requiredField submissionId
1009
- * @permissionScope Manage Submissions
1010
- * @applicableIdentity APP
1011
- */
1012
- export function removeSubmissionFromTrashBin(submissionId) {
1013
- var _a, _b, _c;
1014
- return __awaiter(this, arguments, void 0, function* () {
1015
- const requestTransformation = { submissionId: '$[0]' };
1016
- const responseTransformation = '$';
1017
- // @ts-ignore
1018
- const { httpClient, sideEffects } = arguments[1];
1019
- const { toAmbassadorRequest } = serializer({
1020
- rootSchema: _removeSubmissionFromTrashBinRequest,
1021
- depSchemas: {},
1022
- fqdnTransformation: {
1023
- paths: [],
1024
- transformation: _fromVeloEntity,
1025
- },
1026
- customTransformation: requestTransformation,
1027
- });
1028
- const { fromJSON } = serializer({
1029
- rootSchema: _removeSubmissionFromTrashBinResponse,
1030
- depSchemas: {},
1031
- fqdnTransformation: {
1032
- paths: [],
1033
- transformation: _toVeloEntity,
1034
- },
1035
- customTransformation: responseTransformation,
1036
- });
1037
- const payload = toAmbassadorRequest([submissionId]);
1038
- const reqOpts = ambassadorWixFormsV4Submission.removeSubmissionFromTrashBin(payload);
1039
- __log(`"RemoveSubmissionFromTrashBin" sending request with: ${__inspect(reqOpts)}`);
1040
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1041
- try {
1042
- const result = yield httpClient.request(reqOpts);
1043
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1044
- }
1045
- catch (err) {
1046
- const transformedError = sdkTransformError(err, {
1047
- spreadPathsToArguments: {},
1048
- explicitPathsToArguments: { submissionId: '$[0]' },
1049
- singleArgumentUnchanged: false,
1050
- }, ['submissionId']);
1051
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1052
- throw transformedError;
1053
- }
1054
- });
1055
- }
1056
- /**
1057
- * Remove multiple deleted submissions
1058
- * @param formId - Form ID.
1059
- * @public
1060
- * @documentationMaturity preview
1061
- * @requiredField formId
1062
- * @permissionScope Manage Submissions
1063
- * @applicableIdentity APP
1064
- */
1065
- export function bulkRemoveSubmissionFromTrashBin(formId, options) {
1066
- var _a, _b, _c;
1067
- return __awaiter(this, arguments, void 0, function* () {
1068
- const requestTransformation = {
1069
- formId: '$[0]',
1070
- submissionIds: '$[1].submissionIds',
1071
- };
1072
- const responseTransformation = '$';
1073
- // @ts-ignore
1074
- const { httpClient, sideEffects } = arguments[2];
1075
- const { toAmbassadorRequest } = serializer({
1076
- rootSchema: _bulkRemoveSubmissionFromTrashBinRequest,
1077
- depSchemas: {},
1078
- fqdnTransformation: {
1079
- paths: [],
1080
- transformation: _fromVeloEntity,
1081
- },
1082
- customTransformation: requestTransformation,
1083
- });
1084
- const { fromJSON } = serializer({
1085
- rootSchema: _bulkRemoveSubmissionFromTrashBinResponse,
1086
- depSchemas: {},
1087
- fqdnTransformation: {
1088
- paths: [],
1089
- transformation: _toVeloEntity,
1090
- },
1091
- customTransformation: responseTransformation,
1092
- });
1093
- const payload = toAmbassadorRequest([formId, options]);
1094
- const reqOpts = ambassadorWixFormsV4Submission.bulkRemoveSubmissionFromTrashBin(payload);
1095
- __log(`"BulkRemoveSubmissionFromTrashBin" sending request with: ${__inspect(reqOpts)}`);
1096
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1097
- try {
1098
- const result = yield httpClient.request(reqOpts);
1099
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1100
- return fromJSON(result.data);
1101
- }
1102
- catch (err) {
1103
- const transformedError = sdkTransformError(err, {
1104
- spreadPathsToArguments: {},
1105
- explicitPathsToArguments: {
1106
- formId: '$[0]',
1107
- submissionIds: '$[1].submissionIds',
1108
- },
1109
- singleArgumentUnchanged: false,
1110
- }, ['formId', 'options']);
1111
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1112
- throw transformedError;
1113
- }
1114
- });
1115
- }
1116
- /**
1117
- * List deleted submissions
1118
- * @param formId - Form ID.
1119
- * @public
1120
- * @documentationMaturity preview
1121
- * @requiredField formId
1122
- * @permissionScope Manage Submissions
1123
- * @permissionScope Manage Orders
1124
- * @permissionScope Read Orders
1125
- * @permissionScope Read Submissions
1126
- * @applicableIdentity APP
1127
- */
1128
- export function listDeletedSubmissions(formId, options) {
1129
- var _a, _b, _c;
1130
- return __awaiter(this, arguments, void 0, function* () {
1131
- const requestTransformation = {
1132
- formId: '$[0]',
1133
- submissionIds: '$[1].submissionIds',
1134
- paging: '$[1].paging',
1135
- statuses: '$[1].statuses',
1136
- };
1137
- const responseTransformation = '$';
1138
- // @ts-ignore
1139
- const { httpClient, sideEffects } = arguments[2];
1140
- const { toAmbassadorRequest } = serializer({
1141
- rootSchema: _listDeletedSubmissionsRequest,
1142
- depSchemas: {},
1143
- fqdnTransformation: {
1144
- paths: [],
1145
- transformation: _fromVeloEntity,
1146
- },
1147
- customTransformation: requestTransformation,
1148
- });
1149
- const { fromJSON } = serializer({
1150
- rootSchema: _listDeletedSubmissionsResponse,
1151
- depSchemas: {},
1152
- fqdnTransformation: {
1153
- paths: [...['Array#submissions']],
1154
- transformation: _toVeloEntity,
1155
- },
1156
- customTransformation: responseTransformation,
1157
- });
1158
- const payload = toAmbassadorRequest([formId, options]);
1159
- const reqOpts = ambassadorWixFormsV4Submission.listDeletedSubmissions(payload);
1160
- __log(`"ListDeletedSubmissions" sending request with: ${__inspect(reqOpts)}`);
1161
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1162
- try {
1163
- const result = yield httpClient.request(reqOpts);
1164
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1165
- return fromJSON(result.data);
1166
- }
1167
- catch (err) {
1168
- const transformedError = sdkTransformError(err, {
1169
- spreadPathsToArguments: {},
1170
- explicitPathsToArguments: {
1171
- formId: '$[0]',
1172
- submissionIds: '$[1].submissionIds',
1173
- paging: '$[1].paging',
1174
- statuses: '$[1].statuses',
1175
- },
1176
- singleArgumentUnchanged: false,
1177
- }, ['formId', 'options']);
1178
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1179
- throw transformedError;
1180
- }
1181
- });
1182
- }
1183
- /**
1184
- * Get deleted submission
1185
- * @param submissionId - Submission id.
1186
- * @public
1187
- * @documentationMaturity preview
1188
- * @requiredField submissionId
1189
- * @permissionScope Manage Submissions
1190
- * @permissionScope Manage Orders
1191
- * @permissionScope Read Orders
1192
- * @permissionScope Read Submissions
1193
- * @applicableIdentity APP
1194
- */
1195
- export function getDeletedSubmission(submissionId) {
1196
- var _a, _b, _c;
1197
- return __awaiter(this, arguments, void 0, function* () {
1198
- const requestTransformation = { submissionId: '$[0]' };
1199
- const responseTransformation = '$';
1200
- // @ts-ignore
1201
- const { httpClient, sideEffects } = arguments[1];
1202
- const { toAmbassadorRequest } = serializer({
1203
- rootSchema: _getDeletedSubmissionRequest,
1204
- depSchemas: {},
1205
- fqdnTransformation: {
1206
- paths: [],
1207
- transformation: _fromVeloEntity,
1208
- },
1209
- customTransformation: requestTransformation,
1210
- });
1211
- const { fromJSON } = serializer({
1212
- rootSchema: _getDeletedSubmissionResponse,
1213
- depSchemas: {},
1214
- fqdnTransformation: {
1215
- paths: [...['submission']],
1216
- transformation: _toVeloEntity,
1217
- },
1218
- customTransformation: responseTransformation,
1219
- });
1220
- const payload = toAmbassadorRequest([submissionId]);
1221
- const reqOpts = ambassadorWixFormsV4Submission.getDeletedSubmission(payload);
1222
- __log(`"GetDeletedSubmission" sending request with: ${__inspect(reqOpts)}`);
1223
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1224
- try {
1225
- const result = yield httpClient.request(reqOpts);
1226
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1227
- return fromJSON(result.data);
1228
- }
1229
- catch (err) {
1230
- const transformedError = sdkTransformError(err, {
1231
- spreadPathsToArguments: {},
1232
- explicitPathsToArguments: { submissionId: '$[0]' },
1233
- singleArgumentUnchanged: false,
1234
- }, ['submissionId']);
1235
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1236
- throw transformedError;
1237
- }
1238
- });
1239
- }
1240
- /**
1241
- * Creates a query to retrieve a list of submissions.
1242
- * > **Note:**
1243
- * > The Submissions API is only available in Wix Studio.
1244
- *
1245
- *
1246
- * The `querySubmissionsByNamespace()` method builds a query to retrieve a list of submissions from the specified namespace and returns a [`SubmissionsQueryBuilder`](#submissionsquerybuilder) object.
1247
- * >**Note:** You can only query submissions from a specified namespace. Use the query filter on the `namespace` field, otherwise you will receive an error.
1248
- *
1249
- * The returned object contains the query definition, which is typically used to run the query using the [`find()`](#submissionsquerybuilder/find) method.
1250
- *
1251
- * You can refine the query by chaining `SubmissionsQueryBuilder` methods onto the query. `SubmissionsQueryBuilder` methods enable you to sort, filter, and control the results that `querySubmissionsByNamespace()` returns.
1252
- *
1253
- * The following `SubmissionsQueryBuilder` methods are supported for `querySubmissionsByNamespace()`. For a full description of the Submissions object, see the object returned for the [`items`](#submissionsqueryresult/items) property in [`SubmissionsQueryResult`](#submissionsqueryresult).
1254
- * @public
1255
- * @documentationMaturity preview
1256
- * @param options - Query options.
1257
- * @permissionScope Manage Submissions
1258
- * @permissionScope Manage Orders
1259
- * @permissionScope Read Orders
1260
- * @permissionScope Read Submissions
1261
- * @applicableIdentity APP
1262
- */
1263
- export function querySubmissionsByNamespace(options) {
1264
- const requestTransformation = { '*': '$[1]', query: '$[0]' };
1265
- const responseTransformation = {
1266
- items: '$.submissions',
1267
- pagingMetadata: '$.metadata',
1268
- };
1269
- // @ts-ignore
1270
- const { httpClient, sideEffects } = arguments[1];
1271
- const { toAmbassadorRequest } = serializer({
1272
- rootSchema: _querySubmissionsByNamespaceRequest,
1273
- depSchemas: {},
1274
- fqdnTransformation: {
1275
- paths: [],
1276
- transformation: _fromVeloEntity,
1277
- },
1278
- customTransformation: requestTransformation,
1279
- });
1280
- const { fromJSON } = serializer({
1281
- rootSchema: _querySubmissionsByNamespaceResponse,
1282
- depSchemas: {},
1283
- fqdnTransformation: {
1284
- paths: [...['Array#submissions']],
1285
- transformation: _toVeloEntity,
1286
- },
1287
- customTransformation: responseTransformation,
1288
- });
1289
- return wrapWithQueryBuilder({
1290
- func: (payload) => __awaiter(this, void 0, void 0, function* () {
1291
- var _a, _b, _c;
1292
- const reqOpts = ambassadorWixFormsV4Submission.querySubmissionsByNamespace(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
1293
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1294
- try {
1295
- const result = yield httpClient.request(reqOpts);
1296
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1297
- return result;
1298
- }
1299
- catch (err) {
1300
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1301
- throw err;
1302
- }
1303
- }),
1304
- requestTransformer: (...args) => toAmbassadorRequest(args),
1305
- responseTransformer: ({ data }) => fromJSON(data),
1306
- errorTransformer: (err) => {
1307
- const transformedError = transformError(err, requestTransformation);
1308
- throw transformedError;
1309
- },
1310
- pagingMethod: 'CURSOR',
1311
- transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
1312
- })({ cursorWithEmptyFilterAndSort: true });
1313
- }
1314
- /**
1315
- * Counts the number of submissions belonging to the specified forms.
1316
- * > **Note**:
1317
- * > The Submissions API is only available in Wix Studio.
1318
- * @param formIds - Form IDs.
1319
- * @param namespace - Identifies the app which the form submissions belong to. For example, the namespace for the Wix Forms App is `"wix.form_app.form"`. The namespace of a submission can be retrieved using the Get Submission endpoint.
1320
- * @public
1321
- * @documentationMaturity preview
1322
- * @requiredField formIds
1323
- * @requiredField namespace
1324
- * @permissionScope Manage Submissions
1325
- * @permissionScope Manage Orders
1326
- * @permissionScope Read Orders
1327
- * @permissionScope Read Submissions
1328
- * @applicableIdentity APP
1329
- */
1330
- export function countSubmissions(formIds, namespace, options) {
1331
- var _a, _b, _c;
1332
- return __awaiter(this, arguments, void 0, function* () {
1333
- const requestTransformation = {
1334
- formIds: '$[0]',
1335
- namespace: '$[1]',
1336
- statuses: '$[2].statuses',
1337
- };
1338
- const responseTransformation = '$';
1339
- // @ts-ignore
1340
- const { httpClient, sideEffects } = arguments[3];
1341
- const { toAmbassadorRequest } = serializer({
1342
- rootSchema: _countSubmissionsRequest,
1343
- depSchemas: {},
1344
- fqdnTransformation: {
1345
- paths: [],
1346
- transformation: _fromVeloEntity,
1347
- },
1348
- customTransformation: requestTransformation,
1349
- });
1350
- const { fromJSON } = serializer({
1351
- rootSchema: _countSubmissionsResponse,
1352
- depSchemas: {},
1353
- fqdnTransformation: {
1354
- paths: [],
1355
- transformation: _toVeloEntity,
1356
- },
1357
- customTransformation: responseTransformation,
1358
- });
1359
- const payload = toAmbassadorRequest([formIds, namespace, options]);
1360
- const reqOpts = ambassadorWixFormsV4Submission.countSubmissions(payload);
1361
- __log(`"CountSubmissions" sending request with: ${__inspect(reqOpts)}`);
1362
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1363
- try {
1364
- const result = yield httpClient.request(reqOpts);
1365
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1366
- return fromJSON(result.data);
1367
- }
1368
- catch (err) {
1369
- const transformedError = sdkTransformError(err, {
1370
- spreadPathsToArguments: {},
1371
- explicitPathsToArguments: {
1372
- formIds: '$[0]',
1373
- namespace: '$[1]',
1374
- statuses: '$[2].statuses',
1375
- },
1376
- singleArgumentUnchanged: false,
1377
- }, ['formIds', 'namespace', 'options']);
1378
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1379
- throw transformedError;
1380
- }
1381
- });
1382
- }
1383
- /**
1384
- * > **Note:**
1385
- * > The Submissions API is only available in the Wix Studio editor.
1386
- *
1387
- * Counts the number of submissions belonging to the specified forms.
1388
- * @param formIds - Form IDs.
1389
- * @param namespace - Identifies the app which the form submissions belong to. For example, the namespace for the Wix Forms App is `"wix.form_app.form"`. The namespace of a submission can be retrieved using the Get Submission endpoint.
1390
- * @public
1391
- * @documentationMaturity preview
1392
- * @requiredField formIds
1393
- * @requiredField namespace
1394
- * @permissionScope Manage Submissions
1395
- * @permissionScope Manage Orders
1396
- * @permissionScope Read Orders
1397
- * @permissionScope Read Submissions
1398
- * @applicableIdentity APP
1399
- */
1400
- export function countDeletedSubmissions(formIds, namespace, options) {
1401
- var _a, _b, _c;
1402
- return __awaiter(this, arguments, void 0, function* () {
1403
- const requestTransformation = {
1404
- formIds: '$[0]',
1405
- namespace: '$[1]',
1406
- statuses: '$[2].statuses',
1407
- };
1408
- const responseTransformation = '$';
1409
- // @ts-ignore
1410
- const { httpClient, sideEffects } = arguments[3];
1411
- const { toAmbassadorRequest } = serializer({
1412
- rootSchema: _countDeletedSubmissionsRequest,
1413
- depSchemas: {},
1414
- fqdnTransformation: {
1415
- paths: [],
1416
- transformation: _fromVeloEntity,
1417
- },
1418
- customTransformation: requestTransformation,
1419
- });
1420
- const { fromJSON } = serializer({
1421
- rootSchema: _countDeletedSubmissionsResponse,
1422
- depSchemas: {},
1423
- fqdnTransformation: {
1424
- paths: [],
1425
- transformation: _toVeloEntity,
1426
- },
1427
- customTransformation: responseTransformation,
1428
- });
1429
- const payload = toAmbassadorRequest([formIds, namespace, options]);
1430
- const reqOpts = ambassadorWixFormsV4Submission.countDeletedSubmissions(payload);
1431
- __log(`"CountDeletedSubmissions" sending request with: ${__inspect(reqOpts)}`);
1432
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1433
- try {
1434
- const result = yield httpClient.request(reqOpts);
1435
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1436
- return fromJSON(result.data);
1437
- }
1438
- catch (err) {
1439
- const transformedError = sdkTransformError(err, {
1440
- spreadPathsToArguments: {},
1441
- explicitPathsToArguments: {
1442
- formIds: '$[0]',
1443
- namespace: '$[1]',
1444
- statuses: '$[2].statuses',
1445
- },
1446
- singleArgumentUnchanged: false,
1447
- }, ['formIds', 'namespace', 'options']);
1448
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1449
- throw transformedError;
1450
- }
1451
- });
1452
- }
1453
- /**
1454
- * Retrieves a URL generated by the Media Manager to use when creating a submission that includes a field for uploading files.
1455
- * > **Note:**
1456
- * > The Submissions API is only available in Wix Studio.
1457
- * @param formId - Form ID.
1458
- * @param filename - Name of file to upload.
1459
- * @param mimeType - [Mime type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#) of file to upload.
1460
- *
1461
- * For example, `'image/png'`
1462
- * @public
1463
- * @documentationMaturity preview
1464
- * @requiredField filename
1465
- * @requiredField formId
1466
- * @requiredField mimeType
1467
- * @permissionScope Manage Submissions
1468
- * @applicableIdentity APP
1469
- * @applicableIdentity MEMBER
1470
- * @applicableIdentity VISITOR
1471
- */
1472
- export function getMediaUploadUrl(formId, filename, mimeType) {
1473
- var _a, _b, _c;
1474
- return __awaiter(this, arguments, void 0, function* () {
1475
- const requestTransformation = {
1476
- formId: '$[0]',
1477
- filename: '$[1]',
1478
- mimeType: '$[2]',
1479
- };
1480
- const responseTransformation = '$';
1481
- // @ts-ignore
1482
- const { httpClient, sideEffects } = arguments[3];
1483
- const { toAmbassadorRequest } = serializer({
1484
- rootSchema: _getMediaUploadURLRequest,
1485
- depSchemas: {},
1486
- fqdnTransformation: {
1487
- paths: [],
1488
- transformation: _fromVeloEntity,
1489
- },
1490
- customTransformation: requestTransformation,
1491
- });
1492
- const { fromJSON } = serializer({
1493
- rootSchema: _getMediaUploadURLResponse,
1494
- depSchemas: {},
1495
- fqdnTransformation: {
1496
- paths: [],
1497
- transformation: _toVeloEntity,
1498
- },
1499
- customTransformation: responseTransformation,
1500
- });
1501
- const payload = toAmbassadorRequest([formId, filename, mimeType]);
1502
- const reqOpts = ambassadorWixFormsV4Submission.getMediaUploadUrl(payload);
1503
- __log(`"GetMediaUploadURL" sending request with: ${__inspect(reqOpts)}`);
1504
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1505
- try {
1506
- const result = yield httpClient.request(reqOpts);
1507
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1508
- return fromJSON(result.data);
1509
- }
1510
- catch (err) {
1511
- const transformedError = sdkTransformError(err, {
1512
- spreadPathsToArguments: {},
1513
- explicitPathsToArguments: {
1514
- formId: '$[0]',
1515
- filename: '$[1]',
1516
- mimeType: '$[2]',
1517
- },
1518
- singleArgumentUnchanged: false,
1519
- }, ['formId', 'filename', 'mimeType']);
1520
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1521
- throw transformedError;
1522
- }
1523
- });
1524
- }
1525
- /**
1526
- * Marks form submissions as **seen**.
1527
- * > **Note**:
1528
- * > The Submissions API is only available in Wix Studio.
1529
- *
1530
- *
1531
- * Only site collaborators with **Manage Submission** permissions can mark submissions.
1532
- * @param ids - Submission IDs to mark as seen.
1533
- * @param formId - ID of the form which the submissions belongs to.
1534
- * @public
1535
- * @documentationMaturity preview
1536
- * @requiredField formId
1537
- * @requiredField ids
1538
- * @permissionScope Manage Submissions
1539
- * @permissionScope Manage Orders
1540
- * @permissionScope Read Orders
1541
- * @permissionScope Read Submissions
1542
- * @applicableIdentity APP
1543
- */
1544
- export function bulkMarkSubmissionsAsSeen(ids, formId) {
1545
- var _a, _b, _c;
1546
- return __awaiter(this, arguments, void 0, function* () {
1547
- const requestTransformation = { ids: '$[0]', formId: '$[1]' };
1548
- const responseTransformation = '$';
1549
- // @ts-ignore
1550
- const { httpClient, sideEffects } = arguments[2];
1551
- const { toAmbassadorRequest } = serializer({
1552
- rootSchema: _bulkMarkSubmissionsAsSeenRequest,
1553
- depSchemas: {},
1554
- fqdnTransformation: {
1555
- paths: [],
1556
- transformation: _fromVeloEntity,
1557
- },
1558
- customTransformation: requestTransformation,
1559
- });
1560
- const { fromJSON } = serializer({
1561
- rootSchema: _bulkMarkSubmissionsAsSeenResponse,
1562
- depSchemas: {},
1563
- fqdnTransformation: {
1564
- paths: [],
1565
- transformation: _toVeloEntity,
1566
- },
1567
- customTransformation: responseTransformation,
1568
- });
1569
- const payload = toAmbassadorRequest([ids, formId]);
1570
- const reqOpts = ambassadorWixFormsV4Submission.bulkMarkSubmissionsAsSeen(payload);
1571
- __log(`"BulkMarkSubmissionsAsSeen" sending request with: ${__inspect(reqOpts)}`);
1572
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1573
- try {
1574
- const result = yield httpClient.request(reqOpts);
1575
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1576
- }
1577
- catch (err) {
1578
- const transformedError = sdkTransformError(err, {
1579
- spreadPathsToArguments: {},
1580
- explicitPathsToArguments: { ids: '$[0]', formId: '$[1]' },
1581
- singleArgumentUnchanged: false,
1582
- }, ['ids', 'formId']);
1583
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1584
- throw transformedError;
1585
- }
1586
- });
1587
- }
1588
- //# sourceMappingURL=forms-v4-submission.universal.js.map