docspring 4.4.0 → 4.5.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 +2 -0
- package/LICENSE +1 -1
- package/README.md +4 -1
- package/dist/ApiClient.js +2 -2
- package/dist/RequestSchemas.js +65 -10
- package/dist/api/Client.js +101 -98
- package/dist/index.js +14 -0
- package/dist/model/AddTemplateFieldsRequest.js +1 -1
- package/dist/model/AuthenticationCheck.js +1 -1
- package/dist/model/CombinedPdf.js +1 -1
- 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/CreateAccountEmailActionRequest.js +1 -1
- package/dist/model/CreateCombinedPdfRequest.js +1 -1
- package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
- package/dist/model/CreateEmailActionRequest.js +1 -1
- package/dist/model/CreateEmailDomainRequest.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 +1 -1
- package/dist/model/CreateSubmissionRequest.js +4 -4
- package/dist/model/CreateTemplatePreviewRequest.js +1 -1
- package/dist/model/CreateTemplateRequest.js +47 -3
- 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/EmailAction.js +1 -1
- package/dist/model/EmailActionConditions.js +1 -1
- package/dist/model/EmailActionConditionsInput.js +1 -1
- package/dist/model/EmailActionCustomization.js +1 -1
- package/dist/model/EmailActionList.js +1 -1
- package/dist/model/EmailActionTestEmail.js +1 -1
- package/dist/model/EmailDomain.js +1 -1
- package/dist/model/EmailDomainDnsRecord.js +1 -1
- package/dist/model/EmailDomainList.js +1 -1
- package/dist/model/ErrorDetail.js +1 -1
- package/dist/model/ErrorInfo.js +30 -4
- package/dist/model/ErrorResponse.js +1 -1
- package/dist/model/Field.js +1 -1
- package/dist/model/FieldComparisonCondition.js +1 -1
- package/dist/model/FieldDependency.js +1 -1
- package/dist/model/FieldDependencyInput.js +1 -1
- package/dist/model/FieldEqualsCondition.js +1 -1
- package/dist/model/FieldGroup.js +1 -1
- package/dist/model/FieldGroupInput.js +1 -1
- package/dist/model/FieldInCondition.js +1 -1
- package/dist/model/FieldInput.js +1 -1
- package/dist/model/FieldOverride.js +1 -1
- package/dist/model/FieldPresenceCondition.js +1 -1
- package/dist/model/FieldRangeCondition.js +1 -1
- package/dist/model/Folder.js +1 -1
- package/dist/model/FolderList.js +1 -1
- package/dist/model/GenerateSubmissionFilesRequest.js +1 -1
- package/dist/model/GeneratedFile.js +1 -1
- package/dist/model/HtmlEngineOptions.js +7 -7
- package/dist/model/HtmlEngineOptionsInput.js +5 -5
- package/dist/model/MoveFolderRequest.js +1 -1
- package/dist/model/MoveTemplateRequest.js +1 -1
- package/dist/model/PageImage.js +1 -1
- package/dist/model/PageImages.js +1 -1
- package/dist/model/PredefinedField.js +1 -1
- package/dist/model/PredefinedFieldInput.js +1 -1
- package/dist/model/PublishTemplateVersionRequest.js +1 -1
- package/dist/model/RemoveTemplateFieldsRequest.js +1 -1
- package/dist/model/RenameFolderRequest.js +1 -1
- package/dist/model/ReorderTemplateFieldsRequest.js +1 -1
- package/dist/model/RestoreTemplateVersionRequest.js +1 -1
- package/dist/model/SendAccountEmailActionTestEmailRequest.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/SignatureRequestReminders.js +1 -1
- package/dist/model/SignatureRequestToken.js +1 -1
- package/dist/model/Submission.js +1 -1
- package/dist/model/SubmissionAction.js +1 -1
- package/dist/model/SubmissionBatch.js +1 -1
- package/dist/model/SubmissionFiles.js +1 -1
- package/dist/model/SubmissionInput.js +2 -2
- package/dist/model/SubmissionList.js +1 -1
- package/dist/model/SubmissionSourcePdf.js +1 -1
- package/dist/model/SubmissionSummary.js +1 -1
- package/dist/model/SubmissionValidation.js +1 -1
- package/dist/model/Template.js +66 -9
- package/dist/model/TemplateActor.js +1 -1
- package/dist/model/TemplateDefaults.js +1 -1
- package/dist/model/TemplateDefaultsInput.js +1 -1
- package/dist/model/TemplateDiff.js +1 -1
- package/dist/model/TemplateDiffSummary.js +1 -1
- package/dist/model/TemplateDocument.js +1 -1
- package/dist/model/TemplateDocumentSummary.js +1 -1
- package/dist/model/TemplateFieldChange.js +1 -1
- package/dist/model/TemplateFieldChanges.js +1 -1
- package/dist/model/TemplateFieldDependency.js +1 -1
- package/dist/model/TemplateFieldDependencyCondition.js +1 -1
- package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
- package/dist/model/TemplateFieldDependencyInput.js +1 -1
- package/dist/model/TemplateFieldMove.js +1 -1
- package/dist/model/TemplateFields.js +1 -1
- package/dist/model/TemplateFormSection.js +161 -0
- package/dist/model/TemplateFormSectionInput.js +157 -0
- package/dist/model/TemplateModelCode.js +1 -1
- package/dist/model/TemplatePageImages.js +1 -1
- package/dist/model/TemplatePageProcessingStatus.js +1 -1
- package/dist/model/TemplatePreview.js +1 -1
- package/dist/model/TemplateSourcePdf.js +1 -1
- package/dist/model/TemplateSummary.js +1 -1
- package/dist/model/TemplateSummaryList.js +1 -1
- package/dist/model/TemplateVersion.js +1 -1
- package/dist/model/UpdateAccountEmailActionRequest.js +1 -1
- package/dist/model/UpdateEmailActionCustomizationRequest.js +1 -1
- package/dist/model/UpdateEmailActionRequest.js +1 -1
- package/dist/model/UpdateSignatureRequestRequest.js +1 -1
- package/dist/model/UpdateTemplateDocumentRequest.js +1 -1
- package/dist/model/UpdateTemplateFieldsRequest.js +1 -1
- package/dist/model/UpdateTemplateRequest.js +75 -9
- 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 +4 -4
- package/dist/model/Webhook.js +1 -1
- package/dist/model/WebhookList.js +1 -1
- package/package.json +1 -1
package/dist/model/Template.js
CHANGED
|
@@ -17,6 +17,7 @@ var _TemplateDefaults = _interopRequireDefault(require("./TemplateDefaults"));
|
|
|
17
17
|
var _TemplateDocument = _interopRequireDefault(require("./TemplateDocument"));
|
|
18
18
|
var _TemplateFieldDependency = _interopRequireDefault(require("./TemplateFieldDependency"));
|
|
19
19
|
var _TemplateFormMode = _interopRequireDefault(require("./TemplateFormMode"));
|
|
20
|
+
var _TemplateFormSection = _interopRequireDefault(require("./TemplateFormSection"));
|
|
20
21
|
var _TemplateType = _interopRequireDefault(require("./TemplateType"));
|
|
21
22
|
var _TemplateVersion = _interopRequireDefault(require("./TemplateVersion"));
|
|
22
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -43,7 +44,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
43
44
|
/**
|
|
44
45
|
* The Template model module.
|
|
45
46
|
* @module model/Template
|
|
46
|
-
* @version 4.
|
|
47
|
+
* @version 4.5.0
|
|
47
48
|
*/
|
|
48
49
|
var Template = /*#__PURE__*/function () {
|
|
49
50
|
/**
|
|
@@ -73,7 +74,7 @@ var Template = /*#__PURE__*/function () {
|
|
|
73
74
|
* @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.
|
|
74
75
|
* @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). Only PDF templates have a visual form, so other templates accept only `web`.
|
|
75
76
|
* @param editable_submissions {Boolean} Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
|
|
76
|
-
* @param embed_domains {Array.<String>} 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), without a path. 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
|
|
77
|
+
* @param embed_domains {Array.<String>} 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), without a path. Each one is stored in lowercase, without a trailing slash. 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 Web Forms JS) aren't restricted.
|
|
77
78
|
* @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).
|
|
78
79
|
* @param embed_edit_allow_versioning {Boolean} Allow the embedded template editor to publish, restore, compare and delete published versions.
|
|
79
80
|
* @param embed_edit_allow_document_replacement {Boolean} Allow the embedded template editor to replace the template's PDF.
|
|
@@ -86,7 +87,7 @@ var Template = /*#__PURE__*/function () {
|
|
|
86
87
|
* @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 or Word template's date fields only accept YYYY-MM-DD. Date fields that include a time take RFC 3339 date-times either way.
|
|
87
88
|
* @param public_submissions {Boolean} Allow anyone with a submission's ID to download its PDF.
|
|
88
89
|
* @param public_web_form {Boolean} Allow anyone to fill in the template's web form.
|
|
89
|
-
* @param redirect_url {String} Where the web form sends people after they submit it.
|
|
90
|
+
* @param redirect_url {String} Where the web form sends people after they submit it, instead of showing its success screen. After its `?` or `#`, it can have variables such as `{{ data.first_name }}`, which the form fills in with what they submitted.
|
|
90
91
|
* @param signature_request_email_attachments {module:model/SignatureRequestEmailAttachments} How DocSpring's completed emails send the signed PDF to your signers and CCs: `attachment` (attached, or a download link when it's too big to attach) or `link` (a download link). Null uses your account's rule: a link if your account has signed a BAA, otherwise attached. PDF templates only. A signature request uses the value it had when the request was created.
|
|
91
92
|
* @param signature_request_from_address {String} The address DocSpring's emails to your signers come from: an address at one of your verified email domains, on the Growth plan or higher. Null sends them from DocSpring's shared address, with "via DocSpring" after the sender name. PDF templates only.
|
|
92
93
|
* @param signature_request_include_signing_token {Boolean} Puts a signing token in `signature_request_signing_url`, as `{{ token_id }}` and `{{ token_secret }}`, so your page can open the signing form without creating a token itself. The email then carries a credential: anyone who has it can open the form and sign. PDF templates only.
|
|
@@ -94,11 +95,15 @@ var Template = /*#__PURE__*/function () {
|
|
|
94
95
|
* @param signature_request_notification_emails {Array.<String>} Who DocSpring tells when a signature request's document is completed or declined, or an email bounces or can't be sent: members of your DocSpring team or addresses at your verified email domains. Empty means your account's owner. A submission's `notification_emails` replaces them. PDF templates only.
|
|
95
96
|
* @param signature_request_reply_to {String} Where your signers' replies to DocSpring's emails go: a member of your DocSpring team or an address at one of your verified email domains. Null means your account's owner. A submission's `reply_to` replaces it. PDF templates only.
|
|
96
97
|
* @param signature_request_signing_url {String} A page on your own site that the button in DocSpring's email to a signer opens, instead of DocSpring's signing page: an https URL on one of your verified email domains or a subdomain of one, on the Growth plan or higher. It must include `{{ signature_request_id }}`. Your page authenticates the signer, creates a token for the signature request, and opens the signing form with it. Null links to DocSpring's signing page. PDF templates only.
|
|
98
|
+
* @param success_title {String} The title of the web form's success screen. When it's null or empty, the screen says "Thanks for filling out" and the template's name. It can have variables such as `{{ data.first_name }}`.
|
|
99
|
+
* @param success_message {String} A message under the title of the web form's success screen, as plain text. Line breaks show, and web addresses become links. It can have variables such as `{{ data.first_name }}`.
|
|
100
|
+
* @param show_fill_again_button {Boolean} Whether the web form's success screen has a "Fill out again" button, which clears the form so someone can fill it in again.
|
|
97
101
|
* @param has_slack_webhook_url {Boolean} Whether `slack_webhook_url` is set.
|
|
98
102
|
* @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.
|
|
99
103
|
* @param defaults {module:model/TemplateDefaults}
|
|
100
104
|
* @param field_dependencies {Array.<module:model/TemplateFieldDependency>} Conditional logic: each rule shows or hides its target fields, or makes them required, depending on the values of other fields.
|
|
101
105
|
* @param field_groups {Array.<module:model/FieldGroup>} The groups of the template's fields, with their settings. A field's name puts it in groups: `address/city` is in the group `address`, and `items/0/price` is in the list `items` and its items' group `items/~`.
|
|
106
|
+
* @param form_sections {Array.<module:model/TemplateFormSection>} The web form's sections, in order: Web Forms JS and the hosted web form show one section at a time. Empty when the template has none, and the web form shows all of its fields together, in the order the fields endpoint lists them. A field that no section lists (one added later) goes after the field before it in that order, in that field's section.
|
|
102
107
|
* @param predefined_fields {Array.<module:model/PredefinedField>} The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off.
|
|
103
108
|
* @param predefined_fields_sample_data {Object.<String, Object>} Sample submission data that sets `predefined_fields`: each value becomes a predefined field, with a type that fits it (`string`, `number`, `boolean`, `date`, `email` or `url`) and `required_in_template` true. Nested objects and arrays become names with `/`, such as `customer/email`. Without `predefined_fields` in the same request, it replaces them; with them, it adds to them and sets the types of the ones it has values for.
|
|
104
109
|
* @param html {String} The HTML of an HTML template, as a Liquid template. Null for other templates.
|
|
@@ -111,9 +116,9 @@ var Template = /*#__PURE__*/function () {
|
|
|
111
116
|
* @param embed_edit_token {String} The token that opens the template in the embedded template editor.
|
|
112
117
|
* @param versions {Array.<module:model/TemplateVersion>} The template's published versions, newest first (up to 100).
|
|
113
118
|
*/
|
|
114
|
-
function Template(id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, 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, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions) {
|
|
119
|
+
function Template(id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, 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, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, success_title, success_message, show_fill_again_button, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, form_sections, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions) {
|
|
115
120
|
_classCallCheck(this, Template);
|
|
116
|
-
Template.initialize(this, id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, 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, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions);
|
|
121
|
+
Template.initialize(this, id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, 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, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, success_title, success_message, show_fill_again_button, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, form_sections, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions);
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
/**
|
|
@@ -123,7 +128,7 @@ var Template = /*#__PURE__*/function () {
|
|
|
123
128
|
*/
|
|
124
129
|
return _createClass(Template, null, [{
|
|
125
130
|
key: "initialize",
|
|
126
|
-
value: function initialize(obj, id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, 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, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions) {
|
|
131
|
+
value: function initialize(obj, id, name, description, template_type, output_format, ready, document, parent_folder_id, path, latest_version, version_published_at, locked, last_changed_at, created_at, updated_at, version, 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, signature_request_email_attachments, signature_request_from_address, signature_request_include_signing_token, signature_request_from_name, signature_request_notification_emails, signature_request_reply_to, signature_request_signing_url, success_title, success_message, show_fill_again_button, has_slack_webhook_url, last_changed_by, defaults, field_dependencies, field_groups, form_sections, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data, layout, embed_edit_token, versions) {
|
|
127
132
|
obj['id'] = id;
|
|
128
133
|
obj['name'] = name;
|
|
129
134
|
obj['description'] = description;
|
|
@@ -167,11 +172,15 @@ var Template = /*#__PURE__*/function () {
|
|
|
167
172
|
obj['signature_request_notification_emails'] = signature_request_notification_emails;
|
|
168
173
|
obj['signature_request_reply_to'] = signature_request_reply_to;
|
|
169
174
|
obj['signature_request_signing_url'] = signature_request_signing_url;
|
|
175
|
+
obj['success_title'] = success_title;
|
|
176
|
+
obj['success_message'] = success_message;
|
|
177
|
+
obj['show_fill_again_button'] = show_fill_again_button;
|
|
170
178
|
obj['has_slack_webhook_url'] = has_slack_webhook_url;
|
|
171
179
|
obj['last_changed_by'] = last_changed_by;
|
|
172
180
|
obj['defaults'] = defaults;
|
|
173
181
|
obj['field_dependencies'] = field_dependencies;
|
|
174
182
|
obj['field_groups'] = field_groups;
|
|
183
|
+
obj['form_sections'] = form_sections;
|
|
175
184
|
obj['predefined_fields'] = predefined_fields;
|
|
176
185
|
obj['predefined_fields_sample_data'] = predefined_fields_sample_data;
|
|
177
186
|
obj['html'] = html;
|
|
@@ -327,6 +336,15 @@ var Template = /*#__PURE__*/function () {
|
|
|
327
336
|
if (data.hasOwnProperty('signature_request_signing_url')) {
|
|
328
337
|
obj['signature_request_signing_url'] = _ApiClient["default"].convertToType(data['signature_request_signing_url'], 'String');
|
|
329
338
|
}
|
|
339
|
+
if (data.hasOwnProperty('success_title')) {
|
|
340
|
+
obj['success_title'] = _ApiClient["default"].convertToType(data['success_title'], 'String');
|
|
341
|
+
}
|
|
342
|
+
if (data.hasOwnProperty('success_message')) {
|
|
343
|
+
obj['success_message'] = _ApiClient["default"].convertToType(data['success_message'], 'String');
|
|
344
|
+
}
|
|
345
|
+
if (data.hasOwnProperty('show_fill_again_button')) {
|
|
346
|
+
obj['show_fill_again_button'] = _ApiClient["default"].convertToType(data['show_fill_again_button'], 'Boolean');
|
|
347
|
+
}
|
|
330
348
|
if (data.hasOwnProperty('has_slack_webhook_url')) {
|
|
331
349
|
obj['has_slack_webhook_url'] = _ApiClient["default"].convertToType(data['has_slack_webhook_url'], 'Boolean');
|
|
332
350
|
}
|
|
@@ -342,6 +360,9 @@ var Template = /*#__PURE__*/function () {
|
|
|
342
360
|
if (data.hasOwnProperty('field_groups')) {
|
|
343
361
|
obj['field_groups'] = _ApiClient["default"].convertToType(data['field_groups'], [_FieldGroup["default"]]);
|
|
344
362
|
}
|
|
363
|
+
if (data.hasOwnProperty('form_sections')) {
|
|
364
|
+
obj['form_sections'] = _ApiClient["default"].convertToType(data['form_sections'], [_TemplateFormSection["default"]]);
|
|
365
|
+
}
|
|
345
366
|
if (data.hasOwnProperty('predefined_fields')) {
|
|
346
367
|
obj['predefined_fields'] = _ApiClient["default"].convertToType(data['predefined_fields'], [_PredefinedField["default"]]);
|
|
347
368
|
}
|
|
@@ -467,6 +488,14 @@ var Template = /*#__PURE__*/function () {
|
|
|
467
488
|
if (data['signature_request_signing_url'] && !(typeof data['signature_request_signing_url'] === 'string' || data['signature_request_signing_url'] instanceof String)) {
|
|
468
489
|
throw new Error("Expected the field `signature_request_signing_url` to be a primitive type in the JSON string but got " + data['signature_request_signing_url']);
|
|
469
490
|
}
|
|
491
|
+
// ensure the json data is a string
|
|
492
|
+
if (data['success_title'] && !(typeof data['success_title'] === 'string' || data['success_title'] instanceof String)) {
|
|
493
|
+
throw new Error("Expected the field `success_title` to be a primitive type in the JSON string but got " + data['success_title']);
|
|
494
|
+
}
|
|
495
|
+
// ensure the json data is a string
|
|
496
|
+
if (data['success_message'] && !(typeof data['success_message'] === 'string' || data['success_message'] instanceof String)) {
|
|
497
|
+
throw new Error("Expected the field `success_message` to be a primitive type in the JSON string but got " + data['success_message']);
|
|
498
|
+
}
|
|
470
499
|
// validate the optional field `last_changed_by`
|
|
471
500
|
if (data['last_changed_by']) {
|
|
472
501
|
// data not null
|
|
@@ -480,6 +509,10 @@ var Template = /*#__PURE__*/function () {
|
|
|
480
509
|
if (!Array.isArray(data['field_groups'])) {
|
|
481
510
|
throw new Error("Expected the field `field_groups` to be an array in the JSON data but got " + data['field_groups']);
|
|
482
511
|
}
|
|
512
|
+
// ensure the json data is an array
|
|
513
|
+
if (!Array.isArray(data['form_sections'])) {
|
|
514
|
+
throw new Error("Expected the field `form_sections` to be an array in the JSON data but got " + data['form_sections']);
|
|
515
|
+
}
|
|
483
516
|
if (data['predefined_fields']) {
|
|
484
517
|
// data not null
|
|
485
518
|
// ensure the json data is an array
|
|
@@ -534,7 +567,7 @@ var Template = /*#__PURE__*/function () {
|
|
|
534
567
|
}
|
|
535
568
|
}]);
|
|
536
569
|
}();
|
|
537
|
-
Template.RequiredProperties = ["id", "name", "description", "template_type", "output_format", "ready", "document", "parent_folder_id", "path", "latest_version", "version_published_at", "locked", "last_changed_at", "created_at", "updated_at", "version", "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", "signature_request_email_attachments", "signature_request_from_address", "signature_request_include_signing_token", "signature_request_from_name", "signature_request_notification_emails", "signature_request_reply_to", "signature_request_signing_url", "has_slack_webhook_url", "last_changed_by", "defaults", "field_dependencies", "field_groups", "predefined_fields", "predefined_fields_sample_data", "html", "scss", "header_html", "footer_html", "html_engine_options", "html_escape_data", "layout", "embed_edit_token", "versions"];
|
|
570
|
+
Template.RequiredProperties = ["id", "name", "description", "template_type", "output_format", "ready", "document", "parent_folder_id", "path", "latest_version", "version_published_at", "locked", "last_changed_at", "created_at", "updated_at", "version", "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", "signature_request_email_attachments", "signature_request_from_address", "signature_request_include_signing_token", "signature_request_from_name", "signature_request_notification_emails", "signature_request_reply_to", "signature_request_signing_url", "success_title", "success_message", "show_fill_again_button", "has_slack_webhook_url", "last_changed_by", "defaults", "field_dependencies", "field_groups", "form_sections", "predefined_fields", "predefined_fields_sample_data", "html", "scss", "header_html", "footer_html", "html_engine_options", "html_escape_data", "layout", "embed_edit_token", "versions"];
|
|
538
571
|
|
|
539
572
|
/**
|
|
540
573
|
* The template's ID.
|
|
@@ -669,7 +702,7 @@ Template.prototype['default_form_mode'] = undefined;
|
|
|
669
702
|
Template.prototype['editable_submissions'] = undefined;
|
|
670
703
|
|
|
671
704
|
/**
|
|
672
|
-
* 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), without a path. 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
|
|
705
|
+
* 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), without a path. Each one is stored in lowercase, without a trailing slash. 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 Web Forms JS) aren't restricted.
|
|
673
706
|
* @member {Array.<String>} embed_domains
|
|
674
707
|
*/
|
|
675
708
|
Template.prototype['embed_domains'] = undefined;
|
|
@@ -747,7 +780,7 @@ Template.prototype['public_submissions'] = undefined;
|
|
|
747
780
|
Template.prototype['public_web_form'] = undefined;
|
|
748
781
|
|
|
749
782
|
/**
|
|
750
|
-
* Where the web form sends people after they submit it.
|
|
783
|
+
* Where the web form sends people after they submit it, instead of showing its success screen. After its `?` or `#`, it can have variables such as `{{ data.first_name }}`, which the form fills in with what they submitted.
|
|
751
784
|
* @member {String} redirect_url
|
|
752
785
|
*/
|
|
753
786
|
Template.prototype['redirect_url'] = undefined;
|
|
@@ -794,6 +827,24 @@ Template.prototype['signature_request_reply_to'] = undefined;
|
|
|
794
827
|
*/
|
|
795
828
|
Template.prototype['signature_request_signing_url'] = undefined;
|
|
796
829
|
|
|
830
|
+
/**
|
|
831
|
+
* The title of the web form's success screen. When it's null or empty, the screen says "Thanks for filling out" and the template's name. It can have variables such as `{{ data.first_name }}`.
|
|
832
|
+
* @member {String} success_title
|
|
833
|
+
*/
|
|
834
|
+
Template.prototype['success_title'] = undefined;
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* A message under the title of the web form's success screen, as plain text. Line breaks show, and web addresses become links. It can have variables such as `{{ data.first_name }}`.
|
|
838
|
+
* @member {String} success_message
|
|
839
|
+
*/
|
|
840
|
+
Template.prototype['success_message'] = undefined;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Whether the web form's success screen has a "Fill out again" button, which clears the form so someone can fill it in again.
|
|
844
|
+
* @member {Boolean} show_fill_again_button
|
|
845
|
+
*/
|
|
846
|
+
Template.prototype['show_fill_again_button'] = undefined;
|
|
847
|
+
|
|
797
848
|
/**
|
|
798
849
|
* Whether `slack_webhook_url` is set.
|
|
799
850
|
* @member {Boolean} has_slack_webhook_url
|
|
@@ -823,6 +874,12 @@ Template.prototype['field_dependencies'] = undefined;
|
|
|
823
874
|
*/
|
|
824
875
|
Template.prototype['field_groups'] = undefined;
|
|
825
876
|
|
|
877
|
+
/**
|
|
878
|
+
* The web form's sections, in order: Web Forms JS and the hosted web form show one section at a time. Empty when the template has none, and the web form shows all of its fields together, in the order the fields endpoint lists them. A field that no section lists (one added later) goes after the field before it in that order, in that field's section.
|
|
879
|
+
* @member {Array.<module:model/TemplateFormSection>} form_sections
|
|
880
|
+
*/
|
|
881
|
+
Template.prototype['form_sections'] = undefined;
|
|
882
|
+
|
|
826
883
|
/**
|
|
827
884
|
* The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off.
|
|
828
885
|
* @member {Array.<module:model/PredefinedField>} predefined_fields
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The TemplateActor model module.
|
|
32
32
|
* @module model/TemplateActor
|
|
33
|
-
* @version 4.
|
|
33
|
+
* @version 4.5.0
|
|
34
34
|
*/
|
|
35
35
|
var TemplateActor = /*#__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 TemplateDefaults model module.
|
|
31
31
|
* @module model/TemplateDefaults
|
|
32
|
-
* @version 4.
|
|
32
|
+
* @version 4.5.0
|
|
33
33
|
*/
|
|
34
34
|
var TemplateDefaults = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
29
|
/**
|
|
30
30
|
* The TemplateDefaultsInput model module.
|
|
31
31
|
* @module model/TemplateDefaultsInput
|
|
32
|
-
* @version 4.
|
|
32
|
+
* @version 4.5.0
|
|
33
33
|
*/
|
|
34
34
|
var TemplateDefaultsInput = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
29
|
/**
|
|
30
30
|
* The TemplateDiffSummary model module.
|
|
31
31
|
* @module model/TemplateDiffSummary
|
|
32
|
-
* @version 4.
|
|
32
|
+
* @version 4.5.0
|
|
33
33
|
*/
|
|
34
34
|
var TemplateDiffSummary = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -33,7 +33,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
33
33
|
/**
|
|
34
34
|
* The TemplateDocument model module.
|
|
35
35
|
* @module model/TemplateDocument
|
|
36
|
-
* @version 4.
|
|
36
|
+
* @version 4.5.0
|
|
37
37
|
*/
|
|
38
38
|
var TemplateDocument = /*#__PURE__*/function () {
|
|
39
39
|
/**
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The TemplateDocumentSummary model module.
|
|
32
32
|
* @module model/TemplateDocumentSummary
|
|
33
|
-
* @version 4.
|
|
33
|
+
* @version 4.5.0
|
|
34
34
|
*/
|
|
35
35
|
var TemplateDocumentSummary = /*#__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 TemplateFieldChange model module.
|
|
32
32
|
* @module model/TemplateFieldChange
|
|
33
|
-
* @version 4.
|
|
33
|
+
* @version 4.5.0
|
|
34
34
|
*/
|
|
35
35
|
var TemplateFieldChange = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
@@ -32,7 +32,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
32
32
|
/**
|
|
33
33
|
* The TemplateFieldChanges model module.
|
|
34
34
|
* @module model/TemplateFieldChanges
|
|
35
|
-
* @version 4.
|
|
35
|
+
* @version 4.5.0
|
|
36
36
|
*/
|
|
37
37
|
var TemplateFieldChanges = /*#__PURE__*/function () {
|
|
38
38
|
/**
|
|
@@ -32,7 +32,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
32
32
|
/**
|
|
33
33
|
* The TemplateFieldDependency model module.
|
|
34
34
|
* @module model/TemplateFieldDependency
|
|
35
|
-
* @version 4.
|
|
35
|
+
* @version 4.5.0
|
|
36
36
|
*/
|
|
37
37
|
var TemplateFieldDependency = /*#__PURE__*/function () {
|
|
38
38
|
/**
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The TemplateFieldDependencyCondition model module.
|
|
32
32
|
* @module model/TemplateFieldDependencyCondition
|
|
33
|
-
* @version 4.
|
|
33
|
+
* @version 4.5.0
|
|
34
34
|
*/
|
|
35
35
|
var TemplateFieldDependencyCondition = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
@@ -33,7 +33,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
33
33
|
/**
|
|
34
34
|
* The TemplateFieldDependencyConditionInput model module.
|
|
35
35
|
* @module model/TemplateFieldDependencyConditionInput
|
|
36
|
-
* @version 4.
|
|
36
|
+
* @version 4.5.0
|
|
37
37
|
*/
|
|
38
38
|
var TemplateFieldDependencyConditionInput = /*#__PURE__*/function () {
|
|
39
39
|
/**
|
|
@@ -32,7 +32,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
32
32
|
/**
|
|
33
33
|
* The TemplateFieldDependencyInput model module.
|
|
34
34
|
* @module model/TemplateFieldDependencyInput
|
|
35
|
-
* @version 4.
|
|
35
|
+
* @version 4.5.0
|
|
36
36
|
*/
|
|
37
37
|
var TemplateFieldDependencyInput = /*#__PURE__*/function () {
|
|
38
38
|
/**
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
29
29
|
/**
|
|
30
30
|
* The TemplateFieldMove model module.
|
|
31
31
|
* @module model/TemplateFieldMove
|
|
32
|
-
* @version 4.
|
|
32
|
+
* @version 4.5.0
|
|
33
33
|
*/
|
|
34
34
|
var TemplateFieldMove = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The TemplateFields model module.
|
|
32
32
|
* @module model/TemplateFields
|
|
33
|
-
* @version 4.
|
|
33
|
+
* @version 4.5.0
|
|
34
34
|
*/
|
|
35
35
|
var TemplateFields = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
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
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
18
|
+
* DocSpring API
|
|
19
|
+
* Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
20
|
+
*
|
|
21
|
+
* The version of the OpenAPI document: v2
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
|
+
* https://openapi-generator.tech
|
|
26
|
+
* Do not edit the class manually.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* The TemplateFormSection model module.
|
|
31
|
+
* @module model/TemplateFormSection
|
|
32
|
+
* @version 4.5.0
|
|
33
|
+
*/
|
|
34
|
+
var TemplateFormSection = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>TemplateFormSection</code>.
|
|
37
|
+
* A section of the template's web form, with its fields in order.
|
|
38
|
+
* @alias module:model/TemplateFormSection
|
|
39
|
+
* @extends Object
|
|
40
|
+
* @param id {String} The section's ID, unique among the template's sections. Any string you choose.
|
|
41
|
+
* @param title {String} The section's heading on the web form.
|
|
42
|
+
* @param description {String} Text shown under the section's heading. Null for none.
|
|
43
|
+
* @param field_ids {Array.<Number>} The IDs of the section's fields (Field's `id`), in the order the web form shows them. A field can be in one section only.
|
|
44
|
+
*/
|
|
45
|
+
function TemplateFormSection(id, title, description, field_ids) {
|
|
46
|
+
_classCallCheck(this, TemplateFormSection);
|
|
47
|
+
TemplateFormSection.initialize(this, id, title, description, field_ids);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the fields of this object.
|
|
52
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
53
|
+
* Only for internal use.
|
|
54
|
+
*/
|
|
55
|
+
return _createClass(TemplateFormSection, null, [{
|
|
56
|
+
key: "initialize",
|
|
57
|
+
value: function initialize(obj, id, title, description, field_ids) {
|
|
58
|
+
obj['id'] = id;
|
|
59
|
+
obj['title'] = title;
|
|
60
|
+
obj['description'] = description;
|
|
61
|
+
obj['field_ids'] = field_ids;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Constructs a <code>TemplateFormSection</code> from a plain JavaScript object, optionally creating a new instance.
|
|
66
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
67
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
68
|
+
* @param {module:model/TemplateFormSection} obj Optional instance to populate.
|
|
69
|
+
* @return {module:model/TemplateFormSection} The populated <code>TemplateFormSection</code> instance.
|
|
70
|
+
*/
|
|
71
|
+
}, {
|
|
72
|
+
key: "constructFromObject",
|
|
73
|
+
value: function constructFromObject(data, obj) {
|
|
74
|
+
if (data) {
|
|
75
|
+
obj = obj || new TemplateFormSection();
|
|
76
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
77
|
+
if (data.hasOwnProperty('id')) {
|
|
78
|
+
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('title')) {
|
|
81
|
+
obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String');
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('description')) {
|
|
84
|
+
obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
|
|
85
|
+
}
|
|
86
|
+
if (data.hasOwnProperty('field_ids')) {
|
|
87
|
+
obj['field_ids'] = _ApiClient["default"].convertToType(data['field_ids'], ['Number']);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Validates the JSON data with respect to <code>TemplateFormSection</code>.
|
|
95
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
96
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateFormSection</code>.
|
|
97
|
+
*/
|
|
98
|
+
}, {
|
|
99
|
+
key: "validateJSON",
|
|
100
|
+
value: function validateJSON(data) {
|
|
101
|
+
// check to make sure all required properties are present in the JSON string
|
|
102
|
+
var _iterator = _createForOfIteratorHelper(TemplateFormSection.RequiredProperties),
|
|
103
|
+
_step;
|
|
104
|
+
try {
|
|
105
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
106
|
+
var property = _step.value;
|
|
107
|
+
if (!data.hasOwnProperty(property)) {
|
|
108
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// ensure the json data is a string
|
|
112
|
+
} catch (err) {
|
|
113
|
+
_iterator.e(err);
|
|
114
|
+
} finally {
|
|
115
|
+
_iterator.f();
|
|
116
|
+
}
|
|
117
|
+
if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
|
|
118
|
+
throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
|
|
119
|
+
}
|
|
120
|
+
// ensure the json data is a string
|
|
121
|
+
if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
|
|
122
|
+
throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
|
|
123
|
+
}
|
|
124
|
+
// ensure the json data is a string
|
|
125
|
+
if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
|
|
126
|
+
throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is an array
|
|
129
|
+
if (!Array.isArray(data['field_ids'])) {
|
|
130
|
+
throw new Error("Expected the field `field_ids` to be an array in the JSON data but got " + data['field_ids']);
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}]);
|
|
135
|
+
}();
|
|
136
|
+
TemplateFormSection.RequiredProperties = ["id", "title", "description", "field_ids"];
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The section's ID, unique among the template's sections. Any string you choose.
|
|
140
|
+
* @member {String} id
|
|
141
|
+
*/
|
|
142
|
+
TemplateFormSection.prototype['id'] = undefined;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The section's heading on the web form.
|
|
146
|
+
* @member {String} title
|
|
147
|
+
*/
|
|
148
|
+
TemplateFormSection.prototype['title'] = undefined;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Text shown under the section's heading. Null for none.
|
|
152
|
+
* @member {String} description
|
|
153
|
+
*/
|
|
154
|
+
TemplateFormSection.prototype['description'] = undefined;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The IDs of the section's fields (Field's `id`), in the order the web form shows them. A field can be in one section only.
|
|
158
|
+
* @member {Array.<Number>} field_ids
|
|
159
|
+
*/
|
|
160
|
+
TemplateFormSection.prototype['field_ids'] = undefined;
|
|
161
|
+
var _default = exports["default"] = TemplateFormSection;
|