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
@@ -0,0 +1,154 @@
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * DocSpring API
17
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
18
+ *
19
+ * The version of the OpenAPI document: v2
20
+ *
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * Enum class ErrorCode.
29
+ * @enum {}
30
+ * @readonly
31
+ */
32
+ var ErrorCode = exports["default"] = /*#__PURE__*/function () {
33
+ function ErrorCode() {
34
+ _classCallCheck(this, ErrorCode);
35
+ }
36
+ return _createClass(ErrorCode, null, [{
37
+ key: "constructFromObject",
38
+ value:
39
+ /**
40
+ * Returns a <code>ErrorCode</code> enum value from a Javascript object name.
41
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
42
+ * @return {module:model/ErrorCode} The enum <code>ErrorCode</code> value.
43
+ */
44
+ function constructFromObject(object) {
45
+ // Any value, including one added to the API after this client was released
46
+ return object;
47
+ }
48
+ }]);
49
+ }();
50
+ /**
51
+ * value: "invalid_request"
52
+ * @const
53
+ */
54
+ _defineProperty(ErrorCode, "invalid_request", "invalid_request");
55
+ /**
56
+ * value: "unauthorized"
57
+ * @const
58
+ */
59
+ _defineProperty(ErrorCode, "unauthorized", "unauthorized");
60
+ /**
61
+ * value: "payment_required"
62
+ * @const
63
+ */
64
+ _defineProperty(ErrorCode, "payment_required", "payment_required");
65
+ /**
66
+ * value: "insufficient_credits"
67
+ * @const
68
+ */
69
+ _defineProperty(ErrorCode, "insufficient_credits", "insufficient_credits");
70
+ /**
71
+ * value: "forbidden"
72
+ * @const
73
+ */
74
+ _defineProperty(ErrorCode, "forbidden", "forbidden");
75
+ /**
76
+ * value: "upgrade_required"
77
+ * @const
78
+ */
79
+ _defineProperty(ErrorCode, "upgrade_required", "upgrade_required");
80
+ /**
81
+ * value: "account_suspended"
82
+ * @const
83
+ */
84
+ _defineProperty(ErrorCode, "account_suspended", "account_suspended");
85
+ /**
86
+ * value: "not_found"
87
+ * @const
88
+ */
89
+ _defineProperty(ErrorCode, "not_found", "not_found");
90
+ /**
91
+ * value: "method_not_allowed"
92
+ * @const
93
+ */
94
+ _defineProperty(ErrorCode, "method_not_allowed", "method_not_allowed");
95
+ /**
96
+ * value: "conflict"
97
+ * @const
98
+ */
99
+ _defineProperty(ErrorCode, "conflict", "conflict");
100
+ /**
101
+ * value: "gone"
102
+ * @const
103
+ */
104
+ _defineProperty(ErrorCode, "gone", "gone");
105
+ /**
106
+ * value: "request_too_large"
107
+ * @const
108
+ */
109
+ _defineProperty(ErrorCode, "request_too_large", "request_too_large");
110
+ /**
111
+ * value: "unsupported_media_type"
112
+ * @const
113
+ */
114
+ _defineProperty(ErrorCode, "unsupported_media_type", "unsupported_media_type");
115
+ /**
116
+ * value: "validation_failed"
117
+ * @const
118
+ */
119
+ _defineProperty(ErrorCode, "validation_failed", "validation_failed");
120
+ /**
121
+ * value: "invalid_data"
122
+ * @const
123
+ */
124
+ _defineProperty(ErrorCode, "invalid_data", "invalid_data");
125
+ /**
126
+ * value: "rate_limited"
127
+ * @const
128
+ */
129
+ _defineProperty(ErrorCode, "rate_limited", "rate_limited");
130
+ /**
131
+ * value: "internal_error"
132
+ * @const
133
+ */
134
+ _defineProperty(ErrorCode, "internal_error", "internal_error");
135
+ /**
136
+ * value: "bad_gateway"
137
+ * @const
138
+ */
139
+ _defineProperty(ErrorCode, "bad_gateway", "bad_gateway");
140
+ /**
141
+ * value: "service_unavailable"
142
+ * @const
143
+ */
144
+ _defineProperty(ErrorCode, "service_unavailable", "service_unavailable");
145
+ /**
146
+ * value: "upstream_timeout"
147
+ * @const
148
+ */
149
+ _defineProperty(ErrorCode, "upstream_timeout", "upstream_timeout");
150
+ /**
151
+ * value: "polling_timeout"
152
+ * @const
153
+ */
154
+ _defineProperty(ErrorCode, "polling_timeout", "polling_timeout");
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _SubmissionBatch = _interopRequireDefault(require("./SubmissionBatch"));
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
11
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; } } }; }
@@ -19,7 +18,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
19
18
  * DocSpring API
20
19
  * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
21
20
  *
22
- * The version of the OpenAPI document: v1
21
+ * The version of the OpenAPI document: v2
23
22
  *
24
23
  *
25
24
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,22 +27,22 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
28
27
  *
29
28
  */
30
29
  /**
31
- * The BatchGeneratePdfs201Response model module.
32
- * @module model/BatchGeneratePdfs201Response
33
- * @version 3.2.0
30
+ * The ErrorDetail model module.
31
+ * @module model/ErrorDetail
32
+ * @version 4.0.0
34
33
  */
35
- var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
34
+ var ErrorDetail = /*#__PURE__*/function () {
36
35
  /**
37
- * Constructs a new <code>BatchGeneratePdfs201Response</code>.
38
- * @alias module:model/BatchGeneratePdfs201Response
36
+ * Constructs a new <code>ErrorDetail</code>.
37
+ * One problem with the request, such as a missing or invalid property.
38
+ * @alias module:model/ErrorDetail
39
39
  * @extends Object
40
- * @param status {module:model/BatchGeneratePdfs201Response.StatusEnum}
41
- * @param submission_batch {module:model/SubmissionBatch}
42
- * @param submissions {Array.<Object>}
40
+ * @param code {String} What's wrong: `required`, `unknown_property`, `type`, `enum`, `format`, a JSON Schema keyword such as `minLength`, or a DocSpring code. New codes can be added.
41
+ * @param message {String} A human-readable explanation of the problem.
43
42
  */
44
- function BatchGeneratePdfs201Response(status, submission_batch, submissions) {
45
- _classCallCheck(this, BatchGeneratePdfs201Response);
46
- BatchGeneratePdfs201Response.initialize(this, status, submission_batch, submissions);
43
+ function ErrorDetail(code, message) {
44
+ _classCallCheck(this, ErrorDetail);
45
+ ErrorDetail.initialize(this, code, message);
47
46
  }
48
47
 
49
48
  /**
@@ -51,56 +50,55 @@ var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
51
50
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
52
51
  * Only for internal use.
53
52
  */
54
- return _createClass(BatchGeneratePdfs201Response, null, [{
53
+ return _createClass(ErrorDetail, null, [{
55
54
  key: "initialize",
56
- value: function initialize(obj, status, submission_batch, submissions) {
57
- obj['status'] = status;
58
- obj['submission_batch'] = submission_batch;
59
- obj['submissions'] = submissions;
55
+ value: function initialize(obj, code, message) {
56
+ obj['code'] = code;
57
+ obj['message'] = message;
60
58
  }
61
59
 
62
60
  /**
63
- * Constructs a <code>BatchGeneratePdfs201Response</code> from a plain JavaScript object, optionally creating a new instance.
61
+ * Constructs a <code>ErrorDetail</code> from a plain JavaScript object, optionally creating a new instance.
64
62
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
63
  * @param {Object} data The plain JavaScript object bearing properties of interest.
66
- * @param {module:model/BatchGeneratePdfs201Response} obj Optional instance to populate.
67
- * @return {module:model/BatchGeneratePdfs201Response} The populated <code>BatchGeneratePdfs201Response</code> instance.
64
+ * @param {module:model/ErrorDetail} obj Optional instance to populate.
65
+ * @return {module:model/ErrorDetail} The populated <code>ErrorDetail</code> instance.
68
66
  */
69
67
  }, {
70
68
  key: "constructFromObject",
71
69
  value: function constructFromObject(data, obj) {
72
70
  if (data) {
73
- obj = obj || new BatchGeneratePdfs201Response();
71
+ obj = obj || new ErrorDetail();
74
72
  _ApiClient["default"].constructFromObject(data, obj, 'Object');
75
- if (data.hasOwnProperty('status')) {
76
- obj['status'] = _ApiClient["default"].convertToType(data['status'], 'String');
73
+ if (data.hasOwnProperty('code')) {
74
+ obj['code'] = _ApiClient["default"].convertToType(data['code'], 'String');
77
75
  }
78
- if (data.hasOwnProperty('error')) {
79
- obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
76
+ if (data.hasOwnProperty('message')) {
77
+ obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
80
78
  }
81
- if (data.hasOwnProperty('errors')) {
82
- obj['errors'] = _ApiClient["default"].convertToType(data['errors'], ['String']);
79
+ if (data.hasOwnProperty('pointer')) {
80
+ obj['pointer'] = _ApiClient["default"].convertToType(data['pointer'], 'String');
83
81
  }
84
- if (data.hasOwnProperty('submission_batch')) {
85
- obj['submission_batch'] = _SubmissionBatch["default"].constructFromObject(data['submission_batch']);
82
+ if (data.hasOwnProperty('parameter')) {
83
+ obj['parameter'] = _ApiClient["default"].convertToType(data['parameter'], 'String');
86
84
  }
87
- if (data.hasOwnProperty('submissions')) {
88
- obj['submissions'] = _ApiClient["default"].convertToType(data['submissions'], [Object]);
85
+ if (data.hasOwnProperty('submission_id')) {
86
+ obj['submission_id'] = _ApiClient["default"].convertToType(data['submission_id'], 'String');
89
87
  }
90
88
  }
91
89
  return obj;
92
90
  }
93
91
 
94
92
  /**
95
- * Validates the JSON data with respect to <code>BatchGeneratePdfs201Response</code>.
93
+ * Validates the JSON data with respect to <code>ErrorDetail</code>.
96
94
  * @param {Object} data The plain JavaScript object bearing properties of interest.
97
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>BatchGeneratePdfs201Response</code>.
95
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ErrorDetail</code>.
98
96
  */
99
97
  }, {
100
98
  key: "validateJSON",
101
99
  value: function validateJSON(data) {
102
100
  // check to make sure all required properties are present in the JSON string
103
- var _iterator = _createForOfIteratorHelper(BatchGeneratePdfs201Response.RequiredProperties),
101
+ var _iterator = _createForOfIteratorHelper(ErrorDetail.RequiredProperties),
104
102
  _step;
105
103
  try {
106
104
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -115,67 +113,58 @@ var BatchGeneratePdfs201Response = /*#__PURE__*/function () {
115
113
  } finally {
116
114
  _iterator.f();
117
115
  }
118
- if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
119
- throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
116
+ if (data['code'] && !(typeof data['code'] === 'string' || data['code'] instanceof String)) {
117
+ throw new Error("Expected the field `code` to be a primitive type in the JSON string but got " + data['code']);
120
118
  }
121
119
  // ensure the json data is a string
122
- if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
123
- throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
120
+ if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
121
+ throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
124
122
  }
125
- // ensure the json data is an array
126
- if (!Array.isArray(data['errors'])) {
127
- throw new Error("Expected the field `errors` to be an array in the JSON data but got " + data['errors']);
123
+ // ensure the json data is a string
124
+ if (data['pointer'] && !(typeof data['pointer'] === 'string' || data['pointer'] instanceof String)) {
125
+ throw new Error("Expected the field `pointer` to be a primitive type in the JSON string but got " + data['pointer']);
126
+ }
127
+ // ensure the json data is a string
128
+ if (data['parameter'] && !(typeof data['parameter'] === 'string' || data['parameter'] instanceof String)) {
129
+ throw new Error("Expected the field `parameter` to be a primitive type in the JSON string but got " + data['parameter']);
128
130
  }
129
- // ensure the json data is an array
130
- if (!Array.isArray(data['submissions'])) {
131
- throw new Error("Expected the field `submissions` to be an array in the JSON data but got " + data['submissions']);
131
+ // ensure the json data is a string
132
+ if (data['submission_id'] && !(typeof data['submission_id'] === 'string' || data['submission_id'] instanceof String)) {
133
+ throw new Error("Expected the field `submission_id` to be a primitive type in the JSON string but got " + data['submission_id']);
132
134
  }
133
135
  return true;
134
136
  }
135
137
  }]);
136
138
  }();
137
- BatchGeneratePdfs201Response.RequiredProperties = ["status", "submission_batch", "submissions"];
139
+ ErrorDetail.RequiredProperties = ["code", "message"];
138
140
 
139
141
  /**
140
- * @member {module:model/BatchGeneratePdfs201Response.StatusEnum} status
142
+ * What's wrong: `required`, `unknown_property`, `type`, `enum`, `format`, a JSON Schema keyword such as `minLength`, or a DocSpring code. New codes can be added.
143
+ * @member {String} code
141
144
  */
142
- BatchGeneratePdfs201Response.prototype['status'] = undefined;
145
+ ErrorDetail.prototype['code'] = undefined;
143
146
 
144
147
  /**
145
- * @member {String} error
148
+ * A human-readable explanation of the problem.
149
+ * @member {String} message
146
150
  */
147
- BatchGeneratePdfs201Response.prototype['error'] = undefined;
151
+ ErrorDetail.prototype['message'] = undefined;
148
152
 
149
153
  /**
150
- * @member {Array.<String>} errors
154
+ * A JSON pointer to the value in the request body (RFC 6901). An empty string means the whole body. In a submission's `data_errors`, it points into the request that created the submission.
155
+ * @member {String} pointer
151
156
  */
152
- BatchGeneratePdfs201Response.prototype['errors'] = undefined;
157
+ ErrorDetail.prototype['pointer'] = undefined;
153
158
 
154
159
  /**
155
- * @member {module:model/SubmissionBatch} submission_batch
160
+ * The query parameter the detail is about.
161
+ * @member {String} parameter
156
162
  */
157
- BatchGeneratePdfs201Response.prototype['submission_batch'] = undefined;
163
+ ErrorDetail.prototype['parameter'] = undefined;
158
164
 
159
165
  /**
160
- * @member {Array.<Object>} submissions
166
+ * For a batch item that failed validation, the ID of the submission recorded for it.
167
+ * @member {String} submission_id
161
168
  */
162
- BatchGeneratePdfs201Response.prototype['submissions'] = undefined;
163
-
164
- /**
165
- * Allowed values for the <code>status</code> property.
166
- * @enum {String}
167
- * @readonly
168
- */
169
- BatchGeneratePdfs201Response['StatusEnum'] = {
170
- /**
171
- * value: "success"
172
- * @const
173
- */
174
- "success": "success",
175
- /**
176
- * value: "error"
177
- * @const
178
- */
179
- "error": "error"
180
- };
181
- var _default = exports["default"] = BatchGeneratePdfs201Response;
169
+ ErrorDetail.prototype['submission_id'] = undefined;
170
+ var _default = exports["default"] = ErrorDetail;
@@ -0,0 +1,211 @@
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
+ var _ErrorCode = _interopRequireDefault(require("./ErrorCode"));
9
+ var _ErrorDetail = _interopRequireDefault(require("./ErrorDetail"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ 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); }
12
+ 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; } } }; }
13
+ 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; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ 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); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ 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); } /**
20
+ * DocSpring API
21
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
22
+ *
23
+ * The version of the OpenAPI document: v2
24
+ *
25
+ *
26
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
27
+ * https://openapi-generator.tech
28
+ * Do not edit the class manually.
29
+ *
30
+ */
31
+ /**
32
+ * The ErrorInfo model module.
33
+ * @module model/ErrorInfo
34
+ * @version 4.0.0
35
+ */
36
+ var ErrorInfo = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>ErrorInfo</code>.
39
+ * What went wrong.
40
+ * @alias module:model/ErrorInfo
41
+ * @extends Object
42
+ * @param code {module:model/ErrorCode} A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `upgrade_required` (403): your plan doesn't include this, such as more templates or the embedded template editor. `account_suspended` (403): the account is suspended, so it can't create submissions. `polling_timeout`: on a sync.api host, the PDF wasn't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created.
43
+ * @param message {String} A human-readable explanation, safe to show to developers.
44
+ * @param details {Array.<module:model/ErrorDetail>} What was wrong with each part of the request. Empty when the error isn't about one part of it.
45
+ * @param request_id {String} The ID of the request. Include it when you contact support.
46
+ */
47
+ function ErrorInfo(code, message, details, request_id) {
48
+ _classCallCheck(this, ErrorInfo);
49
+ ErrorInfo.initialize(this, code, message, details, request_id);
50
+ }
51
+
52
+ /**
53
+ * Initializes the fields of this object.
54
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
55
+ * Only for internal use.
56
+ */
57
+ return _createClass(ErrorInfo, null, [{
58
+ key: "initialize",
59
+ value: function initialize(obj, code, message, details, request_id) {
60
+ obj['code'] = code;
61
+ obj['message'] = message;
62
+ obj['details'] = details;
63
+ obj['request_id'] = request_id;
64
+ }
65
+
66
+ /**
67
+ * Constructs a <code>ErrorInfo</code> from a plain JavaScript object, optionally creating a new instance.
68
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
69
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
70
+ * @param {module:model/ErrorInfo} obj Optional instance to populate.
71
+ * @return {module:model/ErrorInfo} The populated <code>ErrorInfo</code> instance.
72
+ */
73
+ }, {
74
+ key: "constructFromObject",
75
+ value: function constructFromObject(data, obj) {
76
+ if (data) {
77
+ obj = obj || new ErrorInfo();
78
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
79
+ if (data.hasOwnProperty('code')) {
80
+ obj['code'] = _ApiClient["default"].convertToType(data['code'], _ErrorCode["default"]);
81
+ }
82
+ if (data.hasOwnProperty('message')) {
83
+ obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
84
+ }
85
+ if (data.hasOwnProperty('details')) {
86
+ obj['details'] = _ApiClient["default"].convertToType(data['details'], [_ErrorDetail["default"]]);
87
+ }
88
+ if (data.hasOwnProperty('request_id')) {
89
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('submission_id')) {
92
+ obj['submission_id'] = _ApiClient["default"].convertToType(data['submission_id'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('submission_batch_id')) {
95
+ obj['submission_batch_id'] = _ApiClient["default"].convertToType(data['submission_batch_id'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('combined_pdf_id')) {
98
+ obj['combined_pdf_id'] = _ApiClient["default"].convertToType(data['combined_pdf_id'], 'String');
99
+ }
100
+ if (data.hasOwnProperty('template_id')) {
101
+ obj['template_id'] = _ApiClient["default"].convertToType(data['template_id'], 'String');
102
+ }
103
+ }
104
+ return obj;
105
+ }
106
+
107
+ /**
108
+ * Validates the JSON data with respect to <code>ErrorInfo</code>.
109
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
110
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ErrorInfo</code>.
111
+ */
112
+ }, {
113
+ key: "validateJSON",
114
+ value: function validateJSON(data) {
115
+ // check to make sure all required properties are present in the JSON string
116
+ var _iterator = _createForOfIteratorHelper(ErrorInfo.RequiredProperties),
117
+ _step;
118
+ try {
119
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
120
+ var property = _step.value;
121
+ if (!data.hasOwnProperty(property)) {
122
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
123
+ }
124
+ }
125
+ // ensure the json data is a string
126
+ } catch (err) {
127
+ _iterator.e(err);
128
+ } finally {
129
+ _iterator.f();
130
+ }
131
+ if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
132
+ throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
133
+ }
134
+ // ensure the json data is an array
135
+ if (!Array.isArray(data['details'])) {
136
+ throw new Error("Expected the field `details` to be an array in the JSON data but got " + data['details']);
137
+ }
138
+ // ensure the json data is a string
139
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
140
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
141
+ }
142
+ // ensure the json data is a string
143
+ if (data['submission_id'] && !(typeof data['submission_id'] === 'string' || data['submission_id'] instanceof String)) {
144
+ throw new Error("Expected the field `submission_id` to be a primitive type in the JSON string but got " + data['submission_id']);
145
+ }
146
+ // ensure the json data is a string
147
+ if (data['submission_batch_id'] && !(typeof data['submission_batch_id'] === 'string' || data['submission_batch_id'] instanceof String)) {
148
+ throw new Error("Expected the field `submission_batch_id` to be a primitive type in the JSON string but got " + data['submission_batch_id']);
149
+ }
150
+ // ensure the json data is a string
151
+ if (data['combined_pdf_id'] && !(typeof data['combined_pdf_id'] === 'string' || data['combined_pdf_id'] instanceof String)) {
152
+ throw new Error("Expected the field `combined_pdf_id` to be a primitive type in the JSON string but got " + data['combined_pdf_id']);
153
+ }
154
+ // ensure the json data is a string
155
+ if (data['template_id'] && !(typeof data['template_id'] === 'string' || data['template_id'] instanceof String)) {
156
+ throw new Error("Expected the field `template_id` to be a primitive type in the JSON string but got " + data['template_id']);
157
+ }
158
+ return true;
159
+ }
160
+ }]);
161
+ }();
162
+ ErrorInfo.RequiredProperties = ["code", "message", "details", "request_id"];
163
+
164
+ /**
165
+ * A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `upgrade_required` (403): your plan doesn't include this, such as more templates or the embedded template editor. `account_suspended` (403): the account is suspended, so it can't create submissions. `polling_timeout`: on a sync.api host, the PDF wasn't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created.
166
+ * @member {module:model/ErrorCode} code
167
+ */
168
+ ErrorInfo.prototype['code'] = undefined;
169
+
170
+ /**
171
+ * A human-readable explanation, safe to show to developers.
172
+ * @member {String} message
173
+ */
174
+ ErrorInfo.prototype['message'] = undefined;
175
+
176
+ /**
177
+ * What was wrong with each part of the request. Empty when the error isn't about one part of it.
178
+ * @member {Array.<module:model/ErrorDetail>} details
179
+ */
180
+ ErrorInfo.prototype['details'] = undefined;
181
+
182
+ /**
183
+ * The ID of the request. Include it when you contact support.
184
+ * @member {String} request_id
185
+ */
186
+ ErrorInfo.prototype['request_id'] = undefined;
187
+
188
+ /**
189
+ * When a submission's data fails validation, the submission is still recorded (state `invalid_data`) so you can see it in the dashboard. This is its ID. With `insufficient_credits`, the submission that waits for credits. With `polling_timeout`, the submission that's still being processed.
190
+ * @member {String} submission_id
191
+ */
192
+ ErrorInfo.prototype['submission_id'] = undefined;
193
+
194
+ /**
195
+ * The ID of the recorded batch, when items in a batch fail validation. With `insufficient_credits`, the batch whose submissions wait for credits. With `polling_timeout`, the batch that's still being processed.
196
+ * @member {String} submission_batch_id
197
+ */
198
+ ErrorInfo.prototype['submission_batch_id'] = undefined;
199
+
200
+ /**
201
+ * With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout`, the combined PDF that's still being processed.
202
+ * @member {String} combined_pdf_id
203
+ */
204
+ ErrorInfo.prototype['combined_pdf_id'] = undefined;
205
+
206
+ /**
207
+ * With `polling_timeout`, the template whose PDF is still being processed.
208
+ * @member {String} template_id
209
+ */
210
+ ErrorInfo.prototype['template_id'] = undefined;
211
+ var _default = exports["default"] = ErrorInfo;