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.
- package/AGENTS.md +3 -2
- package/README.md +13 -1
- package/dist/ApiClient.js +2 -2
- package/dist/RequestSchemas.js +1231 -9
- package/dist/WebhookSignature.js +86 -0
- package/dist/api/Client.js +620 -38
- package/dist/index.js +238 -0
- package/dist/model/AddTemplateFieldsRequest.js +132 -0
- package/dist/model/AuthenticationCheck.js +1 -1
- package/dist/model/CombinedPdf.js +3 -3
- package/dist/model/CombinedPdfFiles.js +1 -1
- package/dist/model/CombinedPdfList.js +1 -1
- package/dist/model/CombinedPdfSource.js +1 -1
- package/dist/model/CombinedPdfSourceInput.js +1 -1
- package/dist/model/CombinedPdfSourcePdf.js +1 -1
- package/dist/model/CopyTemplateRequest.js +1 -1
- package/dist/model/CreateCombinedPdfRequest.js +2 -2
- package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
- package/dist/model/CreateFolderRequest.js +1 -1
- package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
- package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
- package/dist/model/CreateSubmissionBatchRequest.js +15 -1
- package/dist/model/CreateSubmissionRequest.js +17 -3
- package/dist/model/CreateTemplatePreviewRequest.js +112 -0
- package/dist/model/CreateTemplateRequest.js +81 -4
- package/dist/model/CreateWebhookRequest.js +1 -1
- package/dist/model/CustomFile.js +1 -1
- package/dist/model/CustomFileList.js +1 -1
- package/dist/model/CustomFileSourcePdf.js +1 -1
- package/dist/model/ErrorCode.js +11 -1
- package/dist/model/ErrorDetail.js +2 -2
- package/dist/model/ErrorInfo.js +6 -6
- package/dist/model/ErrorResponse.js +1 -1
- package/dist/model/Field.js +1230 -0
- package/dist/model/FieldComparisonCondition.js +1 -1
- package/dist/model/FieldDependency.js +154 -0
- package/dist/model/FieldDependencyInput.js +154 -0
- package/dist/model/FieldEqualsCondition.js +1 -1
- package/dist/model/FieldGroup.js +206 -0
- package/dist/model/FieldGroupInput.js +180 -0
- package/dist/model/FieldGroupType.js +59 -0
- package/dist/model/FieldInCondition.js +1 -1
- package/dist/model/FieldInput.js +1012 -0
- package/dist/model/FieldOverride.js +1 -1
- package/dist/model/FieldPresenceCondition.js +1 -1
- package/dist/model/FieldRangeCondition.js +1 -1
- package/dist/model/FieldType.js +124 -0
- package/dist/model/Folder.js +1 -1
- package/dist/model/FolderList.js +1 -1
- package/dist/model/GenerateFilesFormat.js +54 -0
- package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
- package/dist/model/GeneratedFile.js +1 -1
- package/dist/model/HtmlEngineOptions.js +1 -1
- package/dist/model/HtmlEngineOptionsInput.js +1 -1
- package/dist/model/MoveFolderRequest.js +1 -1
- package/dist/model/MoveTemplateRequest.js +1 -1
- package/dist/model/OutputFormat.js +59 -0
- package/dist/model/PageImage.js +220 -0
- package/dist/model/PageImages.js +155 -0
- package/dist/model/PredefinedField.js +183 -0
- package/dist/model/PredefinedFieldInput.js +183 -0
- package/dist/model/PublishTemplateVersionRequest.js +1 -1
- package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
- package/dist/model/RenameFolderRequest.js +1 -1
- package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
- package/dist/model/RestoreTemplateVersionRequest.js +1 -1
- package/dist/model/SignatureRequest.js +1 -1
- package/dist/model/SignatureRequestEvent.js +1 -1
- package/dist/model/SignatureRequestInput.js +1 -1
- package/dist/model/SignatureRequestToken.js +1 -1
- package/dist/model/Submission.js +84 -68
- package/dist/model/SubmissionAction.js +1 -1
- package/dist/model/SubmissionBatch.js +1 -1
- package/dist/model/SubmissionFiles.js +10 -1
- package/dist/model/SubmissionInput.js +17 -3
- package/dist/model/SubmissionList.js +5 -5
- package/dist/model/SubmissionSourcePdf.js +1 -1
- package/dist/model/SubmissionSummary.js +343 -0
- package/dist/model/SubmissionValidation.js +151 -0
- package/dist/model/Template.js +129 -56
- package/dist/model/TemplateActor.js +3 -3
- package/dist/model/TemplateDefaults.js +1 -1
- package/dist/model/TemplateDefaultsInput.js +1 -1
- package/dist/model/TemplateDiff.js +206 -0
- package/dist/model/TemplateDiffSummary.js +165 -0
- package/dist/model/TemplateDocument.js +36 -36
- package/dist/model/TemplateDocumentState.js +11 -1
- package/dist/model/TemplateDocumentSummary.js +152 -0
- package/dist/model/TemplateFieldChange.js +146 -0
- package/dist/model/TemplateFieldChanges.js +196 -0
- package/dist/model/TemplateFieldDependency.js +3 -3
- package/dist/model/TemplateFieldDependencyCondition.js +1 -1
- package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
- package/dist/model/TemplateFieldDependencyInput.js +3 -3
- package/dist/model/TemplateFieldMove.js +132 -0
- package/dist/model/TemplateFields.js +147 -0
- package/dist/model/TemplateModelCode.js +1 -1
- package/dist/model/TemplatePageImages.js +158 -0
- package/dist/model/TemplatePageProcessingStatus.js +1 -1
- package/dist/model/TemplatePreview.js +211 -0
- package/dist/model/TemplatePreviewState.js +64 -0
- package/dist/model/TemplateSourcePdf.js +1 -1
- package/dist/model/TemplateSummary.js +14 -288
- package/dist/model/TemplateSummaryList.js +1 -1
- package/dist/model/TemplateVersion.js +1 -1
- package/dist/model/UpdateSignatureRequestRequest.js +1 -1
- package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
- package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
- package/dist/model/UpdateTemplateRequest.js +84 -2
- package/dist/model/UpdateWebhookRequest.js +1 -1
- package/dist/model/UploadPresign.js +1 -1
- package/dist/model/UrlSourcePdf.js +1 -1
- package/dist/model/ValidateSubmissionRequest.js +226 -0
- package/dist/model/Webhook.js +1 -1
- package/dist/model/WebhookList.js +1 -1
- 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
|
|
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.
|
|
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
|
|
51
|
-
* @param document {module:model/
|
|
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,
|
|
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,
|
|
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,
|
|
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'],
|
|
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
|
-
|
|
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", "
|
|
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
|
|
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/
|
|
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.
|
|
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.
|
|
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.
|
|
31
|
+
* @version 4.2.0
|
|
32
32
|
*/
|
|
33
33
|
var UpdateSignatureRequestRequest = /*#__PURE__*/function () {
|
|
34
34
|
/**
|
|
@@ -7,9 +7,6 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
9
|
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); }
|
|
10
|
-
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; } } }; }
|
|
11
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
10
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
11
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
12
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -29,18 +26,17 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
26
|
/**
|
|
30
27
|
* The UpdateTemplateDocumentRequest model module.
|
|
31
28
|
* @module model/UpdateTemplateDocumentRequest
|
|
32
|
-
* @version 4.
|
|
29
|
+
* @version 4.2.0
|
|
33
30
|
*/
|
|
34
31
|
var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
|
|
35
32
|
/**
|
|
36
33
|
* Constructs a new <code>UpdateTemplateDocumentRequest</code>.
|
|
37
|
-
* The new PDF
|
|
34
|
+
* The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
|
|
38
35
|
* @alias module:model/UpdateTemplateDocumentRequest
|
|
39
|
-
* @param cache_id {String} The `fields.key` of the new PDF, uploaded with the presigned upload (GET /uploads/presign).
|
|
40
36
|
*/
|
|
41
|
-
function UpdateTemplateDocumentRequest(
|
|
37
|
+
function UpdateTemplateDocumentRequest() {
|
|
42
38
|
_classCallCheck(this, UpdateTemplateDocumentRequest);
|
|
43
|
-
UpdateTemplateDocumentRequest.initialize(this
|
|
39
|
+
UpdateTemplateDocumentRequest.initialize(this);
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
/**
|
|
@@ -50,9 +46,7 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
|
|
|
50
46
|
*/
|
|
51
47
|
return _createClass(UpdateTemplateDocumentRequest, null, [{
|
|
52
48
|
key: "initialize",
|
|
53
|
-
value: function initialize(obj
|
|
54
|
-
obj['cache_id'] = cache_id;
|
|
55
|
-
}
|
|
49
|
+
value: function initialize(obj) {}
|
|
56
50
|
|
|
57
51
|
/**
|
|
58
52
|
* Constructs a <code>UpdateTemplateDocumentRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
@@ -69,6 +63,12 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
|
|
|
69
63
|
if (data.hasOwnProperty('cache_id')) {
|
|
70
64
|
obj['cache_id'] = _ApiClient["default"].convertToType(data['cache_id'], 'String');
|
|
71
65
|
}
|
|
66
|
+
if (data.hasOwnProperty('document_url')) {
|
|
67
|
+
obj['document_url'] = _ApiClient["default"].convertToType(data['document_url'], 'String');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('document_base64')) {
|
|
70
|
+
obj['document_base64'] = _ApiClient["default"].convertToType(data['document_base64'], 'String');
|
|
71
|
+
}
|
|
72
72
|
if (data.hasOwnProperty('filename')) {
|
|
73
73
|
obj['filename'] = _ApiClient["default"].convertToType(data['filename'], 'String');
|
|
74
74
|
}
|
|
@@ -87,26 +87,19 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
|
|
|
87
87
|
}, {
|
|
88
88
|
key: "validateJSON",
|
|
89
89
|
value: function validateJSON(data) {
|
|
90
|
-
//
|
|
91
|
-
var _iterator = _createForOfIteratorHelper(UpdateTemplateDocumentRequest.RequiredProperties),
|
|
92
|
-
_step;
|
|
93
|
-
try {
|
|
94
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
95
|
-
var property = _step.value;
|
|
96
|
-
if (!data.hasOwnProperty(property)) {
|
|
97
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
// ensure the json data is a string
|
|
101
|
-
} catch (err) {
|
|
102
|
-
_iterator.e(err);
|
|
103
|
-
} finally {
|
|
104
|
-
_iterator.f();
|
|
105
|
-
}
|
|
90
|
+
// ensure the json data is a string
|
|
106
91
|
if (data['cache_id'] && !(typeof data['cache_id'] === 'string' || data['cache_id'] instanceof String)) {
|
|
107
92
|
throw new Error("Expected the field `cache_id` to be a primitive type in the JSON string but got " + data['cache_id']);
|
|
108
93
|
}
|
|
109
94
|
// ensure the json data is a string
|
|
95
|
+
if (data['document_url'] && !(typeof data['document_url'] === 'string' || data['document_url'] instanceof String)) {
|
|
96
|
+
throw new Error("Expected the field `document_url` to be a primitive type in the JSON string but got " + data['document_url']);
|
|
97
|
+
}
|
|
98
|
+
// ensure the json data is a string
|
|
99
|
+
if (data['document_base64'] && !(typeof data['document_base64'] === 'string' || data['document_base64'] instanceof String)) {
|
|
100
|
+
throw new Error("Expected the field `document_base64` to be a primitive type in the JSON string but got " + data['document_base64']);
|
|
101
|
+
}
|
|
102
|
+
// ensure the json data is a string
|
|
110
103
|
if (data['filename'] && !(typeof data['filename'] === 'string' || data['filename'] instanceof String)) {
|
|
111
104
|
throw new Error("Expected the field `filename` to be a primitive type in the JSON string but got " + data['filename']);
|
|
112
105
|
}
|
|
@@ -114,8 +107,6 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
|
|
|
114
107
|
}
|
|
115
108
|
}]);
|
|
116
109
|
}();
|
|
117
|
-
UpdateTemplateDocumentRequest.RequiredProperties = ["cache_id"];
|
|
118
|
-
|
|
119
110
|
/**
|
|
120
111
|
* The `fields.key` of the new PDF, uploaded with the presigned upload (GET /uploads/presign).
|
|
121
112
|
* @member {String} cache_id
|
|
@@ -123,7 +114,19 @@ UpdateTemplateDocumentRequest.RequiredProperties = ["cache_id"];
|
|
|
123
114
|
UpdateTemplateDocumentRequest.prototype['cache_id'] = undefined;
|
|
124
115
|
|
|
125
116
|
/**
|
|
126
|
-
*
|
|
117
|
+
* An https:// link to the template's PDF (up to 100 MB), instead of `cache_id`. DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then (sync.api hosts wait for it). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why.
|
|
118
|
+
* @member {String} document_url
|
|
119
|
+
*/
|
|
120
|
+
UpdateTemplateDocumentRequest.prototype['document_url'] = undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The template's PDF, encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`.
|
|
124
|
+
* @member {String} document_base64
|
|
125
|
+
*/
|
|
126
|
+
UpdateTemplateDocumentRequest.prototype['document_base64'] = undefined;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The PDF's file name, for a `cache_id` (presigned uploads don't send one) or `document_base64`. A `document_url`'s is the last part of its path unless you set it.
|
|
127
130
|
* @member {String} filename
|
|
128
131
|
*/
|
|
129
132
|
UpdateTemplateDocumentRequest.prototype['filename'] = undefined;
|