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