docspring 4.2.0 → 4.3.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 (167) hide show
  1. package/AGENTS.md +2 -2
  2. package/README.md +7 -6
  3. package/dist/ApiClient.js +3 -3
  4. package/dist/RequestSchemas.js +19 -7
  5. package/dist/api/Client.js +53 -49
  6. package/dist/model/AddTemplateFieldsRequest.js +2 -2
  7. package/dist/model/AiFieldNamingLanguage.js +1 -1
  8. package/dist/model/AuthenticationCheck.js +2 -2
  9. package/dist/model/BarcodeSymbology.js +1 -1
  10. package/dist/model/CheckCharacter.js +1 -1
  11. package/dist/model/CombinedFieldType.js +1 -1
  12. package/dist/model/CombinedPdf.js +2 -2
  13. package/dist/model/CombinedPdfFiles.js +2 -2
  14. package/dist/model/CombinedPdfList.js +2 -2
  15. package/dist/model/CombinedPdfSource.js +2 -2
  16. package/dist/model/CombinedPdfSourceInput.js +2 -2
  17. package/dist/model/CombinedPdfSourcePdf.js +2 -2
  18. package/dist/model/CombinedPdfSourceType.js +1 -1
  19. package/dist/model/CombinedPdfState.js +1 -1
  20. package/dist/model/CopyTemplateRequest.js +2 -2
  21. package/dist/model/CreateCombinedPdfRequest.js +2 -2
  22. package/dist/model/CreateCustomFileFromUploadRequest.js +2 -2
  23. package/dist/model/CreateFolderRequest.js +2 -2
  24. package/dist/model/CreateSignatureRequestEventRequest.js +2 -2
  25. package/dist/model/CreateSignatureRequestTokenRequest.js +2 -2
  26. package/dist/model/CreateSubmissionBatchRequest.js +2 -2
  27. package/dist/model/CreateSubmissionRequest.js +5 -5
  28. package/dist/model/CreateTemplatePreviewRequest.js +2 -2
  29. package/dist/model/CreateTemplateRequest.js +22 -12
  30. package/dist/model/CreateWebhookRequest.js +2 -2
  31. package/dist/model/CustomFile.js +2 -2
  32. package/dist/model/CustomFileList.js +2 -2
  33. package/dist/model/CustomFileSourcePdf.js +2 -2
  34. package/dist/model/ErrorCode.js +1 -1
  35. package/dist/model/ErrorDetail.js +2 -2
  36. package/dist/model/ErrorInfo.js +4 -4
  37. package/dist/model/ErrorResponse.js +2 -2
  38. package/dist/model/ExpirationInterval.js +1 -1
  39. package/dist/model/Field.js +3 -3
  40. package/dist/model/FieldComparisonCondition.js +2 -2
  41. package/dist/model/FieldComparisonOperator.js +1 -1
  42. package/dist/model/FieldDependency.js +2 -2
  43. package/dist/model/FieldDependencyInput.js +2 -2
  44. package/dist/model/FieldDisplayType.js +1 -1
  45. package/dist/model/FieldEqualsCondition.js +2 -2
  46. package/dist/model/FieldEqualsOperator.js +1 -1
  47. package/dist/model/FieldGroup.js +6 -6
  48. package/dist/model/FieldGroupInput.js +3 -3
  49. package/dist/model/FieldGroupType.js +1 -1
  50. package/dist/model/FieldInCondition.js +2 -2
  51. package/dist/model/FieldInput.js +3 -3
  52. package/dist/model/FieldOverride.js +2 -2
  53. package/dist/model/FieldPresenceCondition.js +2 -2
  54. package/dist/model/FieldPresenceOperator.js +1 -1
  55. package/dist/model/FieldRangeCondition.js +2 -2
  56. package/dist/model/FieldReimportState.js +1 -1
  57. package/dist/model/FieldSetupLogic.js +1 -1
  58. package/dist/model/FieldSetupNaming.js +1 -1
  59. package/dist/model/FieldSetupSource.js +1 -1
  60. package/dist/model/FieldType.js +1 -1
  61. package/dist/model/Folder.js +2 -2
  62. package/dist/model/FolderList.js +2 -2
  63. package/dist/model/GenerateFilesFormat.js +16 -1
  64. package/dist/model/GenerateSubmissionFilesRequest.js +4 -4
  65. package/dist/model/GeneratedFile.js +7 -7
  66. package/dist/model/GeneratedFileState.js +1 -1
  67. package/dist/model/HtmlEngineOptions.js +2 -2
  68. package/dist/model/HtmlEngineOptionsInput.js +2 -2
  69. package/dist/model/ImageGravity.js +1 -1
  70. package/dist/model/ImageScaleType.js +1 -1
  71. package/dist/model/ModelCodeLanguage.js +7 -2
  72. package/dist/model/MoveFolderRequest.js +2 -2
  73. package/dist/model/MoveTemplateRequest.js +2 -2
  74. package/dist/model/NumberConditionType.js +1 -1
  75. package/dist/model/OutputFormat.js +11 -1
  76. package/dist/model/PageFormat.js +1 -1
  77. package/dist/model/PageImage.js +2 -2
  78. package/dist/model/PageImages.js +2 -2
  79. package/dist/model/PredefinedField.js +2 -2
  80. package/dist/model/PredefinedFieldInput.js +2 -2
  81. package/dist/model/PublishTemplateVersionRequest.js +2 -2
  82. package/dist/model/RemoveTemplateFieldsRequest.js +2 -2
  83. package/dist/model/RenameFolderRequest.js +2 -2
  84. package/dist/model/ReorderTemplateFieldsRequest.js +2 -2
  85. package/dist/model/RestoreTemplateVersionRequest.js +2 -2
  86. package/dist/model/ShapeType.js +1 -1
  87. package/dist/model/SignatureRequest.js +2 -2
  88. package/dist/model/SignatureRequestAuthSecondFactorType.js +1 -1
  89. package/dist/model/SignatureRequestAuthType.js +1 -1
  90. package/dist/model/SignatureRequestEvent.js +2 -2
  91. package/dist/model/SignatureRequestEventType.js +1 -1
  92. package/dist/model/SignatureRequestInput.js +2 -2
  93. package/dist/model/SignatureRequestMessageType.js +1 -1
  94. package/dist/model/SignatureRequestState.js +1 -1
  95. package/dist/model/SignatureRequestToken.js +2 -2
  96. package/dist/model/SignatureRequestTokenType.js +1 -1
  97. package/dist/model/StringConditionType.js +1 -1
  98. package/dist/model/Submission.js +11 -11
  99. package/dist/model/SubmissionAction.js +2 -2
  100. package/dist/model/SubmissionActionState.js +1 -1
  101. package/dist/model/SubmissionActionType.js +1 -1
  102. package/dist/model/SubmissionBatch.js +9 -9
  103. package/dist/model/SubmissionBatchState.js +1 -1
  104. package/dist/model/SubmissionFiles.js +20 -2
  105. package/dist/model/SubmissionInput.js +5 -5
  106. package/dist/model/SubmissionList.js +2 -2
  107. package/dist/model/SubmissionSource.js +1 -1
  108. package/dist/model/SubmissionSourcePdf.js +2 -2
  109. package/dist/model/SubmissionState.js +1 -1
  110. package/dist/model/SubmissionSummary.js +6 -6
  111. package/dist/model/SubmissionValidation.js +2 -2
  112. package/dist/model/Template.js +34 -22
  113. package/dist/model/TemplateActor.js +2 -2
  114. package/dist/model/TemplateActorType.js +1 -1
  115. package/dist/model/TemplateDefaults.js +2 -2
  116. package/dist/model/TemplateDefaultsInput.js +2 -2
  117. package/dist/model/TemplateDiff.js +6 -6
  118. package/dist/model/TemplateDiffSummary.js +2 -2
  119. package/dist/model/TemplateDocument.js +23 -23
  120. package/dist/model/TemplateDocumentState.js +12 -2
  121. package/dist/model/TemplateDocumentSummary.js +11 -11
  122. package/dist/model/TemplateFieldChange.js +2 -2
  123. package/dist/model/TemplateFieldChanges.js +2 -2
  124. package/dist/model/TemplateFieldDependency.js +2 -2
  125. package/dist/model/TemplateFieldDependencyAction.js +1 -1
  126. package/dist/model/TemplateFieldDependencyCondition.js +2 -2
  127. package/dist/model/TemplateFieldDependencyConditionInput.js +2 -2
  128. package/dist/model/TemplateFieldDependencyInput.js +2 -2
  129. package/dist/model/TemplateFieldDependencyMatch.js +1 -1
  130. package/dist/model/TemplateFieldDependencyOperator.js +1 -1
  131. package/dist/model/TemplateFieldLogicStatus.js +1 -1
  132. package/dist/model/TemplateFieldMove.js +2 -2
  133. package/dist/model/TemplateFields.js +2 -2
  134. package/dist/model/TemplateFormMode.js +1 -1
  135. package/dist/model/TemplateModelCode.js +2 -2
  136. package/dist/model/TemplatePageAiError.js +1 -1
  137. package/dist/model/TemplatePageAiNamingStatus.js +1 -1
  138. package/dist/model/TemplatePageFieldsStatus.js +1 -1
  139. package/dist/model/TemplatePageImageStatus.js +1 -1
  140. package/dist/model/TemplatePageImages.js +2 -2
  141. package/dist/model/TemplatePageProcessingStatus.js +2 -2
  142. package/dist/model/TemplatePreview.js +5 -5
  143. package/dist/model/TemplatePreviewState.js +1 -1
  144. package/dist/model/TemplateSourcePdf.js +2 -2
  145. package/dist/model/TemplateSummary.js +24 -12
  146. package/dist/model/TemplateSummaryList.js +2 -2
  147. package/dist/model/TemplateType.js +7 -2
  148. package/dist/model/TemplateVersion.js +2 -2
  149. package/dist/model/TemplateVersionType.js +1 -1
  150. package/dist/model/TextAlignment.js +1 -1
  151. package/dist/model/TextOverflow.js +1 -1
  152. package/dist/model/TextVerticalAlignment.js +1 -1
  153. package/dist/model/Typeface.js +1 -1
  154. package/dist/model/UpdateSignatureRequestRequest.js +2 -2
  155. package/dist/model/UpdateTemplateDocumentRequest.js +8 -8
  156. package/dist/model/UpdateTemplateFieldsRequest.js +2 -2
  157. package/dist/model/UpdateTemplateRequest.js +16 -6
  158. package/dist/model/UpdateWebhookRequest.js +2 -2
  159. package/dist/model/UploadMethod.js +1 -1
  160. package/dist/model/UploadPresign.js +2 -2
  161. package/dist/model/UrlSourcePdf.js +2 -2
  162. package/dist/model/ValidateSubmissionRequest.js +5 -5
  163. package/dist/model/Webhook.js +2 -2
  164. package/dist/model/WebhookEventType.js +1 -1
  165. package/dist/model/WebhookList.js +2 -2
  166. package/dist/model/WebhookMode.js +1 -1
  167. package/package.json +2 -2
package/AGENTS.md CHANGED
@@ -90,5 +90,5 @@ keeps it.
90
90
 
91
91
  - List methods return `data` and `next_cursor`: pass `next_cursor` as `cursor` to get the next page.
92
92
  - Responses can be newer than this SDK, because DocSpring adds fields and enum values to API v2 without a new
93
- version. The model object keeps a response field added to the API after this release as a property. The objects defined inside a model, such as a template's `document`, leave it out. Enum values in responses are strings, so a
94
- value added after this release comes back as it is: handle values you don't recognize.
93
+ version. The model object keeps a response field added to the API after this release as a property. The objects defined inside a model, such as a template's `document`, leave it out. An enum value added after this release comes
94
+ back as the API sent it: handle values you don't recognize.
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # DocSpring JavaScript SDK
2
2
 
3
3
  The official JavaScript client for the [DocSpring API](https://docspring.com/docs/api/). DocSpring fills PDF
4
- templates with your data, generates PDFs from HTML templates, combines PDFs and collects e-signatures.
4
+ forms with your data, generates PDFs and Word documents from HTML and Word templates, combines PDFs and collects
5
+ e-signatures.
5
6
 
6
7
  [Documentation](https://docspring.com/docs/) · [API reference](https://docspring.com/docs/api/) ·
7
8
  [npm](https://www.npmjs.com/package/docspring) · [Changelog](https://github.com/DocSpring/docspring-javascript/blob/main/CHANGELOG.md)
@@ -9,7 +10,7 @@ templates with your data, generates PDFs from HTML templates, combines PDFs and
9
10
  The code in this repository is generated from DocSpring's OpenAPI spec ([About this SDK](#about-this-sdk)). Issues and
10
11
  pull requests are welcome.
11
12
 
12
- Version 4.2.0.
13
+ Version 4.3.0.
13
14
 
14
15
  ## Install and configure
15
16
 
@@ -141,11 +142,11 @@ JavaScript code for every method.
141
142
  | [`testAuthentication`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#testauthentication) | Test authentication |
142
143
  | [`updateSignatureRequest`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatesignaturerequest) | Update a signature request |
143
144
  | [`updateTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplate) | Update a template |
144
- | [`updateTemplateDocument`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplatedocument) | Replace a template's PDF |
145
+ | [`updateTemplateDocument`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplatedocument) | Replace a template's document |
145
146
  | [`updateTemplateFields`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatetemplatefields) | Update a template's fields |
146
147
  | [`updateWebhook`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#updatewebhook) | Update a webhook |
147
- | [`uploadTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#uploadtemplate) | Create a PDF template from an uploaded PDF |
148
- | [`uploadTemplateDocument`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#uploadtemplatedocument) | Replace a template's PDF with an uploaded PDF |
148
+ | [`uploadTemplate`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#uploadtemplate) | Create a template from an uploaded PDF or Word document |
149
+ | [`uploadTemplateDocument`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#uploadtemplatedocument) | Replace a template's document with an uploaded file |
149
150
  | [`validateSubmission`](https://github.com/DocSpring/docspring-javascript/blob/main/docs/Client.md#validatesubmission) | Check a submission without creating it |
150
151
 
151
152
  ## Errors
@@ -163,7 +164,7 @@ existing code, such as removing or renaming a field, go in a new API version
163
164
  responses that are newer than it is:
164
165
 
165
166
  - The model object keeps a response field added to the API after this release as a property. The objects defined inside a model, such as a template's `document`, leave it out.
166
- - Enum values in responses are strings, so a value added to the API after this release comes back as it is: handle values you don't recognize.
167
+ - An enum value added to the API after this release comes back as the API sent it: handle values you don't recognize.
167
168
 
168
169
  Upgrade the SDK to read new fields and enum values. The [changelog](https://github.com/DocSpring/docspring-javascript/blob/main/CHANGELOG.md) lists
169
170
  what each release adds.
package/dist/ApiClient.js CHANGED
@@ -14,7 +14,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
16
16
  * DocSpring API
17
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
18
18
  *
19
19
  * The version of the OpenAPI document: v2
20
20
  *
@@ -38,7 +38,7 @@ function responseInfo(response) {
38
38
 
39
39
  /**
40
40
  * @module ApiClient
41
- * @version 4.2.0
41
+ * @version 4.3.0
42
42
  */
43
43
 
44
44
  /**
@@ -88,7 +88,7 @@ var ApiClient = /*#__PURE__*/function () {
88
88
  * @default {}
89
89
  */
90
90
  this.defaultHeaders = {
91
- 'User-Agent': 'docspring-javascript-4.2.0'
91
+ 'User-Agent': 'docspring-javascript-4.3.0'
92
92
  };
93
93
 
94
94
  /**
@@ -597,7 +597,7 @@ var _default = exports["default"] = {
597
597
  "uniqueItems": true,
598
598
  "items": {
599
599
  "type": "string",
600
- "enum": ["pdf", "png"]
600
+ "enum": ["pdf", "docx", "odt", "png"]
601
601
  }
602
602
  },
603
603
  "expires_in": {
@@ -726,7 +726,7 @@ var _default = exports["default"] = {
726
726
  "uniqueItems": true,
727
727
  "items": {
728
728
  "type": "string",
729
- "enum": ["pdf", "png"]
729
+ "enum": ["pdf", "docx", "odt", "png"]
730
730
  }
731
731
  },
732
732
  "submissions": {
@@ -758,7 +758,7 @@ var _default = exports["default"] = {
758
758
  "uniqueItems": true,
759
759
  "items": {
760
760
  "type": "string",
761
- "enum": ["pdf", "png"]
761
+ "enum": ["pdf", "docx", "odt", "png"]
762
762
  }
763
763
  },
764
764
  "expires_in": {
@@ -821,7 +821,11 @@ var _default = exports["default"] = {
821
821
  },
822
822
  "template_type": {
823
823
  "type": "string",
824
- "enum": ["pdf", "html"]
824
+ "enum": ["pdf", "html", "docx"]
825
+ },
826
+ "output_format": {
827
+ "type": "string",
828
+ "enum": ["pdf", "docx", "odt"]
825
829
  },
826
830
  "parent_folder_id": {
827
831
  "type": ["string", "null"],
@@ -1314,7 +1318,7 @@ var _default = exports["default"] = {
1314
1318
  "uniqueItems": true,
1315
1319
  "items": {
1316
1320
  "type": "string",
1317
- "enum": ["png"]
1321
+ "enum": ["pdf", "docx", "odt", "png"]
1318
1322
  }
1319
1323
  }
1320
1324
  },
@@ -1377,7 +1381,7 @@ var _default = exports["default"] = {
1377
1381
  "required": true,
1378
1382
  "schema": {
1379
1383
  "type": "string",
1380
- "enum": ["typescript", "javascript", "ruby", "python", "php", "java", "csharp", "elixir", "go"]
1384
+ "enum": ["typescript", "javascript", "ruby", "python", "php", "java", "csharp", "elixir", "go", "rust"]
1381
1385
  }
1382
1386
  },
1383
1387
  "just_types": {
@@ -1879,6 +1883,10 @@ var _default = exports["default"] = {
1879
1883
  "description": {
1880
1884
  "type": ["string", "null"]
1881
1885
  },
1886
+ "output_format": {
1887
+ "type": "string",
1888
+ "enum": ["pdf", "docx", "odt"]
1889
+ },
1882
1890
  "parent_folder_id": {
1883
1891
  "type": ["string", "null"],
1884
1892
  "minLength": 1
@@ -2770,6 +2778,10 @@ var _default = exports["default"] = {
2770
2778
  "field_logic": {
2771
2779
  "type": "string",
2772
2780
  "enum": ["ai", "none"]
2781
+ },
2782
+ "output_format": {
2783
+ "type": "string",
2784
+ "enum": ["pdf", "docx", "odt"]
2773
2785
  }
2774
2786
  },
2775
2787
  "additionalProperties": false
@@ -2843,7 +2855,7 @@ var _default = exports["default"] = {
2843
2855
  "uniqueItems": true,
2844
2856
  "items": {
2845
2857
  "type": "string",
2846
- "enum": ["pdf", "png"]
2858
+ "enum": ["pdf", "docx", "odt", "png"]
2847
2859
  }
2848
2860
  },
2849
2861
  "expires_in": {
@@ -33,6 +33,7 @@ var _GenerateSubmissionFilesRequest = _interopRequireDefault(require("../model/G
33
33
  var _ModelCodeLanguage = _interopRequireDefault(require("../model/ModelCodeLanguage"));
34
34
  var _MoveFolderRequest = _interopRequireDefault(require("../model/MoveFolderRequest"));
35
35
  var _MoveTemplateRequest = _interopRequireDefault(require("../model/MoveTemplateRequest"));
36
+ var _OutputFormat = _interopRequireDefault(require("../model/OutputFormat"));
36
37
  var _PublishTemplateVersionRequest = _interopRequireDefault(require("../model/PublishTemplateVersionRequest"));
37
38
  var _RemoveTemplateFieldsRequest = _interopRequireDefault(require("../model/RemoveTemplateFieldsRequest"));
38
39
  var _RenameFolderRequest = _interopRequireDefault(require("../model/RenameFolderRequest"));
@@ -73,7 +74,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
73
74
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
74
75
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
75
76
  * DocSpring API
76
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
77
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
77
78
  *
78
79
  * The version of the OpenAPI document: v2
79
80
  *
@@ -86,7 +87,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
86
87
  /**
87
88
  * Client service.
88
89
  * @module api/Client
89
- * @version 4.2.0
90
+ * @version 4.3.0
90
91
  */
91
92
  var Client = exports["default"] = /*#__PURE__*/function () {
92
93
  /**
@@ -522,7 +523,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
522
523
  * Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass `wait=false`), otherwise poll GET /submissions/batches/{submission_batch_id} until `processed_at` is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an `invalid_data` error, with each one's `submission_id` in its details), so you can find them in DocSpring. The other submissions aren't saved.
523
524
  * @param {module:model/CreateSubmissionBatchRequest} body The submissions to create, and the settings they share.
524
525
  * @param {Object} opts Optional parameters
525
- * @param {Boolean} [wait] Wait until every PDF in the batch has been generated before responding. Default true on sync.api hosts.
526
+ * @param {Boolean} [wait] Wait until every file in the batch has been generated before responding. Default true on sync.api hosts.
526
527
  * @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.
527
528
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SubmissionBatch} and HTTP response
528
529
  */
@@ -555,7 +556,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
555
556
  * Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass `wait=false`), otherwise poll GET /submissions/batches/{submission_batch_id} until `processed_at` is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an `invalid_data` error, with each one's `submission_id` in its details), so you can find them in DocSpring. The other submissions aren't saved.
556
557
  * @param {module:model/CreateSubmissionBatchRequest} body The submissions to create, and the settings they share.
557
558
  * @param {Object} opts Optional parameters
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 {Boolean} opts.wait Wait until every file in the batch has been generated before responding. Default true on sync.api hosts.
559
560
  * @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.
560
561
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SubmissionBatch}
561
562
  */
@@ -569,10 +570,10 @@ var Client = exports["default"] = /*#__PURE__*/function () {
569
570
 
570
571
  /**
571
572
  * Create a template
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`.
573
+ * Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. You can send a link to the file (`document_url`) or the file in base64 (`document_base64`) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its `output_format`: what each submission makes, a Word document (`docx`), an OpenDocument file (`odt`) or a PDF. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a `document_url` once its document has been downloaded, and one created from an .odt once it has been converted (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
573
574
  * @param {module:model/CreateTemplateRequest} body The template to create.
574
575
  * @param {Object} opts Optional parameters
575
- * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
576
+ * @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
576
577
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
577
578
  */
578
579
  }, {
@@ -599,10 +600,10 @@ var Client = exports["default"] = /*#__PURE__*/function () {
599
600
 
600
601
  /**
601
602
  * Create a template
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`.
603
+ * Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its `fields.key` as `cache_id`. You can send a link to the file (`document_url`) or the file in base64 (`document_base64`) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its `output_format`: what each submission makes, a Word document (`docx`), an OpenDocument file (`odt`) or a PDF. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a `document_url` once its document has been downloaded, and one created from an .odt once it has been converted (`ready` is true). On sync.api hosts the request waits for that unless you pass `wait=false`.
603
604
  * @param {module:model/CreateTemplateRequest} body The template to create.
604
605
  * @param {Object} opts Optional parameters
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.
606
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
606
607
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
607
608
  */
608
609
  }, {
@@ -615,7 +616,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
615
616
 
616
617
  /**
617
618
  * 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
+ * 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, PDF or Word template prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its `output_format`. 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
620
  * @param {String} template_id The template's ID.
620
621
  * @param {module:model/CreateTemplatePreviewRequest} body The data to render the template with.
621
622
  * @param {Object} opts Optional parameters
@@ -652,7 +653,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
652
653
 
653
654
  /**
654
655
  * 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
+ * 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, PDF or Word template prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its `output_format`. 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
657
  * @param {String} template_id The template's ID.
657
658
  * @param {module:model/CreateTemplatePreviewRequest} body The data to render the template with.
658
659
  * @param {Object} opts Optional parameters
@@ -961,7 +962,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
961
962
 
962
963
  /**
963
964
  * 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
+ * Adds formats to a processed submission's files, in the background, without using credits again: `pdf`, the PDF of a Word template's submission that made only its Word document (converted from that document), `docx`, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), `odt`, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and `png`, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. 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
966
  * @param {String} submission_id The submission's ID.
966
967
  * @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
967
968
  * @param {Object} opts Optional parameters
@@ -998,7 +999,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
998
999
 
999
1000
  /**
1000
1001
  * 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
+ * Adds formats to a processed submission's files, in the background, without using credits again: `pdf`, the PDF of a Word template's submission that made only its Word document (converted from that document), `docx`, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), `odt`, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and `png`, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. 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
1003
  * @param {String} submission_id The submission's ID.
1003
1004
  * @param {module:model/GenerateSubmissionFilesRequest} body The formats to make.
1004
1005
  * @param {Object} opts Optional parameters
@@ -1438,12 +1439,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1438
1439
 
1439
1440
  /**
1440
1441
  * Generate typed code for a template's submission data
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.
1442
+ * Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, 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.
1442
1443
  * @param {String} template_id The template's ID.
1443
1444
  * @param {module:model/ModelCodeLanguage} lang The language to generate the code in.
1444
1445
  * @param {Object} opts Optional parameters
1445
1446
  * @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.
1447
+ * @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, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way.
1447
1448
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateModelCode} and HTTP response
1448
1449
  */
1449
1450
  }, {
@@ -1478,12 +1479,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
1478
1479
 
1479
1480
  /**
1480
1481
  * Generate typed code for a template's submission data
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.
1482
+ * Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, 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.
1482
1483
  * @param {String} template_id The template's ID.
1483
1484
  * @param {module:model/ModelCodeLanguage} lang The language to generate the code in.
1484
1485
  * @param {Object} opts Optional parameters
1485
1486
  * @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.
1487
+ * @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, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way.
1487
1488
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateModelCode}
1488
1489
  */
1489
1490
  }, {
@@ -2197,7 +2198,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2197
2198
 
2198
2199
  /**
2199
2200
  * Publish a template version
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.
2201
+ * Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as `webhook_url` and `public_submissions` keep following the draft. `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.
2201
2202
  * @param {String} template_id The template's ID.
2202
2203
  * @param {module:model/PublishTemplateVersionRequest} body The version to publish.
2203
2204
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TemplateVersion} and HTTP response
@@ -2229,7 +2230,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2229
2230
 
2230
2231
  /**
2231
2232
  * Publish a template version
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.
2233
+ * Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as `webhook_url` and `public_submissions` keep following the draft. `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.
2233
2234
  * @param {String} template_id The template's ID.
2234
2235
  * @param {module:model/PublishTemplateVersionRequest} body The version to publish.
2235
2236
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TemplateVersion}
@@ -2385,7 +2386,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2385
2386
 
2386
2387
  /**
2387
2388
  * Restore a template version
2388
- * Replaces the template's draft with a copy of one of its published versions.
2389
+ * Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as `webhook_url`.
2389
2390
  * @param {String} template_id The template's ID.
2390
2391
  * @param {module:model/RestoreTemplateVersionRequest} body The version to restore.
2391
2392
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
@@ -2417,7 +2418,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2417
2418
 
2418
2419
  /**
2419
2420
  * Restore a template version
2420
- * Replaces the template's draft with a copy of one of its published versions.
2421
+ * Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as `webhook_url`.
2421
2422
  * @param {String} template_id The template's ID.
2422
2423
  * @param {module:model/RestoreTemplateVersionRequest} body The version to restore.
2423
2424
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
@@ -2512,7 +2513,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2512
2513
 
2513
2514
  /**
2514
2515
  * Update a template
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.
2516
+ * 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. Settings such as `webhook_url`, `public_submissions` and `expire_after` apply to every published version too, and setting `parent_folder_id` moves the template and all of its published versions.
2516
2517
  * @param {String} template_id The template's ID.
2517
2518
  * @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
2518
2519
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
@@ -2544,7 +2545,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2544
2545
 
2545
2546
  /**
2546
2547
  * Update a template
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.
2548
+ * 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. Settings such as `webhook_url`, `public_submissions` and `expire_after` apply to every published version too, and setting `parent_folder_id` moves the template and all of its published versions.
2548
2549
  * @param {String} template_id The template's ID.
2549
2550
  * @param {module:model/UpdateTemplateRequest} body The settings to change. Properties left out keep their values.
2550
2551
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
@@ -2558,12 +2559,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2558
2559
  }
2559
2560
 
2560
2561
  /**
2561
- * Replace a template's PDF
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.
2562
+ * Replace a template's document
2563
+ * Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), 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`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
2563
2564
  * @param {String} template_id The template's ID.
2564
- * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
2565
+ * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, or a Word template's new Word document, as one of `cache_id`, `document_url` and `document_base64`.
2565
2566
  * @param {Object} opts Optional parameters
2566
- * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2567
+ * @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
2567
2568
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2568
2569
  */
2569
2570
  }, {
@@ -2595,12 +2596,12 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2595
2596
  }
2596
2597
 
2597
2598
  /**
2598
- * Replace a template's PDF
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.
2599
+ * Replace a template's document
2600
+ * Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), 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`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as `multipart/form-data` instead, use PUT /templates/{template_id}/document/upload.
2600
2601
  * @param {String} template_id The template's ID.
2601
- * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
2602
+ * @param {module:model/UpdateTemplateDocumentRequest} body The new PDF, or a Word template's new Word document, as one of `cache_id`, `document_url` and `document_base64`.
2602
2603
  * @param {Object} opts Optional parameters
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.
2604
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
2604
2605
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2605
2606
  */
2606
2607
  }, {
@@ -2706,11 +2707,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2706
2707
  }
2707
2708
 
2708
2709
  /**
2709
- * Create a PDF template from an uploaded PDF
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.
2711
- * @param {File} document The PDF.
2710
+ * Create a template from an uploaded PDF or Word document
2711
+ * Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (`multipart/form-data`). A Word template needs its `output_format`. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
2712
+ * @param {File} document A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template's `document.state` is `converting` until then (sync.api hosts wait for it).
2712
2713
  * @param {Object} opts Optional parameters
2713
- * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
2714
+ * @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
2714
2715
  * @param {String} [name] The template's name.
2715
2716
  * @param {String} [description] The template's description.
2716
2717
  * @param {String} [parent_folder_id] The folder to put the template in. Left out, it's created at the root.
@@ -2719,6 +2720,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2719
2720
  * @param {module:model/FieldSetupSource} [field_source] With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields.
2720
2721
  * @param {module:model/FieldSetupNaming} [field_naming] With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`.
2721
2722
  * @param {module:model/FieldSetupLogic} [field_logic] With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
2723
+ * @param {module:model/OutputFormat} [output_format] What each submission of a Word template makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. Required when `document` is a Word document.
2722
2724
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2723
2725
  */
2724
2726
  }, {
@@ -2744,7 +2746,8 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2744
2746
  'detect_fields': opts['detect_fields'],
2745
2747
  'field_source': opts['field_source'],
2746
2748
  'field_naming': opts['field_naming'],
2747
- 'field_logic': opts['field_logic']
2749
+ 'field_logic': opts['field_logic'],
2750
+ 'output_format': opts['output_format']
2748
2751
  };
2749
2752
  var authNames = ['api_token_basic'];
2750
2753
  var contentTypes = ['multipart/form-data'];
@@ -2754,11 +2757,11 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2754
2757
  }
2755
2758
 
2756
2759
  /**
2757
- * Create a PDF template from an uploaded PDF
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.
2759
- * @param {File} document The PDF.
2760
+ * Create a template from an uploaded PDF or Word document
2761
+ * Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (`multipart/form-data`). A Word template needs its `output_format`. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
2762
+ * @param {File} document A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template's `document.state` is `converting` until then (sync.api hosts wait for it).
2760
2763
  * @param {Object} opts Optional parameters
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.
2764
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
2762
2765
  * @param {String} opts.name The template's name.
2763
2766
  * @param {String} opts.description The template's description.
2764
2767
  * @param {String} opts.parent_folder_id The folder to put the template in. Left out, it's created at the root.
@@ -2767,6 +2770,7 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2767
2770
  * @param {module:model/FieldSetupSource} opts.field_source With `detect_fields`, where the fields come from. `auto` (the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them; `pdf_detection` detects the fields from the page layout, even on a fillable PDF; `pdf_form_fields` only imports the PDF's form fields.
2768
2771
  * @param {module:model/FieldSetupNaming} opts.field_naming With `detect_fields`, how the fields are named. `ai` (the default) names them and sets their types and settings with AI; `preserve` keeps the names of the PDF's form fields, and AI only names the fields it detected. `preserve` needs `field_source` `auto` or `pdf_form_fields`.
2769
2772
  * @param {module:model/FieldSetupLogic} opts.field_logic With `detect_fields`, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (`ai`) or not (`none`). Default: your account's template settings.
2773
+ * @param {module:model/OutputFormat} opts.output_format What each submission of a Word template makes unless its request sets `output_formats`: `docx` (a Word document), `odt` (an OpenDocument file, converted from the Word document) or `pdf`. Required when `document` is a Word document.
2770
2774
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2771
2775
  */
2772
2776
  }, {
@@ -2778,13 +2782,13 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2778
2782
  }
2779
2783
 
2780
2784
  /**
2781
- * Replace a template's PDF with an uploaded PDF
2782
- * Replaces a PDF template's PDF with one sent with the request (`multipart/form-data`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields.
2785
+ * Replace a template's document with an uploaded file
2786
+ * Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (`multipart/form-data`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
2783
2787
  * @param {String} template_id The template's ID.
2784
- * @param {File} document The new PDF.
2788
+ * @param {File} document The new PDF, or the new Word document (.docx or .odt) of a Word template.
2785
2789
  * @param {Object} opts Optional parameters
2786
- * @param {Boolean} [wait] Wait until the PDF has been processed, and a `document_url` downloaded, before responding. Default true on sync.api hosts.
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.
2790
+ * @param {Boolean} [wait] Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
2791
+ * @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. Only for PDF templates: a Word template adds a field for each new tag.
2788
2792
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Template} and HTTP response
2789
2793
  */
2790
2794
  }, {
@@ -2819,13 +2823,13 @@ var Client = exports["default"] = /*#__PURE__*/function () {
2819
2823
  }
2820
2824
 
2821
2825
  /**
2822
- * Replace a template's PDF with an uploaded PDF
2823
- * Replaces a PDF template's PDF with one sent with the request (`multipart/form-data`). The fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields.
2826
+ * Replace a template's document with an uploaded file
2827
+ * Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (`multipart/form-data`). A PDF template's fields stay where they are, unless `reimport_fields` replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
2824
2828
  * @param {String} template_id The template's ID.
2825
- * @param {File} document The new PDF.
2829
+ * @param {File} document The new PDF, or the new Word document (.docx or .odt) of a Word template.
2826
2830
  * @param {Object} opts Optional parameters
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.
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.
2831
+ * @param {Boolean} opts.wait Wait until the PDF has been processed, a `document_url`'s PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.
2832
+ * @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. Only for PDF templates: a Word template adds a field for each new tag.
2829
2833
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Template}
2830
2834
  */
2831
2835
  }, {
@@ -17,7 +17,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
17
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
18
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
19
19
  * DocSpring API
20
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
21
21
  *
22
22
  * The version of the OpenAPI document: v2
23
23
  *
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The AddTemplateFieldsRequest model module.
32
32
  * @module model/AddTemplateFieldsRequest
33
- * @version 4.2.0
33
+ * @version 4.3.0
34
34
  */
35
35
  var AddTemplateFieldsRequest = /*#__PURE__*/function () {
36
36
  /**
@@ -14,7 +14,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
16
16
  * DocSpring API
17
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
18
18
  *
19
19
  * The version of the OpenAPI document: v2
20
20
  *
@@ -16,7 +16,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
17
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
18
18
  * DocSpring API
19
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
19
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
20
20
  *
21
21
  * The version of the OpenAPI document: v2
22
22
  *
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The AuthenticationCheck model module.
31
31
  * @module model/AuthenticationCheck
32
- * @version 4.2.0
32
+ * @version 4.3.0
33
33
  */
34
34
  var AuthenticationCheck = /*#__PURE__*/function () {
35
35
  /**
@@ -14,7 +14,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
16
16
  * DocSpring API
17
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
18
18
  *
19
19
  * The version of the OpenAPI document: v2
20
20
  *
@@ -14,7 +14,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
16
16
  * DocSpring API
17
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
18
18
  *
19
19
  * The version of the OpenAPI document: v2
20
20
  *
@@ -14,7 +14,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
16
16
  * DocSpring API
17
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
17
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
18
18
  *
19
19
  * The version of the OpenAPI document: v2
20
20
  *