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,294 @@
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 _CombinedPdfFiles = _interopRequireDefault(require("./CombinedPdfFiles"));
9
+ var _CombinedPdfSource = _interopRequireDefault(require("./CombinedPdfSource"));
10
+ var _CombinedPdfState = _interopRequireDefault(require("./CombinedPdfState"));
11
+ var _SubmissionAction = _interopRequireDefault(require("./SubmissionAction"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ 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); }
14
+ 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; } } }; }
15
+ 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; } }
16
+ 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; }
17
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
18
+ 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); } }
19
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
21
+ 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); } /**
22
+ * DocSpring API
23
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
24
+ *
25
+ * The version of the OpenAPI document: v2
26
+ *
27
+ *
28
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
29
+ * https://openapi-generator.tech
30
+ * Do not edit the class manually.
31
+ *
32
+ */
33
+ /**
34
+ * The CombinedPdf model module.
35
+ * @module model/CombinedPdf
36
+ * @version 4.0.0
37
+ */
38
+ var CombinedPdf = /*#__PURE__*/function () {
39
+ /**
40
+ * Constructs a new <code>CombinedPdf</code>.
41
+ * A PDF made by merging other PDFs: submissions, other combined PDFs, templates, custom files and PDFs from URLs.
42
+ * @alias module:model/CombinedPdf
43
+ * @extends Object
44
+ * @param id {String} The combined PDF's ID.
45
+ * @param state {module:model/CombinedPdfState} `pending` until the PDF has been generated, then `processed`. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. `error`: the PDFs couldn't be merged (see `error_message`). Waiting ends in `error` if it's discarded or takes over 30 days.
46
+ * @param source_pdfs {Array.<module:model/CombinedPdfSource>} The PDFs to merge, in order.
47
+ * @param metadata {Object.<String, Object>} Your own data about the combined PDF, such as an ID from your app.
48
+ * @param has_password {Boolean} Whether the PDF needs a password to open (`password`).
49
+ * @param delete_custom_files {Boolean} Delete the custom files in `source_pdfs` once the combined PDF has been generated (they're kept if it fails). Other combined PDFs can't use them after that. A test API token can't delete custom files.
50
+ * @param error_message {String} Why the PDFs couldn't be merged, when `state` is `error`.
51
+ * @param files {module:model/CombinedPdfFiles} The generated files, by format. Empty until the PDF has been generated, and once it has expired.
52
+ * @param actions {Array.<module:model/SubmissionAction>} The uploads of the PDF to your storage (account integrations).
53
+ * @param expired {Boolean} An expired combined PDF's PDF, metadata, password and source URLs have been deleted.
54
+ * @param expires_at {Date} When the combined PDF expires (`expires_in` after it's generated). Null if it's kept until you delete it.
55
+ * @param processed_at {Date} When the PDF was generated. Null until then.
56
+ * @param created_at {Date} When the combined PDF was created.
57
+ * @param updated_at {Date} When the combined PDF was last updated.
58
+ */
59
+ function CombinedPdf(id, state, source_pdfs, metadata, has_password, delete_custom_files, error_message, files, actions, expired, expires_at, processed_at, created_at, updated_at) {
60
+ _classCallCheck(this, CombinedPdf);
61
+ CombinedPdf.initialize(this, id, state, source_pdfs, metadata, has_password, delete_custom_files, error_message, files, actions, expired, expires_at, processed_at, created_at, updated_at);
62
+ }
63
+
64
+ /**
65
+ * Initializes the fields of this object.
66
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
67
+ * Only for internal use.
68
+ */
69
+ return _createClass(CombinedPdf, null, [{
70
+ key: "initialize",
71
+ value: function initialize(obj, id, state, source_pdfs, metadata, has_password, delete_custom_files, error_message, files, actions, expired, expires_at, processed_at, created_at, updated_at) {
72
+ obj['id'] = id;
73
+ obj['state'] = state;
74
+ obj['source_pdfs'] = source_pdfs;
75
+ obj['metadata'] = metadata;
76
+ obj['has_password'] = has_password;
77
+ obj['delete_custom_files'] = delete_custom_files;
78
+ obj['error_message'] = error_message;
79
+ obj['files'] = files;
80
+ obj['actions'] = actions;
81
+ obj['expired'] = expired;
82
+ obj['expires_at'] = expires_at;
83
+ obj['processed_at'] = processed_at;
84
+ obj['created_at'] = created_at;
85
+ obj['updated_at'] = updated_at;
86
+ }
87
+
88
+ /**
89
+ * Constructs a <code>CombinedPdf</code> from a plain JavaScript object, optionally creating a new instance.
90
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
91
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
92
+ * @param {module:model/CombinedPdf} obj Optional instance to populate.
93
+ * @return {module:model/CombinedPdf} The populated <code>CombinedPdf</code> instance.
94
+ */
95
+ }, {
96
+ key: "constructFromObject",
97
+ value: function constructFromObject(data, obj) {
98
+ if (data) {
99
+ obj = obj || new CombinedPdf();
100
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
101
+ if (data.hasOwnProperty('id')) {
102
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
103
+ }
104
+ if (data.hasOwnProperty('state')) {
105
+ obj['state'] = _ApiClient["default"].convertToType(data['state'], _CombinedPdfState["default"]);
106
+ }
107
+ if (data.hasOwnProperty('source_pdfs')) {
108
+ obj['source_pdfs'] = _ApiClient["default"].convertToType(data['source_pdfs'], [_CombinedPdfSource["default"]]);
109
+ }
110
+ if (data.hasOwnProperty('metadata')) {
111
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], {
112
+ 'String': Object
113
+ });
114
+ }
115
+ if (data.hasOwnProperty('has_password')) {
116
+ obj['has_password'] = _ApiClient["default"].convertToType(data['has_password'], 'Boolean');
117
+ }
118
+ if (data.hasOwnProperty('delete_custom_files')) {
119
+ obj['delete_custom_files'] = _ApiClient["default"].convertToType(data['delete_custom_files'], 'Boolean');
120
+ }
121
+ if (data.hasOwnProperty('error_message')) {
122
+ obj['error_message'] = _ApiClient["default"].convertToType(data['error_message'], 'String');
123
+ }
124
+ if (data.hasOwnProperty('files')) {
125
+ obj['files'] = _ApiClient["default"].convertToType(data['files'], _CombinedPdfFiles["default"]);
126
+ }
127
+ if (data.hasOwnProperty('actions')) {
128
+ obj['actions'] = _ApiClient["default"].convertToType(data['actions'], [_SubmissionAction["default"]]);
129
+ }
130
+ if (data.hasOwnProperty('expired')) {
131
+ obj['expired'] = _ApiClient["default"].convertToType(data['expired'], 'Boolean');
132
+ }
133
+ if (data.hasOwnProperty('expires_at')) {
134
+ obj['expires_at'] = _ApiClient["default"].convertToType(data['expires_at'], 'Date');
135
+ }
136
+ if (data.hasOwnProperty('processed_at')) {
137
+ obj['processed_at'] = _ApiClient["default"].convertToType(data['processed_at'], 'Date');
138
+ }
139
+ if (data.hasOwnProperty('created_at')) {
140
+ obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
141
+ }
142
+ if (data.hasOwnProperty('updated_at')) {
143
+ obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
144
+ }
145
+ }
146
+ return obj;
147
+ }
148
+
149
+ /**
150
+ * Validates the JSON data with respect to <code>CombinedPdf</code>.
151
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
152
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CombinedPdf</code>.
153
+ */
154
+ }, {
155
+ key: "validateJSON",
156
+ value: function validateJSON(data) {
157
+ // check to make sure all required properties are present in the JSON string
158
+ var _iterator = _createForOfIteratorHelper(CombinedPdf.RequiredProperties),
159
+ _step;
160
+ try {
161
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
162
+ var property = _step.value;
163
+ if (!data.hasOwnProperty(property)) {
164
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
165
+ }
166
+ }
167
+ // ensure the json data is a string
168
+ } catch (err) {
169
+ _iterator.e(err);
170
+ } finally {
171
+ _iterator.f();
172
+ }
173
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
174
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
175
+ }
176
+ if (data['source_pdfs']) {
177
+ // data not null
178
+ // ensure the json data is an array
179
+ if (!Array.isArray(data['source_pdfs'])) {
180
+ throw new Error("Expected the field `source_pdfs` to be an array in the JSON data but got " + data['source_pdfs']);
181
+ }
182
+ // validate the optional field `source_pdfs` (array)
183
+ var _iterator2 = _createForOfIteratorHelper(data['source_pdfs']),
184
+ _step2;
185
+ try {
186
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
187
+ var item = _step2.value;
188
+ _CombinedPdfSource["default"].validateJSON(item);
189
+ }
190
+ } catch (err) {
191
+ _iterator2.e(err);
192
+ } finally {
193
+ _iterator2.f();
194
+ }
195
+ ;
196
+ }
197
+ // ensure the json data is a string
198
+ if (data['error_message'] && !(typeof data['error_message'] === 'string' || data['error_message'] instanceof String)) {
199
+ throw new Error("Expected the field `error_message` to be a primitive type in the JSON string but got " + data['error_message']);
200
+ }
201
+ // ensure the json data is an array
202
+ if (!Array.isArray(data['actions'])) {
203
+ throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
204
+ }
205
+ return true;
206
+ }
207
+ }]);
208
+ }();
209
+ CombinedPdf.RequiredProperties = ["id", "state", "source_pdfs", "metadata", "has_password", "delete_custom_files", "error_message", "files", "actions", "expired", "expires_at", "processed_at", "created_at", "updated_at"];
210
+
211
+ /**
212
+ * The combined PDF's ID.
213
+ * @member {String} id
214
+ */
215
+ CombinedPdf.prototype['id'] = undefined;
216
+
217
+ /**
218
+ * `pending` until the PDF has been generated, then `processed`. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. `error`: the PDFs couldn't be merged (see `error_message`). Waiting ends in `error` if it's discarded or takes over 30 days.
219
+ * @member {module:model/CombinedPdfState} state
220
+ */
221
+ CombinedPdf.prototype['state'] = undefined;
222
+
223
+ /**
224
+ * The PDFs to merge, in order.
225
+ * @member {Array.<module:model/CombinedPdfSource>} source_pdfs
226
+ */
227
+ CombinedPdf.prototype['source_pdfs'] = undefined;
228
+
229
+ /**
230
+ * Your own data about the combined PDF, such as an ID from your app.
231
+ * @member {Object.<String, Object>} metadata
232
+ */
233
+ CombinedPdf.prototype['metadata'] = undefined;
234
+
235
+ /**
236
+ * Whether the PDF needs a password to open (`password`).
237
+ * @member {Boolean} has_password
238
+ */
239
+ CombinedPdf.prototype['has_password'] = undefined;
240
+
241
+ /**
242
+ * Delete the custom files in `source_pdfs` once the combined PDF has been generated (they're kept if it fails). Other combined PDFs can't use them after that. A test API token can't delete custom files.
243
+ * @member {Boolean} delete_custom_files
244
+ */
245
+ CombinedPdf.prototype['delete_custom_files'] = undefined;
246
+
247
+ /**
248
+ * Why the PDFs couldn't be merged, when `state` is `error`.
249
+ * @member {String} error_message
250
+ */
251
+ CombinedPdf.prototype['error_message'] = undefined;
252
+
253
+ /**
254
+ * The generated files, by format. Empty until the PDF has been generated, and once it has expired.
255
+ * @member {module:model/CombinedPdfFiles} files
256
+ */
257
+ CombinedPdf.prototype['files'] = undefined;
258
+
259
+ /**
260
+ * The uploads of the PDF to your storage (account integrations).
261
+ * @member {Array.<module:model/SubmissionAction>} actions
262
+ */
263
+ CombinedPdf.prototype['actions'] = undefined;
264
+
265
+ /**
266
+ * An expired combined PDF's PDF, metadata, password and source URLs have been deleted.
267
+ * @member {Boolean} expired
268
+ */
269
+ CombinedPdf.prototype['expired'] = undefined;
270
+
271
+ /**
272
+ * When the combined PDF expires (`expires_in` after it's generated). Null if it's kept until you delete it.
273
+ * @member {Date} expires_at
274
+ */
275
+ CombinedPdf.prototype['expires_at'] = undefined;
276
+
277
+ /**
278
+ * When the PDF was generated. Null until then.
279
+ * @member {Date} processed_at
280
+ */
281
+ CombinedPdf.prototype['processed_at'] = undefined;
282
+
283
+ /**
284
+ * When the combined PDF was created.
285
+ * @member {Date} created_at
286
+ */
287
+ CombinedPdf.prototype['created_at'] = undefined;
288
+
289
+ /**
290
+ * When the combined PDF was last updated.
291
+ * @member {Date} updated_at
292
+ */
293
+ CombinedPdf.prototype['updated_at'] = undefined;
294
+ var _default = exports["default"] = CombinedPdf;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _GeneratedFile = _interopRequireDefault(require("./GeneratedFile"));
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
10
  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
11
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -15,7 +16,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
15
16
  * DocSpring API
16
17
  * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
18
  *
18
- * The version of the OpenAPI document: v1
19
+ * The version of the OpenAPI document: v2
19
20
  *
20
21
  *
21
22
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,18 +25,20 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
24
25
  *
25
26
  */
26
27
  /**
27
- * The MoveFolderData model module.
28
- * @module model/MoveFolderData
29
- * @version 3.2.0
28
+ * The CombinedPdfFiles model module.
29
+ * @module model/CombinedPdfFiles
30
+ * @version 4.0.0
30
31
  */
31
- var MoveFolderData = /*#__PURE__*/function () {
32
+ var CombinedPdfFiles = /*#__PURE__*/function () {
32
33
  /**
33
- * Constructs a new <code>MoveFolderData</code>.
34
- * @alias module:model/MoveFolderData
34
+ * Constructs a new <code>CombinedPdfFiles</code>.
35
+ * A combined PDF's generated files, by format.
36
+ * @alias module:model/CombinedPdfFiles
37
+ * @extends Object
35
38
  */
36
- function MoveFolderData() {
37
- _classCallCheck(this, MoveFolderData);
38
- MoveFolderData.initialize(this);
39
+ function CombinedPdfFiles() {
40
+ _classCallCheck(this, CombinedPdfFiles);
41
+ CombinedPdfFiles.initialize(this);
39
42
  }
40
43
 
41
44
  /**
@@ -43,47 +46,44 @@ var MoveFolderData = /*#__PURE__*/function () {
43
46
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
47
  * Only for internal use.
45
48
  */
46
- return _createClass(MoveFolderData, null, [{
49
+ return _createClass(CombinedPdfFiles, null, [{
47
50
  key: "initialize",
48
51
  value: function initialize(obj) {}
49
52
 
50
53
  /**
51
- * Constructs a <code>MoveFolderData</code> from a plain JavaScript object, optionally creating a new instance.
54
+ * Constructs a <code>CombinedPdfFiles</code> from a plain JavaScript object, optionally creating a new instance.
52
55
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
56
  * @param {Object} data The plain JavaScript object bearing properties of interest.
54
- * @param {module:model/MoveFolderData} obj Optional instance to populate.
55
- * @return {module:model/MoveFolderData} The populated <code>MoveFolderData</code> instance.
57
+ * @param {module:model/CombinedPdfFiles} obj Optional instance to populate.
58
+ * @return {module:model/CombinedPdfFiles} The populated <code>CombinedPdfFiles</code> instance.
56
59
  */
57
60
  }, {
58
61
  key: "constructFromObject",
59
62
  value: function constructFromObject(data, obj) {
60
63
  if (data) {
61
- obj = obj || new MoveFolderData();
62
- if (data.hasOwnProperty('parent_folder_id')) {
63
- obj['parent_folder_id'] = _ApiClient["default"].convertToType(data['parent_folder_id'], 'String');
64
+ obj = obj || new CombinedPdfFiles();
65
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
66
+ if (data.hasOwnProperty('pdf')) {
67
+ obj['pdf'] = data['pdf'] === null ? null : _GeneratedFile["default"].constructFromObject(data['pdf']);
64
68
  }
65
69
  }
66
70
  return obj;
67
71
  }
68
72
 
69
73
  /**
70
- * Validates the JSON data with respect to <code>MoveFolderData</code>.
74
+ * Validates the JSON data with respect to <code>CombinedPdfFiles</code>.
71
75
  * @param {Object} data The plain JavaScript object bearing properties of interest.
72
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>MoveFolderData</code>.
76
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CombinedPdfFiles</code>.
73
77
  */
74
78
  }, {
75
79
  key: "validateJSON",
76
80
  value: function validateJSON(data) {
77
- // ensure the json data is a string
78
- if (data['parent_folder_id'] && !(typeof data['parent_folder_id'] === 'string' || data['parent_folder_id'] instanceof String)) {
79
- throw new Error("Expected the field `parent_folder_id` to be a primitive type in the JSON string but got " + data['parent_folder_id']);
80
- }
81
81
  return true;
82
82
  }
83
83
  }]);
84
84
  }();
85
85
  /**
86
- * @member {String} parent_folder_id
86
+ * @member {module:model/GeneratedFile} pdf
87
87
  */
88
- MoveFolderData.prototype['parent_folder_id'] = undefined;
89
- var _default = exports["default"] = MoveFolderData;
88
+ CombinedPdfFiles.prototype['pdf'] = undefined;
89
+ var _default = exports["default"] = CombinedPdfFiles;
@@ -0,0 +1,132 @@
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 _CombinedPdf = _interopRequireDefault(require("./CombinedPdf"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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
+ 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; } } }; }
12
+ 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; } }
13
+ 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; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * DocSpring API
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
21
+ *
22
+ * The version of the OpenAPI document: v2
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The CombinedPdfList model module.
32
+ * @module model/CombinedPdfList
33
+ * @version 4.0.0
34
+ */
35
+ var CombinedPdfList = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>CombinedPdfList</code>.
38
+ * A page of combined PDFs, newest first.
39
+ * @alias module:model/CombinedPdfList
40
+ * @extends Object
41
+ * @param data {Array.<module:model/CombinedPdf>} The items on this page.
42
+ * @param next_cursor {String} Pass it as `cursor` to get the next page. Null on the last page.
43
+ */
44
+ function CombinedPdfList(data, next_cursor) {
45
+ _classCallCheck(this, CombinedPdfList);
46
+ CombinedPdfList.initialize(this, data, next_cursor);
47
+ }
48
+
49
+ /**
50
+ * Initializes the fields of this object.
51
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
52
+ * Only for internal use.
53
+ */
54
+ return _createClass(CombinedPdfList, null, [{
55
+ key: "initialize",
56
+ value: function initialize(obj, data, next_cursor) {
57
+ obj['data'] = data;
58
+ obj['next_cursor'] = next_cursor;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>CombinedPdfList</code> from a plain JavaScript object, optionally creating a new instance.
63
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
64
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
65
+ * @param {module:model/CombinedPdfList} obj Optional instance to populate.
66
+ * @return {module:model/CombinedPdfList} The populated <code>CombinedPdfList</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new CombinedPdfList();
73
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
74
+ if (data.hasOwnProperty('data')) {
75
+ obj['data'] = _ApiClient["default"].convertToType(data['data'], [_CombinedPdf["default"]]);
76
+ }
77
+ if (data.hasOwnProperty('next_cursor')) {
78
+ obj['next_cursor'] = _ApiClient["default"].convertToType(data['next_cursor'], 'String');
79
+ }
80
+ }
81
+ return obj;
82
+ }
83
+
84
+ /**
85
+ * Validates the JSON data with respect to <code>CombinedPdfList</code>.
86
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
87
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CombinedPdfList</code>.
88
+ */
89
+ }, {
90
+ key: "validateJSON",
91
+ value: function validateJSON(data) {
92
+ // check to make sure all required properties are present in the JSON string
93
+ var _iterator = _createForOfIteratorHelper(CombinedPdfList.RequiredProperties),
94
+ _step;
95
+ try {
96
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
97
+ var property = _step.value;
98
+ if (!data.hasOwnProperty(property)) {
99
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
100
+ }
101
+ }
102
+ // ensure the json data is an array
103
+ } catch (err) {
104
+ _iterator.e(err);
105
+ } finally {
106
+ _iterator.f();
107
+ }
108
+ if (!Array.isArray(data['data'])) {
109
+ throw new Error("Expected the field `data` to be an array in the JSON data but got " + data['data']);
110
+ }
111
+ // ensure the json data is a string
112
+ if (data['next_cursor'] && !(typeof data['next_cursor'] === 'string' || data['next_cursor'] instanceof String)) {
113
+ throw new Error("Expected the field `next_cursor` to be a primitive type in the JSON string but got " + data['next_cursor']);
114
+ }
115
+ return true;
116
+ }
117
+ }]);
118
+ }();
119
+ CombinedPdfList.RequiredProperties = ["data", "next_cursor"];
120
+
121
+ /**
122
+ * The items on this page.
123
+ * @member {Array.<module:model/CombinedPdf>} data
124
+ */
125
+ CombinedPdfList.prototype['data'] = undefined;
126
+
127
+ /**
128
+ * Pass it as `cursor` to get the next page. Null on the last page.
129
+ * @member {String} next_cursor
130
+ */
131
+ CombinedPdfList.prototype['next_cursor'] = undefined;
132
+ var _default = exports["default"] = CombinedPdfList;