docspring 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/AGENTS.md +3 -2
  2. package/README.md +4 -1
  3. package/dist/ApiClient.js +2 -2
  4. package/dist/RequestSchemas.js +75 -8
  5. package/dist/WebhookSignature.js +86 -0
  6. package/dist/api/Client.js +147 -15
  7. package/dist/index.js +42 -0
  8. package/dist/model/AddTemplateFieldsRequest.js +1 -1
  9. package/dist/model/AuthenticationCheck.js +1 -1
  10. package/dist/model/CombinedPdf.js +3 -3
  11. package/dist/model/CombinedPdfFiles.js +1 -1
  12. package/dist/model/CombinedPdfList.js +1 -1
  13. package/dist/model/CombinedPdfSource.js +1 -1
  14. package/dist/model/CombinedPdfSourceInput.js +1 -1
  15. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  16. package/dist/model/CopyTemplateRequest.js +1 -1
  17. package/dist/model/CreateCombinedPdfRequest.js +2 -2
  18. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  19. package/dist/model/CreateFolderRequest.js +1 -1
  20. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  21. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  22. package/dist/model/CreateSubmissionBatchRequest.js +1 -1
  23. package/dist/model/CreateSubmissionRequest.js +3 -3
  24. package/dist/model/CreateTemplatePreviewRequest.js +112 -0
  25. package/dist/model/CreateTemplateRequest.js +11 -2
  26. package/dist/model/CreateWebhookRequest.js +1 -1
  27. package/dist/model/CustomFile.js +1 -1
  28. package/dist/model/CustomFileList.js +1 -1
  29. package/dist/model/CustomFileSourcePdf.js +1 -1
  30. package/dist/model/ErrorCode.js +11 -1
  31. package/dist/model/ErrorDetail.js +2 -2
  32. package/dist/model/ErrorInfo.js +6 -6
  33. package/dist/model/ErrorResponse.js +1 -1
  34. package/dist/model/Field.js +1 -1
  35. package/dist/model/FieldComparisonCondition.js +1 -1
  36. package/dist/model/FieldDependency.js +1 -1
  37. package/dist/model/FieldDependencyInput.js +1 -1
  38. package/dist/model/FieldEqualsCondition.js +1 -1
  39. package/dist/model/FieldGroup.js +1 -1
  40. package/dist/model/FieldGroupInput.js +1 -1
  41. package/dist/model/FieldInCondition.js +1 -1
  42. package/dist/model/FieldInput.js +1 -1
  43. package/dist/model/FieldOverride.js +1 -1
  44. package/dist/model/FieldPresenceCondition.js +1 -1
  45. package/dist/model/FieldRangeCondition.js +1 -1
  46. package/dist/model/Folder.js +1 -1
  47. package/dist/model/FolderList.js +1 -1
  48. package/dist/model/GenerateSubmissionFilesRequest.js +1 -1
  49. package/dist/model/GeneratedFile.js +1 -1
  50. package/dist/model/HtmlEngineOptions.js +1 -1
  51. package/dist/model/HtmlEngineOptionsInput.js +1 -1
  52. package/dist/model/MoveFolderRequest.js +1 -1
  53. package/dist/model/MoveTemplateRequest.js +1 -1
  54. package/dist/model/PageImage.js +1 -1
  55. package/dist/model/PageImages.js +1 -1
  56. package/dist/model/PredefinedField.js +1 -1
  57. package/dist/model/PredefinedFieldInput.js +1 -1
  58. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  59. package/dist/model/RemoveTemplateFieldsRequest.js +1 -1
  60. package/dist/model/RenameFolderRequest.js +1 -1
  61. package/dist/model/ReorderTemplateFieldsRequest.js +1 -1
  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 +75 -75
  68. package/dist/model/SubmissionAction.js +1 -1
  69. package/dist/model/SubmissionBatch.js +1 -1
  70. package/dist/model/SubmissionFiles.js +1 -1
  71. package/dist/model/SubmissionInput.js +3 -3
  72. package/dist/model/SubmissionList.js +5 -5
  73. package/dist/model/SubmissionSourcePdf.js +1 -1
  74. package/dist/model/SubmissionSummary.js +343 -0
  75. package/dist/model/SubmissionValidation.js +1 -1
  76. package/dist/model/Template.js +68 -57
  77. package/dist/model/TemplateActor.js +3 -3
  78. package/dist/model/TemplateDefaults.js +1 -1
  79. package/dist/model/TemplateDefaultsInput.js +1 -1
  80. package/dist/model/TemplateDiff.js +1 -1
  81. package/dist/model/TemplateDiffSummary.js +1 -1
  82. package/dist/model/TemplateDocument.js +33 -33
  83. package/dist/model/TemplateDocumentSummary.js +152 -0
  84. package/dist/model/TemplateFieldChange.js +1 -1
  85. package/dist/model/TemplateFieldChanges.js +1 -1
  86. package/dist/model/TemplateFieldDependency.js +1 -1
  87. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  88. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  89. package/dist/model/TemplateFieldDependencyInput.js +1 -1
  90. package/dist/model/TemplateFieldMove.js +1 -1
  91. package/dist/model/TemplateFields.js +1 -1
  92. package/dist/model/TemplateModelCode.js +1 -1
  93. package/dist/model/TemplatePageImages.js +1 -1
  94. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  95. package/dist/model/TemplatePreview.js +211 -0
  96. package/dist/model/TemplatePreviewState.js +64 -0
  97. package/dist/model/TemplateSourcePdf.js +1 -1
  98. package/dist/model/TemplateSummary.js +14 -288
  99. package/dist/model/TemplateSummaryList.js +1 -1
  100. package/dist/model/TemplateVersion.js +1 -1
  101. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  102. package/dist/model/UpdateTemplateDocumentRequest.js +1 -1
  103. package/dist/model/UpdateTemplateFieldsRequest.js +1 -1
  104. package/dist/model/UpdateTemplateRequest.js +11 -2
  105. package/dist/model/UpdateWebhookRequest.js +1 -1
  106. package/dist/model/UploadPresign.js +1 -1
  107. package/dist/model/UrlSourcePdf.js +1 -1
  108. package/dist/model/ValidateSubmissionRequest.js +3 -3
  109. package/dist/model/Webhook.js +1 -1
  110. package/dist/model/WebhookList.js +1 -1
  111. package/package.json +3 -2
@@ -5,11 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _AiFieldNamingLanguage = _interopRequireDefault(require("./AiFieldNamingLanguage"));
9
- var _ExpirationInterval = _interopRequireDefault(require("./ExpirationInterval"));
10
- var _TemplateActor = _interopRequireDefault(require("./TemplateActor"));
11
- var _TemplateDocument = _interopRequireDefault(require("./TemplateDocument"));
12
- var _TemplateFormMode = _interopRequireDefault(require("./TemplateFormMode"));
8
+ var _TemplateDocumentSummary = _interopRequireDefault(require("./TemplateDocumentSummary"));
13
9
  var _TemplateType = _interopRequireDefault(require("./TemplateType"));
14
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
15
11
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -35,55 +31,32 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
35
31
  /**
36
32
  * The TemplateSummary model module.
37
33
  * @module model/TemplateSummary
38
- * @version 4.1.0
34
+ * @version 4.2.0
39
35
  */
40
36
  var TemplateSummary = /*#__PURE__*/function () {
41
37
  /**
42
38
  * Constructs a new <code>TemplateSummary</code>.
43
- * A template in a list. Get a template by its ID for its HTML, defaults, field dependency rules and published versions.
39
+ * A template in a list: its name, type, folder, latest published version and whether it's ready. Get a template by its ID for its settings, its PDF in full, its HTML, defaults, field dependency rules and published versions.
44
40
  * @alias module:model/TemplateSummary
45
41
  * @extends Object
46
42
  * @param id {String} The template's ID.
47
43
  * @param name {String} The template's name.
48
44
  * @param description {String} Shown under the template's name at the top of its hosted forms, and used as their meta description. Not shown on embedded forms or signature requests.
49
45
  * @param template_type {module:model/TemplateType} `pdf`: fields placed on an uploaded PDF. `html`: a PDF rendered from HTML and SCSS. It can't be changed after the template is created.
50
- * @param ready {Boolean} Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its document has been processed (`document.state` is `processed`).
51
- * @param document {module:model/TemplateDocument} The PDF of a PDF template. Null for HTML templates, and for a PDF template that has no PDF yet.
46
+ * @param ready {Boolean} Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready.
47
+ * @param document {module:model/TemplateDocumentSummary} The PDF of a PDF template: its file name, page count and processing state. Null for HTML templates, and for a PDF template that has no PDF yet.
52
48
  * @param parent_folder_id {String} The ID of the folder the template is in. Null for a template at the root. Setting it moves the template and all of its published versions.
53
49
  * @param path {String} The path of the folder the template is in, such as `/Contracts`. `/` for a template at the root.
54
- * @param version {String} The published version this is, such as `1.2.0`. Null for the draft.
55
50
  * @param latest_version {String} The template's latest published version. Null if no version has been published.
56
51
  * @param version_published_at {Date} When this version was published. Null for the draft.
57
52
  * @param locked {Boolean} A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed).
58
- * @param add_signature_request_submission_id_footers {Boolean} Print the submission ID in the footer of each page of PDFs signed through signature requests.
59
- * @param ai_field_naming_language {module:model/AiFieldNamingLanguage} The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. New templates take it from your account's template settings. Null for HTML templates.
60
- * @param allow_additional_properties {Boolean} Accept submission data with properties that aren't fields of the template.
61
- * @param allow_skipping_optional_fields {Boolean} Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it.
62
- * @param default_form_mode {module:model/TemplateFormMode} The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept.
63
- * @param editable_submissions {Boolean} Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
64
- * @param embed_domains {Array.<String>} The sites where the template's signature requests, forms and embedded template editor can be loaded: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). When it's empty, live signature requests don't load on any site, and the embedded template editor loads on every site.
65
- * @param embed_edit_allow_settings {Boolean} Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on).
66
- * @param embed_edit_allow_versioning {Boolean} Allow the embedded template editor to publish, restore, compare and delete published versions.
67
- * @param embed_edit_allow_document_replacement {Boolean} Allow the embedded template editor to replace the template's PDF.
68
- * @param encrypt_pdfs {Boolean} Encrypt generated PDFs with `encrypt_pdfs_password`.
69
- * @param has_encrypt_pdfs_password {Boolean} Whether `encrypt_pdfs_password` is set.
70
- * @param expire_submissions {Boolean} Delete each submission's data and PDF after `expire_after` `expiration_interval`.
71
- * @param expire_after {Number} How many `expiration_interval`s a submission's data and PDF are kept for, when `expire_submissions` is on. At most 5256000 (10 years in minutes).
72
- * @param expiration_interval {module:model/ExpirationInterval} The unit of `expire_after`.
73
- * @param merge_audit_trail_pdf {Boolean} Add the audit trail to the end of PDFs signed through signature requests.
74
- * @param parse_dates_using_template_date_format {Boolean} Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way.
75
- * @param public_submissions {Boolean} Allow anyone with a submission's ID to download its PDF.
76
- * @param public_web_form {Boolean} Allow anyone to fill in the template's web form.
77
- * @param redirect_url {String} Where the web form sends people after they submit it.
78
- * @param has_slack_webhook_url {Boolean} Whether `slack_webhook_url` is set.
79
53
  * @param last_changed_at {Date} When the draft was last changed.
80
- * @param last_changed_by {module:model/TemplateActor} Who last changed the draft: a user in your account, an API token, or someone using the embedded template editor. Null if no change has been recorded.
81
54
  * @param created_at {Date} When the template was created.
82
55
  * @param updated_at {Date} When the template was last updated.
83
56
  */
84
- function TemplateSummary(id, name, description, template_type, ready, document, parent_folder_id, path, version, latest_version, version_published_at, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_at, last_changed_by, created_at, updated_at) {
57
+ function TemplateSummary(id, name, description, template_type, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at) {
85
58
  _classCallCheck(this, TemplateSummary);
86
- TemplateSummary.initialize(this, id, name, description, template_type, ready, document, parent_folder_id, path, version, latest_version, version_published_at, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_at, last_changed_by, created_at, updated_at);
59
+ TemplateSummary.initialize(this, id, name, description, template_type, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at);
87
60
  }
88
61
 
89
62
  /**
@@ -93,7 +66,7 @@ var TemplateSummary = /*#__PURE__*/function () {
93
66
  */
94
67
  return _createClass(TemplateSummary, null, [{
95
68
  key: "initialize",
96
- value: function initialize(obj, id, name, description, template_type, ready, document, parent_folder_id, path, version, latest_version, version_published_at, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_at, last_changed_by, created_at, updated_at) {
69
+ value: function initialize(obj, id, name, description, template_type, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at) {
97
70
  obj['id'] = id;
98
71
  obj['name'] = name;
99
72
  obj['description'] = description;
@@ -102,33 +75,10 @@ var TemplateSummary = /*#__PURE__*/function () {
102
75
  obj['document'] = document;
103
76
  obj['parent_folder_id'] = parent_folder_id;
104
77
  obj['path'] = path;
105
- obj['version'] = version;
106
78
  obj['latest_version'] = latest_version;
107
79
  obj['version_published_at'] = version_published_at;
108
80
  obj['locked'] = locked;
109
- obj['add_signature_request_submission_id_footers'] = add_signature_request_submission_id_footers;
110
- obj['ai_field_naming_language'] = ai_field_naming_language;
111
- obj['allow_additional_properties'] = allow_additional_properties;
112
- obj['allow_skipping_optional_fields'] = allow_skipping_optional_fields;
113
- obj['default_form_mode'] = default_form_mode;
114
- obj['editable_submissions'] = editable_submissions;
115
- obj['embed_domains'] = embed_domains;
116
- obj['embed_edit_allow_settings'] = embed_edit_allow_settings;
117
- obj['embed_edit_allow_versioning'] = embed_edit_allow_versioning;
118
- obj['embed_edit_allow_document_replacement'] = embed_edit_allow_document_replacement;
119
- obj['encrypt_pdfs'] = encrypt_pdfs;
120
- obj['has_encrypt_pdfs_password'] = has_encrypt_pdfs_password;
121
- obj['expire_submissions'] = expire_submissions;
122
- obj['expire_after'] = expire_after;
123
- obj['expiration_interval'] = expiration_interval;
124
- obj['merge_audit_trail_pdf'] = merge_audit_trail_pdf;
125
- obj['parse_dates_using_template_date_format'] = parse_dates_using_template_date_format;
126
- obj['public_submissions'] = public_submissions;
127
- obj['public_web_form'] = public_web_form;
128
- obj['redirect_url'] = redirect_url;
129
- obj['has_slack_webhook_url'] = has_slack_webhook_url;
130
81
  obj['last_changed_at'] = last_changed_at;
131
- obj['last_changed_by'] = last_changed_by;
132
82
  obj['created_at'] = created_at;
133
83
  obj['updated_at'] = updated_at;
134
84
  }
@@ -162,7 +112,7 @@ var TemplateSummary = /*#__PURE__*/function () {
162
112
  obj['ready'] = _ApiClient["default"].convertToType(data['ready'], 'Boolean');
163
113
  }
164
114
  if (data.hasOwnProperty('document')) {
165
- obj['document'] = _ApiClient["default"].convertToType(data['document'], _TemplateDocument["default"]);
115
+ obj['document'] = _ApiClient["default"].convertToType(data['document'], _TemplateDocumentSummary["default"]);
166
116
  }
167
117
  if (data.hasOwnProperty('parent_folder_id')) {
168
118
  obj['parent_folder_id'] = _ApiClient["default"].convertToType(data['parent_folder_id'], 'String');
@@ -170,9 +120,6 @@ var TemplateSummary = /*#__PURE__*/function () {
170
120
  if (data.hasOwnProperty('path')) {
171
121
  obj['path'] = _ApiClient["default"].convertToType(data['path'], 'String');
172
122
  }
173
- if (data.hasOwnProperty('version')) {
174
- obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
175
- }
176
123
  if (data.hasOwnProperty('latest_version')) {
177
124
  obj['latest_version'] = _ApiClient["default"].convertToType(data['latest_version'], 'String');
178
125
  }
@@ -182,75 +129,9 @@ var TemplateSummary = /*#__PURE__*/function () {
182
129
  if (data.hasOwnProperty('locked')) {
183
130
  obj['locked'] = _ApiClient["default"].convertToType(data['locked'], 'Boolean');
184
131
  }
185
- if (data.hasOwnProperty('add_signature_request_submission_id_footers')) {
186
- obj['add_signature_request_submission_id_footers'] = _ApiClient["default"].convertToType(data['add_signature_request_submission_id_footers'], 'Boolean');
187
- }
188
- if (data.hasOwnProperty('ai_field_naming_language')) {
189
- obj['ai_field_naming_language'] = _ApiClient["default"].convertToType(data['ai_field_naming_language'], _AiFieldNamingLanguage["default"]);
190
- }
191
- if (data.hasOwnProperty('allow_additional_properties')) {
192
- obj['allow_additional_properties'] = _ApiClient["default"].convertToType(data['allow_additional_properties'], 'Boolean');
193
- }
194
- if (data.hasOwnProperty('allow_skipping_optional_fields')) {
195
- obj['allow_skipping_optional_fields'] = _ApiClient["default"].convertToType(data['allow_skipping_optional_fields'], 'Boolean');
196
- }
197
- if (data.hasOwnProperty('default_form_mode')) {
198
- obj['default_form_mode'] = _ApiClient["default"].convertToType(data['default_form_mode'], _TemplateFormMode["default"]);
199
- }
200
- if (data.hasOwnProperty('editable_submissions')) {
201
- obj['editable_submissions'] = _ApiClient["default"].convertToType(data['editable_submissions'], 'Boolean');
202
- }
203
- if (data.hasOwnProperty('embed_domains')) {
204
- obj['embed_domains'] = _ApiClient["default"].convertToType(data['embed_domains'], ['String']);
205
- }
206
- if (data.hasOwnProperty('embed_edit_allow_settings')) {
207
- obj['embed_edit_allow_settings'] = _ApiClient["default"].convertToType(data['embed_edit_allow_settings'], 'Boolean');
208
- }
209
- if (data.hasOwnProperty('embed_edit_allow_versioning')) {
210
- obj['embed_edit_allow_versioning'] = _ApiClient["default"].convertToType(data['embed_edit_allow_versioning'], 'Boolean');
211
- }
212
- if (data.hasOwnProperty('embed_edit_allow_document_replacement')) {
213
- obj['embed_edit_allow_document_replacement'] = _ApiClient["default"].convertToType(data['embed_edit_allow_document_replacement'], 'Boolean');
214
- }
215
- if (data.hasOwnProperty('encrypt_pdfs')) {
216
- obj['encrypt_pdfs'] = _ApiClient["default"].convertToType(data['encrypt_pdfs'], 'Boolean');
217
- }
218
- if (data.hasOwnProperty('has_encrypt_pdfs_password')) {
219
- obj['has_encrypt_pdfs_password'] = _ApiClient["default"].convertToType(data['has_encrypt_pdfs_password'], 'Boolean');
220
- }
221
- if (data.hasOwnProperty('expire_submissions')) {
222
- obj['expire_submissions'] = _ApiClient["default"].convertToType(data['expire_submissions'], 'Boolean');
223
- }
224
- if (data.hasOwnProperty('expire_after')) {
225
- obj['expire_after'] = _ApiClient["default"].convertToType(data['expire_after'], 'Number');
226
- }
227
- if (data.hasOwnProperty('expiration_interval')) {
228
- obj['expiration_interval'] = _ApiClient["default"].convertToType(data['expiration_interval'], _ExpirationInterval["default"]);
229
- }
230
- if (data.hasOwnProperty('merge_audit_trail_pdf')) {
231
- obj['merge_audit_trail_pdf'] = _ApiClient["default"].convertToType(data['merge_audit_trail_pdf'], 'Boolean');
232
- }
233
- if (data.hasOwnProperty('parse_dates_using_template_date_format')) {
234
- obj['parse_dates_using_template_date_format'] = _ApiClient["default"].convertToType(data['parse_dates_using_template_date_format'], 'Boolean');
235
- }
236
- if (data.hasOwnProperty('public_submissions')) {
237
- obj['public_submissions'] = _ApiClient["default"].convertToType(data['public_submissions'], 'Boolean');
238
- }
239
- if (data.hasOwnProperty('public_web_form')) {
240
- obj['public_web_form'] = _ApiClient["default"].convertToType(data['public_web_form'], 'Boolean');
241
- }
242
- if (data.hasOwnProperty('redirect_url')) {
243
- obj['redirect_url'] = _ApiClient["default"].convertToType(data['redirect_url'], 'String');
244
- }
245
- if (data.hasOwnProperty('has_slack_webhook_url')) {
246
- obj['has_slack_webhook_url'] = _ApiClient["default"].convertToType(data['has_slack_webhook_url'], 'Boolean');
247
- }
248
132
  if (data.hasOwnProperty('last_changed_at')) {
249
133
  obj['last_changed_at'] = _ApiClient["default"].convertToType(data['last_changed_at'], 'Date');
250
134
  }
251
- if (data.hasOwnProperty('last_changed_by')) {
252
- obj['last_changed_by'] = _ApiClient["default"].convertToType(data['last_changed_by'], _TemplateActor["default"]);
253
- }
254
135
  if (data.hasOwnProperty('created_at')) {
255
136
  obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
256
137
  }
@@ -299,7 +180,7 @@ var TemplateSummary = /*#__PURE__*/function () {
299
180
  // validate the optional field `document`
300
181
  if (data['document']) {
301
182
  // data not null
302
- _TemplateDocument["default"].validateJSON(data['document']);
183
+ _TemplateDocumentSummary["default"].validateJSON(data['document']);
303
184
  }
304
185
  // ensure the json data is a string
305
186
  if (data['parent_folder_id'] && !(typeof data['parent_folder_id'] === 'string' || data['parent_folder_id'] instanceof String)) {
@@ -310,31 +191,14 @@ var TemplateSummary = /*#__PURE__*/function () {
310
191
  throw new Error("Expected the field `path` to be a primitive type in the JSON string but got " + data['path']);
311
192
  }
312
193
  // ensure the json data is a string
313
- if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
314
- throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
315
- }
316
- // ensure the json data is a string
317
194
  if (data['latest_version'] && !(typeof data['latest_version'] === 'string' || data['latest_version'] instanceof String)) {
318
195
  throw new Error("Expected the field `latest_version` to be a primitive type in the JSON string but got " + data['latest_version']);
319
196
  }
320
- // ensure the json data is an array
321
- if (!Array.isArray(data['embed_domains'])) {
322
- throw new Error("Expected the field `embed_domains` to be an array in the JSON data but got " + data['embed_domains']);
323
- }
324
- // ensure the json data is a string
325
- if (data['redirect_url'] && !(typeof data['redirect_url'] === 'string' || data['redirect_url'] instanceof String)) {
326
- throw new Error("Expected the field `redirect_url` to be a primitive type in the JSON string but got " + data['redirect_url']);
327
- }
328
- // validate the optional field `last_changed_by`
329
- if (data['last_changed_by']) {
330
- // data not null
331
- _TemplateActor["default"].validateJSON(data['last_changed_by']);
332
- }
333
197
  return true;
334
198
  }
335
199
  }]);
336
200
  }();
337
- TemplateSummary.RequiredProperties = ["id", "name", "description", "template_type", "ready", "document", "parent_folder_id", "path", "version", "latest_version", "version_published_at", "locked", "add_signature_request_submission_id_footers", "ai_field_naming_language", "allow_additional_properties", "allow_skipping_optional_fields", "default_form_mode", "editable_submissions", "embed_domains", "embed_edit_allow_settings", "embed_edit_allow_versioning", "embed_edit_allow_document_replacement", "encrypt_pdfs", "has_encrypt_pdfs_password", "expire_submissions", "expire_after", "expiration_interval", "merge_audit_trail_pdf", "parse_dates_using_template_date_format", "public_submissions", "public_web_form", "redirect_url", "has_slack_webhook_url", "last_changed_at", "last_changed_by", "created_at", "updated_at"];
201
+ TemplateSummary.RequiredProperties = ["id", "name", "description", "template_type", "ready", "document", "parent_folder_id", "path", "latest_version", "version_published_at", "locked", "last_changed_at", "created_at", "updated_at"];
338
202
 
339
203
  /**
340
204
  * The template's ID.
@@ -361,14 +225,14 @@ TemplateSummary.prototype['description'] = undefined;
361
225
  TemplateSummary.prototype['template_type'] = undefined;
362
226
 
363
227
  /**
364
- * Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its document has been processed (`document.state` is `processed`).
228
+ * Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once DocSpring has stored its PDF, made an image of each page and finished looking for fields on each page, which can be after `document.state` becomes `processed`. A PDF template with no PDF (`document` is null) isn't ready.
365
229
  * @member {Boolean} ready
366
230
  */
367
231
  TemplateSummary.prototype['ready'] = undefined;
368
232
 
369
233
  /**
370
- * The PDF of a PDF template. Null for HTML templates, and for a PDF template that has no PDF yet.
371
- * @member {module:model/TemplateDocument} document
234
+ * The PDF of a PDF template: its file name, page count and processing state. Null for HTML templates, and for a PDF template that has no PDF yet.
235
+ * @member {module:model/TemplateDocumentSummary} document
372
236
  */
373
237
  TemplateSummary.prototype['document'] = undefined;
374
238
 
@@ -384,12 +248,6 @@ TemplateSummary.prototype['parent_folder_id'] = undefined;
384
248
  */
385
249
  TemplateSummary.prototype['path'] = undefined;
386
250
 
387
- /**
388
- * The published version this is, such as `1.2.0`. Null for the draft.
389
- * @member {String} version
390
- */
391
- TemplateSummary.prototype['version'] = undefined;
392
-
393
251
  /**
394
252
  * The template's latest published version. Null if no version has been published.
395
253
  * @member {String} latest_version
@@ -408,144 +266,12 @@ TemplateSummary.prototype['version_published_at'] = undefined;
408
266
  */
409
267
  TemplateSummary.prototype['locked'] = undefined;
410
268
 
411
- /**
412
- * Print the submission ID in the footer of each page of PDFs signed through signature requests.
413
- * @member {Boolean} add_signature_request_submission_id_footers
414
- */
415
- TemplateSummary.prototype['add_signature_request_submission_id_footers'] = undefined;
416
-
417
- /**
418
- * The language AI field setup names fields in: `auto` uses the form's language when it's written in the Latin alphabet without accents, and English otherwise; `english` always uses English; `form_language` uses the form's language and script. New templates take it from your account's template settings. Null for HTML templates.
419
- * @member {module:model/AiFieldNamingLanguage} ai_field_naming_language
420
- */
421
- TemplateSummary.prototype['ai_field_naming_language'] = undefined;
422
-
423
- /**
424
- * Accept submission data with properties that aren't fields of the template.
425
- * @member {Boolean} allow_additional_properties
426
- */
427
- TemplateSummary.prototype['allow_additional_properties'] = undefined;
428
-
429
- /**
430
- * Visual forms and signature request forms show the Continue button as soon as the required fields are filled in, without visiting each optional field. The `allowSkippingOptionalFields` embed option overrides it.
431
- * @member {Boolean} allow_skipping_optional_fields
432
- */
433
- TemplateSummary.prototype['allow_skipping_optional_fields'] = undefined;
434
-
435
- /**
436
- * The hosted form that /templates/{template_id}/form shows when its URL has no `mode` parameter: `web` (the web form), `visual` (the visual form, where fields are filled in on the PDF) or `dual` (both, in tabs). HTML templates have no visual form, so `web` is the only value they accept.
437
- * @member {module:model/TemplateFormMode} default_form_mode
438
- */
439
- TemplateSummary.prototype['default_form_mode'] = undefined;
440
-
441
- /**
442
- * Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
443
- * @member {Boolean} editable_submissions
444
- */
445
- TemplateSummary.prototype['editable_submissions'] = undefined;
446
-
447
- /**
448
- * The sites where the template's signature requests, forms and embedded template editor can be loaded: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). When it's empty, live signature requests don't load on any site, and the embedded template editor loads on every site.
449
- * @member {Array.<String>} embed_domains
450
- */
451
- TemplateSummary.prototype['embed_domains'] = undefined;
452
-
453
- /**
454
- * Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on).
455
- * @member {Boolean} embed_edit_allow_settings
456
- */
457
- TemplateSummary.prototype['embed_edit_allow_settings'] = undefined;
458
-
459
- /**
460
- * Allow the embedded template editor to publish, restore, compare and delete published versions.
461
- * @member {Boolean} embed_edit_allow_versioning
462
- */
463
- TemplateSummary.prototype['embed_edit_allow_versioning'] = undefined;
464
-
465
- /**
466
- * Allow the embedded template editor to replace the template's PDF.
467
- * @member {Boolean} embed_edit_allow_document_replacement
468
- */
469
- TemplateSummary.prototype['embed_edit_allow_document_replacement'] = undefined;
470
-
471
- /**
472
- * Encrypt generated PDFs with `encrypt_pdfs_password`.
473
- * @member {Boolean} encrypt_pdfs
474
- */
475
- TemplateSummary.prototype['encrypt_pdfs'] = undefined;
476
-
477
- /**
478
- * Whether `encrypt_pdfs_password` is set.
479
- * @member {Boolean} has_encrypt_pdfs_password
480
- */
481
- TemplateSummary.prototype['has_encrypt_pdfs_password'] = undefined;
482
-
483
- /**
484
- * Delete each submission's data and PDF after `expire_after` `expiration_interval`.
485
- * @member {Boolean} expire_submissions
486
- */
487
- TemplateSummary.prototype['expire_submissions'] = undefined;
488
-
489
- /**
490
- * How many `expiration_interval`s a submission's data and PDF are kept for, when `expire_submissions` is on. At most 5256000 (10 years in minutes).
491
- * @member {Number} expire_after
492
- */
493
- TemplateSummary.prototype['expire_after'] = undefined;
494
-
495
- /**
496
- * The unit of `expire_after`.
497
- * @member {module:model/ExpirationInterval} expiration_interval
498
- */
499
- TemplateSummary.prototype['expiration_interval'] = undefined;
500
-
501
- /**
502
- * Add the audit trail to the end of PDFs signed through signature requests.
503
- * @member {Boolean} merge_audit_trail_pdf
504
- */
505
- TemplateSummary.prototype['merge_audit_trail_pdf'] = undefined;
506
-
507
- /**
508
- * Date fields also accept NN/NN/YYYY dates (with slashes, dashes or dots), read in the order of the template's default date format: month first for %m/%d/%Y, day first for %d/%m/%Y. When false, date fields only accept YYYY-MM-DD. Applies to PDF templates: an HTML template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way.
509
- * @member {Boolean} parse_dates_using_template_date_format
510
- */
511
- TemplateSummary.prototype['parse_dates_using_template_date_format'] = undefined;
512
-
513
- /**
514
- * Allow anyone with a submission's ID to download its PDF.
515
- * @member {Boolean} public_submissions
516
- */
517
- TemplateSummary.prototype['public_submissions'] = undefined;
518
-
519
- /**
520
- * Allow anyone to fill in the template's web form.
521
- * @member {Boolean} public_web_form
522
- */
523
- TemplateSummary.prototype['public_web_form'] = undefined;
524
-
525
- /**
526
- * Where the web form sends people after they submit it.
527
- * @member {String} redirect_url
528
- */
529
- TemplateSummary.prototype['redirect_url'] = undefined;
530
-
531
- /**
532
- * Whether `slack_webhook_url` is set.
533
- * @member {Boolean} has_slack_webhook_url
534
- */
535
- TemplateSummary.prototype['has_slack_webhook_url'] = undefined;
536
-
537
269
  /**
538
270
  * When the draft was last changed.
539
271
  * @member {Date} last_changed_at
540
272
  */
541
273
  TemplateSummary.prototype['last_changed_at'] = undefined;
542
274
 
543
- /**
544
- * Who last changed the draft: a user in your account, an API token, or someone using the embedded template editor. Null if no change has been recorded.
545
- * @member {module:model/TemplateActor} last_changed_by
546
- */
547
- TemplateSummary.prototype['last_changed_by'] = undefined;
548
-
549
275
  /**
550
276
  * When the template was created.
551
277
  * @member {Date} created_at
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The TemplateSummaryList model module.
32
32
  * @module model/TemplateSummaryList
33
- * @version 4.1.0
33
+ * @version 4.2.0
34
34
  */
35
35
  var TemplateSummaryList = /*#__PURE__*/function () {
36
36
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The TemplateVersion model module.
32
32
  * @module model/TemplateVersion
33
- * @version 4.1.0
33
+ * @version 4.2.0
34
34
  */
35
35
  var TemplateVersion = /*#__PURE__*/function () {
36
36
  /**
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
28
28
  /**
29
29
  * The UpdateSignatureRequestRequest model module.
30
30
  * @module model/UpdateSignatureRequestRequest
31
- * @version 4.1.0
31
+ * @version 4.2.0
32
32
  */
33
33
  var UpdateSignatureRequestRequest = /*#__PURE__*/function () {
34
34
  /**
@@ -26,7 +26,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
26
26
  /**
27
27
  * The UpdateTemplateDocumentRequest model module.
28
28
  * @module model/UpdateTemplateDocumentRequest
29
- * @version 4.1.0
29
+ * @version 4.2.0
30
30
  */
31
31
  var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
32
32
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UpdateTemplateFieldsRequest model module.
32
32
  * @module model/UpdateTemplateFieldsRequest
33
- * @version 4.1.0
33
+ * @version 4.2.0
34
34
  */
35
35
  var UpdateTemplateFieldsRequest = /*#__PURE__*/function () {
36
36
  /**
@@ -37,7 +37,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
37
37
  /**
38
38
  * The UpdateTemplateRequest model module.
39
39
  * @module model/UpdateTemplateRequest
40
- * @version 4.1.0
40
+ * @version 4.2.0
41
41
  */
42
42
  var UpdateTemplateRequest = /*#__PURE__*/function () {
43
43
  /**
@@ -178,6 +178,9 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
178
178
  if (data.hasOwnProperty('html_engine_options')) {
179
179
  obj['html_engine_options'] = _ApiClient["default"].convertToType(data['html_engine_options'], _HtmlEngineOptionsInput["default"]);
180
180
  }
181
+ if (data.hasOwnProperty('html_escape_data')) {
182
+ obj['html_escape_data'] = _ApiClient["default"].convertToType(data['html_escape_data'], 'Boolean');
183
+ }
181
184
  }
182
185
  return obj;
183
186
  }
@@ -372,7 +375,7 @@ UpdateTemplateRequest.prototype['default_form_mode'] = undefined;
372
375
  UpdateTemplateRequest.prototype['editable_submissions'] = undefined;
373
376
 
374
377
  /**
375
- * The sites where the template's signature requests, forms and embedded template editor can be loaded: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). When it's empty, live signature requests don't load on any site, and the embedded template editor loads on every site.
378
+ * The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted.
376
379
  * @member {Array.<String>} embed_domains
377
380
  */
378
381
  UpdateTemplateRequest.prototype['embed_domains'] = undefined;
@@ -520,4 +523,10 @@ UpdateTemplateRequest.prototype['footer_html'] = undefined;
520
523
  * @member {module:model/HtmlEngineOptionsInput} html_engine_options
521
524
  */
522
525
  UpdateTemplateRequest.prototype['html_engine_options'] = undefined;
526
+
527
+ /**
528
+ * Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates.
529
+ * @member {Boolean} html_escape_data
530
+ */
531
+ UpdateTemplateRequest.prototype['html_escape_data'] = undefined;
523
532
  var _default = exports["default"] = UpdateTemplateRequest;
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
28
28
  /**
29
29
  * The UpdateWebhookRequest model module.
30
30
  * @module model/UpdateWebhookRequest
31
- * @version 4.1.0
31
+ * @version 4.2.0
32
32
  */
33
33
  var UpdateWebhookRequest = /*#__PURE__*/function () {
34
34
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UploadPresign model module.
32
32
  * @module model/UploadPresign
33
- * @version 4.1.0
33
+ * @version 4.2.0
34
34
  */
35
35
  var UploadPresign = /*#__PURE__*/function () {
36
36
  /**
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The UrlSourcePdf model module.
31
31
  * @module model/UrlSourcePdf
32
- * @version 4.1.0
32
+ * @version 4.2.0
33
33
  */
34
34
  var UrlSourcePdf = /*#__PURE__*/function () {
35
35
  /**
@@ -32,7 +32,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
32
32
  /**
33
33
  * The ValidateSubmissionRequest model module.
34
34
  * @module model/ValidateSubmissionRequest
35
- * @version 4.1.0
35
+ * @version 4.2.0
36
36
  */
37
37
  var ValidateSubmissionRequest = /*#__PURE__*/function () {
38
38
  /**
@@ -177,7 +177,7 @@ ValidateSubmissionRequest.prototype['editable'] = undefined;
177
177
  ValidateSubmissionRequest.prototype['data'] = undefined;
178
178
 
179
179
  /**
180
- * Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
180
+ * Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`).
181
181
  * @member {Object.<String, Object>} metadata
182
182
  */
183
183
  ValidateSubmissionRequest.prototype['metadata'] = undefined;
@@ -213,7 +213,7 @@ ValidateSubmissionRequest.prototype['field_overrides'] = undefined;
213
213
  ValidateSubmissionRequest.prototype['html'] = undefined;
214
214
 
215
215
  /**
216
- * For an HTML template, CSS to use instead of the template's.
216
+ * For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity.
217
217
  * @member {String} css
218
218
  */
219
219
  ValidateSubmissionRequest.prototype['css'] = undefined;
@@ -31,7 +31,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
31
31
  /**
32
32
  * The Webhook model module.
33
33
  * @module model/Webhook
34
- * @version 4.1.0
34
+ * @version 4.2.0
35
35
  */
36
36
  var Webhook = /*#__PURE__*/function () {
37
37
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The WebhookList model module.
32
32
  * @module model/WebhookList
33
- * @version 4.1.0
33
+ * @version 4.2.0
34
34
  */
35
35
  var WebhookList = /*#__PURE__*/function () {
36
36
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docspring",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "An API client for the DocSpring PDF generation service",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -10,7 +10,8 @@
10
10
  "test": "mocha --require @babel/register --recursive"
11
11
  },
12
12
  "browser": {
13
- "fs": false
13
+ "fs": false,
14
+ "crypto": false
14
15
  },
15
16
  "dependencies": {
16
17
  "@babel/cli": "^7.0.0",