docspring 4.0.0 → 4.2.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 (116) hide show
  1. package/AGENTS.md +3 -2
  2. package/README.md +13 -1
  3. package/dist/ApiClient.js +2 -2
  4. package/dist/RequestSchemas.js +1231 -9
  5. package/dist/WebhookSignature.js +86 -0
  6. package/dist/api/Client.js +620 -38
  7. package/dist/index.js +238 -0
  8. package/dist/model/AddTemplateFieldsRequest.js +132 -0
  9. package/dist/model/AuthenticationCheck.js +1 -1
  10. package/dist/model/CombinedPdf.js +3 -3
  11. package/dist/model/CombinedPdfFiles.js +1 -1
  12. package/dist/model/CombinedPdfList.js +1 -1
  13. package/dist/model/CombinedPdfSource.js +1 -1
  14. package/dist/model/CombinedPdfSourceInput.js +1 -1
  15. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  16. package/dist/model/CopyTemplateRequest.js +1 -1
  17. package/dist/model/CreateCombinedPdfRequest.js +2 -2
  18. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  19. package/dist/model/CreateFolderRequest.js +1 -1
  20. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  21. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  22. package/dist/model/CreateSubmissionBatchRequest.js +15 -1
  23. package/dist/model/CreateSubmissionRequest.js +17 -3
  24. package/dist/model/CreateTemplatePreviewRequest.js +112 -0
  25. package/dist/model/CreateTemplateRequest.js +81 -4
  26. package/dist/model/CreateWebhookRequest.js +1 -1
  27. package/dist/model/CustomFile.js +1 -1
  28. package/dist/model/CustomFileList.js +1 -1
  29. package/dist/model/CustomFileSourcePdf.js +1 -1
  30. package/dist/model/ErrorCode.js +11 -1
  31. package/dist/model/ErrorDetail.js +2 -2
  32. package/dist/model/ErrorInfo.js +6 -6
  33. package/dist/model/ErrorResponse.js +1 -1
  34. package/dist/model/Field.js +1230 -0
  35. package/dist/model/FieldComparisonCondition.js +1 -1
  36. package/dist/model/FieldDependency.js +154 -0
  37. package/dist/model/FieldDependencyInput.js +154 -0
  38. package/dist/model/FieldEqualsCondition.js +1 -1
  39. package/dist/model/FieldGroup.js +206 -0
  40. package/dist/model/FieldGroupInput.js +180 -0
  41. package/dist/model/FieldGroupType.js +59 -0
  42. package/dist/model/FieldInCondition.js +1 -1
  43. package/dist/model/FieldInput.js +1012 -0
  44. package/dist/model/FieldOverride.js +1 -1
  45. package/dist/model/FieldPresenceCondition.js +1 -1
  46. package/dist/model/FieldRangeCondition.js +1 -1
  47. package/dist/model/FieldType.js +124 -0
  48. package/dist/model/Folder.js +1 -1
  49. package/dist/model/FolderList.js +1 -1
  50. package/dist/model/GenerateFilesFormat.js +54 -0
  51. package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
  52. package/dist/model/GeneratedFile.js +1 -1
  53. package/dist/model/HtmlEngineOptions.js +1 -1
  54. package/dist/model/HtmlEngineOptionsInput.js +1 -1
  55. package/dist/model/MoveFolderRequest.js +1 -1
  56. package/dist/model/MoveTemplateRequest.js +1 -1
  57. package/dist/model/OutputFormat.js +59 -0
  58. package/dist/model/PageImage.js +220 -0
  59. package/dist/model/PageImages.js +155 -0
  60. package/dist/model/PredefinedField.js +183 -0
  61. package/dist/model/PredefinedFieldInput.js +183 -0
  62. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  63. package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
  64. package/dist/model/RenameFolderRequest.js +1 -1
  65. package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
  66. package/dist/model/RestoreTemplateVersionRequest.js +1 -1
  67. package/dist/model/SignatureRequest.js +1 -1
  68. package/dist/model/SignatureRequestEvent.js +1 -1
  69. package/dist/model/SignatureRequestInput.js +1 -1
  70. package/dist/model/SignatureRequestToken.js +1 -1
  71. package/dist/model/Submission.js +84 -68
  72. package/dist/model/SubmissionAction.js +1 -1
  73. package/dist/model/SubmissionBatch.js +1 -1
  74. package/dist/model/SubmissionFiles.js +10 -1
  75. package/dist/model/SubmissionInput.js +17 -3
  76. package/dist/model/SubmissionList.js +5 -5
  77. package/dist/model/SubmissionSourcePdf.js +1 -1
  78. package/dist/model/SubmissionSummary.js +343 -0
  79. package/dist/model/SubmissionValidation.js +151 -0
  80. package/dist/model/Template.js +129 -56
  81. package/dist/model/TemplateActor.js +3 -3
  82. package/dist/model/TemplateDefaults.js +1 -1
  83. package/dist/model/TemplateDefaultsInput.js +1 -1
  84. package/dist/model/TemplateDiff.js +206 -0
  85. package/dist/model/TemplateDiffSummary.js +165 -0
  86. package/dist/model/TemplateDocument.js +36 -36
  87. package/dist/model/TemplateDocumentState.js +11 -1
  88. package/dist/model/TemplateDocumentSummary.js +152 -0
  89. package/dist/model/TemplateFieldChange.js +146 -0
  90. package/dist/model/TemplateFieldChanges.js +196 -0
  91. package/dist/model/TemplateFieldDependency.js +3 -3
  92. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  93. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  94. package/dist/model/TemplateFieldDependencyInput.js +3 -3
  95. package/dist/model/TemplateFieldMove.js +132 -0
  96. package/dist/model/TemplateFields.js +147 -0
  97. package/dist/model/TemplateModelCode.js +1 -1
  98. package/dist/model/TemplatePageImages.js +158 -0
  99. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  100. package/dist/model/TemplatePreview.js +211 -0
  101. package/dist/model/TemplatePreviewState.js +64 -0
  102. package/dist/model/TemplateSourcePdf.js +1 -1
  103. package/dist/model/TemplateSummary.js +14 -288
  104. package/dist/model/TemplateSummaryList.js +1 -1
  105. package/dist/model/TemplateVersion.js +1 -1
  106. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  107. package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
  108. package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
  109. package/dist/model/UpdateTemplateRequest.js +84 -2
  110. package/dist/model/UpdateWebhookRequest.js +1 -1
  111. package/dist/model/UploadPresign.js +1 -1
  112. package/dist/model/UrlSourcePdf.js +1 -1
  113. package/dist/model/ValidateSubmissionRequest.js +226 -0
  114. package/dist/model/Webhook.js +1 -1
  115. package/dist/model/WebhookList.js +1 -1
  116. package/package.json +3 -2
@@ -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 _AddTemplateFieldsRequest = _interopRequireDefault(require("../model/AddTemplateFieldsRequest"));
8
9
  var _AiFieldNamingLanguage = _interopRequireDefault(require("../model/AiFieldNamingLanguage"));
9
10
  var _AuthenticationCheck = _interopRequireDefault(require("../model/AuthenticationCheck"));
10
11
  var _CombinedPdf = _interopRequireDefault(require("../model/CombinedPdf"));
@@ -17,6 +18,7 @@ var _CreateSignatureRequestEventRequest = _interopRequireDefault(require("../mod
17
18
  var _CreateSignatureRequestTokenRequest = _interopRequireDefault(require("../model/CreateSignatureRequestTokenRequest"));
18
19
  var _CreateSubmissionBatchRequest = _interopRequireDefault(require("../model/CreateSubmissionBatchRequest"));
19
20
  var _CreateSubmissionRequest = _interopRequireDefault(require("../model/CreateSubmissionRequest"));
21
+ var _CreateTemplatePreviewRequest = _interopRequireDefault(require("../model/CreateTemplatePreviewRequest"));
20
22
  var _CreateTemplateRequest = _interopRequireDefault(require("../model/CreateTemplateRequest"));
21
23
  var _CreateWebhookRequest = _interopRequireDefault(require("../model/CreateWebhookRequest"));
22
24
  var _CustomFile = _interopRequireDefault(require("../model/CustomFile"));
@@ -27,11 +29,14 @@ var _FieldSetupNaming = _interopRequireDefault(require("../model/FieldSetupNamin
27
29
  var _FieldSetupSource = _interopRequireDefault(require("../model/FieldSetupSource"));
28
30
  var _Folder = _interopRequireDefault(require("../model/Folder"));
29
31
  var _FolderList = _interopRequireDefault(require("../model/FolderList"));
32
+ var _GenerateSubmissionFilesRequest = _interopRequireDefault(require("../model/GenerateSubmissionFilesRequest"));
30
33
  var _ModelCodeLanguage = _interopRequireDefault(require("../model/ModelCodeLanguage"));
31
34
  var _MoveFolderRequest = _interopRequireDefault(require("../model/MoveFolderRequest"));
32
35
  var _MoveTemplateRequest = _interopRequireDefault(require("../model/MoveTemplateRequest"));
33
36
  var _PublishTemplateVersionRequest = _interopRequireDefault(require("../model/PublishTemplateVersionRequest"));
37
+ var _RemoveTemplateFieldsRequest = _interopRequireDefault(require("../model/RemoveTemplateFieldsRequest"));
34
38
  var _RenameFolderRequest = _interopRequireDefault(require("../model/RenameFolderRequest"));
39
+ var _ReorderTemplateFieldsRequest = _interopRequireDefault(require("../model/ReorderTemplateFieldsRequest"));
35
40
  var _RestoreTemplateVersionRequest = _interopRequireDefault(require("../model/RestoreTemplateVersionRequest"));
36
41
  var _SignatureRequest = _interopRequireDefault(require("../model/SignatureRequest"));
37
42
  var _SignatureRequestEvent = _interopRequireDefault(require("../model/SignatureRequestEvent"));
@@ -39,15 +44,23 @@ var _SignatureRequestToken = _interopRequireDefault(require("../model/SignatureR
39
44
  var _Submission = _interopRequireDefault(require("../model/Submission"));
40
45
  var _SubmissionBatch = _interopRequireDefault(require("../model/SubmissionBatch"));
41
46
  var _SubmissionList = _interopRequireDefault(require("../model/SubmissionList"));
47
+ var _SubmissionState = _interopRequireDefault(require("../model/SubmissionState"));
48
+ var _SubmissionValidation = _interopRequireDefault(require("../model/SubmissionValidation"));
42
49
  var _Template = _interopRequireDefault(require("../model/Template"));
50
+ var _TemplateDiff = _interopRequireDefault(require("../model/TemplateDiff"));
51
+ var _TemplateFields = _interopRequireDefault(require("../model/TemplateFields"));
43
52
  var _TemplateModelCode = _interopRequireDefault(require("../model/TemplateModelCode"));
53
+ var _TemplatePageImages = _interopRequireDefault(require("../model/TemplatePageImages"));
54
+ var _TemplatePreview = _interopRequireDefault(require("../model/TemplatePreview"));
44
55
  var _TemplateSummaryList = _interopRequireDefault(require("../model/TemplateSummaryList"));
45
56
  var _TemplateVersion = _interopRequireDefault(require("../model/TemplateVersion"));
46
57
  var _UpdateSignatureRequestRequest = _interopRequireDefault(require("../model/UpdateSignatureRequestRequest"));
47
58
  var _UpdateTemplateDocumentRequest = _interopRequireDefault(require("../model/UpdateTemplateDocumentRequest"));
59
+ var _UpdateTemplateFieldsRequest = _interopRequireDefault(require("../model/UpdateTemplateFieldsRequest"));
48
60
  var _UpdateTemplateRequest = _interopRequireDefault(require("../model/UpdateTemplateRequest"));
49
61
  var _UpdateWebhookRequest = _interopRequireDefault(require("../model/UpdateWebhookRequest"));
50
62
  var _UploadPresign = _interopRequireDefault(require("../model/UploadPresign"));
63
+ var _ValidateSubmissionRequest = _interopRequireDefault(require("../model/ValidateSubmissionRequest"));
51
64
  var _Webhook = _interopRequireDefault(require("../model/Webhook"));
52
65
  var _WebhookEventType = _interopRequireDefault(require("../model/WebhookEventType"));
53
66
  var _WebhookList = _interopRequireDefault(require("../model/WebhookList"));
@@ -73,7 +86,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
73
86
  /**
74
87
  * Client service.
75
88
  * @module api/Client
76
- * @version 4.0.0
89
+ * @version 4.2.0
77
90
  */
78
91
  var Client = exports["default"] = /*#__PURE__*/function () {
79
92
  /**
@@ -130,14 +143,61 @@ var Client = exports["default"] = /*#__PURE__*/function () {
130
143
  }
131
144
 
132
145
  /**
133
- * Copy a template
134
- * Copies a template (its draft, or a published version) into a new template.
146
+ * Add fields to a template
147
+ * Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them.
135
148
  * @param {String} template_id The template's ID.
136
- * @param {Object} opts Optional parameters
137
- * @param {module:model/CopyTemplateRequest} [body] Settings for the copy.
138
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
149
+ * @param {module:model/AddTemplateFieldsRequest} body The fields to add to the template's draft.
150
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
139
151
  */
140
152
  return _createClass(Client, [{
153
+ key: "addTemplateFieldsWithHttpInfo",
154
+ value: function addTemplateFieldsWithHttpInfo(template_id, body) {
155
+ var postBody = body;
156
+ // verify the required parameter 'template_id' is set
157
+ if (template_id === undefined || template_id === null) {
158
+ throw new Error("Missing the required parameter 'template_id' when calling addTemplateFields");
159
+ }
160
+ // verify the required parameter 'body' is set
161
+ if (body === undefined || body === null) {
162
+ throw new Error("Missing the required parameter 'body' when calling addTemplateFields");
163
+ }
164
+ var pathParams = {
165
+ 'template_id': template_id
166
+ };
167
+ var queryParams = {};
168
+ var headerParams = {};
169
+ var formParams = {};
170
+ var authNames = ['api_token_basic'];
171
+ var contentTypes = ['application/json'];
172
+ var accepts = ['application/json'];
173
+ var returnType = _TemplateFields["default"];
174
+ return this.apiClient.callApi('/templates/{template_id}/fields', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
175
+ }
176
+
177
+ /**
178
+ * Add fields to a template
179
+ * Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them.
180
+ * @param {String} template_id The template's ID.
181
+ * @param {module:model/AddTemplateFieldsRequest} body The fields to add to the template's draft.
182
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
183
+ */
184
+ }, {
185
+ key: "addTemplateFields",
186
+ value: function addTemplateFields(template_id, body) {
187
+ return this.addTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
188
+ return response_and_data.data;
189
+ });
190
+ }
191
+
192
+ /**
193
+ * Copy a template
194
+ * Copies a template (its draft, or a published version) into a new template.
195
+ * @param {String} template_id The template's ID.
196
+ * @param {Object} opts Optional parameters
197
+ * @param {module:model/CopyTemplateRequest} [body] Settings for the copy.
198
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
199
+ */
200
+ }, {
141
201
  key: "copyTemplateWithHttpInfo",
142
202
  value: function copyTemplateWithHttpInfo(template_id, opts) {
143
203
  opts = opts || {};
@@ -181,6 +241,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
181
241
  * @param {module:model/CreateCombinedPdfRequest} body The PDFs to merge, and the combined PDF's settings.
182
242
  * @param {Object} opts Optional parameters
183
243
  * @param {Boolean} [wait] Wait until the PDF has been generated before responding. Default true on sync.api hosts.
244
+ * @param {String} [idempotencyKey] A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
184
245
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CombinedPdf} and HTTP response
185
246
  */
186
247
  }, {
@@ -196,7 +257,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
196
257
  var queryParams = {
197
258
  'wait': opts['wait']
198
259
  };
199
- var headerParams = {};
260
+ var headerParams = {
261
+ 'Idempotency-Key': opts['idempotencyKey']
262
+ };
200
263
  var formParams = {};
201
264
  var authNames = ['api_token_basic'];
202
265
  var contentTypes = ['application/json'];
@@ -211,6 +274,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
211
274
  * @param {module:model/CreateCombinedPdfRequest} body The PDFs to merge, and the combined PDF's settings.
212
275
  * @param {Object} opts Optional parameters
213
276
  * @param {Boolean} opts.wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
277
+ * @param {String} opts.idempotencyKey A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another combined PDF. Send a new key with each new combined PDF, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
214
278
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CombinedPdf}
215
279
  */
216
280
  }, {
@@ -301,7 +365,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
301
365
 
302
366
  /**
303
367
  * Record a signature request event
304
- * Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
368
+ * Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
305
369
  * @param {String} signature_request_id The signature request's ID.
306
370
  * @param {module:model/CreateSignatureRequestEventRequest} body The event to record.
307
371
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SignatureRequestEvent} and HTTP response
@@ -333,7 +397,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
333
397
 
334
398
  /**
335
399
  * Record a signature request event
336
- * Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account.
400
+ * Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (`send_request`). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
337
401
  * @param {String} signature_request_id The signature request's ID.
338
402
  * @param {module:model/CreateSignatureRequestEventRequest} body The event to record.
339
403
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SignatureRequestEvent}
@@ -399,7 +463,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
399
463
  * @param {module:model/CreateSubmissionRequest} body The submission's data and settings.
400
464
  * @param {Object} opts Optional parameters
401
465
  * @param {String} [version] The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
402
- * @param {Boolean} [wait] Wait until the PDF has been generated before responding. Default true on sync.api hosts.
466
+ * @param {Boolean} [wait] Wait until the files have been generated before responding. Default true on sync.api hosts.
467
+ * @param {String} [idempotencyKey] A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
403
468
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Submission} and HTTP response
404
469
  */
405
470
  }, {
@@ -422,7 +487,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
422
487
  'version': opts['version'],
423
488
  'wait': opts['wait']
424
489
  };
425
- var headerParams = {};
490
+ var headerParams = {
491
+ 'Idempotency-Key': opts['idempotencyKey']
492
+ };
426
493
  var formParams = {};
427
494
  var authNames = ['api_token_basic'];
428
495
  var contentTypes = ['application/json'];
@@ -438,7 +505,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
438
505
  * @param {module:model/CreateSubmissionRequest} body The submission's data and settings.
439
506
  * @param {Object} opts Optional parameters
440
507
  * @param {String} opts.version The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
441
- * @param {Boolean} opts.wait Wait until the PDF has been generated before responding. Default true on sync.api hosts.
508
+ * @param {Boolean} opts.wait Wait until the files have been generated before responding. Default true on sync.api hosts.
509
+ * @param {String} opts.idempotencyKey A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another submission. Send a new key with each new submission, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
442
510
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Submission}
443
511
  */
444
512
  }, {
@@ -455,6 +523,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
455
523
  * @param {module:model/CreateSubmissionBatchRequest} body The submissions to create, and the settings they share.
456
524
  * @param {Object} opts Optional parameters
457
525
  * @param {Boolean} [wait] Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
526
+ * @param {String} [idempotencyKey] A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
458
527
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionBatch} and HTTP response
459
528
  */
460
529
  }, {
@@ -470,7 +539,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
470
539
  var queryParams = {
471
540
  'wait': opts['wait']
472
541
  };
473
- var headerParams = {};
542
+ var headerParams = {
543
+ 'Idempotency-Key': opts['idempotencyKey']
544
+ };
474
545
  var formParams = {};
475
546
  var authNames = ['api_token_basic'];
476
547
  var contentTypes = ['application/json'];
@@ -485,6 +556,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
485
556
  * @param {module:model/CreateSubmissionBatchRequest} body The submissions to create, and the settings they share.
486
557
  * @param {Object} opts Optional parameters
487
558
  * @param {Boolean} opts.wait Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
559
+ * @param {String} opts.idempotencyKey A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and an `Idempotent-Replayed: true` header) instead of creating another batch. Send a new key with each new batch, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422 `idempotency_key_reused`. A 409 `idempotency_key_in_use` means the first request is still being processed: send the request again in a few seconds.
488
560
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionBatch}
489
561
  */
490
562
  }, {
@@ -500,7 +572,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
500
572
  * Creates an HTML template, or a PDF template from a PDF you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. To send the PDF with the request instead, use POST /templates/upload. A PDF template is ready to generate PDFs once DocSpring has processed its PDF (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
501
573
  * @param {module:model/CreateTemplateRequest} body The template to create.
502
574
  * @param {Object} opts Optional parameters
503
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
575
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
504
576
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
505
577
  */
506
578
  }, {
@@ -530,7 +602,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
530
602
  * Creates an HTML template, or a PDF template from a PDF you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. To send the PDF with the request instead, use POST /templates/upload. A PDF template is ready to generate PDFs once DocSpring has processed its PDF (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
531
603
  * @param {module:model/CreateTemplateRequest} body The template to create.
532
604
  * @param {Object} opts Optional parameters
533
- * @param {Boolean} opts.wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
605
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
534
606
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
535
607
  */
536
608
  }, {
@@ -541,6 +613,60 @@ var Client = exports["default"] = /*#__PURE__*/function () {
541
613
  });
542
614
  }
543
615
 
616
+ /**
617
+ * Preview a template with data
618
+ * Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML or PDF template prints with your data before you publish a version or send live data. It renders the template's draft, or the published `version` you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's `pending` while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's `processed`, with an image of each page, or `error`.
619
+ * @param {String} template_id The template's ID.
620
+ * @param {module:model/CreateTemplatePreviewRequest} body The data to render the template with.
621
+ * @param {Object} opts Optional parameters
622
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
623
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplatePreview} and HTTP response
624
+ */
625
+ }, {
626
+ key: "createTemplatePreviewWithHttpInfo",
627
+ value: function createTemplatePreviewWithHttpInfo(template_id, body, opts) {
628
+ opts = opts || {};
629
+ var postBody = body;
630
+ // verify the required parameter 'template_id' is set
631
+ if (template_id === undefined || template_id === null) {
632
+ throw new Error("Missing the required parameter 'template_id' when calling createTemplatePreview");
633
+ }
634
+ // verify the required parameter 'body' is set
635
+ if (body === undefined || body === null) {
636
+ throw new Error("Missing the required parameter 'body' when calling createTemplatePreview");
637
+ }
638
+ var pathParams = {
639
+ 'template_id': template_id
640
+ };
641
+ var queryParams = {
642
+ 'version': opts['version']
643
+ };
644
+ var headerParams = {};
645
+ var formParams = {};
646
+ var authNames = ['api_token_basic'];
647
+ var contentTypes = ['application/json'];
648
+ var accepts = ['application/json'];
649
+ var returnType = _TemplatePreview["default"];
650
+ return this.apiClient.callApi('/templates/{template_id}/previews', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
651
+ }
652
+
653
+ /**
654
+ * Preview a template with data
655
+ * Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML or PDF template prints with your data before you publish a version or send live data. It renders the template's draft, or the published `version` you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's `pending` while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's `processed`, with an image of each page, or `error`.
656
+ * @param {String} template_id The template's ID.
657
+ * @param {module:model/CreateTemplatePreviewRequest} body The data to render the template with.
658
+ * @param {Object} opts Optional parameters
659
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
660
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplatePreview}
661
+ */
662
+ }, {
663
+ key: "createTemplatePreview",
664
+ value: function createTemplatePreview(template_id, body, opts) {
665
+ return this.createTemplatePreviewWithHttpInfo(template_id, body, opts).then(function (response_and_data) {
666
+ return response_and_data.data;
667
+ });
668
+ }
669
+
544
670
  /**
545
671
  * Create a webhook
546
672
  * Creates a webhook that sends a POST request to your endpoint whenever a subscribed event happens. Scope it to API tokens, templates or folders to receive only their events.
@@ -833,6 +959,60 @@ var Client = exports["default"] = /*#__PURE__*/function () {
833
959
  });
834
960
  }
835
961
 
962
+ /**
963
+ * Generate more files
964
+ * Adds formats to a processed submission's files, in the background: `png`, a PNG image of each page of the PDF (up to 100 pages). To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
965
+ * @param {String} submission_id The submission's ID.
966
+ * @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
967
+ * @param {Object} opts Optional parameters
968
+ * @param {Boolean} [wait] Wait until the files have been generated before responding. Default true on sync.api hosts.
969
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Submission} and HTTP response
970
+ */
971
+ }, {
972
+ key: "generateSubmissionFilesWithHttpInfo",
973
+ value: function generateSubmissionFilesWithHttpInfo(submission_id, body, opts) {
974
+ opts = opts || {};
975
+ var postBody = body;
976
+ // verify the required parameter 'submission_id' is set
977
+ if (submission_id === undefined || submission_id === null) {
978
+ throw new Error("Missing the required parameter 'submission_id' when calling generateSubmissionFiles");
979
+ }
980
+ // verify the required parameter 'body' is set
981
+ if (body === undefined || body === null) {
982
+ throw new Error("Missing the required parameter 'body' when calling generateSubmissionFiles");
983
+ }
984
+ var pathParams = {
985
+ 'submission_id': submission_id
986
+ };
987
+ var queryParams = {
988
+ 'wait': opts['wait']
989
+ };
990
+ var headerParams = {};
991
+ var formParams = {};
992
+ var authNames = ['api_token_basic'];
993
+ var contentTypes = ['application/json'];
994
+ var accepts = ['application/json'];
995
+ var returnType = _Submission["default"];
996
+ return this.apiClient.callApi('/submissions/{submission_id}/generate_files', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
997
+ }
998
+
999
+ /**
1000
+ * Generate more files
1001
+ * Adds formats to a processed submission's files, in the background: `png`, a PNG image of each page of the PDF (up to 100 pages). To make them with the submission, add them to `output_formats` when you create it. Each new file is listed in `files` while it's made: on sync.api hosts the request waits for them (unless you pass `wait=false`), otherwise poll GET /submissions/{submission_id} until none of their `state` is `pending`. A file that couldn't be made has the state `error` and an `error_message`, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
1002
+ * @param {String} submission_id The submission's ID.
1003
+ * @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
1004
+ * @param {Object} opts Optional parameters
1005
+ * @param {Boolean} opts.wait Wait until the files have been generated before responding. Default true on sync.api hosts.
1006
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Submission}
1007
+ */
1008
+ }, {
1009
+ key: "generateSubmissionFiles",
1010
+ value: function generateSubmissionFiles(submission_id, body, opts) {
1011
+ return this.generateSubmissionFilesWithHttpInfo(submission_id, body, opts).then(function (response_and_data) {
1012
+ return response_and_data.data;
1013
+ });
1014
+ }
1015
+
836
1016
  /**
837
1017
  * Generate a preview PDF
838
1018
  * Generates a preview of a submission's PDF in the background, such as for a submission still waiting for its signature requests. It's in `files.preview` once `preview_generated_at` changes.
@@ -1208,13 +1388,62 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1208
1388
  });
1209
1389
  }
1210
1390
 
1391
+ /**
1392
+ * Compare a version of a template with the one before it
1393
+ * Returns what changed in the template's draft since its latest published version (or in a published version since the one before it): fields added, removed, changed and moved, the settings that changed, and whether the document was replaced. Check it before you publish a version.
1394
+ * @param {String} template_id The template's ID.
1395
+ * @param {Object} opts Optional parameters
1396
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1397
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateDiff} and HTTP response
1398
+ */
1399
+ }, {
1400
+ key: "getTemplateDiffWithHttpInfo",
1401
+ value: function getTemplateDiffWithHttpInfo(template_id, opts) {
1402
+ opts = opts || {};
1403
+ var postBody = null;
1404
+ // verify the required parameter 'template_id' is set
1405
+ if (template_id === undefined || template_id === null) {
1406
+ throw new Error("Missing the required parameter 'template_id' when calling getTemplateDiff");
1407
+ }
1408
+ var pathParams = {
1409
+ 'template_id': template_id
1410
+ };
1411
+ var queryParams = {
1412
+ 'version': opts['version']
1413
+ };
1414
+ var headerParams = {};
1415
+ var formParams = {};
1416
+ var authNames = ['api_token_basic'];
1417
+ var contentTypes = [];
1418
+ var accepts = ['application/json'];
1419
+ var returnType = _TemplateDiff["default"];
1420
+ return this.apiClient.callApi('/templates/{template_id}/diff', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1421
+ }
1422
+
1423
+ /**
1424
+ * Compare a version of a template with the one before it
1425
+ * Returns what changed in the template's draft since its latest published version (or in a published version since the one before it): fields added, removed, changed and moved, the settings that changed, and whether the document was replaced. Check it before you publish a version.
1426
+ * @param {String} template_id The template's ID.
1427
+ * @param {Object} opts Optional parameters
1428
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1429
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateDiff}
1430
+ */
1431
+ }, {
1432
+ key: "getTemplateDiff",
1433
+ value: function getTemplateDiff(template_id, opts) {
1434
+ return this.getTemplateDiffWithHttpInfo(template_id, opts).then(function (response_and_data) {
1435
+ return response_and_data.data;
1436
+ });
1437
+ }
1438
+
1211
1439
  /**
1212
1440
  * Generate typed code for a template's submission data
1213
- * Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
1441
+ * Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object, and `just_types=true` leaves out the code that converts JSON to and from the types. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
1214
1442
  * @param {String} template_id The template's ID.
1215
1443
  * @param {module:model/ModelCodeLanguage} lang The language to generate the code in.
1216
1444
  * @param {Object} opts Optional parameters
1217
1445
  * @param {String} [version] The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
1446
+ * @param {Boolean} [just_types] Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types and PHP no types-only code, so theirs is the same either way.
1218
1447
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateModelCode} and HTTP response
1219
1448
  */
1220
1449
  }, {
@@ -1235,7 +1464,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1235
1464
  };
1236
1465
  var queryParams = {
1237
1466
  'version': opts['version'],
1238
- 'lang': lang
1467
+ 'lang': lang,
1468
+ 'just_types': opts['just_types']
1239
1469
  };
1240
1470
  var headerParams = {};
1241
1471
  var formParams = {};
@@ -1248,11 +1478,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1248
1478
 
1249
1479
  /**
1250
1480
  * Generate typed code for a template's submission data
1251
- * Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
1481
+ * Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, so your app catches mistakes before it calls the API. `root_type_name` is the type of the whole `data` object, and `just_types=true` leaves out the code that converts JSON to and from the types. Java returns every class in `code`, each under a `// ClassName.java` comment. A template with no named fields returns 422.
1252
1482
  * @param {String} template_id The template's ID.
1253
1483
  * @param {module:model/ModelCodeLanguage} lang The language to generate the code in.
1254
1484
  * @param {Object} opts Optional parameters
1255
1485
  * @param {String} opts.version The template version: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published), the version a submission uses by default.
1486
+ * @param {Boolean} opts.just_types Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types and PHP no types-only code, so theirs is the same either way.
1256
1487
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateModelCode}
1257
1488
  */
1258
1489
  }, {
@@ -1263,6 +1494,102 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1263
1494
  });
1264
1495
  }
1265
1496
 
1497
+ /**
1498
+ * Get images of a template's pages
1499
+ * Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
1500
+ * @param {String} template_id The template's ID.
1501
+ * @param {Object} opts Optional parameters
1502
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1503
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplatePageImages} and HTTP response
1504
+ */
1505
+ }, {
1506
+ key: "getTemplatePageImagesWithHttpInfo",
1507
+ value: function getTemplatePageImagesWithHttpInfo(template_id, opts) {
1508
+ opts = opts || {};
1509
+ var postBody = null;
1510
+ // verify the required parameter 'template_id' is set
1511
+ if (template_id === undefined || template_id === null) {
1512
+ throw new Error("Missing the required parameter 'template_id' when calling getTemplatePageImages");
1513
+ }
1514
+ var pathParams = {
1515
+ 'template_id': template_id
1516
+ };
1517
+ var queryParams = {
1518
+ 'version': opts['version']
1519
+ };
1520
+ var headerParams = {};
1521
+ var formParams = {};
1522
+ var authNames = ['api_token_basic'];
1523
+ var contentTypes = [];
1524
+ var accepts = ['application/json'];
1525
+ var returnType = _TemplatePageImages["default"];
1526
+ return this.apiClient.callApi('/templates/{template_id}/page_images', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1527
+ }
1528
+
1529
+ /**
1530
+ * Get images of a template's pages
1531
+ * Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
1532
+ * @param {String} template_id The template's ID.
1533
+ * @param {Object} opts Optional parameters
1534
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1535
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplatePageImages}
1536
+ */
1537
+ }, {
1538
+ key: "getTemplatePageImages",
1539
+ value: function getTemplatePageImages(template_id, opts) {
1540
+ return this.getTemplatePageImagesWithHttpInfo(template_id, opts).then(function (response_and_data) {
1541
+ return response_and_data.data;
1542
+ });
1543
+ }
1544
+
1545
+ /**
1546
+ * Get a template preview
1547
+ * Returns a preview made with POST /templates/{template_id}/previews. Once it's `processed`, `pages` has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
1548
+ * @param {String} template_id The template's ID.
1549
+ * @param {String} preview_id The preview's ID.
1550
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplatePreview} and HTTP response
1551
+ */
1552
+ }, {
1553
+ key: "getTemplatePreviewWithHttpInfo",
1554
+ value: function getTemplatePreviewWithHttpInfo(template_id, preview_id) {
1555
+ var postBody = null;
1556
+ // verify the required parameter 'template_id' is set
1557
+ if (template_id === undefined || template_id === null) {
1558
+ throw new Error("Missing the required parameter 'template_id' when calling getTemplatePreview");
1559
+ }
1560
+ // verify the required parameter 'preview_id' is set
1561
+ if (preview_id === undefined || preview_id === null) {
1562
+ throw new Error("Missing the required parameter 'preview_id' when calling getTemplatePreview");
1563
+ }
1564
+ var pathParams = {
1565
+ 'template_id': template_id,
1566
+ 'preview_id': preview_id
1567
+ };
1568
+ var queryParams = {};
1569
+ var headerParams = {};
1570
+ var formParams = {};
1571
+ var authNames = ['api_token_basic'];
1572
+ var contentTypes = [];
1573
+ var accepts = ['application/json'];
1574
+ var returnType = _TemplatePreview["default"];
1575
+ return this.apiClient.callApi('/templates/{template_id}/previews/{preview_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1576
+ }
1577
+
1578
+ /**
1579
+ * Get a template preview
1580
+ * Returns a preview made with POST /templates/{template_id}/previews. Once it's `processed`, `pages` has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
1581
+ * @param {String} template_id The template's ID.
1582
+ * @param {String} preview_id The preview's ID.
1583
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplatePreview}
1584
+ */
1585
+ }, {
1586
+ key: "getTemplatePreview",
1587
+ value: function getTemplatePreview(template_id, preview_id) {
1588
+ return this.getTemplatePreviewWithHttpInfo(template_id, preview_id).then(function (response_and_data) {
1589
+ return response_and_data.data;
1590
+ });
1591
+ }
1592
+
1266
1593
  /**
1267
1594
  * Get the JSON Schema of a template's submission data
1268
1595
  * Returns the JSON Schema that a submission's `data` must match. Use it to check data before you create submissions, or to build a form for the template's fields.
@@ -1488,7 +1815,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1488
1815
 
1489
1816
  /**
1490
1817
  * List submissions
1491
- * Returns the submissions in your account, newest first, one page at a time. Lists leave out each submission's `data` unless you pass `include_data=true`.
1818
+ * Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
1492
1819
  * @param {Object} opts Optional parameters
1493
1820
  * @param {String} [template_id] Only list this template's submissions.
1494
1821
  * @param {Boolean} [test] Only list test submissions (true) or live submissions (false).
@@ -1497,6 +1824,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1497
1824
  * @param {Boolean} [include_data] Include each submission's `data` (null without it).
1498
1825
  * @param {Number} [limit = 50)] How many items to return (1-100, default 50).
1499
1826
  * @param {String} [cursor] The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1827
+ * @param {module:model/SubmissionState} [state] Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
1828
+ * @param {Boolean} [include_files] Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
1500
1829
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionList} and HTTP response
1501
1830
  */
1502
1831
  }, {
@@ -1512,7 +1841,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1512
1841
  'created_before': opts['created_before'],
1513
1842
  'include_data': opts['include_data'],
1514
1843
  'limit': opts['limit'],
1515
- 'cursor': opts['cursor']
1844
+ 'cursor': opts['cursor'],
1845
+ 'state': opts['state'],
1846
+ 'include_files': opts['include_files']
1516
1847
  };
1517
1848
  var headerParams = {};
1518
1849
  var formParams = {};
@@ -1525,7 +1856,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1525
1856
 
1526
1857
  /**
1527
1858
  * List submissions
1528
- * Returns the submissions in your account, newest first, one page at a time. Lists leave out each submission's `data` unless you pass `include_data=true`.
1859
+ * Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its `data` is null unless you pass `include_data=true`, and its `files` are empty unless you pass `include_files=true`. Get a submission by its ID for its signature requests, uploads and page images.
1529
1860
  * @param {Object} opts Optional parameters
1530
1861
  * @param {String} opts.template_id Only list this template's submissions.
1531
1862
  * @param {Boolean} opts.test Only list test submissions (true) or live submissions (false).
@@ -1534,6 +1865,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1534
1865
  * @param {Boolean} opts.include_data Include each submission's `data` (null without it).
1535
1866
  * @param {Number} opts.limit How many items to return (1-100, default 50). (default to 50)
1536
1867
  * @param {String} opts.cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1868
+ * @param {module:model/SubmissionState} opts.state Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
1869
+ * @param {Boolean} opts.include_files Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
1537
1870
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionList}
1538
1871
  */
1539
1872
  }, {
@@ -1544,6 +1877,54 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1544
1877
  });
1545
1878
  }
1546
1879
 
1880
+ /**
1881
+ * List a template's fields
1882
+ * Returns a template's fields with all of their settings, page by page: the draft's fields, or a published version's. A PDF template's fields are placed on its pages: GET /templates/{template_id}/page_images has images of the pages.
1883
+ * @param {String} template_id The template's ID.
1884
+ * @param {Object} opts Optional parameters
1885
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1886
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
1887
+ */
1888
+ }, {
1889
+ key: "listTemplateFieldsWithHttpInfo",
1890
+ value: function listTemplateFieldsWithHttpInfo(template_id, opts) {
1891
+ opts = opts || {};
1892
+ var postBody = null;
1893
+ // verify the required parameter 'template_id' is set
1894
+ if (template_id === undefined || template_id === null) {
1895
+ throw new Error("Missing the required parameter 'template_id' when calling listTemplateFields");
1896
+ }
1897
+ var pathParams = {
1898
+ 'template_id': template_id
1899
+ };
1900
+ var queryParams = {
1901
+ 'version': opts['version']
1902
+ };
1903
+ var headerParams = {};
1904
+ var formParams = {};
1905
+ var authNames = ['api_token_basic'];
1906
+ var contentTypes = [];
1907
+ var accepts = ['application/json'];
1908
+ var returnType = _TemplateFields["default"];
1909
+ return this.apiClient.callApi('/templates/{template_id}/fields', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1910
+ }
1911
+
1912
+ /**
1913
+ * List a template's fields
1914
+ * Returns a template's fields with all of their settings, page by page: the draft's fields, or a published version's. A PDF template's fields are placed on its pages: GET /templates/{template_id}/page_images has images of the pages.
1915
+ * @param {String} template_id The template's ID.
1916
+ * @param {Object} opts Optional parameters
1917
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1918
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
1919
+ */
1920
+ }, {
1921
+ key: "listTemplateFields",
1922
+ value: function listTemplateFields(template_id, opts) {
1923
+ return this.listTemplateFieldsWithHttpInfo(template_id, opts).then(function (response_and_data) {
1924
+ return response_and_data.data;
1925
+ });
1926
+ }
1927
+
1547
1928
  /**
1548
1929
  * List a template's submissions
1549
1930
  * Returns a template's submissions (from every version of the template), newest first.
@@ -1555,6 +1936,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1555
1936
  * @param {Boolean} [include_data] Include each submission's `data` (null without it).
1556
1937
  * @param {Number} [limit = 50)] How many items to return (1-100, default 50).
1557
1938
  * @param {String} [cursor] The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1939
+ * @param {module:model/SubmissionState} [state] Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
1940
+ * @param {Boolean} [include_files] Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
1558
1941
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionList} and HTTP response
1559
1942
  */
1560
1943
  }, {
@@ -1575,7 +1958,9 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1575
1958
  'created_before': opts['created_before'],
1576
1959
  'include_data': opts['include_data'],
1577
1960
  'limit': opts['limit'],
1578
- 'cursor': opts['cursor']
1961
+ 'cursor': opts['cursor'],
1962
+ 'state': opts['state'],
1963
+ 'include_files': opts['include_files']
1579
1964
  };
1580
1965
  var headerParams = {};
1581
1966
  var formParams = {};
@@ -1597,6 +1982,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1597
1982
  * @param {Boolean} opts.include_data Include each submission's `data` (null without it).
1598
1983
  * @param {Number} opts.limit How many items to return (1-100, default 50). (default to 50)
1599
1984
  * @param {String} opts.cursor The previous page's `next_cursor`, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
1985
+ * @param {module:model/SubmissionState} opts.state Only list submissions in this state (one state per request). The ones that failed are `invalid_data`, `error`, `syntax_error`, `image_download_failed` and `image_processing_failed`, and one still `pending` an hour after it was created is stuck.
1986
+ * @param {Boolean} opts.include_files Include each submission's generated files and their download links (`files`, empty without it), without the page images' links.
1600
1987
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionList}
1601
1988
  */
1602
1989
  }, {
@@ -1609,7 +1996,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1609
1996
 
1610
1997
  /**
1611
1998
  * List templates
1612
- * Returns the templates in your account (their drafts), newest first, one page at a time. Get a template by its ID for its HTML, defaults and published versions.
1999
+ * Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
1613
2000
  * @param {Object} opts Optional parameters
1614
2001
  * @param {String} [query] Only list templates whose name contains this text (ignoring case).
1615
2002
  * @param {String} [parent_folder_id] Only list the templates in this folder (not in its subfolders).
@@ -1640,7 +2027,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1640
2027
 
1641
2028
  /**
1642
2029
  * List templates
1643
- * Returns the templates in your account (their drafts), newest first, one page at a time. Get a template by its ID for its HTML, defaults and published versions.
2030
+ * Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
1644
2031
  * @param {Object} opts Optional parameters
1645
2032
  * @param {String} opts.query Only list templates whose name contains this text (ignoring case).
1646
2033
  * @param {String} opts.parent_folder_id Only list the templates in this folder (not in its subfolders).
@@ -1810,7 +2197,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1810
2197
 
1811
2198
  /**
1812
2199
  * Publish a template version
1813
- * Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up.
2200
+ * Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
1814
2201
  * @param {String} template_id The template's ID.
1815
2202
  * @param {module:model/PublishTemplateVersionRequest} body The version to publish.
1816
2203
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateVersion} and HTTP response
@@ -1842,7 +2229,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1842
2229
 
1843
2230
  /**
1844
2231
  * Publish a template version
1845
- * Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up.
2232
+ * Publishes the template's draft as a new version that doesn't change. `version_type` says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
1846
2233
  * @param {String} template_id The template's ID.
1847
2234
  * @param {module:model/PublishTemplateVersionRequest} body The version to publish.
1848
2235
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateVersion}
@@ -1855,6 +2242,53 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1855
2242
  });
1856
2243
  }
1857
2244
 
2245
+ /**
2246
+ * Remove fields from a template
2247
+ * Removes fields from a template's draft and returns the fields that are left. Conditional logic that used only the removed fields is removed too.
2248
+ * @param {String} template_id The template's ID.
2249
+ * @param {module:model/RemoveTemplateFieldsRequest} body The fields to remove from the template's draft.
2250
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
2251
+ */
2252
+ }, {
2253
+ key: "removeTemplateFieldsWithHttpInfo",
2254
+ value: function removeTemplateFieldsWithHttpInfo(template_id, body) {
2255
+ var postBody = body;
2256
+ // verify the required parameter 'template_id' is set
2257
+ if (template_id === undefined || template_id === null) {
2258
+ throw new Error("Missing the required parameter 'template_id' when calling removeTemplateFields");
2259
+ }
2260
+ // verify the required parameter 'body' is set
2261
+ if (body === undefined || body === null) {
2262
+ throw new Error("Missing the required parameter 'body' when calling removeTemplateFields");
2263
+ }
2264
+ var pathParams = {
2265
+ 'template_id': template_id
2266
+ };
2267
+ var queryParams = {};
2268
+ var headerParams = {};
2269
+ var formParams = {};
2270
+ var authNames = ['api_token_basic'];
2271
+ var contentTypes = ['application/json'];
2272
+ var accepts = ['application/json'];
2273
+ var returnType = _TemplateFields["default"];
2274
+ return this.apiClient.callApi('/templates/{template_id}/fields/remove', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2275
+ }
2276
+
2277
+ /**
2278
+ * Remove fields from a template
2279
+ * Removes fields from a template's draft and returns the fields that are left. Conditional logic that used only the removed fields is removed too.
2280
+ * @param {String} template_id The template's ID.
2281
+ * @param {module:model/RemoveTemplateFieldsRequest} body The fields to remove from the template's draft.
2282
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
2283
+ */
2284
+ }, {
2285
+ key: "removeTemplateFields",
2286
+ value: function removeTemplateFields(template_id, body) {
2287
+ return this.removeTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
2288
+ return response_and_data.data;
2289
+ });
2290
+ }
2291
+
1858
2292
  /**
1859
2293
  * Rename a folder
1860
2294
  * Renames a folder. The name must be unique within its parent folder.
@@ -1902,6 +2336,53 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1902
2336
  });
1903
2337
  }
1904
2338
 
2339
+ /**
2340
+ * Reorder a template's fields
2341
+ * Changes the order of the fields in a template's draft and returns them in their new order. Send every field's ID: each field stays on its page, and a page's fields are printed in this order, so a later field prints over an earlier one where they overlap. Their values are in this order in the template's data schema and forms.
2342
+ * @param {String} template_id The template's ID.
2343
+ * @param {module:model/ReorderTemplateFieldsRequest} body The new order of the fields in the template's draft.
2344
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
2345
+ */
2346
+ }, {
2347
+ key: "reorderTemplateFieldsWithHttpInfo",
2348
+ value: function reorderTemplateFieldsWithHttpInfo(template_id, body) {
2349
+ var postBody = body;
2350
+ // verify the required parameter 'template_id' is set
2351
+ if (template_id === undefined || template_id === null) {
2352
+ throw new Error("Missing the required parameter 'template_id' when calling reorderTemplateFields");
2353
+ }
2354
+ // verify the required parameter 'body' is set
2355
+ if (body === undefined || body === null) {
2356
+ throw new Error("Missing the required parameter 'body' when calling reorderTemplateFields");
2357
+ }
2358
+ var pathParams = {
2359
+ 'template_id': template_id
2360
+ };
2361
+ var queryParams = {};
2362
+ var headerParams = {};
2363
+ var formParams = {};
2364
+ var authNames = ['api_token_basic'];
2365
+ var contentTypes = ['application/json'];
2366
+ var accepts = ['application/json'];
2367
+ var returnType = _TemplateFields["default"];
2368
+ return this.apiClient.callApi('/templates/{template_id}/fields/reorder', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2369
+ }
2370
+
2371
+ /**
2372
+ * Reorder a template's fields
2373
+ * Changes the order of the fields in a template's draft and returns them in their new order. Send every field's ID: each field stays on its page, and a page's fields are printed in this order, so a later field prints over an earlier one where they overlap. Their values are in this order in the template's data schema and forms.
2374
+ * @param {String} template_id The template's ID.
2375
+ * @param {module:model/ReorderTemplateFieldsRequest} body The new order of the fields in the template's draft.
2376
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
2377
+ */
2378
+ }, {
2379
+ key: "reorderTemplateFields",
2380
+ value: function reorderTemplateFields(template_id, body) {
2381
+ return this.reorderTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
2382
+ return response_and_data.data;
2383
+ });
2384
+ }
2385
+
1905
2386
  /**
1906
2387
  * Restore a template version
1907
2388
  * Replaces the template's draft with a copy of one of its published versions.
@@ -2031,7 +2512,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2031
2512
 
2032
2513
  /**
2033
2514
  * Update a template
2034
- * Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object. Setting `parent_folder_id` moves the template and all of its published versions.
2515
+ * Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Setting `parent_folder_id` moves the template and all of its published versions.
2035
2516
  * @param {String} template_id The template's ID.
2036
2517
  * @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
2037
2518
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
@@ -2063,7 +2544,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2063
2544
 
2064
2545
  /**
2065
2546
  * Update a template
2066
- * Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object. Setting `parent_folder_id` moves the template and all of its published versions.
2547
+ * Changes a template's draft. Properties left out keep their values. `defaults` and `html_engine_options` replace the whole object, and `field_groups` changes only the groups it lists. Setting `parent_folder_id` moves the template and all of its published versions.
2067
2548
  * @param {String} template_id The template's ID.
2068
2549
  * @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
2069
2550
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
@@ -2078,11 +2559,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2078
2559
 
2079
2560
  /**
2080
2561
  * Replace a template's PDF
2081
- * Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF with the request instead, use PUT /templates/{template_id}/document/upload.
2562
+ * Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
2082
2563
  * @param {String} template_id The template's ID.
2083
- * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF.
2564
+ * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
2084
2565
  * @param {Object} opts Optional parameters
2085
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2566
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2086
2567
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2087
2568
  */
2088
2569
  }, {
@@ -2115,11 +2596,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2115
2596
 
2116
2597
  /**
2117
2598
  * Replace a template's PDF
2118
- * Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF with the request instead, use PUT /templates/{template_id}/document/upload.
2599
+ * Replaces a PDF template's PDF with one you uploaded with the presigned upload (GET /uploads/presign) (`cache_id`), a link to download it from (`document_url`), or the file in base64 (`document_base64`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields. To send the PDF as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
2119
2600
  * @param {String} template_id The template's ID.
2120
- * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF.
2601
+ * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
2121
2602
  * @param {Object} opts Optional parameters
2122
- * @param {Boolean} opts.wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2603
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2123
2604
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2124
2605
  */
2125
2606
  }, {
@@ -2130,6 +2611,53 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2130
2611
  });
2131
2612
  }
2132
2613
 
2614
+ /**
2615
+ * Update a template's fields
2616
+ * Changes fields of a template's draft and returns all of its fields. Settings left out keep their values. A shared setting (`type`, `required`, `default`, ...) changes for every field with the same name.
2617
+ * @param {String} template_id The template's ID.
2618
+ * @param {module:model/UpdateTemplateFieldsRequest} body The fields to change in the template's draft.
2619
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
2620
+ */
2621
+ }, {
2622
+ key: "updateTemplateFieldsWithHttpInfo",
2623
+ value: function updateTemplateFieldsWithHttpInfo(template_id, body) {
2624
+ var postBody = body;
2625
+ // verify the required parameter 'template_id' is set
2626
+ if (template_id === undefined || template_id === null) {
2627
+ throw new Error("Missing the required parameter 'template_id' when calling updateTemplateFields");
2628
+ }
2629
+ // verify the required parameter 'body' is set
2630
+ if (body === undefined || body === null) {
2631
+ throw new Error("Missing the required parameter 'body' when calling updateTemplateFields");
2632
+ }
2633
+ var pathParams = {
2634
+ 'template_id': template_id
2635
+ };
2636
+ var queryParams = {};
2637
+ var headerParams = {};
2638
+ var formParams = {};
2639
+ var authNames = ['api_token_basic'];
2640
+ var contentTypes = ['application/json'];
2641
+ var accepts = ['application/json'];
2642
+ var returnType = _TemplateFields["default"];
2643
+ return this.apiClient.callApi('/templates/{template_id}/fields', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2644
+ }
2645
+
2646
+ /**
2647
+ * Update a template's fields
2648
+ * Changes fields of a template's draft and returns all of its fields. Settings left out keep their values. A shared setting (`type`, `required`, `default`, ...) changes for every field with the same name.
2649
+ * @param {String} template_id The template's ID.
2650
+ * @param {module:model/UpdateTemplateFieldsRequest} body The fields to change in the template's draft.
2651
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
2652
+ */
2653
+ }, {
2654
+ key: "updateTemplateFields",
2655
+ value: function updateTemplateFields(template_id, body) {
2656
+ return this.updateTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
2657
+ return response_and_data.data;
2658
+ });
2659
+ }
2660
+
2133
2661
  /**
2134
2662
  * Update a webhook
2135
2663
  * Updates a webhook. Only the properties you send change.
@@ -2182,7 +2710,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2182
2710
  * Creates a PDF template from a PDF sent with the request (`multipart/form-data`). For large files, upload the PDF with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
2183
2711
  * @param {File} document The PDF.
2184
2712
  * @param {Object} opts Optional parameters
2185
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2713
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2186
2714
  * @param {String} [name] The template's name.
2187
2715
  * @param {String} [description] The template's description.
2188
2716
  * @param {String} [parent_folder_id] The folder to put the template in. Left out, it's created at the root.
@@ -2230,7 +2758,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2230
2758
  * Creates a PDF template from a PDF sent with the request (`multipart/form-data`). For large files, upload the PDF with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
2231
2759
  * @param {File} document The PDF.
2232
2760
  * @param {Object} opts Optional parameters
2233
- * @param {Boolean} opts.wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2761
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2234
2762
  * @param {String} opts.name The template's name.
2235
2763
  * @param {String} opts.description The template's description.
2236
2764
  * @param {String} opts.parent_folder_id The folder to put the template in. Left out, it's created at the root.
@@ -2255,7 +2783,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2255
2783
  * @param {String} template_id The template's ID.
2256
2784
  * @param {File} document The new PDF.
2257
2785
  * @param {Object} opts Optional parameters
2258
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2786
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2259
2787
  * @param {Boolean} [reimport_fields] Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
2260
2788
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2261
2789
  */
@@ -2296,7 +2824,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2296
2824
  * @param {String} template_id The template's ID.
2297
2825
  * @param {File} document The new PDF.
2298
2826
  * @param {Object} opts Optional parameters
2299
- * @param {Boolean} opts.wait Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2827
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2300
2828
  * @param {Boolean} opts.reimport_fields Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
2301
2829
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2302
2830
  */
@@ -2307,5 +2835,59 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2307
2835
  return response_and_data.data;
2308
2836
  });
2309
2837
  }
2838
+
2839
+ /**
2840
+ * Check a submission without creating it
2841
+ * Checks a submission as creating it would (its data against the template's fields, its settings and signature requests) without saving it, generating anything or using credits. It doesn't check your account's credits. The response says whether the submission is valid, and if not, has the error that creating it would return.
2842
+ * @param {String} template_id The template's ID.
2843
+ * @param {module:model/ValidateSubmissionRequest} body The submission's data and settings.
2844
+ * @param {Object} opts Optional parameters
2845
+ * @param {String} [version] The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
2846
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionValidation} and HTTP response
2847
+ */
2848
+ }, {
2849
+ key: "validateSubmissionWithHttpInfo",
2850
+ value: function validateSubmissionWithHttpInfo(template_id, body, opts) {
2851
+ opts = opts || {};
2852
+ var postBody = body;
2853
+ // verify the required parameter 'template_id' is set
2854
+ if (template_id === undefined || template_id === null) {
2855
+ throw new Error("Missing the required parameter 'template_id' when calling validateSubmission");
2856
+ }
2857
+ // verify the required parameter 'body' is set
2858
+ if (body === undefined || body === null) {
2859
+ throw new Error("Missing the required parameter 'body' when calling validateSubmission");
2860
+ }
2861
+ var pathParams = {
2862
+ 'template_id': template_id
2863
+ };
2864
+ var queryParams = {
2865
+ 'version': opts['version']
2866
+ };
2867
+ var headerParams = {};
2868
+ var formParams = {};
2869
+ var authNames = ['api_token_basic'];
2870
+ var contentTypes = ['application/json'];
2871
+ var accepts = ['application/json'];
2872
+ var returnType = _SubmissionValidation["default"];
2873
+ return this.apiClient.callApi('/templates/{template_id}/submissions/validate', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2874
+ }
2875
+
2876
+ /**
2877
+ * Check a submission without creating it
2878
+ * Checks a submission as creating it would (its data against the template's fields, its settings and signature requests) without saving it, generating anything or using credits. It doesn't check your account's credits. The response says whether the submission is valid, and if not, has the error that creating it would return.
2879
+ * @param {String} template_id The template's ID.
2880
+ * @param {module:model/ValidateSubmissionRequest} body The submission's data and settings.
2881
+ * @param {Object} opts Optional parameters
2882
+ * @param {String} opts.version The template version to use: a published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `latest` (the draft when no version has been published).
2883
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionValidation}
2884
+ */
2885
+ }, {
2886
+ key: "validateSubmission",
2887
+ value: function validateSubmission(template_id, body, opts) {
2888
+ return this.validateSubmissionWithHttpInfo(template_id, body, opts).then(function (response_and_data) {
2889
+ return response_and_data.data;
2890
+ });
2891
+ }
2310
2892
  }]);
2311
2893
  }();