docspring 4.0.0 → 4.1.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 (108) hide show
  1. package/README.md +10 -1
  2. package/dist/ApiClient.js +2 -2
  3. package/dist/RequestSchemas.js +1171 -16
  4. package/dist/api/Client.js +474 -24
  5. package/dist/index.js +196 -0
  6. package/dist/model/AddTemplateFieldsRequest.js +132 -0
  7. package/dist/model/AuthenticationCheck.js +1 -1
  8. package/dist/model/CombinedPdf.js +1 -1
  9. package/dist/model/CombinedPdfFiles.js +1 -1
  10. package/dist/model/CombinedPdfList.js +1 -1
  11. package/dist/model/CombinedPdfSource.js +1 -1
  12. package/dist/model/CombinedPdfSourceInput.js +1 -1
  13. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  14. package/dist/model/CopyTemplateRequest.js +1 -1
  15. package/dist/model/CreateCombinedPdfRequest.js +1 -1
  16. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  17. package/dist/model/CreateFolderRequest.js +1 -1
  18. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  19. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  20. package/dist/model/CreateSubmissionBatchRequest.js +15 -1
  21. package/dist/model/CreateSubmissionRequest.js +15 -1
  22. package/dist/model/CreateTemplateRequest.js +71 -3
  23. package/dist/model/CreateWebhookRequest.js +1 -1
  24. package/dist/model/CustomFile.js +1 -1
  25. package/dist/model/CustomFileList.js +1 -1
  26. package/dist/model/CustomFileSourcePdf.js +1 -1
  27. package/dist/model/ErrorDetail.js +1 -1
  28. package/dist/model/ErrorInfo.js +1 -1
  29. package/dist/model/ErrorResponse.js +1 -1
  30. package/dist/model/Field.js +1230 -0
  31. package/dist/model/FieldComparisonCondition.js +1 -1
  32. package/dist/model/FieldDependency.js +154 -0
  33. package/dist/model/FieldDependencyInput.js +154 -0
  34. package/dist/model/FieldEqualsCondition.js +1 -1
  35. package/dist/model/FieldGroup.js +206 -0
  36. package/dist/model/FieldGroupInput.js +180 -0
  37. package/dist/model/FieldGroupType.js +59 -0
  38. package/dist/model/FieldInCondition.js +1 -1
  39. package/dist/model/FieldInput.js +1012 -0
  40. package/dist/model/FieldOverride.js +1 -1
  41. package/dist/model/FieldPresenceCondition.js +1 -1
  42. package/dist/model/FieldRangeCondition.js +1 -1
  43. package/dist/model/FieldType.js +124 -0
  44. package/dist/model/Folder.js +1 -1
  45. package/dist/model/FolderList.js +1 -1
  46. package/dist/model/GenerateFilesFormat.js +54 -0
  47. package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
  48. package/dist/model/GeneratedFile.js +1 -1
  49. package/dist/model/HtmlEngineOptions.js +1 -1
  50. package/dist/model/HtmlEngineOptionsInput.js +1 -1
  51. package/dist/model/MoveFolderRequest.js +1 -1
  52. package/dist/model/MoveTemplateRequest.js +1 -1
  53. package/dist/model/OutputFormat.js +59 -0
  54. package/dist/model/PageImage.js +220 -0
  55. package/dist/model/PageImages.js +155 -0
  56. package/dist/model/PredefinedField.js +183 -0
  57. package/dist/model/PredefinedFieldInput.js +183 -0
  58. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  59. package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
  60. package/dist/model/RenameFolderRequest.js +1 -1
  61. package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
  62. package/dist/model/RestoreTemplateVersionRequest.js +1 -1
  63. package/dist/model/SignatureRequest.js +1 -1
  64. package/dist/model/SignatureRequestEvent.js +1 -1
  65. package/dist/model/SignatureRequestInput.js +1 -1
  66. package/dist/model/SignatureRequestToken.js +1 -1
  67. package/dist/model/Submission.js +23 -7
  68. package/dist/model/SubmissionAction.js +1 -1
  69. package/dist/model/SubmissionBatch.js +1 -1
  70. package/dist/model/SubmissionFiles.js +10 -1
  71. package/dist/model/SubmissionInput.js +15 -1
  72. package/dist/model/SubmissionList.js +1 -1
  73. package/dist/model/SubmissionSourcePdf.js +1 -1
  74. package/dist/model/SubmissionValidation.js +151 -0
  75. package/dist/model/Template.js +67 -5
  76. package/dist/model/TemplateActor.js +1 -1
  77. package/dist/model/TemplateDefaults.js +1 -1
  78. package/dist/model/TemplateDefaultsInput.js +1 -1
  79. package/dist/model/TemplateDiff.js +206 -0
  80. package/dist/model/TemplateDiffSummary.js +165 -0
  81. package/dist/model/TemplateDocument.js +7 -7
  82. package/dist/model/TemplateDocumentState.js +11 -1
  83. package/dist/model/TemplateFieldChange.js +146 -0
  84. package/dist/model/TemplateFieldChanges.js +196 -0
  85. package/dist/model/TemplateFieldDependency.js +3 -3
  86. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  87. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  88. package/dist/model/TemplateFieldDependencyInput.js +3 -3
  89. package/dist/model/TemplateFieldMove.js +132 -0
  90. package/dist/model/TemplateFields.js +147 -0
  91. package/dist/model/TemplateModelCode.js +1 -1
  92. package/dist/model/TemplatePageImages.js +158 -0
  93. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  94. package/dist/model/TemplateSourcePdf.js +1 -1
  95. package/dist/model/TemplateSummary.js +1 -1
  96. package/dist/model/TemplateSummaryList.js +1 -1
  97. package/dist/model/TemplateVersion.js +1 -1
  98. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  99. package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
  100. package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
  101. package/dist/model/UpdateTemplateRequest.js +74 -1
  102. package/dist/model/UpdateWebhookRequest.js +1 -1
  103. package/dist/model/UploadPresign.js +1 -1
  104. package/dist/model/UrlSourcePdf.js +1 -1
  105. package/dist/model/ValidateSubmissionRequest.js +226 -0
  106. package/dist/model/Webhook.js +1 -1
  107. package/dist/model/WebhookList.js +1 -1
  108. package/package.json +1 -1
@@ -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"));
@@ -27,11 +28,14 @@ var _FieldSetupNaming = _interopRequireDefault(require("../model/FieldSetupNamin
27
28
  var _FieldSetupSource = _interopRequireDefault(require("../model/FieldSetupSource"));
28
29
  var _Folder = _interopRequireDefault(require("../model/Folder"));
29
30
  var _FolderList = _interopRequireDefault(require("../model/FolderList"));
31
+ var _GenerateSubmissionFilesRequest = _interopRequireDefault(require("../model/GenerateSubmissionFilesRequest"));
30
32
  var _ModelCodeLanguage = _interopRequireDefault(require("../model/ModelCodeLanguage"));
31
33
  var _MoveFolderRequest = _interopRequireDefault(require("../model/MoveFolderRequest"));
32
34
  var _MoveTemplateRequest = _interopRequireDefault(require("../model/MoveTemplateRequest"));
33
35
  var _PublishTemplateVersionRequest = _interopRequireDefault(require("../model/PublishTemplateVersionRequest"));
36
+ var _RemoveTemplateFieldsRequest = _interopRequireDefault(require("../model/RemoveTemplateFieldsRequest"));
34
37
  var _RenameFolderRequest = _interopRequireDefault(require("../model/RenameFolderRequest"));
38
+ var _ReorderTemplateFieldsRequest = _interopRequireDefault(require("../model/ReorderTemplateFieldsRequest"));
35
39
  var _RestoreTemplateVersionRequest = _interopRequireDefault(require("../model/RestoreTemplateVersionRequest"));
36
40
  var _SignatureRequest = _interopRequireDefault(require("../model/SignatureRequest"));
37
41
  var _SignatureRequestEvent = _interopRequireDefault(require("../model/SignatureRequestEvent"));
@@ -39,15 +43,21 @@ var _SignatureRequestToken = _interopRequireDefault(require("../model/SignatureR
39
43
  var _Submission = _interopRequireDefault(require("../model/Submission"));
40
44
  var _SubmissionBatch = _interopRequireDefault(require("../model/SubmissionBatch"));
41
45
  var _SubmissionList = _interopRequireDefault(require("../model/SubmissionList"));
46
+ var _SubmissionValidation = _interopRequireDefault(require("../model/SubmissionValidation"));
42
47
  var _Template = _interopRequireDefault(require("../model/Template"));
48
+ var _TemplateDiff = _interopRequireDefault(require("../model/TemplateDiff"));
49
+ var _TemplateFields = _interopRequireDefault(require("../model/TemplateFields"));
43
50
  var _TemplateModelCode = _interopRequireDefault(require("../model/TemplateModelCode"));
51
+ var _TemplatePageImages = _interopRequireDefault(require("../model/TemplatePageImages"));
44
52
  var _TemplateSummaryList = _interopRequireDefault(require("../model/TemplateSummaryList"));
45
53
  var _TemplateVersion = _interopRequireDefault(require("../model/TemplateVersion"));
46
54
  var _UpdateSignatureRequestRequest = _interopRequireDefault(require("../model/UpdateSignatureRequestRequest"));
47
55
  var _UpdateTemplateDocumentRequest = _interopRequireDefault(require("../model/UpdateTemplateDocumentRequest"));
56
+ var _UpdateTemplateFieldsRequest = _interopRequireDefault(require("../model/UpdateTemplateFieldsRequest"));
48
57
  var _UpdateTemplateRequest = _interopRequireDefault(require("../model/UpdateTemplateRequest"));
49
58
  var _UpdateWebhookRequest = _interopRequireDefault(require("../model/UpdateWebhookRequest"));
50
59
  var _UploadPresign = _interopRequireDefault(require("../model/UploadPresign"));
60
+ var _ValidateSubmissionRequest = _interopRequireDefault(require("../model/ValidateSubmissionRequest"));
51
61
  var _Webhook = _interopRequireDefault(require("../model/Webhook"));
52
62
  var _WebhookEventType = _interopRequireDefault(require("../model/WebhookEventType"));
53
63
  var _WebhookList = _interopRequireDefault(require("../model/WebhookList"));
@@ -73,7 +83,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
73
83
  /**
74
84
  * Client service.
75
85
  * @module api/Client
76
- * @version 4.0.0
86
+ * @version 4.1.0
77
87
  */
78
88
  var Client = exports["default"] = /*#__PURE__*/function () {
79
89
  /**
@@ -130,14 +140,61 @@ var Client = exports["default"] = /*#__PURE__*/function () {
130
140
  }
131
141
 
132
142
  /**
133
- * Copy a template
134
- * Copies a template (its draft, or a published version) into a new template.
143
+ * Add fields to a template
144
+ * 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
145
  * @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
146
+ * @param {module:model/AddTemplateFieldsRequest} body The fields to add to the template's draft.
147
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
139
148
  */
140
149
  return _createClass(Client, [{
150
+ key: "addTemplateFieldsWithHttpInfo",
151
+ value: function addTemplateFieldsWithHttpInfo(template_id, body) {
152
+ var postBody = body;
153
+ // verify the required parameter 'template_id' is set
154
+ if (template_id === undefined || template_id === null) {
155
+ throw new Error("Missing the required parameter 'template_id' when calling addTemplateFields");
156
+ }
157
+ // verify the required parameter 'body' is set
158
+ if (body === undefined || body === null) {
159
+ throw new Error("Missing the required parameter 'body' when calling addTemplateFields");
160
+ }
161
+ var pathParams = {
162
+ 'template_id': template_id
163
+ };
164
+ var queryParams = {};
165
+ var headerParams = {};
166
+ var formParams = {};
167
+ var authNames = ['api_token_basic'];
168
+ var contentTypes = ['application/json'];
169
+ var accepts = ['application/json'];
170
+ var returnType = _TemplateFields["default"];
171
+ return this.apiClient.callApi('/templates/{template_id}/fields', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
172
+ }
173
+
174
+ /**
175
+ * Add fields to a template
176
+ * Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them.
177
+ * @param {String} template_id The template's ID.
178
+ * @param {module:model/AddTemplateFieldsRequest} body The fields to add to the template's draft.
179
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
180
+ */
181
+ }, {
182
+ key: "addTemplateFields",
183
+ value: function addTemplateFields(template_id, body) {
184
+ return this.addTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
185
+ return response_and_data.data;
186
+ });
187
+ }
188
+
189
+ /**
190
+ * Copy a template
191
+ * Copies a template (its draft, or a published version) into a new template.
192
+ * @param {String} template_id The template's ID.
193
+ * @param {Object} opts Optional parameters
194
+ * @param {module:model/CopyTemplateRequest} [body] Settings for the copy.
195
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
196
+ */
197
+ }, {
141
198
  key: "copyTemplateWithHttpInfo",
142
199
  value: function copyTemplateWithHttpInfo(template_id, opts) {
143
200
  opts = opts || {};
@@ -399,7 +456,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
399
456
  * @param {module:model/CreateSubmissionRequest} body The submission's data and settings.
400
457
  * @param {Object} opts Optional parameters
401
458
  * @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.
459
+ * @param {Boolean} [wait] Wait until the files have been generated before responding. Default true on sync.api hosts.
403
460
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Submission} and HTTP response
404
461
  */
405
462
  }, {
@@ -438,7 +495,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
438
495
  * @param {module:model/CreateSubmissionRequest} body The submission's data and settings.
439
496
  * @param {Object} opts Optional parameters
440
497
  * @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.
498
+ * @param {Boolean} opts.wait Wait until the files have been generated before responding. Default true on sync.api hosts.
442
499
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Submission}
443
500
  */
444
501
  }, {
@@ -500,7 +557,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
500
557
  * 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
558
  * @param {module:model/CreateTemplateRequest} body The template to create.
502
559
  * @param {Object} opts Optional parameters
503
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
560
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
504
561
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
505
562
  */
506
563
  }, {
@@ -530,7 +587,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
530
587
  * 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
588
  * @param {module:model/CreateTemplateRequest} body The template to create.
532
589
  * @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.
590
+ * @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
591
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
535
592
  */
536
593
  }, {
@@ -833,6 +890,60 @@ var Client = exports["default"] = /*#__PURE__*/function () {
833
890
  });
834
891
  }
835
892
 
893
+ /**
894
+ * Generate more files
895
+ * 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.
896
+ * @param {String} submission_id The submission's ID.
897
+ * @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
898
+ * @param {Object} opts Optional parameters
899
+ * @param {Boolean} [wait] Wait until the files have been generated before responding. Default true on sync.api hosts.
900
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Submission} and HTTP response
901
+ */
902
+ }, {
903
+ key: "generateSubmissionFilesWithHttpInfo",
904
+ value: function generateSubmissionFilesWithHttpInfo(submission_id, body, opts) {
905
+ opts = opts || {};
906
+ var postBody = body;
907
+ // verify the required parameter 'submission_id' is set
908
+ if (submission_id === undefined || submission_id === null) {
909
+ throw new Error("Missing the required parameter 'submission_id' when calling generateSubmissionFiles");
910
+ }
911
+ // verify the required parameter 'body' is set
912
+ if (body === undefined || body === null) {
913
+ throw new Error("Missing the required parameter 'body' when calling generateSubmissionFiles");
914
+ }
915
+ var pathParams = {
916
+ 'submission_id': submission_id
917
+ };
918
+ var queryParams = {
919
+ 'wait': opts['wait']
920
+ };
921
+ var headerParams = {};
922
+ var formParams = {};
923
+ var authNames = ['api_token_basic'];
924
+ var contentTypes = ['application/json'];
925
+ var accepts = ['application/json'];
926
+ var returnType = _Submission["default"];
927
+ return this.apiClient.callApi('/submissions/{submission_id}/generate_files', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
928
+ }
929
+
930
+ /**
931
+ * Generate more files
932
+ * 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.
933
+ * @param {String} submission_id The submission's ID.
934
+ * @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
935
+ * @param {Object} opts Optional parameters
936
+ * @param {Boolean} opts.wait Wait until the files have been generated before responding. Default true on sync.api hosts.
937
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Submission}
938
+ */
939
+ }, {
940
+ key: "generateSubmissionFiles",
941
+ value: function generateSubmissionFiles(submission_id, body, opts) {
942
+ return this.generateSubmissionFilesWithHttpInfo(submission_id, body, opts).then(function (response_and_data) {
943
+ return response_and_data.data;
944
+ });
945
+ }
946
+
836
947
  /**
837
948
  * Generate a preview PDF
838
949
  * 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,6 +1319,54 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1208
1319
  });
1209
1320
  }
1210
1321
 
1322
+ /**
1323
+ * Compare a version of a template with the one before it
1324
+ * 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.
1325
+ * @param {String} template_id The template's ID.
1326
+ * @param {Object} opts Optional parameters
1327
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1328
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateDiff} and HTTP response
1329
+ */
1330
+ }, {
1331
+ key: "getTemplateDiffWithHttpInfo",
1332
+ value: function getTemplateDiffWithHttpInfo(template_id, opts) {
1333
+ opts = opts || {};
1334
+ var postBody = null;
1335
+ // verify the required parameter 'template_id' is set
1336
+ if (template_id === undefined || template_id === null) {
1337
+ throw new Error("Missing the required parameter 'template_id' when calling getTemplateDiff");
1338
+ }
1339
+ var pathParams = {
1340
+ 'template_id': template_id
1341
+ };
1342
+ var queryParams = {
1343
+ 'version': opts['version']
1344
+ };
1345
+ var headerParams = {};
1346
+ var formParams = {};
1347
+ var authNames = ['api_token_basic'];
1348
+ var contentTypes = [];
1349
+ var accepts = ['application/json'];
1350
+ var returnType = _TemplateDiff["default"];
1351
+ return this.apiClient.callApi('/templates/{template_id}/diff', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1352
+ }
1353
+
1354
+ /**
1355
+ * Compare a version of a template with the one before it
1356
+ * 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.
1357
+ * @param {String} template_id The template's ID.
1358
+ * @param {Object} opts Optional parameters
1359
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1360
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateDiff}
1361
+ */
1362
+ }, {
1363
+ key: "getTemplateDiff",
1364
+ value: function getTemplateDiff(template_id, opts) {
1365
+ return this.getTemplateDiffWithHttpInfo(template_id, opts).then(function (response_and_data) {
1366
+ return response_and_data.data;
1367
+ });
1368
+ }
1369
+
1211
1370
  /**
1212
1371
  * Generate typed code for a template's submission data
1213
1372
  * 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.
@@ -1263,6 +1422,54 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1263
1422
  });
1264
1423
  }
1265
1424
 
1425
+ /**
1426
+ * Get images of a template's pages
1427
+ * 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.
1428
+ * @param {String} template_id The template's ID.
1429
+ * @param {Object} opts Optional parameters
1430
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1431
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplatePageImages} and HTTP response
1432
+ */
1433
+ }, {
1434
+ key: "getTemplatePageImagesWithHttpInfo",
1435
+ value: function getTemplatePageImagesWithHttpInfo(template_id, opts) {
1436
+ opts = opts || {};
1437
+ var postBody = null;
1438
+ // verify the required parameter 'template_id' is set
1439
+ if (template_id === undefined || template_id === null) {
1440
+ throw new Error("Missing the required parameter 'template_id' when calling getTemplatePageImages");
1441
+ }
1442
+ var pathParams = {
1443
+ 'template_id': template_id
1444
+ };
1445
+ var queryParams = {
1446
+ 'version': opts['version']
1447
+ };
1448
+ var headerParams = {};
1449
+ var formParams = {};
1450
+ var authNames = ['api_token_basic'];
1451
+ var contentTypes = [];
1452
+ var accepts = ['application/json'];
1453
+ var returnType = _TemplatePageImages["default"];
1454
+ return this.apiClient.callApi('/templates/{template_id}/page_images', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1455
+ }
1456
+
1457
+ /**
1458
+ * Get images of a template's pages
1459
+ * 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.
1460
+ * @param {String} template_id The template's ID.
1461
+ * @param {Object} opts Optional parameters
1462
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1463
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplatePageImages}
1464
+ */
1465
+ }, {
1466
+ key: "getTemplatePageImages",
1467
+ value: function getTemplatePageImages(template_id, opts) {
1468
+ return this.getTemplatePageImagesWithHttpInfo(template_id, opts).then(function (response_and_data) {
1469
+ return response_and_data.data;
1470
+ });
1471
+ }
1472
+
1266
1473
  /**
1267
1474
  * Get the JSON Schema of a template's submission data
1268
1475
  * 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.
@@ -1544,6 +1751,54 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1544
1751
  });
1545
1752
  }
1546
1753
 
1754
+ /**
1755
+ * List a template's fields
1756
+ * 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.
1757
+ * @param {String} template_id The template's ID.
1758
+ * @param {Object} opts Optional parameters
1759
+ * @param {String} [version] A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1760
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
1761
+ */
1762
+ }, {
1763
+ key: "listTemplateFieldsWithHttpInfo",
1764
+ value: function listTemplateFieldsWithHttpInfo(template_id, opts) {
1765
+ opts = opts || {};
1766
+ var postBody = null;
1767
+ // verify the required parameter 'template_id' is set
1768
+ if (template_id === undefined || template_id === null) {
1769
+ throw new Error("Missing the required parameter 'template_id' when calling listTemplateFields");
1770
+ }
1771
+ var pathParams = {
1772
+ 'template_id': template_id
1773
+ };
1774
+ var queryParams = {
1775
+ 'version': opts['version']
1776
+ };
1777
+ var headerParams = {};
1778
+ var formParams = {};
1779
+ var authNames = ['api_token_basic'];
1780
+ var contentTypes = [];
1781
+ var accepts = ['application/json'];
1782
+ var returnType = _TemplateFields["default"];
1783
+ return this.apiClient.callApi('/templates/{template_id}/fields', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
1784
+ }
1785
+
1786
+ /**
1787
+ * List a template's fields
1788
+ * 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.
1789
+ * @param {String} template_id The template's ID.
1790
+ * @param {Object} opts Optional parameters
1791
+ * @param {String} opts.version A published version (`1.2.0`, or `1` for the latest 1.x.x), `latest` or `draft`. Default `draft`.
1792
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
1793
+ */
1794
+ }, {
1795
+ key: "listTemplateFields",
1796
+ value: function listTemplateFields(template_id, opts) {
1797
+ return this.listTemplateFieldsWithHttpInfo(template_id, opts).then(function (response_and_data) {
1798
+ return response_and_data.data;
1799
+ });
1800
+ }
1801
+
1547
1802
  /**
1548
1803
  * List a template's submissions
1549
1804
  * Returns a template's submissions (from every version of the template), newest first.
@@ -1810,7 +2065,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1810
2065
 
1811
2066
  /**
1812
2067
  * 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.
2068
+ * 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
2069
  * @param {String} template_id The template's ID.
1815
2070
  * @param {module:model/PublishTemplateVersionRequest} body The version to publish.
1816
2071
  * @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 +2097,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1842
2097
 
1843
2098
  /**
1844
2099
  * 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.
2100
+ * 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
2101
  * @param {String} template_id The template's ID.
1847
2102
  * @param {module:model/PublishTemplateVersionRequest} body The version to publish.
1848
2103
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateVersion}
@@ -1855,6 +2110,53 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1855
2110
  });
1856
2111
  }
1857
2112
 
2113
+ /**
2114
+ * Remove fields from a template
2115
+ * 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.
2116
+ * @param {String} template_id The template's ID.
2117
+ * @param {module:model/RemoveTemplateFieldsRequest} body The fields to remove from the template's draft.
2118
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
2119
+ */
2120
+ }, {
2121
+ key: "removeTemplateFieldsWithHttpInfo",
2122
+ value: function removeTemplateFieldsWithHttpInfo(template_id, body) {
2123
+ var postBody = body;
2124
+ // verify the required parameter 'template_id' is set
2125
+ if (template_id === undefined || template_id === null) {
2126
+ throw new Error("Missing the required parameter 'template_id' when calling removeTemplateFields");
2127
+ }
2128
+ // verify the required parameter 'body' is set
2129
+ if (body === undefined || body === null) {
2130
+ throw new Error("Missing the required parameter 'body' when calling removeTemplateFields");
2131
+ }
2132
+ var pathParams = {
2133
+ 'template_id': template_id
2134
+ };
2135
+ var queryParams = {};
2136
+ var headerParams = {};
2137
+ var formParams = {};
2138
+ var authNames = ['api_token_basic'];
2139
+ var contentTypes = ['application/json'];
2140
+ var accepts = ['application/json'];
2141
+ var returnType = _TemplateFields["default"];
2142
+ return this.apiClient.callApi('/templates/{template_id}/fields/remove', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2143
+ }
2144
+
2145
+ /**
2146
+ * Remove fields from a template
2147
+ * 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.
2148
+ * @param {String} template_id The template's ID.
2149
+ * @param {module:model/RemoveTemplateFieldsRequest} body The fields to remove from the template's draft.
2150
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
2151
+ */
2152
+ }, {
2153
+ key: "removeTemplateFields",
2154
+ value: function removeTemplateFields(template_id, body) {
2155
+ return this.removeTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
2156
+ return response_and_data.data;
2157
+ });
2158
+ }
2159
+
1858
2160
  /**
1859
2161
  * Rename a folder
1860
2162
  * Renames a folder. The name must be unique within its parent folder.
@@ -1902,6 +2204,53 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1902
2204
  });
1903
2205
  }
1904
2206
 
2207
+ /**
2208
+ * Reorder a template's fields
2209
+ * 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.
2210
+ * @param {String} template_id The template's ID.
2211
+ * @param {module:model/ReorderTemplateFieldsRequest} body The new order of the fields in the template's draft.
2212
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
2213
+ */
2214
+ }, {
2215
+ key: "reorderTemplateFieldsWithHttpInfo",
2216
+ value: function reorderTemplateFieldsWithHttpInfo(template_id, body) {
2217
+ var postBody = body;
2218
+ // verify the required parameter 'template_id' is set
2219
+ if (template_id === undefined || template_id === null) {
2220
+ throw new Error("Missing the required parameter 'template_id' when calling reorderTemplateFields");
2221
+ }
2222
+ // verify the required parameter 'body' is set
2223
+ if (body === undefined || body === null) {
2224
+ throw new Error("Missing the required parameter 'body' when calling reorderTemplateFields");
2225
+ }
2226
+ var pathParams = {
2227
+ 'template_id': template_id
2228
+ };
2229
+ var queryParams = {};
2230
+ var headerParams = {};
2231
+ var formParams = {};
2232
+ var authNames = ['api_token_basic'];
2233
+ var contentTypes = ['application/json'];
2234
+ var accepts = ['application/json'];
2235
+ var returnType = _TemplateFields["default"];
2236
+ return this.apiClient.callApi('/templates/{template_id}/fields/reorder', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2237
+ }
2238
+
2239
+ /**
2240
+ * Reorder a template's fields
2241
+ * 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.
2242
+ * @param {String} template_id The template's ID.
2243
+ * @param {module:model/ReorderTemplateFieldsRequest} body The new order of the fields in the template's draft.
2244
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
2245
+ */
2246
+ }, {
2247
+ key: "reorderTemplateFields",
2248
+ value: function reorderTemplateFields(template_id, body) {
2249
+ return this.reorderTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
2250
+ return response_and_data.data;
2251
+ });
2252
+ }
2253
+
1905
2254
  /**
1906
2255
  * Restore a template version
1907
2256
  * Replaces the template's draft with a copy of one of its published versions.
@@ -2031,7 +2380,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2031
2380
 
2032
2381
  /**
2033
2382
  * 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.
2383
+ * 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
2384
  * @param {String} template_id The template's ID.
2036
2385
  * @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
2037
2386
  * @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 +2412,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2063
2412
 
2064
2413
  /**
2065
2414
  * 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.
2415
+ * 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
2416
  * @param {String} template_id The template's ID.
2068
2417
  * @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
2069
2418
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
@@ -2078,11 +2427,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2078
2427
 
2079
2428
  /**
2080
2429
  * 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.
2430
+ * 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
2431
  * @param {String} template_id The template's ID.
2083
- * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF.
2432
+ * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
2084
2433
  * @param {Object} opts Optional parameters
2085
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2434
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2086
2435
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2087
2436
  */
2088
2437
  }, {
@@ -2115,11 +2464,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2115
2464
 
2116
2465
  /**
2117
2466
  * 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.
2467
+ * 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
2468
  * @param {String} template_id The template's ID.
2120
- * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF.
2469
+ * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
2121
2470
  * @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.
2471
+ * @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
2472
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2124
2473
  */
2125
2474
  }, {
@@ -2130,6 +2479,53 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2130
2479
  });
2131
2480
  }
2132
2481
 
2482
+ /**
2483
+ * Update a template's fields
2484
+ * 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.
2485
+ * @param {String} template_id The template's ID.
2486
+ * @param {module:model/UpdateTemplateFieldsRequest} body The fields to change in the template's draft.
2487
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateFields} and HTTP response
2488
+ */
2489
+ }, {
2490
+ key: "updateTemplateFieldsWithHttpInfo",
2491
+ value: function updateTemplateFieldsWithHttpInfo(template_id, body) {
2492
+ var postBody = body;
2493
+ // verify the required parameter 'template_id' is set
2494
+ if (template_id === undefined || template_id === null) {
2495
+ throw new Error("Missing the required parameter 'template_id' when calling updateTemplateFields");
2496
+ }
2497
+ // verify the required parameter 'body' is set
2498
+ if (body === undefined || body === null) {
2499
+ throw new Error("Missing the required parameter 'body' when calling updateTemplateFields");
2500
+ }
2501
+ var pathParams = {
2502
+ 'template_id': template_id
2503
+ };
2504
+ var queryParams = {};
2505
+ var headerParams = {};
2506
+ var formParams = {};
2507
+ var authNames = ['api_token_basic'];
2508
+ var contentTypes = ['application/json'];
2509
+ var accepts = ['application/json'];
2510
+ var returnType = _TemplateFields["default"];
2511
+ return this.apiClient.callApi('/templates/{template_id}/fields', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2512
+ }
2513
+
2514
+ /**
2515
+ * Update a template's fields
2516
+ * 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.
2517
+ * @param {String} template_id The template's ID.
2518
+ * @param {module:model/UpdateTemplateFieldsRequest} body The fields to change in the template's draft.
2519
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateFields}
2520
+ */
2521
+ }, {
2522
+ key: "updateTemplateFields",
2523
+ value: function updateTemplateFields(template_id, body) {
2524
+ return this.updateTemplateFieldsWithHttpInfo(template_id, body).then(function (response_and_data) {
2525
+ return response_and_data.data;
2526
+ });
2527
+ }
2528
+
2133
2529
  /**
2134
2530
  * Update a webhook
2135
2531
  * Updates a webhook. Only the properties you send change.
@@ -2182,7 +2578,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2182
2578
  * 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
2579
  * @param {File} document The PDF.
2184
2580
  * @param {Object} opts Optional parameters
2185
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2581
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2186
2582
  * @param {String} [name] The template's name.
2187
2583
  * @param {String} [description] The template's description.
2188
2584
  * @param {String} [parent_folder_id] The folder to put the template in. Left out, it's created at the root.
@@ -2230,7 +2626,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2230
2626
  * 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
2627
  * @param {File} document The PDF.
2232
2628
  * @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.
2629
+ * @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
2630
  * @param {String} opts.name The template's name.
2235
2631
  * @param {String} opts.description The template's description.
2236
2632
  * @param {String} opts.parent_folder_id The folder to put the template in. Left out, it's created at the root.
@@ -2255,7 +2651,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2255
2651
  * @param {String} template_id The template's ID.
2256
2652
  * @param {File} document The new PDF.
2257
2653
  * @param {Object} opts Optional parameters
2258
- * @param {Boolean} [wait] Wait until the PDF has been processed before responding. Default true on sync.api hosts.
2654
+ * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2259
2655
  * @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
2656
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2261
2657
  */
@@ -2296,7 +2692,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2296
2692
  * @param {String} template_id The template's ID.
2297
2693
  * @param {File} document The new PDF.
2298
2694
  * @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.
2695
+ * @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
2696
  * @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
2697
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2302
2698
  */
@@ -2307,5 +2703,59 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2307
2703
  return response_and_data.data;
2308
2704
  });
2309
2705
  }
2706
+
2707
+ /**
2708
+ * Check a submission without creating it
2709
+ * 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.
2710
+ * @param {String} template_id The template's ID.
2711
+ * @param {module:model/ValidateSubmissionRequest} body The submission's data and settings.
2712
+ * @param {Object} opts Optional parameters
2713
+ * @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).
2714
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionValidation} and HTTP response
2715
+ */
2716
+ }, {
2717
+ key: "validateSubmissionWithHttpInfo",
2718
+ value: function validateSubmissionWithHttpInfo(template_id, body, opts) {
2719
+ opts = opts || {};
2720
+ var postBody = body;
2721
+ // verify the required parameter 'template_id' is set
2722
+ if (template_id === undefined || template_id === null) {
2723
+ throw new Error("Missing the required parameter 'template_id' when calling validateSubmission");
2724
+ }
2725
+ // verify the required parameter 'body' is set
2726
+ if (body === undefined || body === null) {
2727
+ throw new Error("Missing the required parameter 'body' when calling validateSubmission");
2728
+ }
2729
+ var pathParams = {
2730
+ 'template_id': template_id
2731
+ };
2732
+ var queryParams = {
2733
+ 'version': opts['version']
2734
+ };
2735
+ var headerParams = {};
2736
+ var formParams = {};
2737
+ var authNames = ['api_token_basic'];
2738
+ var contentTypes = ['application/json'];
2739
+ var accepts = ['application/json'];
2740
+ var returnType = _SubmissionValidation["default"];
2741
+ return this.apiClient.callApi('/templates/{template_id}/submissions/validate', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
2742
+ }
2743
+
2744
+ /**
2745
+ * Check a submission without creating it
2746
+ * 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.
2747
+ * @param {String} template_id The template's ID.
2748
+ * @param {module:model/ValidateSubmissionRequest} body The submission's data and settings.
2749
+ * @param {Object} opts Optional parameters
2750
+ * @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).
2751
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionValidation}
2752
+ */
2753
+ }, {
2754
+ key: "validateSubmission",
2755
+ value: function validateSubmission(template_id, body, opts) {
2756
+ return this.validateSubmissionWithHttpInfo(template_id, body, opts).then(function (response_and_data) {
2757
+ return response_and_data.data;
2758
+ });
2759
+ }
2310
2760
  }]);
2311
2761
  }();