docspring 3.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/AGENTS.md +79 -19
  2. package/README.md +65 -63
  3. package/dist/ApiClient.js +62 -27
  4. package/dist/RequestSchemas.js +2297 -0
  5. package/dist/RequestValidator.js +494 -0
  6. package/dist/api/Client.js +1345 -946
  7. package/dist/index.js +655 -151
  8. package/dist/model/AiFieldNamingLanguage.js +64 -0
  9. package/dist/model/{AddFieldsData.js → AuthenticationCheck.js} +31 -31
  10. package/dist/model/BarcodeSymbology.js +89 -0
  11. package/dist/model/CheckCharacter.js +74 -0
  12. package/dist/model/CombinedFieldType.js +59 -0
  13. package/dist/model/CombinedPdf.js +294 -0
  14. package/dist/model/{MoveFolderData.js → CombinedPdfFiles.js} +26 -26
  15. package/dist/model/CombinedPdfList.js +132 -0
  16. package/dist/model/{SubmissionDataRequestToken.js → CombinedPdfSource.js} +55 -52
  17. package/dist/model/CombinedPdfSourceInput.js +270 -0
  18. package/dist/model/{SuccessErrorResponse.js → CombinedPdfSourcePdf.js} +41 -55
  19. package/dist/model/CombinedPdfSourceType.js +74 -0
  20. package/dist/model/CombinedPdfState.js +74 -0
  21. package/dist/model/{CopyTemplateOptions.js → CopyTemplateRequest.js} +25 -21
  22. package/dist/model/{CombinePdfsData.js → CreateCombinedPdfRequest.js} +68 -52
  23. package/dist/model/{CreateCustomFileData.js → CreateCustomFileFromUploadRequest.js} +24 -22
  24. package/dist/model/{CreateFolderData.js → CreateFolderRequest.js} +46 -27
  25. package/dist/model/{CreateSubmissionDataRequestEventRequest.js → CreateSignatureRequestEventRequest.js} +41 -137
  26. package/dist/model/CreateSignatureRequestTokenRequest.js +88 -0
  27. package/dist/model/{CreatePdfSubmissionData.js → CreateSubmissionBatchRequest.js} +63 -87
  28. package/dist/model/CreateSubmissionRequest.js +212 -0
  29. package/dist/model/CreateTemplateRequest.js +545 -0
  30. package/dist/model/CreateWebhookRequest.js +234 -0
  31. package/dist/model/CustomFile.js +66 -15
  32. package/dist/model/CustomFileList.js +132 -0
  33. package/dist/model/CustomFileSourcePdf.js +130 -0
  34. package/dist/model/ErrorCode.js +154 -0
  35. package/dist/model/{BatchGeneratePdfs201Response.js → ErrorDetail.js} +65 -76
  36. package/dist/model/ErrorInfo.js +211 -0
  37. package/dist/model/ErrorResponse.js +11 -40
  38. package/dist/model/ExpirationInterval.js +64 -0
  39. package/dist/model/{CreateSubmissionResponse.js → FieldComparisonCondition.js} +46 -64
  40. package/dist/model/FieldComparisonOperator.js +69 -0
  41. package/dist/model/FieldDisplayType.js +79 -0
  42. package/dist/model/FieldEqualsCondition.js +137 -0
  43. package/dist/model/FieldEqualsOperator.js +59 -0
  44. package/dist/model/FieldInCondition.js +145 -0
  45. package/dist/model/FieldOverride.js +722 -0
  46. package/dist/model/{MultipleErrorsResponse.js → FieldPresenceCondition.js} +39 -54
  47. package/dist/model/FieldPresenceOperator.js +59 -0
  48. package/dist/model/FieldRangeCondition.js +148 -0
  49. package/dist/model/FieldReimportState.js +69 -0
  50. package/dist/model/FieldSetupLogic.js +59 -0
  51. package/dist/model/FieldSetupNaming.js +59 -0
  52. package/dist/model/FieldSetupSource.js +64 -0
  53. package/dist/model/Folder.js +37 -10
  54. package/dist/model/FolderList.js +132 -0
  55. package/dist/model/GeneratedFile.js +214 -0
  56. package/dist/model/GeneratedFileState.js +64 -0
  57. package/dist/model/HtmlEngineOptions.js +230 -0
  58. package/dist/model/HtmlEngineOptionsInput.js +193 -0
  59. package/dist/model/ImageGravity.js +94 -0
  60. package/dist/model/ImageScaleType.js +64 -0
  61. package/dist/model/ModelCodeLanguage.js +94 -0
  62. package/dist/model/{UpdatePdfTemplate.js → MoveFolderRequest.js} +33 -27
  63. package/dist/model/{MoveTemplateData.js → MoveTemplateRequest.js} +24 -34
  64. package/dist/model/NumberConditionType.js +79 -0
  65. package/dist/model/PageFormat.js +114 -0
  66. package/dist/model/{PublishVersionData.js → PublishTemplateVersionRequest.js} +32 -32
  67. package/dist/model/{RenameFolderData.js → RenameFolderRequest.js} +24 -22
  68. package/dist/model/{RestoreVersionData.js → RestoreTemplateVersionRequest.js} +24 -22
  69. package/dist/model/ShapeType.js +79 -0
  70. package/dist/model/{SubmissionDataRequestShow.js → SignatureRequest.js} +164 -239
  71. package/dist/model/SignatureRequestAuthSecondFactorType.js +79 -0
  72. package/dist/model/SignatureRequestAuthType.js +84 -0
  73. package/dist/model/{SubmissionDataRequestEvent.js → SignatureRequestEvent.js} +66 -148
  74. package/dist/model/SignatureRequestEventType.js +79 -0
  75. package/dist/model/SignatureRequestInput.js +278 -0
  76. package/dist/model/SignatureRequestMessageType.js +94 -0
  77. package/dist/model/SignatureRequestState.js +64 -0
  78. package/dist/model/SignatureRequestToken.js +195 -0
  79. package/dist/model/SignatureRequestTokenType.js +59 -0
  80. package/dist/model/StringConditionType.js +74 -0
  81. package/dist/model/Submission.js +185 -339
  82. package/dist/model/SubmissionAction.js +29 -114
  83. package/dist/model/SubmissionActionState.js +69 -0
  84. package/dist/model/SubmissionActionType.js +84 -0
  85. package/dist/model/SubmissionBatch.js +73 -54
  86. package/dist/model/SubmissionBatchState.js +64 -0
  87. package/dist/model/SubmissionFiles.js +108 -0
  88. package/dist/model/SubmissionInput.js +204 -0
  89. package/dist/model/{ListSubmissionsResponse.js → SubmissionList.js} +34 -41
  90. package/dist/model/SubmissionSource.js +69 -0
  91. package/dist/model/SubmissionSourcePdf.js +130 -0
  92. package/dist/model/SubmissionState.js +114 -0
  93. package/dist/model/Template.js +309 -572
  94. package/dist/model/TemplateActor.js +171 -0
  95. package/dist/model/TemplateActorType.js +64 -0
  96. package/dist/model/TemplateDefaults.js +307 -0
  97. package/dist/model/TemplateDefaultsInput.js +305 -0
  98. package/dist/model/TemplateDocument.js +280 -0
  99. package/dist/model/TemplateDocumentState.js +74 -0
  100. package/dist/model/TemplateFieldDependency.js +184 -0
  101. package/dist/model/TemplateFieldDependencyAction.js +64 -0
  102. package/dist/model/{CreateCombinedSubmissionResponse.js → TemplateFieldDependencyCondition.js} +50 -61
  103. package/dist/model/TemplateFieldDependencyConditionInput.js +304 -0
  104. package/dist/model/TemplateFieldDependencyInput.js +182 -0
  105. package/dist/model/TemplateFieldDependencyMatch.js +59 -0
  106. package/dist/model/TemplateFieldDependencyOperator.js +99 -0
  107. package/dist/model/TemplateFieldLogicStatus.js +74 -0
  108. package/dist/model/TemplateFormMode.js +64 -0
  109. package/dist/model/{TemplateModelCodeResponse.js → TemplateModelCode.js} +33 -85
  110. package/dist/model/TemplatePageAiError.js +69 -0
  111. package/dist/model/TemplatePageAiNamingStatus.js +59 -0
  112. package/dist/model/TemplatePageFieldsStatus.js +74 -0
  113. package/dist/model/TemplatePageImageStatus.js +59 -0
  114. package/dist/model/TemplatePageProcessingStatus.js +162 -0
  115. package/dist/model/{SubmissionBatchData.js → TemplateSourcePdf.js} +49 -49
  116. package/dist/model/TemplateSummary.js +560 -0
  117. package/dist/model/{SuccessMultipleErrorsResponse.js → TemplateSummaryList.js} +43 -55
  118. package/dist/model/TemplateType.js +59 -0
  119. package/dist/model/{Submission422Response.js → TemplateVersion.js} +59 -62
  120. package/dist/model/TemplateVersionType.js +64 -0
  121. package/dist/model/TextAlignment.js +69 -0
  122. package/dist/model/TextOverflow.js +59 -0
  123. package/dist/model/TextVerticalAlignment.js +64 -0
  124. package/dist/model/Typeface.js +134 -0
  125. package/dist/model/UpdateSignatureRequestRequest.js +183 -0
  126. package/dist/model/{ErrorOrMultipleErrorsResponse.js → UpdateTemplateDocumentRequest.js} +43 -60
  127. package/dist/model/UpdateTemplateRequest.js +450 -0
  128. package/dist/model/UpdateWebhookRequest.js +209 -0
  129. package/dist/model/UploadMethod.js +54 -0
  130. package/dist/model/{UploadPresignResponse.js → UploadPresign.js} +52 -57
  131. package/dist/model/UrlSourcePdf.js +130 -0
  132. package/dist/model/Webhook.js +57 -72
  133. package/dist/model/WebhookEventType.js +174 -0
  134. package/dist/model/WebhookList.js +132 -0
  135. package/dist/model/WebhookMode.js +59 -0
  136. package/package.json +1 -1
  137. package/dist/model/CombinedSubmission.js +0 -308
  138. package/dist/model/CombinedSubmissionAction.js +0 -268
  139. package/dist/model/CreateCustomFileResponse.js +0 -155
  140. package/dist/model/CreateHtmlTemplate.js +0 -108
  141. package/dist/model/CreatePdfTemplate.js +0 -108
  142. package/dist/model/CreateSubmissionDataRequestData.js +0 -314
  143. package/dist/model/CreateSubmissionDataRequestEventResponse.js +0 -155
  144. package/dist/model/CreateSubmissionDataRequestResponse.js +0 -155
  145. package/dist/model/CreateSubmissionDataRequestTokenResponse.js +0 -155
  146. package/dist/model/CreateWebhookData.js +0 -108
  147. package/dist/model/JsonSchema.js +0 -205
  148. package/dist/model/SubmissionBatchWithSubmissions.js +0 -228
  149. package/dist/model/SubmissionDataRequest.js +0 -496
  150. package/dist/model/SubmissionPreview.js +0 -504
  151. package/dist/model/TemplateAddFieldsResponse.js +0 -156
  152. package/dist/model/TemplateDeleteResponse.js +0 -168
  153. package/dist/model/TemplatePreview.js +0 -796
  154. package/dist/model/TemplatePublishVersionResponse.js +0 -154
  155. package/dist/model/UpdateHtmlTemplate.js +0 -108
  156. package/dist/model/UpdateSubmissionDataRequestData.js +0 -311
  157. package/dist/model/UpdateWebhookData.js +0 -108
@@ -1,496 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
- function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
18
- * DocSpring API
19
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
- *
21
- * The version of the OpenAPI document: v1
22
- *
23
- *
24
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
- * https://openapi-generator.tech
26
- * Do not edit the class manually.
27
- *
28
- */
29
- /**
30
- * The SubmissionDataRequest model module.
31
- * @module model/SubmissionDataRequest
32
- * @version 3.2.0
33
- */
34
- var SubmissionDataRequest = /*#__PURE__*/function () {
35
- /**
36
- * Constructs a new <code>SubmissionDataRequest</code>.
37
- * @alias module:model/SubmissionDataRequest
38
- * @extends Object
39
- * @param id {String}
40
- * @param email {String}
41
- * @param name {String}
42
- * @param order {Number}
43
- * @param sort_order {Number}
44
- * @param fields {Array.<String>}
45
- * @param metadata {Object}
46
- * @param state {module:model/SubmissionDataRequest.StateEnum}
47
- * @param viewed_at {String}
48
- * @param completed_at {String}
49
- * @param declined_at {String}
50
- * @param data {Object}
51
- * @param auth_type {module:model/SubmissionDataRequest.AuthTypeEnum}
52
- * @param auth_second_factor_type {module:model/SubmissionDataRequest.AuthSecondFactorTypeEnum}
53
- * @param auth_provider {String}
54
- * @param auth_session_started_at {String}
55
- * @param auth_session_id_hash {String}
56
- * @param auth_user_id_hash {String}
57
- * @param auth_username_hash {String}
58
- * @param auth_phone_number_hash {String}
59
- * @param ip_address {String}
60
- * @param user_agent {String}
61
- */
62
- function SubmissionDataRequest(id, email, name, order, sort_order, fields, metadata, state, viewed_at, completed_at, declined_at, data, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent) {
63
- _classCallCheck(this, SubmissionDataRequest);
64
- SubmissionDataRequest.initialize(this, id, email, name, order, sort_order, fields, metadata, state, viewed_at, completed_at, declined_at, data, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent);
65
- }
66
-
67
- /**
68
- * Initializes the fields of this object.
69
- * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
70
- * Only for internal use.
71
- */
72
- return _createClass(SubmissionDataRequest, null, [{
73
- key: "initialize",
74
- value: function initialize(obj, id, email, name, order, sort_order, fields, metadata, state, viewed_at, completed_at, declined_at, data, auth_type, auth_second_factor_type, auth_provider, auth_session_started_at, auth_session_id_hash, auth_user_id_hash, auth_username_hash, auth_phone_number_hash, ip_address, user_agent) {
75
- obj['id'] = id;
76
- obj['email'] = email;
77
- obj['name'] = name;
78
- obj['order'] = order;
79
- obj['sort_order'] = sort_order;
80
- obj['fields'] = fields;
81
- obj['metadata'] = metadata;
82
- obj['state'] = state;
83
- obj['viewed_at'] = viewed_at;
84
- obj['completed_at'] = completed_at;
85
- obj['declined_at'] = declined_at;
86
- obj['data'] = data;
87
- obj['auth_type'] = auth_type;
88
- obj['auth_second_factor_type'] = auth_second_factor_type;
89
- obj['auth_provider'] = auth_provider;
90
- obj['auth_session_started_at'] = auth_session_started_at;
91
- obj['auth_session_id_hash'] = auth_session_id_hash;
92
- obj['auth_user_id_hash'] = auth_user_id_hash;
93
- obj['auth_username_hash'] = auth_username_hash;
94
- obj['auth_phone_number_hash'] = auth_phone_number_hash;
95
- obj['ip_address'] = ip_address;
96
- obj['user_agent'] = user_agent;
97
- }
98
-
99
- /**
100
- * Constructs a <code>SubmissionDataRequest</code> from a plain JavaScript object, optionally creating a new instance.
101
- * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
102
- * @param {Object} data The plain JavaScript object bearing properties of interest.
103
- * @param {module:model/SubmissionDataRequest} obj Optional instance to populate.
104
- * @return {module:model/SubmissionDataRequest} The populated <code>SubmissionDataRequest</code> instance.
105
- */
106
- }, {
107
- key: "constructFromObject",
108
- value: function constructFromObject(data, obj) {
109
- if (data) {
110
- obj = obj || new SubmissionDataRequest();
111
- _ApiClient["default"].constructFromObject(data, obj, 'Object');
112
- if (data.hasOwnProperty('id')) {
113
- obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
114
- }
115
- if (data.hasOwnProperty('email')) {
116
- obj['email'] = _ApiClient["default"].convertToType(data['email'], 'String');
117
- }
118
- if (data.hasOwnProperty('name')) {
119
- obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
120
- }
121
- if (data.hasOwnProperty('order')) {
122
- obj['order'] = _ApiClient["default"].convertToType(data['order'], 'Number');
123
- }
124
- if (data.hasOwnProperty('sort_order')) {
125
- obj['sort_order'] = _ApiClient["default"].convertToType(data['sort_order'], 'Number');
126
- }
127
- if (data.hasOwnProperty('fields')) {
128
- obj['fields'] = _ApiClient["default"].convertToType(data['fields'], ['String']);
129
- }
130
- if (data.hasOwnProperty('metadata')) {
131
- obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
132
- }
133
- if (data.hasOwnProperty('state')) {
134
- obj['state'] = _ApiClient["default"].convertToType(data['state'], 'String');
135
- }
136
- if (data.hasOwnProperty('viewed_at')) {
137
- obj['viewed_at'] = _ApiClient["default"].convertToType(data['viewed_at'], 'String');
138
- }
139
- if (data.hasOwnProperty('completed_at')) {
140
- obj['completed_at'] = _ApiClient["default"].convertToType(data['completed_at'], 'String');
141
- }
142
- if (data.hasOwnProperty('declined_at')) {
143
- obj['declined_at'] = _ApiClient["default"].convertToType(data['declined_at'], 'String');
144
- }
145
- if (data.hasOwnProperty('data')) {
146
- obj['data'] = _ApiClient["default"].convertToType(data['data'], Object);
147
- }
148
- if (data.hasOwnProperty('auth_type')) {
149
- obj['auth_type'] = _ApiClient["default"].convertToType(data['auth_type'], 'String');
150
- }
151
- if (data.hasOwnProperty('auth_second_factor_type')) {
152
- obj['auth_second_factor_type'] = _ApiClient["default"].convertToType(data['auth_second_factor_type'], 'String');
153
- }
154
- if (data.hasOwnProperty('auth_provider')) {
155
- obj['auth_provider'] = _ApiClient["default"].convertToType(data['auth_provider'], 'String');
156
- }
157
- if (data.hasOwnProperty('auth_session_started_at')) {
158
- obj['auth_session_started_at'] = _ApiClient["default"].convertToType(data['auth_session_started_at'], 'String');
159
- }
160
- if (data.hasOwnProperty('auth_session_id_hash')) {
161
- obj['auth_session_id_hash'] = _ApiClient["default"].convertToType(data['auth_session_id_hash'], 'String');
162
- }
163
- if (data.hasOwnProperty('auth_user_id_hash')) {
164
- obj['auth_user_id_hash'] = _ApiClient["default"].convertToType(data['auth_user_id_hash'], 'String');
165
- }
166
- if (data.hasOwnProperty('auth_username_hash')) {
167
- obj['auth_username_hash'] = _ApiClient["default"].convertToType(data['auth_username_hash'], 'String');
168
- }
169
- if (data.hasOwnProperty('auth_phone_number_hash')) {
170
- obj['auth_phone_number_hash'] = _ApiClient["default"].convertToType(data['auth_phone_number_hash'], 'String');
171
- }
172
- if (data.hasOwnProperty('ip_address')) {
173
- obj['ip_address'] = _ApiClient["default"].convertToType(data['ip_address'], 'String');
174
- }
175
- if (data.hasOwnProperty('user_agent')) {
176
- obj['user_agent'] = _ApiClient["default"].convertToType(data['user_agent'], 'String');
177
- }
178
- }
179
- return obj;
180
- }
181
-
182
- /**
183
- * Validates the JSON data with respect to <code>SubmissionDataRequest</code>.
184
- * @param {Object} data The plain JavaScript object bearing properties of interest.
185
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SubmissionDataRequest</code>.
186
- */
187
- }, {
188
- key: "validateJSON",
189
- value: function validateJSON(data) {
190
- // check to make sure all required properties are present in the JSON string
191
- var _iterator = _createForOfIteratorHelper(SubmissionDataRequest.RequiredProperties),
192
- _step;
193
- try {
194
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
195
- var property = _step.value;
196
- if (!data.hasOwnProperty(property)) {
197
- throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
198
- }
199
- }
200
- // ensure the json data is a string
201
- } catch (err) {
202
- _iterator.e(err);
203
- } finally {
204
- _iterator.f();
205
- }
206
- if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
207
- throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
208
- }
209
- // ensure the json data is a string
210
- if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
211
- throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
212
- }
213
- // ensure the json data is a string
214
- if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
215
- throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
216
- }
217
- // ensure the json data is an array
218
- if (!Array.isArray(data['fields'])) {
219
- throw new Error("Expected the field `fields` to be an array in the JSON data but got " + data['fields']);
220
- }
221
- // ensure the json data is a string
222
- if (data['state'] && !(typeof data['state'] === 'string' || data['state'] instanceof String)) {
223
- throw new Error("Expected the field `state` to be a primitive type in the JSON string but got " + data['state']);
224
- }
225
- // ensure the json data is a string
226
- if (data['viewed_at'] && !(typeof data['viewed_at'] === 'string' || data['viewed_at'] instanceof String)) {
227
- throw new Error("Expected the field `viewed_at` to be a primitive type in the JSON string but got " + data['viewed_at']);
228
- }
229
- // ensure the json data is a string
230
- if (data['completed_at'] && !(typeof data['completed_at'] === 'string' || data['completed_at'] instanceof String)) {
231
- throw new Error("Expected the field `completed_at` to be a primitive type in the JSON string but got " + data['completed_at']);
232
- }
233
- // ensure the json data is a string
234
- if (data['declined_at'] && !(typeof data['declined_at'] === 'string' || data['declined_at'] instanceof String)) {
235
- throw new Error("Expected the field `declined_at` to be a primitive type in the JSON string but got " + data['declined_at']);
236
- }
237
- // ensure the json data is a string
238
- if (data['auth_type'] && !(typeof data['auth_type'] === 'string' || data['auth_type'] instanceof String)) {
239
- throw new Error("Expected the field `auth_type` to be a primitive type in the JSON string but got " + data['auth_type']);
240
- }
241
- // ensure the json data is a string
242
- if (data['auth_second_factor_type'] && !(typeof data['auth_second_factor_type'] === 'string' || data['auth_second_factor_type'] instanceof String)) {
243
- throw new Error("Expected the field `auth_second_factor_type` to be a primitive type in the JSON string but got " + data['auth_second_factor_type']);
244
- }
245
- // ensure the json data is a string
246
- if (data['auth_provider'] && !(typeof data['auth_provider'] === 'string' || data['auth_provider'] instanceof String)) {
247
- throw new Error("Expected the field `auth_provider` to be a primitive type in the JSON string but got " + data['auth_provider']);
248
- }
249
- // ensure the json data is a string
250
- if (data['auth_session_started_at'] && !(typeof data['auth_session_started_at'] === 'string' || data['auth_session_started_at'] instanceof String)) {
251
- throw new Error("Expected the field `auth_session_started_at` to be a primitive type in the JSON string but got " + data['auth_session_started_at']);
252
- }
253
- // ensure the json data is a string
254
- if (data['auth_session_id_hash'] && !(typeof data['auth_session_id_hash'] === 'string' || data['auth_session_id_hash'] instanceof String)) {
255
- throw new Error("Expected the field `auth_session_id_hash` to be a primitive type in the JSON string but got " + data['auth_session_id_hash']);
256
- }
257
- // ensure the json data is a string
258
- if (data['auth_user_id_hash'] && !(typeof data['auth_user_id_hash'] === 'string' || data['auth_user_id_hash'] instanceof String)) {
259
- throw new Error("Expected the field `auth_user_id_hash` to be a primitive type in the JSON string but got " + data['auth_user_id_hash']);
260
- }
261
- // ensure the json data is a string
262
- if (data['auth_username_hash'] && !(typeof data['auth_username_hash'] === 'string' || data['auth_username_hash'] instanceof String)) {
263
- throw new Error("Expected the field `auth_username_hash` to be a primitive type in the JSON string but got " + data['auth_username_hash']);
264
- }
265
- // ensure the json data is a string
266
- if (data['auth_phone_number_hash'] && !(typeof data['auth_phone_number_hash'] === 'string' || data['auth_phone_number_hash'] instanceof String)) {
267
- throw new Error("Expected the field `auth_phone_number_hash` to be a primitive type in the JSON string but got " + data['auth_phone_number_hash']);
268
- }
269
- // ensure the json data is a string
270
- if (data['ip_address'] && !(typeof data['ip_address'] === 'string' || data['ip_address'] instanceof String)) {
271
- throw new Error("Expected the field `ip_address` to be a primitive type in the JSON string but got " + data['ip_address']);
272
- }
273
- // ensure the json data is a string
274
- if (data['user_agent'] && !(typeof data['user_agent'] === 'string' || data['user_agent'] instanceof String)) {
275
- throw new Error("Expected the field `user_agent` to be a primitive type in the JSON string but got " + data['user_agent']);
276
- }
277
- return true;
278
- }
279
- }]);
280
- }();
281
- SubmissionDataRequest.RequiredProperties = ["id", "email", "name", "order", "sort_order", "fields", "metadata", "state", "viewed_at", "completed_at", "declined_at", "data", "auth_type", "auth_second_factor_type", "auth_provider", "auth_session_started_at", "auth_session_id_hash", "auth_user_id_hash", "auth_username_hash", "auth_phone_number_hash", "ip_address", "user_agent"];
282
-
283
- /**
284
- * @member {String} id
285
- */
286
- SubmissionDataRequest.prototype['id'] = undefined;
287
-
288
- /**
289
- * @member {String} email
290
- */
291
- SubmissionDataRequest.prototype['email'] = undefined;
292
-
293
- /**
294
- * @member {String} name
295
- */
296
- SubmissionDataRequest.prototype['name'] = undefined;
297
-
298
- /**
299
- * @member {Number} order
300
- */
301
- SubmissionDataRequest.prototype['order'] = undefined;
302
-
303
- /**
304
- * @member {Number} sort_order
305
- */
306
- SubmissionDataRequest.prototype['sort_order'] = undefined;
307
-
308
- /**
309
- * @member {Array.<String>} fields
310
- */
311
- SubmissionDataRequest.prototype['fields'] = undefined;
312
-
313
- /**
314
- * @member {Object} metadata
315
- */
316
- SubmissionDataRequest.prototype['metadata'] = undefined;
317
-
318
- /**
319
- * @member {module:model/SubmissionDataRequest.StateEnum} state
320
- */
321
- SubmissionDataRequest.prototype['state'] = undefined;
322
-
323
- /**
324
- * @member {String} viewed_at
325
- */
326
- SubmissionDataRequest.prototype['viewed_at'] = undefined;
327
-
328
- /**
329
- * @member {String} completed_at
330
- */
331
- SubmissionDataRequest.prototype['completed_at'] = undefined;
332
-
333
- /**
334
- * @member {String} declined_at
335
- */
336
- SubmissionDataRequest.prototype['declined_at'] = undefined;
337
-
338
- /**
339
- * @member {Object} data
340
- */
341
- SubmissionDataRequest.prototype['data'] = undefined;
342
-
343
- /**
344
- * @member {module:model/SubmissionDataRequest.AuthTypeEnum} auth_type
345
- */
346
- SubmissionDataRequest.prototype['auth_type'] = undefined;
347
-
348
- /**
349
- * @member {module:model/SubmissionDataRequest.AuthSecondFactorTypeEnum} auth_second_factor_type
350
- */
351
- SubmissionDataRequest.prototype['auth_second_factor_type'] = undefined;
352
-
353
- /**
354
- * @member {String} auth_provider
355
- */
356
- SubmissionDataRequest.prototype['auth_provider'] = undefined;
357
-
358
- /**
359
- * @member {String} auth_session_started_at
360
- */
361
- SubmissionDataRequest.prototype['auth_session_started_at'] = undefined;
362
-
363
- /**
364
- * @member {String} auth_session_id_hash
365
- */
366
- SubmissionDataRequest.prototype['auth_session_id_hash'] = undefined;
367
-
368
- /**
369
- * @member {String} auth_user_id_hash
370
- */
371
- SubmissionDataRequest.prototype['auth_user_id_hash'] = undefined;
372
-
373
- /**
374
- * @member {String} auth_username_hash
375
- */
376
- SubmissionDataRequest.prototype['auth_username_hash'] = undefined;
377
-
378
- /**
379
- * @member {String} auth_phone_number_hash
380
- */
381
- SubmissionDataRequest.prototype['auth_phone_number_hash'] = undefined;
382
-
383
- /**
384
- * @member {String} ip_address
385
- */
386
- SubmissionDataRequest.prototype['ip_address'] = undefined;
387
-
388
- /**
389
- * @member {String} user_agent
390
- */
391
- SubmissionDataRequest.prototype['user_agent'] = undefined;
392
-
393
- /**
394
- * Allowed values for the <code>state</code> property.
395
- * @enum {String}
396
- * @readonly
397
- */
398
- SubmissionDataRequest['StateEnum'] = {
399
- /**
400
- * value: "pending"
401
- * @const
402
- */
403
- "pending": "pending",
404
- /**
405
- * value: "completed"
406
- * @const
407
- */
408
- "completed": "completed",
409
- /**
410
- * value: "declined"
411
- * @const
412
- */
413
- "declined": "declined"
414
- };
415
-
416
- /**
417
- * Allowed values for the <code>auth_type</code> property.
418
- * @enum {String}
419
- * @readonly
420
- */
421
- SubmissionDataRequest['AuthTypeEnum'] = {
422
- /**
423
- * value: "none"
424
- * @const
425
- */
426
- "none": "none",
427
- /**
428
- * value: "password"
429
- * @const
430
- */
431
- "password": "password",
432
- /**
433
- * value: "oauth"
434
- * @const
435
- */
436
- "oauth": "oauth",
437
- /**
438
- * value: "email_link"
439
- * @const
440
- */
441
- "email_link": "email_link",
442
- /**
443
- * value: "phone_number"
444
- * @const
445
- */
446
- "phone_number": "phone_number",
447
- /**
448
- * value: "ldap"
449
- * @const
450
- */
451
- "ldap": "ldap",
452
- /**
453
- * value: "saml"
454
- * @const
455
- */
456
- "saml": "saml"
457
- };
458
-
459
- /**
460
- * Allowed values for the <code>auth_second_factor_type</code> property.
461
- * @enum {String}
462
- * @readonly
463
- */
464
- SubmissionDataRequest['AuthSecondFactorTypeEnum'] = {
465
- /**
466
- * value: "none"
467
- * @const
468
- */
469
- "none": "none",
470
- /**
471
- * value: "phone_number"
472
- * @const
473
- */
474
- "phone_number": "phone_number",
475
- /**
476
- * value: "totp"
477
- * @const
478
- */
479
- "totp": "totp",
480
- /**
481
- * value: "mobile_push"
482
- * @const
483
- */
484
- "mobile_push": "mobile_push",
485
- /**
486
- * value: "security_key"
487
- * @const
488
- */
489
- "security_key": "security_key",
490
- /**
491
- * value: "fingerprint"
492
- * @const
493
- */
494
- "fingerprint": "fingerprint"
495
- };
496
- var _default = exports["default"] = SubmissionDataRequest;