docspring 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/AGENTS.md +3 -2
  2. package/README.md +13 -1
  3. package/dist/ApiClient.js +2 -2
  4. package/dist/RequestSchemas.js +1231 -9
  5. package/dist/WebhookSignature.js +86 -0
  6. package/dist/api/Client.js +620 -38
  7. package/dist/index.js +238 -0
  8. package/dist/model/AddTemplateFieldsRequest.js +132 -0
  9. package/dist/model/AuthenticationCheck.js +1 -1
  10. package/dist/model/CombinedPdf.js +3 -3
  11. package/dist/model/CombinedPdfFiles.js +1 -1
  12. package/dist/model/CombinedPdfList.js +1 -1
  13. package/dist/model/CombinedPdfSource.js +1 -1
  14. package/dist/model/CombinedPdfSourceInput.js +1 -1
  15. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  16. package/dist/model/CopyTemplateRequest.js +1 -1
  17. package/dist/model/CreateCombinedPdfRequest.js +2 -2
  18. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  19. package/dist/model/CreateFolderRequest.js +1 -1
  20. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  21. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  22. package/dist/model/CreateSubmissionBatchRequest.js +15 -1
  23. package/dist/model/CreateSubmissionRequest.js +17 -3
  24. package/dist/model/CreateTemplatePreviewRequest.js +112 -0
  25. package/dist/model/CreateTemplateRequest.js +81 -4
  26. package/dist/model/CreateWebhookRequest.js +1 -1
  27. package/dist/model/CustomFile.js +1 -1
  28. package/dist/model/CustomFileList.js +1 -1
  29. package/dist/model/CustomFileSourcePdf.js +1 -1
  30. package/dist/model/ErrorCode.js +11 -1
  31. package/dist/model/ErrorDetail.js +2 -2
  32. package/dist/model/ErrorInfo.js +6 -6
  33. package/dist/model/ErrorResponse.js +1 -1
  34. package/dist/model/Field.js +1230 -0
  35. package/dist/model/FieldComparisonCondition.js +1 -1
  36. package/dist/model/FieldDependency.js +154 -0
  37. package/dist/model/FieldDependencyInput.js +154 -0
  38. package/dist/model/FieldEqualsCondition.js +1 -1
  39. package/dist/model/FieldGroup.js +206 -0
  40. package/dist/model/FieldGroupInput.js +180 -0
  41. package/dist/model/FieldGroupType.js +59 -0
  42. package/dist/model/FieldInCondition.js +1 -1
  43. package/dist/model/FieldInput.js +1012 -0
  44. package/dist/model/FieldOverride.js +1 -1
  45. package/dist/model/FieldPresenceCondition.js +1 -1
  46. package/dist/model/FieldRangeCondition.js +1 -1
  47. package/dist/model/FieldType.js +124 -0
  48. package/dist/model/Folder.js +1 -1
  49. package/dist/model/FolderList.js +1 -1
  50. package/dist/model/GenerateFilesFormat.js +54 -0
  51. package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
  52. package/dist/model/GeneratedFile.js +1 -1
  53. package/dist/model/HtmlEngineOptions.js +1 -1
  54. package/dist/model/HtmlEngineOptionsInput.js +1 -1
  55. package/dist/model/MoveFolderRequest.js +1 -1
  56. package/dist/model/MoveTemplateRequest.js +1 -1
  57. package/dist/model/OutputFormat.js +59 -0
  58. package/dist/model/PageImage.js +220 -0
  59. package/dist/model/PageImages.js +155 -0
  60. package/dist/model/PredefinedField.js +183 -0
  61. package/dist/model/PredefinedFieldInput.js +183 -0
  62. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  63. package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
  64. package/dist/model/RenameFolderRequest.js +1 -1
  65. package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
  66. package/dist/model/RestoreTemplateVersionRequest.js +1 -1
  67. package/dist/model/SignatureRequest.js +1 -1
  68. package/dist/model/SignatureRequestEvent.js +1 -1
  69. package/dist/model/SignatureRequestInput.js +1 -1
  70. package/dist/model/SignatureRequestToken.js +1 -1
  71. package/dist/model/Submission.js +84 -68
  72. package/dist/model/SubmissionAction.js +1 -1
  73. package/dist/model/SubmissionBatch.js +1 -1
  74. package/dist/model/SubmissionFiles.js +10 -1
  75. package/dist/model/SubmissionInput.js +17 -3
  76. package/dist/model/SubmissionList.js +5 -5
  77. package/dist/model/SubmissionSourcePdf.js +1 -1
  78. package/dist/model/SubmissionSummary.js +343 -0
  79. package/dist/model/SubmissionValidation.js +151 -0
  80. package/dist/model/Template.js +129 -56
  81. package/dist/model/TemplateActor.js +3 -3
  82. package/dist/model/TemplateDefaults.js +1 -1
  83. package/dist/model/TemplateDefaultsInput.js +1 -1
  84. package/dist/model/TemplateDiff.js +206 -0
  85. package/dist/model/TemplateDiffSummary.js +165 -0
  86. package/dist/model/TemplateDocument.js +36 -36
  87. package/dist/model/TemplateDocumentState.js +11 -1
  88. package/dist/model/TemplateDocumentSummary.js +152 -0
  89. package/dist/model/TemplateFieldChange.js +146 -0
  90. package/dist/model/TemplateFieldChanges.js +196 -0
  91. package/dist/model/TemplateFieldDependency.js +3 -3
  92. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  93. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  94. package/dist/model/TemplateFieldDependencyInput.js +3 -3
  95. package/dist/model/TemplateFieldMove.js +132 -0
  96. package/dist/model/TemplateFields.js +147 -0
  97. package/dist/model/TemplateModelCode.js +1 -1
  98. package/dist/model/TemplatePageImages.js +158 -0
  99. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  100. package/dist/model/TemplatePreview.js +211 -0
  101. package/dist/model/TemplatePreviewState.js +64 -0
  102. package/dist/model/TemplateSourcePdf.js +1 -1
  103. package/dist/model/TemplateSummary.js +14 -288
  104. package/dist/model/TemplateSummaryList.js +1 -1
  105. package/dist/model/TemplateVersion.js +1 -1
  106. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  107. package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
  108. package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
  109. package/dist/model/UpdateTemplateRequest.js +84 -2
  110. package/dist/model/UpdateWebhookRequest.js +1 -1
  111. package/dist/model/UploadPresign.js +1 -1
  112. package/dist/model/UrlSourcePdf.js +1 -1
  113. package/dist/model/ValidateSubmissionRequest.js +226 -0
  114. package/dist/model/Webhook.js +1 -1
  115. package/dist/model/WebhookList.js +1 -1
  116. package/package.json +3 -2
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _ErrorDetail = _interopRequireDefault(require("./ErrorDetail"));
9
+ var _OutputFormat = _interopRequireDefault(require("./OutputFormat"));
9
10
  var _SignatureRequest = _interopRequireDefault(require("./SignatureRequest"));
10
11
  var _SubmissionAction = _interopRequireDefault(require("./SubmissionAction"));
11
12
  var _SubmissionFiles = _interopRequireDefault(require("./SubmissionFiles"));
@@ -36,7 +37,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
36
37
  /**
37
38
  * The Submission model module.
38
39
  * @module model/Submission
39
- * @version 4.0.0
40
+ * @version 4.2.0
40
41
  */
41
42
  var Submission = /*#__PURE__*/function () {
42
43
  /**
@@ -53,25 +54,26 @@ var Submission = /*#__PURE__*/function () {
53
54
  * @param state {module:model/SubmissionState} `pending` until the PDF has been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no PDF: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the PDF failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`.
54
55
  * @param test {Boolean} Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions.
55
56
  * @param editable {Boolean} `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`.
56
- * @param data {Object.<String, Object>} The submission's data, with the values entered in completed signature requests. Lists leave it out (null) unless you pass `include_data=true`. Empty once the submission has expired.
57
+ * @param data {Object.<String, Object>} The submission's data, with the values entered in completed signature requests. Empty once the submission has expired. Null in a batch's submissions unless you pass `include_data=true`, and in the events of a webhook that leaves out submission data.
57
58
  * @param data_errors {Array.<module:model/ErrorDetail>} Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired.
58
59
  * @param error_message {String} Why the PDF couldn't be generated, when `state` is `error`.
59
- * @param metadata {Object.<String, Object>} Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
60
- * @param has_password {Boolean} Whether the PDF needs a password to open (`password`).
61
- * @param signature_requests {Array.<module:model/SignatureRequest>} The people asked to sign the submission (and fill in their fields), in order.
62
- * @param actions {Array.<module:model/SubmissionAction>} The uploads of the submission's PDF to your storage (account integrations).
63
- * @param truncated_text {Object.<String, Array.<String>>} The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired.
64
- * @param files {module:model/SubmissionFiles} The generated files: `pdf` once the submission has been processed, `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired.
65
- * @param preview_generated_at {Date} When the preview PDF was generated. Null if there is no preview.
60
+ * @param metadata {Object.<String, Object>} 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`).
61
+ * @param files {module:model/SubmissionFiles} The generated files: `pdf` once the submission has been processed, `png` (the images of the PDF's pages, when `output_formats` has it: `files.png.pages[0]` is page 1), `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired.
66
62
  * @param expired {Boolean} An expired submission's data, metadata, password and PDF have been deleted.
67
63
  * @param expires_at {Date} When the submission expires. Null if it's kept until you delete it.
68
64
  * @param processed_at {Date} When the PDF was generated. Null until then.
69
65
  * @param created_at {Date} When the submission was created.
70
66
  * @param updated_at {Date} When the submission was last updated.
67
+ * @param has_password {Boolean} Whether the PDF needs a password to open (`password`).
68
+ * @param signature_requests {Array.<module:model/SignatureRequest>} The people asked to sign the submission (and fill in their fields), in order.
69
+ * @param actions {Array.<module:model/SubmissionAction>} The uploads of the submission's PDF to your storage (account integrations).
70
+ * @param truncated_text {Object.<String, Array.<String>>} The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired.
71
+ * @param output_formats {Array.<module:model/OutputFormat>} What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
72
+ * @param preview_generated_at {Date} When the preview PDF was generated. Null if there is no preview.
71
73
  */
72
- function Submission(id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, has_password, signature_requests, actions, truncated_text, files, preview_generated_at, expired, expires_at, processed_at, created_at, updated_at) {
74
+ function Submission(id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, files, expired, expires_at, processed_at, created_at, updated_at, has_password, signature_requests, actions, truncated_text, output_formats, preview_generated_at) {
73
75
  _classCallCheck(this, Submission);
74
- Submission.initialize(this, id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, has_password, signature_requests, actions, truncated_text, files, preview_generated_at, expired, expires_at, processed_at, created_at, updated_at);
76
+ Submission.initialize(this, id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, files, expired, expires_at, processed_at, created_at, updated_at, has_password, signature_requests, actions, truncated_text, output_formats, preview_generated_at);
75
77
  }
76
78
 
77
79
  /**
@@ -81,7 +83,7 @@ var Submission = /*#__PURE__*/function () {
81
83
  */
82
84
  return _createClass(Submission, null, [{
83
85
  key: "initialize",
84
- value: function initialize(obj, id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, has_password, signature_requests, actions, truncated_text, files, preview_generated_at, expired, expires_at, processed_at, created_at, updated_at) {
86
+ value: function initialize(obj, id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, files, expired, expires_at, processed_at, created_at, updated_at, has_password, signature_requests, actions, truncated_text, output_formats, preview_generated_at) {
85
87
  obj['id'] = id;
86
88
  obj['template_id'] = template_id;
87
89
  obj['template_type'] = template_type;
@@ -95,17 +97,18 @@ var Submission = /*#__PURE__*/function () {
95
97
  obj['data_errors'] = data_errors;
96
98
  obj['error_message'] = error_message;
97
99
  obj['metadata'] = metadata;
98
- obj['has_password'] = has_password;
99
- obj['signature_requests'] = signature_requests;
100
- obj['actions'] = actions;
101
- obj['truncated_text'] = truncated_text;
102
100
  obj['files'] = files;
103
- obj['preview_generated_at'] = preview_generated_at;
104
101
  obj['expired'] = expired;
105
102
  obj['expires_at'] = expires_at;
106
103
  obj['processed_at'] = processed_at;
107
104
  obj['created_at'] = created_at;
108
105
  obj['updated_at'] = updated_at;
106
+ obj['has_password'] = has_password;
107
+ obj['signature_requests'] = signature_requests;
108
+ obj['actions'] = actions;
109
+ obj['truncated_text'] = truncated_text;
110
+ obj['output_formats'] = output_formats;
111
+ obj['preview_generated_at'] = preview_generated_at;
109
112
  }
110
113
 
111
114
  /**
@@ -164,26 +167,9 @@ var Submission = /*#__PURE__*/function () {
164
167
  'String': Object
165
168
  });
166
169
  }
167
- if (data.hasOwnProperty('has_password')) {
168
- obj['has_password'] = _ApiClient["default"].convertToType(data['has_password'], 'Boolean');
169
- }
170
- if (data.hasOwnProperty('signature_requests')) {
171
- obj['signature_requests'] = _ApiClient["default"].convertToType(data['signature_requests'], [_SignatureRequest["default"]]);
172
- }
173
- if (data.hasOwnProperty('actions')) {
174
- obj['actions'] = _ApiClient["default"].convertToType(data['actions'], [_SubmissionAction["default"]]);
175
- }
176
- if (data.hasOwnProperty('truncated_text')) {
177
- obj['truncated_text'] = _ApiClient["default"].convertToType(data['truncated_text'], {
178
- 'String': ['String']
179
- });
180
- }
181
170
  if (data.hasOwnProperty('files')) {
182
171
  obj['files'] = _ApiClient["default"].convertToType(data['files'], _SubmissionFiles["default"]);
183
172
  }
184
- if (data.hasOwnProperty('preview_generated_at')) {
185
- obj['preview_generated_at'] = _ApiClient["default"].convertToType(data['preview_generated_at'], 'Date');
186
- }
187
173
  if (data.hasOwnProperty('expired')) {
188
174
  obj['expired'] = _ApiClient["default"].convertToType(data['expired'], 'Boolean');
189
175
  }
@@ -199,6 +185,26 @@ var Submission = /*#__PURE__*/function () {
199
185
  if (data.hasOwnProperty('updated_at')) {
200
186
  obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
201
187
  }
188
+ if (data.hasOwnProperty('has_password')) {
189
+ obj['has_password'] = _ApiClient["default"].convertToType(data['has_password'], 'Boolean');
190
+ }
191
+ if (data.hasOwnProperty('signature_requests')) {
192
+ obj['signature_requests'] = _ApiClient["default"].convertToType(data['signature_requests'], [_SignatureRequest["default"]]);
193
+ }
194
+ if (data.hasOwnProperty('actions')) {
195
+ obj['actions'] = _ApiClient["default"].convertToType(data['actions'], [_SubmissionAction["default"]]);
196
+ }
197
+ if (data.hasOwnProperty('truncated_text')) {
198
+ obj['truncated_text'] = _ApiClient["default"].convertToType(data['truncated_text'], {
199
+ 'String': ['String']
200
+ });
201
+ }
202
+ if (data.hasOwnProperty('output_formats')) {
203
+ obj['output_formats'] = _ApiClient["default"].convertToType(data['output_formats'], [_OutputFormat["default"]]);
204
+ }
205
+ if (data.hasOwnProperty('preview_generated_at')) {
206
+ obj['preview_generated_at'] = _ApiClient["default"].convertToType(data['preview_generated_at'], 'Date');
207
+ }
202
208
  }
203
209
  return obj;
204
210
  }
@@ -258,11 +264,15 @@ var Submission = /*#__PURE__*/function () {
258
264
  if (!Array.isArray(data['actions'])) {
259
265
  throw new Error("Expected the field `actions` to be an array in the JSON data but got " + data['actions']);
260
266
  }
267
+ // ensure the json data is an array
268
+ if (!Array.isArray(data['output_formats'])) {
269
+ throw new Error("Expected the field `output_formats` to be an array in the JSON data but got " + data['output_formats']);
270
+ }
261
271
  return true;
262
272
  }
263
273
  }]);
264
274
  }();
265
- Submission.RequiredProperties = ["id", "template_id", "template_type", "template_version", "batch_id", "source", "state", "test", "editable", "data", "data_errors", "error_message", "metadata", "has_password", "signature_requests", "actions", "truncated_text", "files", "preview_generated_at", "expired", "expires_at", "processed_at", "created_at", "updated_at"];
275
+ Submission.RequiredProperties = ["id", "template_id", "template_type", "template_version", "batch_id", "source", "state", "test", "editable", "data", "data_errors", "error_message", "metadata", "files", "expired", "expires_at", "processed_at", "created_at", "updated_at", "has_password", "signature_requests", "actions", "truncated_text", "output_formats", "preview_generated_at"];
266
276
 
267
277
  /**
268
278
  * The submission's ID.
@@ -319,7 +329,7 @@ Submission.prototype['test'] = undefined;
319
329
  Submission.prototype['editable'] = undefined;
320
330
 
321
331
  /**
322
- * The submission's data, with the values entered in completed signature requests. Lists leave it out (null) unless you pass `include_data=true`. Empty once the submission has expired.
332
+ * The submission's data, with the values entered in completed signature requests. Empty once the submission has expired. Null in a batch's submissions unless you pass `include_data=true`, and in the events of a webhook that leaves out submission data.
323
333
  * @member {Object.<String, Object>} data
324
334
  */
325
335
  Submission.prototype['data'] = undefined;
@@ -337,47 +347,17 @@ Submission.prototype['data_errors'] = undefined;
337
347
  Submission.prototype['error_message'] = undefined;
338
348
 
339
349
  /**
340
- * Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
350
+ * 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`).
341
351
  * @member {Object.<String, Object>} metadata
342
352
  */
343
353
  Submission.prototype['metadata'] = undefined;
344
354
 
345
355
  /**
346
- * Whether the PDF needs a password to open (`password`).
347
- * @member {Boolean} has_password
348
- */
349
- Submission.prototype['has_password'] = undefined;
350
-
351
- /**
352
- * The people asked to sign the submission (and fill in their fields), in order.
353
- * @member {Array.<module:model/SignatureRequest>} signature_requests
354
- */
355
- Submission.prototype['signature_requests'] = undefined;
356
-
357
- /**
358
- * The uploads of the submission's PDF to your storage (account integrations).
359
- * @member {Array.<module:model/SubmissionAction>} actions
360
- */
361
- Submission.prototype['actions'] = undefined;
362
-
363
- /**
364
- * The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired.
365
- * @member {Object.<String, Array.<String>>} truncated_text
366
- */
367
- Submission.prototype['truncated_text'] = undefined;
368
-
369
- /**
370
- * The generated files: `pdf` once the submission has been processed, `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired.
356
+ * The generated files: `pdf` once the submission has been processed, `png` (the images of the PDF's pages, when `output_formats` has it: `files.png.pages[0]` is page 1), `audit_trail` once its signature requests are completed, and `preview` once a preview PDF has been generated. Empty once the submission has expired.
371
357
  * @member {module:model/SubmissionFiles} files
372
358
  */
373
359
  Submission.prototype['files'] = undefined;
374
360
 
375
- /**
376
- * When the preview PDF was generated. Null if there is no preview.
377
- * @member {Date} preview_generated_at
378
- */
379
- Submission.prototype['preview_generated_at'] = undefined;
380
-
381
361
  /**
382
362
  * An expired submission's data, metadata, password and PDF have been deleted.
383
363
  * @member {Boolean} expired
@@ -407,4 +387,40 @@ Submission.prototype['created_at'] = undefined;
407
387
  * @member {Date} updated_at
408
388
  */
409
389
  Submission.prototype['updated_at'] = undefined;
390
+
391
+ /**
392
+ * Whether the PDF needs a password to open (`password`).
393
+ * @member {Boolean} has_password
394
+ */
395
+ Submission.prototype['has_password'] = undefined;
396
+
397
+ /**
398
+ * The people asked to sign the submission (and fill in their fields), in order.
399
+ * @member {Array.<module:model/SignatureRequest>} signature_requests
400
+ */
401
+ Submission.prototype['signature_requests'] = undefined;
402
+
403
+ /**
404
+ * The uploads of the submission's PDF to your storage (account integrations).
405
+ * @member {Array.<module:model/SubmissionAction>} actions
406
+ */
407
+ Submission.prototype['actions'] = undefined;
408
+
409
+ /**
410
+ * The text of each field that didn't fit in it, by field name. Left out (null) with `data`, and empty once the submission has expired.
411
+ * @member {Object.<String, Array.<String>>} truncated_text
412
+ */
413
+ Submission.prototype['truncated_text'] = undefined;
414
+
415
+ /**
416
+ * What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
417
+ * @member {Array.<module:model/OutputFormat>} output_formats
418
+ */
419
+ Submission.prototype['output_formats'] = undefined;
420
+
421
+ /**
422
+ * When the preview PDF was generated. Null if there is no preview.
423
+ * @member {Date} preview_generated_at
424
+ */
425
+ Submission.prototype['preview_generated_at'] = undefined;
410
426
  var _default = exports["default"] = Submission;
@@ -31,7 +31,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
31
31
  /**
32
32
  * The SubmissionAction model module.
33
33
  * @module model/SubmissionAction
34
- * @version 4.0.0
34
+ * @version 4.2.0
35
35
  */
36
36
  var SubmissionAction = /*#__PURE__*/function () {
37
37
  /**
@@ -31,7 +31,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
31
31
  /**
32
32
  * The SubmissionBatch model module.
33
33
  * @module model/SubmissionBatch
34
- * @version 4.0.0
34
+ * @version 4.2.0
35
35
  */
36
36
  var SubmissionBatch = /*#__PURE__*/function () {
37
37
  /**
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _GeneratedFile = _interopRequireDefault(require("./GeneratedFile"));
9
+ var _PageImages = _interopRequireDefault(require("./PageImages"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
11
12
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -27,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
27
28
  /**
28
29
  * The SubmissionFiles model module.
29
30
  * @module model/SubmissionFiles
30
- * @version 4.0.0
31
+ * @version 4.2.0
31
32
  */
32
33
  var SubmissionFiles = /*#__PURE__*/function () {
33
34
  /**
@@ -72,6 +73,9 @@ var SubmissionFiles = /*#__PURE__*/function () {
72
73
  if (data.hasOwnProperty('preview')) {
73
74
  obj['preview'] = _ApiClient["default"].convertToType(data['preview'], _GeneratedFile["default"]);
74
75
  }
76
+ if (data.hasOwnProperty('png')) {
77
+ obj['png'] = data['png'] === null ? null : _PageImages["default"].constructFromObject(data['png']);
78
+ }
75
79
  }
76
80
  return obj;
77
81
  }
@@ -105,4 +109,9 @@ SubmissionFiles.prototype['audit_trail'] = undefined;
105
109
  * @member {module:model/GeneratedFile} preview
106
110
  */
107
111
  SubmissionFiles.prototype['preview'] = undefined;
112
+
113
+ /**
114
+ * @member {module:model/PageImages} png
115
+ */
116
+ SubmissionFiles.prototype['png'] = undefined;
108
117
  var _default = exports["default"] = SubmissionFiles;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _FieldOverride = _interopRequireDefault(require("./FieldOverride"));
9
+ var _OutputFormat = _interopRequireDefault(require("./OutputFormat"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
11
12
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -27,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
27
28
  /**
28
29
  * The SubmissionInput model module.
29
30
  * @module model/SubmissionInput
30
- * @version 4.0.0
31
+ * @version 4.2.0
31
32
  */
32
33
  var SubmissionInput = /*#__PURE__*/function () {
33
34
  /**
@@ -80,6 +81,9 @@ var SubmissionInput = /*#__PURE__*/function () {
80
81
  if (data.hasOwnProperty('password')) {
81
82
  obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
82
83
  }
84
+ if (data.hasOwnProperty('output_formats')) {
85
+ obj['output_formats'] = _ApiClient["default"].convertToType(data['output_formats'], [_OutputFormat["default"]]);
86
+ }
83
87
  if (data.hasOwnProperty('expires_in')) {
84
88
  obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
85
89
  }
@@ -116,6 +120,10 @@ var SubmissionInput = /*#__PURE__*/function () {
116
120
  if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
117
121
  throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
118
122
  }
123
+ // ensure the json data is an array
124
+ if (!Array.isArray(data['output_formats'])) {
125
+ throw new Error("Expected the field `output_formats` to be an array in the JSON data but got " + data['output_formats']);
126
+ }
119
127
  // ensure the json data is a string
120
128
  if (data['html'] && !(typeof data['html'] === 'string' || data['html'] instanceof String)) {
121
129
  throw new Error("Expected the field `html` to be a primitive type in the JSON string but got " + data['html']);
@@ -155,7 +163,7 @@ SubmissionInput.prototype['editable'] = undefined;
155
163
  SubmissionInput.prototype['data'] = undefined;
156
164
 
157
165
  /**
158
- * Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
166
+ * 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`).
159
167
  * @member {Object.<String, Object>} metadata
160
168
  */
161
169
  SubmissionInput.prototype['metadata'] = undefined;
@@ -166,6 +174,12 @@ SubmissionInput.prototype['metadata'] = undefined;
166
174
  */
167
175
  SubmissionInput.prototype['password'] = undefined;
168
176
 
177
+ /**
178
+ * What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
179
+ * @member {Array.<module:model/OutputFormat>} output_formats
180
+ */
181
+ SubmissionInput.prototype['output_formats'] = undefined;
182
+
169
183
  /**
170
184
  * Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours.
171
185
  * @member {Number} expires_in
@@ -185,7 +199,7 @@ SubmissionInput.prototype['field_overrides'] = undefined;
185
199
  SubmissionInput.prototype['html'] = undefined;
186
200
 
187
201
  /**
188
- * For an HTML template, CSS to use instead of the template's.
202
+ * 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.
189
203
  * @member {String} css
190
204
  */
191
205
  SubmissionInput.prototype['css'] = undefined;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _Submission = _interopRequireDefault(require("./Submission"));
8
+ var _SubmissionSummary = _interopRequireDefault(require("./SubmissionSummary"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
10
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
11
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The SubmissionList model module.
32
32
  * @module model/SubmissionList
33
- * @version 4.0.0
33
+ * @version 4.2.0
34
34
  */
35
35
  var SubmissionList = /*#__PURE__*/function () {
36
36
  /**
@@ -38,7 +38,7 @@ var SubmissionList = /*#__PURE__*/function () {
38
38
  * A page of submissions, newest first.
39
39
  * @alias module:model/SubmissionList
40
40
  * @extends Object
41
- * @param data {Array.<module:model/Submission>} The items on this page.
41
+ * @param data {Array.<module:model/SubmissionSummary>} The items on this page.
42
42
  * @param next_cursor {String} Pass it as `cursor` to get the next page. Null on the last page.
43
43
  */
44
44
  function SubmissionList(data, next_cursor) {
@@ -72,7 +72,7 @@ var SubmissionList = /*#__PURE__*/function () {
72
72
  obj = obj || new SubmissionList();
73
73
  _ApiClient["default"].constructFromObject(data, obj, 'Object');
74
74
  if (data.hasOwnProperty('data')) {
75
- obj['data'] = _ApiClient["default"].convertToType(data['data'], [_Submission["default"]]);
75
+ obj['data'] = _ApiClient["default"].convertToType(data['data'], [_SubmissionSummary["default"]]);
76
76
  }
77
77
  if (data.hasOwnProperty('next_cursor')) {
78
78
  obj['next_cursor'] = _ApiClient["default"].convertToType(data['next_cursor'], 'String');
@@ -120,7 +120,7 @@ SubmissionList.RequiredProperties = ["data", "next_cursor"];
120
120
 
121
121
  /**
122
122
  * The items on this page.
123
- * @member {Array.<module:model/Submission>} data
123
+ * @member {Array.<module:model/SubmissionSummary>} data
124
124
  */
125
125
  SubmissionList.prototype['data'] = undefined;
126
126
 
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The SubmissionSourcePdf model module.
31
31
  * @module model/SubmissionSourcePdf
32
- * @version 4.0.0
32
+ * @version 4.2.0
33
33
  */
34
34
  var SubmissionSourcePdf = /*#__PURE__*/function () {
35
35
  /**