docspring 3.3.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/AGENTS.md +79 -19
  2. package/README.md +74 -63
  3. package/dist/ApiClient.js +63 -28
  4. package/dist/RequestSchemas.js +3452 -0
  5. package/dist/RequestValidator.js +494 -0
  6. package/dist/api/Client.js +1769 -921
  7. package/dist/index.js +847 -154
  8. package/dist/model/AddTemplateFieldsRequest.js +132 -0
  9. package/dist/model/AiFieldNamingLanguage.js +64 -0
  10. package/dist/model/{CreateWebhookData.js → AuthenticationCheck.js} +32 -28
  11. package/dist/model/BarcodeSymbology.js +89 -0
  12. package/dist/model/CheckCharacter.js +74 -0
  13. package/dist/model/CombinedFieldType.js +59 -0
  14. package/dist/model/CombinedPdf.js +294 -0
  15. package/dist/model/{MoveFolderData.js → CombinedPdfFiles.js} +27 -27
  16. package/dist/model/CombinedPdfList.js +132 -0
  17. package/dist/model/{ForbiddenErrorResponse.js → CombinedPdfSource.js} +59 -73
  18. package/dist/model/CombinedPdfSourceInput.js +270 -0
  19. package/dist/model/CombinedPdfSourcePdf.js +130 -0
  20. package/dist/model/CombinedPdfSourceType.js +74 -0
  21. package/dist/model/CombinedPdfState.js +74 -0
  22. package/dist/model/{CopyTemplateOptions.js → CopyTemplateRequest.js} +26 -22
  23. package/dist/model/{CombinePdfsData.js → CreateCombinedPdfRequest.js} +69 -53
  24. package/dist/model/{CreateCustomFileData.js → CreateCustomFileFromUploadRequest.js} +25 -23
  25. package/dist/model/{CreateFolderData.js → CreateFolderRequest.js} +47 -28
  26. package/dist/model/{CreateCustomFileResponse.js → CreateSignatureRequestEventRequest.js} +49 -73
  27. package/dist/model/CreateSignatureRequestTokenRequest.js +88 -0
  28. package/dist/model/CreateSubmissionBatchRequest.js +192 -0
  29. package/dist/model/CreateSubmissionRequest.js +226 -0
  30. package/dist/model/CreateTemplateRequest.js +613 -0
  31. package/dist/model/CreateWebhookRequest.js +234 -0
  32. package/dist/model/CustomFile.js +67 -16
  33. package/dist/model/CustomFileList.js +132 -0
  34. package/dist/model/CustomFileSourcePdf.js +130 -0
  35. package/dist/model/ErrorCode.js +154 -0
  36. package/dist/model/{CreateSubmissionResponse.js → ErrorDetail.js} +65 -75
  37. package/dist/model/ErrorInfo.js +211 -0
  38. package/dist/model/ErrorResponse.js +12 -41
  39. package/dist/model/ExpirationInterval.js +64 -0
  40. package/dist/model/Field.js +1230 -0
  41. package/dist/model/FieldComparisonCondition.js +137 -0
  42. package/dist/model/FieldComparisonOperator.js +69 -0
  43. package/dist/model/FieldDependency.js +154 -0
  44. package/dist/model/FieldDependencyInput.js +154 -0
  45. package/dist/model/FieldDisplayType.js +79 -0
  46. package/dist/model/{MultipleErrorsResponse.js → FieldEqualsCondition.js} +48 -52
  47. package/dist/model/FieldEqualsOperator.js +59 -0
  48. package/dist/model/FieldGroup.js +206 -0
  49. package/dist/model/FieldGroupInput.js +180 -0
  50. package/dist/model/FieldGroupType.js +59 -0
  51. package/dist/model/{SuccessMultipleErrorsResponse.js → FieldInCondition.js} +54 -53
  52. package/dist/model/FieldInput.js +1012 -0
  53. package/dist/model/FieldOverride.js +722 -0
  54. package/dist/model/FieldPresenceCondition.js +126 -0
  55. package/dist/model/FieldPresenceOperator.js +59 -0
  56. package/dist/model/FieldRangeCondition.js +148 -0
  57. package/dist/model/FieldReimportState.js +69 -0
  58. package/dist/model/FieldSetupLogic.js +59 -0
  59. package/dist/model/FieldSetupNaming.js +59 -0
  60. package/dist/model/FieldSetupSource.js +64 -0
  61. package/dist/model/FieldType.js +124 -0
  62. package/dist/model/Folder.js +38 -11
  63. package/dist/model/FolderList.js +132 -0
  64. package/dist/model/GenerateFilesFormat.js +54 -0
  65. package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
  66. package/dist/model/GeneratedFile.js +214 -0
  67. package/dist/model/GeneratedFileState.js +64 -0
  68. package/dist/model/HtmlEngineOptions.js +230 -0
  69. package/dist/model/HtmlEngineOptionsInput.js +193 -0
  70. package/dist/model/ImageGravity.js +94 -0
  71. package/dist/model/ImageScaleType.js +64 -0
  72. package/dist/model/ModelCodeLanguage.js +94 -0
  73. package/dist/model/{UpdatePdfTemplate.js → MoveFolderRequest.js} +34 -28
  74. package/dist/model/{MoveTemplateData.js → MoveTemplateRequest.js} +25 -35
  75. package/dist/model/NumberConditionType.js +79 -0
  76. package/dist/model/OutputFormat.js +59 -0
  77. package/dist/model/PageFormat.js +114 -0
  78. package/dist/model/PageImage.js +220 -0
  79. package/dist/model/{TemplateDeleteResponse.js → PageImages.js} +57 -70
  80. package/dist/model/PredefinedField.js +183 -0
  81. package/dist/model/PredefinedFieldInput.js +183 -0
  82. package/dist/model/{PublishVersionData.js → PublishTemplateVersionRequest.js} +33 -33
  83. package/dist/model/{AddFieldsData.js → RemoveTemplateFieldsRequest.js} +32 -30
  84. package/dist/model/{RenameFolderData.js → RenameFolderRequest.js} +25 -23
  85. package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
  86. package/dist/model/{RestoreVersionData.js → RestoreTemplateVersionRequest.js} +25 -23
  87. package/dist/model/ShapeType.js +79 -0
  88. package/dist/model/{SubmissionDataRequestShow.js → SignatureRequest.js} +165 -240
  89. package/dist/model/SignatureRequestAuthSecondFactorType.js +79 -0
  90. package/dist/model/SignatureRequestAuthType.js +84 -0
  91. package/dist/model/{SubmissionDataRequestEvent.js → SignatureRequestEvent.js} +67 -149
  92. package/dist/model/SignatureRequestEventType.js +79 -0
  93. package/dist/model/SignatureRequestInput.js +278 -0
  94. package/dist/model/SignatureRequestMessageType.js +94 -0
  95. package/dist/model/SignatureRequestState.js +64 -0
  96. package/dist/model/SignatureRequestToken.js +195 -0
  97. package/dist/model/SignatureRequestTokenType.js +59 -0
  98. package/dist/model/StringConditionType.js +74 -0
  99. package/dist/model/Submission.js +198 -341
  100. package/dist/model/SubmissionAction.js +30 -115
  101. package/dist/model/SubmissionActionState.js +69 -0
  102. package/dist/model/SubmissionActionType.js +84 -0
  103. package/dist/model/SubmissionBatch.js +74 -55
  104. package/dist/model/SubmissionBatchState.js +64 -0
  105. package/dist/model/SubmissionFiles.js +117 -0
  106. package/dist/model/SubmissionInput.js +218 -0
  107. package/dist/model/{ListSubmissionsResponse.js → SubmissionList.js} +35 -42
  108. package/dist/model/SubmissionSource.js +69 -0
  109. package/dist/model/SubmissionSourcePdf.js +130 -0
  110. package/dist/model/SubmissionState.js +114 -0
  111. package/dist/model/{SubmissionBatchData.js → SubmissionValidation.js} +46 -48
  112. package/dist/model/Template.js +359 -560
  113. package/dist/model/TemplateActor.js +171 -0
  114. package/dist/model/TemplateActorType.js +64 -0
  115. package/dist/model/TemplateDefaults.js +307 -0
  116. package/dist/model/TemplateDefaultsInput.js +305 -0
  117. package/dist/model/TemplateDiff.js +206 -0
  118. package/dist/model/TemplateDiffSummary.js +165 -0
  119. package/dist/model/TemplateDocument.js +280 -0
  120. package/dist/model/TemplateDocumentState.js +84 -0
  121. package/dist/model/TemplateFieldChange.js +146 -0
  122. package/dist/model/TemplateFieldChanges.js +196 -0
  123. package/dist/model/{CreatePdfSubmissionData.js → TemplateFieldDependency.js} +70 -89
  124. package/dist/model/TemplateFieldDependencyAction.js +64 -0
  125. package/dist/model/{TemplatePublishVersionResponse.js → TemplateFieldDependencyCondition.js} +51 -61
  126. package/dist/model/TemplateFieldDependencyConditionInput.js +304 -0
  127. package/dist/model/TemplateFieldDependencyInput.js +182 -0
  128. package/dist/model/TemplateFieldDependencyMatch.js +59 -0
  129. package/dist/model/TemplateFieldDependencyOperator.js +99 -0
  130. package/dist/model/TemplateFieldLogicStatus.js +74 -0
  131. package/dist/model/{CreatePdfTemplate.js → TemplateFieldMove.js} +52 -28
  132. package/dist/model/TemplateFields.js +147 -0
  133. package/dist/model/TemplateFormMode.js +64 -0
  134. package/dist/model/{TemplateModelCodeResponse.js → TemplateModelCode.js} +34 -86
  135. package/dist/model/TemplatePageAiError.js +69 -0
  136. package/dist/model/TemplatePageAiNamingStatus.js +59 -0
  137. package/dist/model/TemplatePageFieldsStatus.js +74 -0
  138. package/dist/model/TemplatePageImageStatus.js +59 -0
  139. package/dist/model/TemplatePageImages.js +158 -0
  140. package/dist/model/TemplatePageProcessingStatus.js +162 -0
  141. package/dist/model/{SubmissionDataRequestToken.js → TemplateSourcePdf.js} +52 -56
  142. package/dist/model/TemplateSummary.js +560 -0
  143. package/dist/model/{SuccessErrorResponse.js → TemplateSummaryList.js} +43 -55
  144. package/dist/model/TemplateType.js +59 -0
  145. package/dist/model/{Submission422Response.js → TemplateVersion.js} +60 -63
  146. package/dist/model/TemplateVersionType.js +64 -0
  147. package/dist/model/TextAlignment.js +69 -0
  148. package/dist/model/TextOverflow.js +59 -0
  149. package/dist/model/TextVerticalAlignment.js +64 -0
  150. package/dist/model/Typeface.js +134 -0
  151. package/dist/model/UpdateSignatureRequestRequest.js +183 -0
  152. package/dist/model/UpdateTemplateDocumentRequest.js +139 -0
  153. package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
  154. package/dist/model/UpdateTemplateRequest.js +523 -0
  155. package/dist/model/UpdateWebhookRequest.js +209 -0
  156. package/dist/model/UploadMethod.js +54 -0
  157. package/dist/model/{UploadPresignResponse.js → UploadPresign.js} +53 -58
  158. package/dist/model/UrlSourcePdf.js +130 -0
  159. package/dist/model/ValidateSubmissionRequest.js +226 -0
  160. package/dist/model/Webhook.js +58 -73
  161. package/dist/model/WebhookEventType.js +174 -0
  162. package/dist/model/WebhookList.js +132 -0
  163. package/dist/model/WebhookMode.js +59 -0
  164. package/package.json +1 -1
  165. package/dist/model/BatchGeneratePdfs201Response.js +0 -194
  166. package/dist/model/CombinedSubmission.js +0 -313
  167. package/dist/model/CombinedSubmissionAction.js +0 -268
  168. package/dist/model/CreateCombinedSubmissionResponse.js +0 -180
  169. package/dist/model/CreateHtmlTemplate.js +0 -108
  170. package/dist/model/CreateSubmissionDataRequestData.js +0 -314
  171. package/dist/model/CreateSubmissionDataRequestEventRequest.js +0 -239
  172. package/dist/model/CreateSubmissionDataRequestEventResponse.js +0 -167
  173. package/dist/model/CreateSubmissionDataRequestResponse.js +0 -167
  174. package/dist/model/CreateSubmissionDataRequestTokenResponse.js +0 -167
  175. package/dist/model/ErrorOrMultipleErrorsResponse.js +0 -153
  176. package/dist/model/JsonSchema.js +0 -205
  177. package/dist/model/SubmissionBatchWithSubmissions.js +0 -228
  178. package/dist/model/SubmissionDataRequest.js +0 -496
  179. package/dist/model/SubmissionPreview.js +0 -509
  180. package/dist/model/TemplateAddFieldsResponse.js +0 -156
  181. package/dist/model/TemplatePreview.js +0 -796
  182. package/dist/model/UpdateHtmlTemplate.js +0 -108
  183. package/dist/model/UpdateSubmissionDataRequestData.js +0 -311
  184. package/dist/model/UpdateWebhookData.js +0 -108
@@ -5,6 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _AiFieldNamingLanguage = _interopRequireDefault(require("./AiFieldNamingLanguage"));
9
+ var _ExpirationInterval = _interopRequireDefault(require("./ExpirationInterval"));
10
+ var _FieldGroup = _interopRequireDefault(require("./FieldGroup"));
11
+ var _HtmlEngineOptions = _interopRequireDefault(require("./HtmlEngineOptions"));
12
+ var _PredefinedField = _interopRequireDefault(require("./PredefinedField"));
13
+ var _TemplateActor = _interopRequireDefault(require("./TemplateActor"));
14
+ var _TemplateDefaults = _interopRequireDefault(require("./TemplateDefaults"));
15
+ var _TemplateDocument = _interopRequireDefault(require("./TemplateDocument"));
16
+ var _TemplateFieldDependency = _interopRequireDefault(require("./TemplateFieldDependency"));
17
+ var _TemplateFormMode = _interopRequireDefault(require("./TemplateFormMode"));
18
+ var _TemplateType = _interopRequireDefault(require("./TemplateType"));
19
+ var _TemplateVersion = _interopRequireDefault(require("./TemplateVersion"));
8
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
21
  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
22
  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; } } }; }
@@ -16,9 +28,9 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
16
28
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
29
  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
30
  * DocSpring API
19
- * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures. Requests are rate limited per account, and live PDFs use credits: a request over the limit returns 429 with a Retry-After header, and one your credits can't cover returns 402. See [Credits & Rate Limits](https://docspring.com/docs/api-guide/credits-and-rate-limits/).
31
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
20
32
  *
21
- * The version of the OpenAPI document: v1
33
+ * The version of the OpenAPI document: v2
22
34
  *
23
35
  *
24
36
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -29,79 +41,67 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
41
  /**
30
42
  * The Template model module.
31
43
  * @module model/Template
32
- * @version 3.3.0
44
+ * @version 4.1.0
33
45
  */
34
46
  var Template = /*#__PURE__*/function () {
35
47
  /**
36
48
  * Constructs a new <code>Template</code>.
49
+ * A template that generates PDFs from submission data.
37
50
  * @alias module:model/Template
38
51
  * @extends Object
39
- * @param add_data_request_submission_id_footers {Boolean}
40
- * @param allow_additional_properties {Boolean}
41
- * @param description {String}
42
- * @param document_filename {String}
43
- * @param document_md5 {String}
44
- * @param document_parse_error {Boolean}
45
- * @param document_processed {Boolean}
46
- * @param document_state {module:model/Template.DocumentStateEnum}
47
- * @param document_url {String}
48
- * @param editable_submissions {Boolean}
49
- * @param embed_domains {String}
50
- * @param embed_edit_allow_settings {Boolean}
51
- * @param embed_edit_allow_versioning {Boolean}
52
- * @param embed_edit_allow_document_replacement {Boolean}
53
- * @param encrypt_pdfs_password {String}
54
- * @param encrypt_pdfs {Boolean}
55
- * @param expiration_interval {String}
56
- * @param expire_after {Number}
57
- * @param expire_submissions {Boolean}
58
- * @param external_predefined_fields_template_id {String}
59
- * @param external_predefined_fields_template_name {String}
60
- * @param first_template {Boolean}
61
- * @param id {String}
62
- * @param locked {Boolean}
63
- * @param merge_audit_trail_pdf {Boolean}
64
- * @param name {String}
65
- * @param page_count {Number}
66
- * @param page_dimensions {Array.<Array.<Number>>}
67
- * @param parent_folder_id {String}
68
- * @param parse_dates_using_template_date_format {Boolean}
69
- * @param path {String}
70
- * @param permanent_document_url {String}
71
- * @param public_submissions {Boolean}
72
- * @param public_web_form {Boolean}
73
- * @param redirect_url {String}
74
- * @param slack_webhook_url {String}
75
- * @param template_type {module:model/Template.TemplateTypeEnum}
76
- * @param updated_at {String}
77
- * @param version_published_at {String}
78
- * @param version {String}
79
- * @param webhook_url {String}
80
- * @param demo {Boolean}
81
- * @param latest_version {String}
82
- * @param last_changed_at {String}
83
- * @param last_changed_by_type {module:model/Template.LastChangedByTypeEnum}
84
- * @param last_changed_by_id {String}
85
- * @param last_changed_by_external_name {String}
86
- * @param last_changed_by_external_email {String}
87
- * @param last_changed_by_external_id {String}
88
- * @param defaults {Object}
89
- * @param field_dependencies {Array.<Object>}
90
- * @param field_order {Array.<Array.<Number>>}
91
- * @param fields {Object}
92
- * @param footer_html {String}
93
- * @param header_html {String}
94
- * @param html_engine_options {Object}
95
- * @param html {String}
96
- * @param predefined_fields {Array.<Object>}
97
- * @param scss {String}
98
- * @param shared_field_data {Object}
99
- * @param template_schema_version {Number}
100
- * @param versions {Array.<Object>}
52
+ * @param id {String} The template's ID.
53
+ * @param name {String} The template's name.
54
+ * @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.
55
+ * @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.
56
+ * @param ready {Boolean} Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its document has been processed (`document.state` is `processed`).
57
+ * @param document {module:model/TemplateDocument} The PDF of a PDF template. Null for HTML templates, and for a PDF template that has no PDF yet.
58
+ * @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.
59
+ * @param path {String} The path of the folder the template is in, such as `/Contracts`. `/` for a template at the root.
60
+ * @param version {String} The published version this is, such as `1.2.0`. Null for the draft.
61
+ * @param latest_version {String} The template's latest published version. Null if no version has been published.
62
+ * @param version_published_at {Date} When this version was published. Null for the draft.
63
+ * @param locked {Boolean} A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed).
64
+ * @param add_signature_request_submission_id_footers {Boolean} Print the submission ID in the footer of each page of PDFs signed through signature requests.
65
+ * @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.
66
+ * @param allow_additional_properties {Boolean} Accept submission data with properties that aren't fields of the template.
67
+ * @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.
68
+ * @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.
69
+ * @param editable_submissions {Boolean} Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
70
+ * @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.
71
+ * @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).
72
+ * @param embed_edit_allow_versioning {Boolean} Allow the embedded template editor to publish, restore, compare and delete published versions.
73
+ * @param embed_edit_allow_document_replacement {Boolean} Allow the embedded template editor to replace the template's PDF.
74
+ * @param encrypt_pdfs {Boolean} Encrypt generated PDFs with `encrypt_pdfs_password`.
75
+ * @param has_encrypt_pdfs_password {Boolean} Whether `encrypt_pdfs_password` is set.
76
+ * @param expire_submissions {Boolean} Delete each submission's data and PDF after `expire_after` `expiration_interval`.
77
+ * @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).
78
+ * @param expiration_interval {module:model/ExpirationInterval} The unit of `expire_after`.
79
+ * @param merge_audit_trail_pdf {Boolean} Add the audit trail to the end of PDFs signed through signature requests.
80
+ * @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.
81
+ * @param public_submissions {Boolean} Allow anyone with a submission's ID to download its PDF.
82
+ * @param public_web_form {Boolean} Allow anyone to fill in the template's web form.
83
+ * @param redirect_url {String} Where the web form sends people after they submit it.
84
+ * @param has_slack_webhook_url {Boolean} Whether `slack_webhook_url` is set.
85
+ * @param last_changed_at {Date} When the draft was last changed.
86
+ * @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.
87
+ * @param created_at {Date} When the template was created.
88
+ * @param updated_at {Date} When the template was last updated.
89
+ * @param defaults {module:model/TemplateDefaults}
90
+ * @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.
91
+ * @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/~`.
92
+ * @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.
93
+ * @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.
94
+ * @param html {String} The HTML of an HTML template, as a Liquid template. Null for PDF templates.
95
+ * @param scss {String} The SCSS of an HTML template.
96
+ * @param header_html {String} The HTML printed at the top of each page of an HTML template.
97
+ * @param footer_html {String} The HTML printed at the bottom of each page of an HTML template.
98
+ * @param html_engine_options {module:model/HtmlEngineOptions} How an HTML template's PDFs are printed. Null for PDF templates. Setting it replaces the whole object: options left out use their defaults.
99
+ * @param embed_edit_token {String} The token that opens the template in the embedded template editor.
100
+ * @param versions {Array.<module:model/TemplateVersion>} The template's published versions, newest first (up to 100).
101
101
  */
102
- function Template(add_data_request_submission_id_footers, allow_additional_properties, description, document_filename, document_md5, document_parse_error, document_processed, document_state, document_url, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs_password, encrypt_pdfs, expiration_interval, expire_after, expire_submissions, external_predefined_fields_template_id, external_predefined_fields_template_name, first_template, id, locked, merge_audit_trail_pdf, name, page_count, page_dimensions, parent_folder_id, parse_dates_using_template_date_format, path, permanent_document_url, public_submissions, public_web_form, redirect_url, slack_webhook_url, template_type, updated_at, version_published_at, version, webhook_url, demo, latest_version, last_changed_at, last_changed_by_type, last_changed_by_id, last_changed_by_external_name, last_changed_by_external_email, last_changed_by_external_id, defaults, field_dependencies, field_order, fields, footer_html, header_html, html_engine_options, html, predefined_fields, scss, shared_field_data, template_schema_version, versions) {
102
+ function Template(id, name, description, template_type, ready, document, parent_folder_id, path, version, latest_version, version_published_at, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_at, last_changed_by, created_at, updated_at, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, embed_edit_token, versions) {
103
103
  _classCallCheck(this, Template);
104
- Template.initialize(this, add_data_request_submission_id_footers, allow_additional_properties, description, document_filename, document_md5, document_parse_error, document_processed, document_state, document_url, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs_password, encrypt_pdfs, expiration_interval, expire_after, expire_submissions, external_predefined_fields_template_id, external_predefined_fields_template_name, first_template, id, locked, merge_audit_trail_pdf, name, page_count, page_dimensions, parent_folder_id, parse_dates_using_template_date_format, path, permanent_document_url, public_submissions, public_web_form, redirect_url, slack_webhook_url, template_type, updated_at, version_published_at, version, webhook_url, demo, latest_version, last_changed_at, last_changed_by_type, last_changed_by_id, last_changed_by_external_name, last_changed_by_external_email, last_changed_by_external_id, defaults, field_dependencies, field_order, fields, footer_html, header_html, html_engine_options, html, predefined_fields, scss, shared_field_data, template_schema_version, versions);
104
+ Template.initialize(this, id, name, description, template_type, ready, document, parent_folder_id, path, version, latest_version, version_published_at, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_at, last_changed_by, created_at, updated_at, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, embed_edit_token, versions);
105
105
  }
106
106
 
107
107
  /**
@@ -111,68 +111,55 @@ var Template = /*#__PURE__*/function () {
111
111
  */
112
112
  return _createClass(Template, null, [{
113
113
  key: "initialize",
114
- value: function initialize(obj, add_data_request_submission_id_footers, allow_additional_properties, description, document_filename, document_md5, document_parse_error, document_processed, document_state, document_url, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs_password, encrypt_pdfs, expiration_interval, expire_after, expire_submissions, external_predefined_fields_template_id, external_predefined_fields_template_name, first_template, id, locked, merge_audit_trail_pdf, name, page_count, page_dimensions, parent_folder_id, parse_dates_using_template_date_format, path, permanent_document_url, public_submissions, public_web_form, redirect_url, slack_webhook_url, template_type, updated_at, version_published_at, version, webhook_url, demo, latest_version, last_changed_at, last_changed_by_type, last_changed_by_id, last_changed_by_external_name, last_changed_by_external_email, last_changed_by_external_id, defaults, field_dependencies, field_order, fields, footer_html, header_html, html_engine_options, html, predefined_fields, scss, shared_field_data, template_schema_version, versions) {
115
- obj['add_data_request_submission_id_footers'] = add_data_request_submission_id_footers;
116
- obj['allow_additional_properties'] = allow_additional_properties;
114
+ value: function initialize(obj, id, name, description, template_type, ready, document, parent_folder_id, path, version, latest_version, version_published_at, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, has_encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, has_slack_webhook_url, last_changed_at, last_changed_by, created_at, updated_at, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, embed_edit_token, versions) {
115
+ obj['id'] = id;
116
+ obj['name'] = name;
117
117
  obj['description'] = description;
118
- obj['document_filename'] = document_filename;
119
- obj['document_md5'] = document_md5;
120
- obj['document_parse_error'] = document_parse_error;
121
- obj['document_processed'] = document_processed;
122
- obj['document_state'] = document_state;
123
- obj['document_url'] = document_url;
118
+ obj['template_type'] = template_type;
119
+ obj['ready'] = ready;
120
+ obj['document'] = document;
121
+ obj['parent_folder_id'] = parent_folder_id;
122
+ obj['path'] = path;
123
+ obj['version'] = version;
124
+ obj['latest_version'] = latest_version;
125
+ obj['version_published_at'] = version_published_at;
126
+ obj['locked'] = locked;
127
+ obj['add_signature_request_submission_id_footers'] = add_signature_request_submission_id_footers;
128
+ obj['ai_field_naming_language'] = ai_field_naming_language;
129
+ obj['allow_additional_properties'] = allow_additional_properties;
130
+ obj['allow_skipping_optional_fields'] = allow_skipping_optional_fields;
131
+ obj['default_form_mode'] = default_form_mode;
124
132
  obj['editable_submissions'] = editable_submissions;
125
133
  obj['embed_domains'] = embed_domains;
126
134
  obj['embed_edit_allow_settings'] = embed_edit_allow_settings;
127
135
  obj['embed_edit_allow_versioning'] = embed_edit_allow_versioning;
128
136
  obj['embed_edit_allow_document_replacement'] = embed_edit_allow_document_replacement;
129
- obj['encrypt_pdfs_password'] = encrypt_pdfs_password;
130
137
  obj['encrypt_pdfs'] = encrypt_pdfs;
131
- obj['expiration_interval'] = expiration_interval;
132
- obj['expire_after'] = expire_after;
138
+ obj['has_encrypt_pdfs_password'] = has_encrypt_pdfs_password;
133
139
  obj['expire_submissions'] = expire_submissions;
134
- obj['external_predefined_fields_template_id'] = external_predefined_fields_template_id;
135
- obj['external_predefined_fields_template_name'] = external_predefined_fields_template_name;
136
- obj['first_template'] = first_template;
137
- obj['id'] = id;
138
- obj['locked'] = locked;
140
+ obj['expire_after'] = expire_after;
141
+ obj['expiration_interval'] = expiration_interval;
139
142
  obj['merge_audit_trail_pdf'] = merge_audit_trail_pdf;
140
- obj['name'] = name;
141
- obj['page_count'] = page_count;
142
- obj['page_dimensions'] = page_dimensions;
143
- obj['parent_folder_id'] = parent_folder_id;
144
143
  obj['parse_dates_using_template_date_format'] = parse_dates_using_template_date_format;
145
- obj['path'] = path;
146
- obj['permanent_document_url'] = permanent_document_url;
147
144
  obj['public_submissions'] = public_submissions;
148
145
  obj['public_web_form'] = public_web_form;
149
146
  obj['redirect_url'] = redirect_url;
150
- obj['slack_webhook_url'] = slack_webhook_url;
151
- obj['template_type'] = template_type;
152
- obj['updated_at'] = updated_at;
153
- obj['version_published_at'] = version_published_at;
154
- obj['version'] = version;
155
- obj['webhook_url'] = webhook_url;
156
- obj['demo'] = demo;
157
- obj['latest_version'] = latest_version;
147
+ obj['has_slack_webhook_url'] = has_slack_webhook_url;
158
148
  obj['last_changed_at'] = last_changed_at;
159
- obj['last_changed_by_type'] = last_changed_by_type;
160
- obj['last_changed_by_id'] = last_changed_by_id;
161
- obj['last_changed_by_external_name'] = last_changed_by_external_name;
162
- obj['last_changed_by_external_email'] = last_changed_by_external_email;
163
- obj['last_changed_by_external_id'] = last_changed_by_external_id;
149
+ obj['last_changed_by'] = last_changed_by;
150
+ obj['created_at'] = created_at;
151
+ obj['updated_at'] = updated_at;
164
152
  obj['defaults'] = defaults;
165
153
  obj['field_dependencies'] = field_dependencies;
166
- obj['field_order'] = field_order;
167
- obj['fields'] = fields;
168
- obj['footer_html'] = footer_html;
169
- obj['header_html'] = header_html;
170
- obj['html_engine_options'] = html_engine_options;
171
- obj['html'] = html;
154
+ obj['field_groups'] = field_groups;
172
155
  obj['predefined_fields'] = predefined_fields;
156
+ obj['predefined_fields_sample_data'] = predefined_fields_sample_data;
157
+ obj['html'] = html;
173
158
  obj['scss'] = scss;
174
- obj['shared_field_data'] = shared_field_data;
175
- obj['template_schema_version'] = template_schema_version;
159
+ obj['header_html'] = header_html;
160
+ obj['footer_html'] = footer_html;
161
+ obj['html_engine_options'] = html_engine_options;
162
+ obj['embed_edit_token'] = embed_edit_token;
176
163
  obj['versions'] = versions;
177
164
  }
178
165
 
@@ -189,38 +176,62 @@ var Template = /*#__PURE__*/function () {
189
176
  if (data) {
190
177
  obj = obj || new Template();
191
178
  _ApiClient["default"].constructFromObject(data, obj, 'Object');
192
- if (data.hasOwnProperty('add_data_request_submission_id_footers')) {
193
- obj['add_data_request_submission_id_footers'] = _ApiClient["default"].convertToType(data['add_data_request_submission_id_footers'], 'Boolean');
179
+ if (data.hasOwnProperty('id')) {
180
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
194
181
  }
195
- if (data.hasOwnProperty('allow_additional_properties')) {
196
- obj['allow_additional_properties'] = _ApiClient["default"].convertToType(data['allow_additional_properties'], 'Boolean');
182
+ if (data.hasOwnProperty('name')) {
183
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
197
184
  }
198
185
  if (data.hasOwnProperty('description')) {
199
186
  obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
200
187
  }
201
- if (data.hasOwnProperty('document_filename')) {
202
- obj['document_filename'] = _ApiClient["default"].convertToType(data['document_filename'], 'String');
188
+ if (data.hasOwnProperty('template_type')) {
189
+ obj['template_type'] = _ApiClient["default"].convertToType(data['template_type'], _TemplateType["default"]);
190
+ }
191
+ if (data.hasOwnProperty('ready')) {
192
+ obj['ready'] = _ApiClient["default"].convertToType(data['ready'], 'Boolean');
193
+ }
194
+ if (data.hasOwnProperty('document')) {
195
+ obj['document'] = _ApiClient["default"].convertToType(data['document'], _TemplateDocument["default"]);
196
+ }
197
+ if (data.hasOwnProperty('parent_folder_id')) {
198
+ obj['parent_folder_id'] = _ApiClient["default"].convertToType(data['parent_folder_id'], 'String');
199
+ }
200
+ if (data.hasOwnProperty('path')) {
201
+ obj['path'] = _ApiClient["default"].convertToType(data['path'], 'String');
202
+ }
203
+ if (data.hasOwnProperty('version')) {
204
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
203
205
  }
204
- if (data.hasOwnProperty('document_md5')) {
205
- obj['document_md5'] = _ApiClient["default"].convertToType(data['document_md5'], 'String');
206
+ if (data.hasOwnProperty('latest_version')) {
207
+ obj['latest_version'] = _ApiClient["default"].convertToType(data['latest_version'], 'String');
206
208
  }
207
- if (data.hasOwnProperty('document_parse_error')) {
208
- obj['document_parse_error'] = _ApiClient["default"].convertToType(data['document_parse_error'], 'Boolean');
209
+ if (data.hasOwnProperty('version_published_at')) {
210
+ obj['version_published_at'] = _ApiClient["default"].convertToType(data['version_published_at'], 'Date');
209
211
  }
210
- if (data.hasOwnProperty('document_processed')) {
211
- obj['document_processed'] = _ApiClient["default"].convertToType(data['document_processed'], 'Boolean');
212
+ if (data.hasOwnProperty('locked')) {
213
+ obj['locked'] = _ApiClient["default"].convertToType(data['locked'], 'Boolean');
212
214
  }
213
- if (data.hasOwnProperty('document_state')) {
214
- obj['document_state'] = _ApiClient["default"].convertToType(data['document_state'], 'String');
215
+ if (data.hasOwnProperty('add_signature_request_submission_id_footers')) {
216
+ obj['add_signature_request_submission_id_footers'] = _ApiClient["default"].convertToType(data['add_signature_request_submission_id_footers'], 'Boolean');
215
217
  }
216
- if (data.hasOwnProperty('document_url')) {
217
- obj['document_url'] = _ApiClient["default"].convertToType(data['document_url'], 'String');
218
+ if (data.hasOwnProperty('ai_field_naming_language')) {
219
+ obj['ai_field_naming_language'] = _ApiClient["default"].convertToType(data['ai_field_naming_language'], _AiFieldNamingLanguage["default"]);
220
+ }
221
+ if (data.hasOwnProperty('allow_additional_properties')) {
222
+ obj['allow_additional_properties'] = _ApiClient["default"].convertToType(data['allow_additional_properties'], 'Boolean');
223
+ }
224
+ if (data.hasOwnProperty('allow_skipping_optional_fields')) {
225
+ obj['allow_skipping_optional_fields'] = _ApiClient["default"].convertToType(data['allow_skipping_optional_fields'], 'Boolean');
226
+ }
227
+ if (data.hasOwnProperty('default_form_mode')) {
228
+ obj['default_form_mode'] = _ApiClient["default"].convertToType(data['default_form_mode'], _TemplateFormMode["default"]);
218
229
  }
219
230
  if (data.hasOwnProperty('editable_submissions')) {
220
231
  obj['editable_submissions'] = _ApiClient["default"].convertToType(data['editable_submissions'], 'Boolean');
221
232
  }
222
233
  if (data.hasOwnProperty('embed_domains')) {
223
- obj['embed_domains'] = _ApiClient["default"].convertToType(data['embed_domains'], 'String');
234
+ obj['embed_domains'] = _ApiClient["default"].convertToType(data['embed_domains'], ['String']);
224
235
  }
225
236
  if (data.hasOwnProperty('embed_edit_allow_settings')) {
226
237
  obj['embed_edit_allow_settings'] = _ApiClient["default"].convertToType(data['embed_edit_allow_settings'], 'Boolean');
@@ -231,60 +242,27 @@ var Template = /*#__PURE__*/function () {
231
242
  if (data.hasOwnProperty('embed_edit_allow_document_replacement')) {
232
243
  obj['embed_edit_allow_document_replacement'] = _ApiClient["default"].convertToType(data['embed_edit_allow_document_replacement'], 'Boolean');
233
244
  }
234
- if (data.hasOwnProperty('encrypt_pdfs_password')) {
235
- obj['encrypt_pdfs_password'] = _ApiClient["default"].convertToType(data['encrypt_pdfs_password'], 'String');
236
- }
237
245
  if (data.hasOwnProperty('encrypt_pdfs')) {
238
246
  obj['encrypt_pdfs'] = _ApiClient["default"].convertToType(data['encrypt_pdfs'], 'Boolean');
239
247
  }
240
- if (data.hasOwnProperty('expiration_interval')) {
241
- obj['expiration_interval'] = _ApiClient["default"].convertToType(data['expiration_interval'], 'String');
242
- }
243
- if (data.hasOwnProperty('expire_after')) {
244
- obj['expire_after'] = _ApiClient["default"].convertToType(data['expire_after'], 'Number');
248
+ if (data.hasOwnProperty('has_encrypt_pdfs_password')) {
249
+ obj['has_encrypt_pdfs_password'] = _ApiClient["default"].convertToType(data['has_encrypt_pdfs_password'], 'Boolean');
245
250
  }
246
251
  if (data.hasOwnProperty('expire_submissions')) {
247
252
  obj['expire_submissions'] = _ApiClient["default"].convertToType(data['expire_submissions'], 'Boolean');
248
253
  }
249
- if (data.hasOwnProperty('external_predefined_fields_template_id')) {
250
- obj['external_predefined_fields_template_id'] = _ApiClient["default"].convertToType(data['external_predefined_fields_template_id'], 'String');
251
- }
252
- if (data.hasOwnProperty('external_predefined_fields_template_name')) {
253
- obj['external_predefined_fields_template_name'] = _ApiClient["default"].convertToType(data['external_predefined_fields_template_name'], 'String');
254
- }
255
- if (data.hasOwnProperty('first_template')) {
256
- obj['first_template'] = _ApiClient["default"].convertToType(data['first_template'], 'Boolean');
257
- }
258
- if (data.hasOwnProperty('id')) {
259
- obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
254
+ if (data.hasOwnProperty('expire_after')) {
255
+ obj['expire_after'] = _ApiClient["default"].convertToType(data['expire_after'], 'Number');
260
256
  }
261
- if (data.hasOwnProperty('locked')) {
262
- obj['locked'] = _ApiClient["default"].convertToType(data['locked'], 'Boolean');
257
+ if (data.hasOwnProperty('expiration_interval')) {
258
+ obj['expiration_interval'] = _ApiClient["default"].convertToType(data['expiration_interval'], _ExpirationInterval["default"]);
263
259
  }
264
260
  if (data.hasOwnProperty('merge_audit_trail_pdf')) {
265
261
  obj['merge_audit_trail_pdf'] = _ApiClient["default"].convertToType(data['merge_audit_trail_pdf'], 'Boolean');
266
262
  }
267
- if (data.hasOwnProperty('name')) {
268
- obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
269
- }
270
- if (data.hasOwnProperty('page_count')) {
271
- obj['page_count'] = _ApiClient["default"].convertToType(data['page_count'], 'Number');
272
- }
273
- if (data.hasOwnProperty('page_dimensions')) {
274
- obj['page_dimensions'] = _ApiClient["default"].convertToType(data['page_dimensions'], [['Number']]);
275
- }
276
- if (data.hasOwnProperty('parent_folder_id')) {
277
- obj['parent_folder_id'] = _ApiClient["default"].convertToType(data['parent_folder_id'], 'String');
278
- }
279
263
  if (data.hasOwnProperty('parse_dates_using_template_date_format')) {
280
264
  obj['parse_dates_using_template_date_format'] = _ApiClient["default"].convertToType(data['parse_dates_using_template_date_format'], 'Boolean');
281
265
  }
282
- if (data.hasOwnProperty('path')) {
283
- obj['path'] = _ApiClient["default"].convertToType(data['path'], 'String');
284
- }
285
- if (data.hasOwnProperty('permanent_document_url')) {
286
- obj['permanent_document_url'] = _ApiClient["default"].convertToType(data['permanent_document_url'], 'String');
287
- }
288
266
  if (data.hasOwnProperty('public_submissions')) {
289
267
  obj['public_submissions'] = _ApiClient["default"].convertToType(data['public_submissions'], 'Boolean');
290
268
  }
@@ -294,89 +272,58 @@ var Template = /*#__PURE__*/function () {
294
272
  if (data.hasOwnProperty('redirect_url')) {
295
273
  obj['redirect_url'] = _ApiClient["default"].convertToType(data['redirect_url'], 'String');
296
274
  }
297
- if (data.hasOwnProperty('slack_webhook_url')) {
298
- obj['slack_webhook_url'] = _ApiClient["default"].convertToType(data['slack_webhook_url'], 'String');
299
- }
300
- if (data.hasOwnProperty('template_type')) {
301
- obj['template_type'] = _ApiClient["default"].convertToType(data['template_type'], 'String');
302
- }
303
- if (data.hasOwnProperty('updated_at')) {
304
- obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'String');
305
- }
306
- if (data.hasOwnProperty('version_published_at')) {
307
- obj['version_published_at'] = _ApiClient["default"].convertToType(data['version_published_at'], 'String');
308
- }
309
- if (data.hasOwnProperty('version')) {
310
- obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
311
- }
312
- if (data.hasOwnProperty('webhook_url')) {
313
- obj['webhook_url'] = _ApiClient["default"].convertToType(data['webhook_url'], 'String');
314
- }
315
- if (data.hasOwnProperty('embed_edit_token')) {
316
- obj['embed_edit_token'] = _ApiClient["default"].convertToType(data['embed_edit_token'], 'String');
317
- }
318
- if (data.hasOwnProperty('demo')) {
319
- obj['demo'] = _ApiClient["default"].convertToType(data['demo'], 'Boolean');
320
- }
321
- if (data.hasOwnProperty('latest_version')) {
322
- obj['latest_version'] = _ApiClient["default"].convertToType(data['latest_version'], 'String');
275
+ if (data.hasOwnProperty('has_slack_webhook_url')) {
276
+ obj['has_slack_webhook_url'] = _ApiClient["default"].convertToType(data['has_slack_webhook_url'], 'Boolean');
323
277
  }
324
278
  if (data.hasOwnProperty('last_changed_at')) {
325
- obj['last_changed_at'] = _ApiClient["default"].convertToType(data['last_changed_at'], 'String');
326
- }
327
- if (data.hasOwnProperty('last_changed_by_type')) {
328
- obj['last_changed_by_type'] = _ApiClient["default"].convertToType(data['last_changed_by_type'], 'String');
279
+ obj['last_changed_at'] = _ApiClient["default"].convertToType(data['last_changed_at'], 'Date');
329
280
  }
330
- if (data.hasOwnProperty('last_changed_by_id')) {
331
- obj['last_changed_by_id'] = _ApiClient["default"].convertToType(data['last_changed_by_id'], 'String');
281
+ if (data.hasOwnProperty('last_changed_by')) {
282
+ obj['last_changed_by'] = _ApiClient["default"].convertToType(data['last_changed_by'], _TemplateActor["default"]);
332
283
  }
333
- if (data.hasOwnProperty('last_changed_by_external_name')) {
334
- obj['last_changed_by_external_name'] = _ApiClient["default"].convertToType(data['last_changed_by_external_name'], 'String');
284
+ if (data.hasOwnProperty('created_at')) {
285
+ obj['created_at'] = _ApiClient["default"].convertToType(data['created_at'], 'Date');
335
286
  }
336
- if (data.hasOwnProperty('last_changed_by_external_email')) {
337
- obj['last_changed_by_external_email'] = _ApiClient["default"].convertToType(data['last_changed_by_external_email'], 'String');
338
- }
339
- if (data.hasOwnProperty('last_changed_by_external_id')) {
340
- obj['last_changed_by_external_id'] = _ApiClient["default"].convertToType(data['last_changed_by_external_id'], 'String');
287
+ if (data.hasOwnProperty('updated_at')) {
288
+ obj['updated_at'] = _ApiClient["default"].convertToType(data['updated_at'], 'Date');
341
289
  }
342
290
  if (data.hasOwnProperty('defaults')) {
343
- obj['defaults'] = _ApiClient["default"].convertToType(data['defaults'], Object);
291
+ obj['defaults'] = data['defaults'] === null ? null : _TemplateDefaults["default"].constructFromObject(data['defaults']);
344
292
  }
345
293
  if (data.hasOwnProperty('field_dependencies')) {
346
- obj['field_dependencies'] = _ApiClient["default"].convertToType(data['field_dependencies'], [Object]);
347
- }
348
- if (data.hasOwnProperty('field_order')) {
349
- obj['field_order'] = _ApiClient["default"].convertToType(data['field_order'], [['Number']]);
294
+ obj['field_dependencies'] = _ApiClient["default"].convertToType(data['field_dependencies'], [_TemplateFieldDependency["default"]]);
350
295
  }
351
- if (data.hasOwnProperty('fields')) {
352
- obj['fields'] = _ApiClient["default"].convertToType(data['fields'], Object);
296
+ if (data.hasOwnProperty('field_groups')) {
297
+ obj['field_groups'] = _ApiClient["default"].convertToType(data['field_groups'], [_FieldGroup["default"]]);
353
298
  }
354
- if (data.hasOwnProperty('footer_html')) {
355
- obj['footer_html'] = _ApiClient["default"].convertToType(data['footer_html'], 'String');
356
- }
357
- if (data.hasOwnProperty('header_html')) {
358
- obj['header_html'] = _ApiClient["default"].convertToType(data['header_html'], 'String');
299
+ if (data.hasOwnProperty('predefined_fields')) {
300
+ obj['predefined_fields'] = _ApiClient["default"].convertToType(data['predefined_fields'], [_PredefinedField["default"]]);
359
301
  }
360
- if (data.hasOwnProperty('html_engine_options')) {
361
- obj['html_engine_options'] = _ApiClient["default"].convertToType(data['html_engine_options'], Object);
302
+ if (data.hasOwnProperty('predefined_fields_sample_data')) {
303
+ obj['predefined_fields_sample_data'] = _ApiClient["default"].convertToType(data['predefined_fields_sample_data'], {
304
+ 'String': Object
305
+ });
362
306
  }
363
307
  if (data.hasOwnProperty('html')) {
364
308
  obj['html'] = _ApiClient["default"].convertToType(data['html'], 'String');
365
309
  }
366
- if (data.hasOwnProperty('predefined_fields')) {
367
- obj['predefined_fields'] = _ApiClient["default"].convertToType(data['predefined_fields'], [Object]);
368
- }
369
310
  if (data.hasOwnProperty('scss')) {
370
311
  obj['scss'] = _ApiClient["default"].convertToType(data['scss'], 'String');
371
312
  }
372
- if (data.hasOwnProperty('shared_field_data')) {
373
- obj['shared_field_data'] = _ApiClient["default"].convertToType(data['shared_field_data'], Object);
313
+ if (data.hasOwnProperty('header_html')) {
314
+ obj['header_html'] = _ApiClient["default"].convertToType(data['header_html'], 'String');
315
+ }
316
+ if (data.hasOwnProperty('footer_html')) {
317
+ obj['footer_html'] = _ApiClient["default"].convertToType(data['footer_html'], 'String');
374
318
  }
375
- if (data.hasOwnProperty('template_schema_version')) {
376
- obj['template_schema_version'] = _ApiClient["default"].convertToType(data['template_schema_version'], 'Number');
319
+ if (data.hasOwnProperty('html_engine_options')) {
320
+ obj['html_engine_options'] = _ApiClient["default"].convertToType(data['html_engine_options'], _HtmlEngineOptions["default"]);
321
+ }
322
+ if (data.hasOwnProperty('embed_edit_token')) {
323
+ obj['embed_edit_token'] = _ApiClient["default"].convertToType(data['embed_edit_token'], 'String');
377
324
  }
378
325
  if (data.hasOwnProperty('versions')) {
379
- obj['versions'] = _ApiClient["default"].convertToType(data['versions'], [Object]);
326
+ obj['versions'] = _ApiClient["default"].convertToType(data['versions'], [_TemplateVersion["default"]]);
380
327
  }
381
328
  }
382
329
  return obj;
@@ -406,46 +353,6 @@ var Template = /*#__PURE__*/function () {
406
353
  } finally {
407
354
  _iterator.f();
408
355
  }
409
- if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
410
- throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
411
- }
412
- // ensure the json data is a string
413
- if (data['document_filename'] && !(typeof data['document_filename'] === 'string' || data['document_filename'] instanceof String)) {
414
- throw new Error("Expected the field `document_filename` to be a primitive type in the JSON string but got " + data['document_filename']);
415
- }
416
- // ensure the json data is a string
417
- if (data['document_md5'] && !(typeof data['document_md5'] === 'string' || data['document_md5'] instanceof String)) {
418
- throw new Error("Expected the field `document_md5` to be a primitive type in the JSON string but got " + data['document_md5']);
419
- }
420
- // ensure the json data is a string
421
- if (data['document_state'] && !(typeof data['document_state'] === 'string' || data['document_state'] instanceof String)) {
422
- throw new Error("Expected the field `document_state` to be a primitive type in the JSON string but got " + data['document_state']);
423
- }
424
- // ensure the json data is a string
425
- if (data['document_url'] && !(typeof data['document_url'] === 'string' || data['document_url'] instanceof String)) {
426
- throw new Error("Expected the field `document_url` to be a primitive type in the JSON string but got " + data['document_url']);
427
- }
428
- // ensure the json data is a string
429
- if (data['embed_domains'] && !(typeof data['embed_domains'] === 'string' || data['embed_domains'] instanceof String)) {
430
- throw new Error("Expected the field `embed_domains` to be a primitive type in the JSON string but got " + data['embed_domains']);
431
- }
432
- // ensure the json data is a string
433
- if (data['encrypt_pdfs_password'] && !(typeof data['encrypt_pdfs_password'] === 'string' || data['encrypt_pdfs_password'] instanceof String)) {
434
- throw new Error("Expected the field `encrypt_pdfs_password` to be a primitive type in the JSON string but got " + data['encrypt_pdfs_password']);
435
- }
436
- // ensure the json data is a string
437
- if (data['expiration_interval'] && !(typeof data['expiration_interval'] === 'string' || data['expiration_interval'] instanceof String)) {
438
- throw new Error("Expected the field `expiration_interval` to be a primitive type in the JSON string but got " + data['expiration_interval']);
439
- }
440
- // ensure the json data is a string
441
- if (data['external_predefined_fields_template_id'] && !(typeof data['external_predefined_fields_template_id'] === 'string' || data['external_predefined_fields_template_id'] instanceof String)) {
442
- throw new Error("Expected the field `external_predefined_fields_template_id` to be a primitive type in the JSON string but got " + data['external_predefined_fields_template_id']);
443
- }
444
- // ensure the json data is a string
445
- if (data['external_predefined_fields_template_name'] && !(typeof data['external_predefined_fields_template_name'] === 'string' || data['external_predefined_fields_template_name'] instanceof String)) {
446
- throw new Error("Expected the field `external_predefined_fields_template_name` to be a primitive type in the JSON string but got " + data['external_predefined_fields_template_name']);
447
- }
448
- // ensure the json data is a string
449
356
  if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
450
357
  throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
451
358
  }
@@ -453,9 +360,14 @@ var Template = /*#__PURE__*/function () {
453
360
  if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
454
361
  throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
455
362
  }
456
- // ensure the json data is an array
457
- if (!Array.isArray(data['page_dimensions'])) {
458
- throw new Error("Expected the field `page_dimensions` to be an array in the JSON data but got " + data['page_dimensions']);
363
+ // ensure the json data is a string
364
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
365
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
366
+ }
367
+ // validate the optional field `document`
368
+ if (data['document']) {
369
+ // data not null
370
+ _TemplateDocument["default"].validateJSON(data['document']);
459
371
  }
460
372
  // ensure the json data is a string
461
373
  if (data['parent_folder_id'] && !(typeof data['parent_folder_id'] === 'string' || data['parent_folder_id'] instanceof String)) {
@@ -466,96 +378,79 @@ var Template = /*#__PURE__*/function () {
466
378
  throw new Error("Expected the field `path` to be a primitive type in the JSON string but got " + data['path']);
467
379
  }
468
380
  // ensure the json data is a string
469
- if (data['permanent_document_url'] && !(typeof data['permanent_document_url'] === 'string' || data['permanent_document_url'] instanceof String)) {
470
- throw new Error("Expected the field `permanent_document_url` to be a primitive type in the JSON string but got " + data['permanent_document_url']);
471
- }
472
- // ensure the json data is a string
473
- if (data['redirect_url'] && !(typeof data['redirect_url'] === 'string' || data['redirect_url'] instanceof String)) {
474
- throw new Error("Expected the field `redirect_url` to be a primitive type in the JSON string but got " + data['redirect_url']);
475
- }
476
- // ensure the json data is a string
477
- if (data['slack_webhook_url'] && !(typeof data['slack_webhook_url'] === 'string' || data['slack_webhook_url'] instanceof String)) {
478
- throw new Error("Expected the field `slack_webhook_url` to be a primitive type in the JSON string but got " + data['slack_webhook_url']);
479
- }
480
- // ensure the json data is a string
481
- if (data['template_type'] && !(typeof data['template_type'] === 'string' || data['template_type'] instanceof String)) {
482
- throw new Error("Expected the field `template_type` to be a primitive type in the JSON string but got " + data['template_type']);
483
- }
484
- // ensure the json data is a string
485
- if (data['updated_at'] && !(typeof data['updated_at'] === 'string' || data['updated_at'] instanceof String)) {
486
- throw new Error("Expected the field `updated_at` to be a primitive type in the JSON string but got " + data['updated_at']);
487
- }
488
- // ensure the json data is a string
489
- if (data['version_published_at'] && !(typeof data['version_published_at'] === 'string' || data['version_published_at'] instanceof String)) {
490
- throw new Error("Expected the field `version_published_at` to be a primitive type in the JSON string but got " + data['version_published_at']);
491
- }
492
- // ensure the json data is a string
493
381
  if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
494
382
  throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
495
383
  }
496
384
  // ensure the json data is a string
497
- if (data['webhook_url'] && !(typeof data['webhook_url'] === 'string' || data['webhook_url'] instanceof String)) {
498
- throw new Error("Expected the field `webhook_url` to be a primitive type in the JSON string but got " + data['webhook_url']);
499
- }
500
- // ensure the json data is a string
501
- if (data['embed_edit_token'] && !(typeof data['embed_edit_token'] === 'string' || data['embed_edit_token'] instanceof String)) {
502
- throw new Error("Expected the field `embed_edit_token` to be a primitive type in the JSON string but got " + data['embed_edit_token']);
503
- }
504
- // ensure the json data is a string
505
385
  if (data['latest_version'] && !(typeof data['latest_version'] === 'string' || data['latest_version'] instanceof String)) {
506
386
  throw new Error("Expected the field `latest_version` to be a primitive type in the JSON string but got " + data['latest_version']);
507
387
  }
508
- // ensure the json data is a string
509
- if (data['last_changed_at'] && !(typeof data['last_changed_at'] === 'string' || data['last_changed_at'] instanceof String)) {
510
- throw new Error("Expected the field `last_changed_at` to be a primitive type in the JSON string but got " + data['last_changed_at']);
511
- }
512
- // ensure the json data is a string
513
- if (data['last_changed_by_type'] && !(typeof data['last_changed_by_type'] === 'string' || data['last_changed_by_type'] instanceof String)) {
514
- throw new Error("Expected the field `last_changed_by_type` to be a primitive type in the JSON string but got " + data['last_changed_by_type']);
515
- }
516
- // ensure the json data is a string
517
- if (data['last_changed_by_id'] && !(typeof data['last_changed_by_id'] === 'string' || data['last_changed_by_id'] instanceof String)) {
518
- throw new Error("Expected the field `last_changed_by_id` to be a primitive type in the JSON string but got " + data['last_changed_by_id']);
519
- }
520
- // ensure the json data is a string
521
- if (data['last_changed_by_external_name'] && !(typeof data['last_changed_by_external_name'] === 'string' || data['last_changed_by_external_name'] instanceof String)) {
522
- throw new Error("Expected the field `last_changed_by_external_name` to be a primitive type in the JSON string but got " + data['last_changed_by_external_name']);
388
+ // ensure the json data is an array
389
+ if (!Array.isArray(data['embed_domains'])) {
390
+ throw new Error("Expected the field `embed_domains` to be an array in the JSON data but got " + data['embed_domains']);
523
391
  }
524
392
  // ensure the json data is a string
525
- if (data['last_changed_by_external_email'] && !(typeof data['last_changed_by_external_email'] === 'string' || data['last_changed_by_external_email'] instanceof String)) {
526
- throw new Error("Expected the field `last_changed_by_external_email` to be a primitive type in the JSON string but got " + data['last_changed_by_external_email']);
393
+ if (data['redirect_url'] && !(typeof data['redirect_url'] === 'string' || data['redirect_url'] instanceof String)) {
394
+ throw new Error("Expected the field `redirect_url` to be a primitive type in the JSON string but got " + data['redirect_url']);
527
395
  }
528
- // ensure the json data is a string
529
- if (data['last_changed_by_external_id'] && !(typeof data['last_changed_by_external_id'] === 'string' || data['last_changed_by_external_id'] instanceof String)) {
530
- throw new Error("Expected the field `last_changed_by_external_id` to be a primitive type in the JSON string but got " + data['last_changed_by_external_id']);
396
+ // validate the optional field `last_changed_by`
397
+ if (data['last_changed_by']) {
398
+ // data not null
399
+ _TemplateActor["default"].validateJSON(data['last_changed_by']);
531
400
  }
532
401
  // ensure the json data is an array
533
402
  if (!Array.isArray(data['field_dependencies'])) {
534
403
  throw new Error("Expected the field `field_dependencies` to be an array in the JSON data but got " + data['field_dependencies']);
535
404
  }
536
405
  // ensure the json data is an array
537
- if (!Array.isArray(data['field_order'])) {
538
- throw new Error("Expected the field `field_order` to be an array in the JSON data but got " + data['field_order']);
406
+ if (!Array.isArray(data['field_groups'])) {
407
+ throw new Error("Expected the field `field_groups` to be an array in the JSON data but got " + data['field_groups']);
408
+ }
409
+ if (data['predefined_fields']) {
410
+ // data not null
411
+ // ensure the json data is an array
412
+ if (!Array.isArray(data['predefined_fields'])) {
413
+ throw new Error("Expected the field `predefined_fields` to be an array in the JSON data but got " + data['predefined_fields']);
414
+ }
415
+ // validate the optional field `predefined_fields` (array)
416
+ var _iterator2 = _createForOfIteratorHelper(data['predefined_fields']),
417
+ _step2;
418
+ try {
419
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
420
+ var item = _step2.value;
421
+ _PredefinedField["default"].validateJSON(item);
422
+ }
423
+ } catch (err) {
424
+ _iterator2.e(err);
425
+ } finally {
426
+ _iterator2.f();
427
+ }
428
+ ;
539
429
  }
540
430
  // ensure the json data is a string
541
- if (data['footer_html'] && !(typeof data['footer_html'] === 'string' || data['footer_html'] instanceof String)) {
542
- throw new Error("Expected the field `footer_html` to be a primitive type in the JSON string but got " + data['footer_html']);
431
+ if (data['html'] && !(typeof data['html'] === 'string' || data['html'] instanceof String)) {
432
+ throw new Error("Expected the field `html` to be a primitive type in the JSON string but got " + data['html']);
433
+ }
434
+ // ensure the json data is a string
435
+ if (data['scss'] && !(typeof data['scss'] === 'string' || data['scss'] instanceof String)) {
436
+ throw new Error("Expected the field `scss` to be a primitive type in the JSON string but got " + data['scss']);
543
437
  }
544
438
  // ensure the json data is a string
545
439
  if (data['header_html'] && !(typeof data['header_html'] === 'string' || data['header_html'] instanceof String)) {
546
440
  throw new Error("Expected the field `header_html` to be a primitive type in the JSON string but got " + data['header_html']);
547
441
  }
548
442
  // ensure the json data is a string
549
- if (data['html'] && !(typeof data['html'] === 'string' || data['html'] instanceof String)) {
550
- throw new Error("Expected the field `html` to be a primitive type in the JSON string but got " + data['html']);
443
+ if (data['footer_html'] && !(typeof data['footer_html'] === 'string' || data['footer_html'] instanceof String)) {
444
+ throw new Error("Expected the field `footer_html` to be a primitive type in the JSON string but got " + data['footer_html']);
551
445
  }
552
- // ensure the json data is an array
553
- if (!Array.isArray(data['predefined_fields'])) {
554
- throw new Error("Expected the field `predefined_fields` to be an array in the JSON data but got " + data['predefined_fields']);
446
+ // validate the optional field `html_engine_options`
447
+ if (data['html_engine_options']) {
448
+ // data not null
449
+ _HtmlEngineOptions["default"].validateJSON(data['html_engine_options']);
555
450
  }
556
451
  // ensure the json data is a string
557
- if (data['scss'] && !(typeof data['scss'] === 'string' || data['scss'] instanceof String)) {
558
- throw new Error("Expected the field `scss` to be a primitive type in the JSON string but got " + data['scss']);
452
+ if (data['embed_edit_token'] && !(typeof data['embed_edit_token'] === 'string' || data['embed_edit_token'] instanceof String)) {
453
+ throw new Error("Expected the field `embed_edit_token` to be a primitive type in the JSON string but got " + data['embed_edit_token']);
559
454
  }
560
455
  // ensure the json data is an array
561
456
  if (!Array.isArray(data['versions'])) {
@@ -565,394 +460,298 @@ var Template = /*#__PURE__*/function () {
565
460
  }
566
461
  }]);
567
462
  }();
568
- Template.RequiredProperties = ["add_data_request_submission_id_footers", "allow_additional_properties", "description", "document_filename", "document_md5", "document_parse_error", "document_processed", "document_state", "document_url", "editable_submissions", "embed_domains", "embed_edit_allow_settings", "embed_edit_allow_versioning", "embed_edit_allow_document_replacement", "encrypt_pdfs_password", "encrypt_pdfs", "expiration_interval", "expire_after", "expire_submissions", "external_predefined_fields_template_id", "external_predefined_fields_template_name", "first_template", "id", "locked", "merge_audit_trail_pdf", "name", "page_count", "page_dimensions", "parent_folder_id", "parse_dates_using_template_date_format", "path", "permanent_document_url", "public_submissions", "public_web_form", "redirect_url", "slack_webhook_url", "template_type", "updated_at", "version_published_at", "version", "webhook_url", "demo", "latest_version", "last_changed_at", "last_changed_by_type", "last_changed_by_id", "last_changed_by_external_name", "last_changed_by_external_email", "last_changed_by_external_id", "defaults", "field_dependencies", "field_order", "fields", "footer_html", "header_html", "html_engine_options", "html", "predefined_fields", "scss", "shared_field_data", "template_schema_version", "versions"];
463
+ Template.RequiredProperties = ["id", "name", "description", "template_type", "ready", "document", "parent_folder_id", "path", "version", "latest_version", "version_published_at", "locked", "add_signature_request_submission_id_footers", "ai_field_naming_language", "allow_additional_properties", "allow_skipping_optional_fields", "default_form_mode", "editable_submissions", "embed_domains", "embed_edit_allow_settings", "embed_edit_allow_versioning", "embed_edit_allow_document_replacement", "encrypt_pdfs", "has_encrypt_pdfs_password", "expire_submissions", "expire_after", "expiration_interval", "merge_audit_trail_pdf", "parse_dates_using_template_date_format", "public_submissions", "public_web_form", "redirect_url", "has_slack_webhook_url", "last_changed_at", "last_changed_by", "created_at", "updated_at", "defaults", "field_dependencies", "field_groups", "predefined_fields", "predefined_fields_sample_data", "html", "scss", "header_html", "footer_html", "html_engine_options", "embed_edit_token", "versions"];
569
464
 
570
465
  /**
571
- * @member {Boolean} add_data_request_submission_id_footers
466
+ * The template's ID.
467
+ * @member {String} id
572
468
  */
573
- Template.prototype['add_data_request_submission_id_footers'] = undefined;
469
+ Template.prototype['id'] = undefined;
574
470
 
575
471
  /**
576
- * @member {Boolean} allow_additional_properties
472
+ * The template's name.
473
+ * @member {String} name
577
474
  */
578
- Template.prototype['allow_additional_properties'] = undefined;
475
+ Template.prototype['name'] = undefined;
579
476
 
580
477
  /**
478
+ * 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.
581
479
  * @member {String} description
582
480
  */
583
481
  Template.prototype['description'] = undefined;
584
482
 
585
483
  /**
586
- * @member {String} document_filename
587
- */
588
- Template.prototype['document_filename'] = undefined;
589
-
590
- /**
591
- * @member {String} document_md5
484
+ * `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.
485
+ * @member {module:model/TemplateType} template_type
592
486
  */
593
- Template.prototype['document_md5'] = undefined;
487
+ Template.prototype['template_type'] = undefined;
594
488
 
595
489
  /**
596
- * @member {Boolean} document_parse_error
490
+ * Whether the template can generate PDFs. HTML templates are always ready. A PDF template is ready once its document has been processed (`document.state` is `processed`).
491
+ * @member {Boolean} ready
597
492
  */
598
- Template.prototype['document_parse_error'] = undefined;
493
+ Template.prototype['ready'] = undefined;
599
494
 
600
495
  /**
601
- * @member {Boolean} document_processed
496
+ * The PDF of a PDF template. Null for HTML templates, and for a PDF template that has no PDF yet.
497
+ * @member {module:model/TemplateDocument} document
602
498
  */
603
- Template.prototype['document_processed'] = undefined;
499
+ Template.prototype['document'] = undefined;
604
500
 
605
501
  /**
606
- * @member {module:model/Template.DocumentStateEnum} document_state
502
+ * 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.
503
+ * @member {String} parent_folder_id
607
504
  */
608
- Template.prototype['document_state'] = undefined;
505
+ Template.prototype['parent_folder_id'] = undefined;
609
506
 
610
507
  /**
611
- * @member {String} document_url
508
+ * The path of the folder the template is in, such as `/Contracts`. `/` for a template at the root.
509
+ * @member {String} path
612
510
  */
613
- Template.prototype['document_url'] = undefined;
511
+ Template.prototype['path'] = undefined;
614
512
 
615
513
  /**
616
- * @member {Boolean} editable_submissions
514
+ * The published version this is, such as `1.2.0`. Null for the draft.
515
+ * @member {String} version
617
516
  */
618
- Template.prototype['editable_submissions'] = undefined;
517
+ Template.prototype['version'] = undefined;
619
518
 
620
519
  /**
621
- * @member {String} embed_domains
520
+ * The template's latest published version. Null if no version has been published.
521
+ * @member {String} latest_version
622
522
  */
623
- Template.prototype['embed_domains'] = undefined;
523
+ Template.prototype['latest_version'] = undefined;
624
524
 
625
525
  /**
626
- * @member {Boolean} embed_edit_allow_settings
526
+ * When this version was published. Null for the draft.
527
+ * @member {Date} version_published_at
627
528
  */
628
- Template.prototype['embed_edit_allow_settings'] = undefined;
529
+ Template.prototype['version_published_at'] = undefined;
629
530
 
630
531
  /**
631
- * @member {Boolean} embed_edit_allow_versioning
532
+ * A locked template can't be changed or deleted until it's unlocked (`locked` can always be changed).
533
+ * @member {Boolean} locked
632
534
  */
633
- Template.prototype['embed_edit_allow_versioning'] = undefined;
535
+ Template.prototype['locked'] = undefined;
634
536
 
635
537
  /**
636
- * @member {Boolean} embed_edit_allow_document_replacement
538
+ * Print the submission ID in the footer of each page of PDFs signed through signature requests.
539
+ * @member {Boolean} add_signature_request_submission_id_footers
637
540
  */
638
- Template.prototype['embed_edit_allow_document_replacement'] = undefined;
541
+ Template.prototype['add_signature_request_submission_id_footers'] = undefined;
639
542
 
640
543
  /**
641
- * @member {String} encrypt_pdfs_password
544
+ * 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.
545
+ * @member {module:model/AiFieldNamingLanguage} ai_field_naming_language
642
546
  */
643
- Template.prototype['encrypt_pdfs_password'] = undefined;
547
+ Template.prototype['ai_field_naming_language'] = undefined;
644
548
 
645
549
  /**
646
- * @member {Boolean} encrypt_pdfs
550
+ * Accept submission data with properties that aren't fields of the template.
551
+ * @member {Boolean} allow_additional_properties
647
552
  */
648
- Template.prototype['encrypt_pdfs'] = undefined;
553
+ Template.prototype['allow_additional_properties'] = undefined;
649
554
 
650
555
  /**
651
- * @member {String} expiration_interval
556
+ * 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.
557
+ * @member {Boolean} allow_skipping_optional_fields
652
558
  */
653
- Template.prototype['expiration_interval'] = undefined;
559
+ Template.prototype['allow_skipping_optional_fields'] = undefined;
654
560
 
655
561
  /**
656
- * @member {Number} expire_after
562
+ * 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.
563
+ * @member {module:model/TemplateFormMode} default_form_mode
657
564
  */
658
- Template.prototype['expire_after'] = undefined;
565
+ Template.prototype['default_form_mode'] = undefined;
659
566
 
660
567
  /**
661
- * @member {Boolean} expire_submissions
568
+ * Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
569
+ * @member {Boolean} editable_submissions
662
570
  */
663
- Template.prototype['expire_submissions'] = undefined;
571
+ Template.prototype['editable_submissions'] = undefined;
664
572
 
665
573
  /**
666
- * @member {String} external_predefined_fields_template_id
574
+ * 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.
575
+ * @member {Array.<String>} embed_domains
667
576
  */
668
- Template.prototype['external_predefined_fields_template_id'] = undefined;
577
+ Template.prototype['embed_domains'] = undefined;
669
578
 
670
579
  /**
671
- * @member {String} external_predefined_fields_template_name
580
+ * Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on).
581
+ * @member {Boolean} embed_edit_allow_settings
672
582
  */
673
- Template.prototype['external_predefined_fields_template_name'] = undefined;
583
+ Template.prototype['embed_edit_allow_settings'] = undefined;
674
584
 
675
585
  /**
676
- * @member {Boolean} first_template
586
+ * Allow the embedded template editor to publish, restore, compare and delete published versions.
587
+ * @member {Boolean} embed_edit_allow_versioning
677
588
  */
678
- Template.prototype['first_template'] = undefined;
589
+ Template.prototype['embed_edit_allow_versioning'] = undefined;
679
590
 
680
591
  /**
681
- * @member {String} id
592
+ * Allow the embedded template editor to replace the template's PDF.
593
+ * @member {Boolean} embed_edit_allow_document_replacement
682
594
  */
683
- Template.prototype['id'] = undefined;
595
+ Template.prototype['embed_edit_allow_document_replacement'] = undefined;
684
596
 
685
597
  /**
686
- * @member {Boolean} locked
598
+ * Encrypt generated PDFs with `encrypt_pdfs_password`.
599
+ * @member {Boolean} encrypt_pdfs
687
600
  */
688
- Template.prototype['locked'] = undefined;
601
+ Template.prototype['encrypt_pdfs'] = undefined;
689
602
 
690
603
  /**
691
- * @member {Boolean} merge_audit_trail_pdf
604
+ * Whether `encrypt_pdfs_password` is set.
605
+ * @member {Boolean} has_encrypt_pdfs_password
692
606
  */
693
- Template.prototype['merge_audit_trail_pdf'] = undefined;
607
+ Template.prototype['has_encrypt_pdfs_password'] = undefined;
694
608
 
695
609
  /**
696
- * @member {String} name
610
+ * Delete each submission's data and PDF after `expire_after` `expiration_interval`.
611
+ * @member {Boolean} expire_submissions
697
612
  */
698
- Template.prototype['name'] = undefined;
613
+ Template.prototype['expire_submissions'] = undefined;
699
614
 
700
615
  /**
701
- * @member {Number} page_count
616
+ * 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).
617
+ * @member {Number} expire_after
702
618
  */
703
- Template.prototype['page_count'] = undefined;
619
+ Template.prototype['expire_after'] = undefined;
704
620
 
705
621
  /**
706
- * @member {Array.<Array.<Number>>} page_dimensions
622
+ * The unit of `expire_after`.
623
+ * @member {module:model/ExpirationInterval} expiration_interval
707
624
  */
708
- Template.prototype['page_dimensions'] = undefined;
625
+ Template.prototype['expiration_interval'] = undefined;
709
626
 
710
627
  /**
711
- * @member {String} parent_folder_id
628
+ * Add the audit trail to the end of PDFs signed through signature requests.
629
+ * @member {Boolean} merge_audit_trail_pdf
712
630
  */
713
- Template.prototype['parent_folder_id'] = undefined;
631
+ Template.prototype['merge_audit_trail_pdf'] = undefined;
714
632
 
715
633
  /**
634
+ * 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.
716
635
  * @member {Boolean} parse_dates_using_template_date_format
717
636
  */
718
637
  Template.prototype['parse_dates_using_template_date_format'] = undefined;
719
638
 
720
639
  /**
721
- * @member {String} path
722
- */
723
- Template.prototype['path'] = undefined;
724
-
725
- /**
726
- * @member {String} permanent_document_url
727
- */
728
- Template.prototype['permanent_document_url'] = undefined;
729
-
730
- /**
640
+ * Allow anyone with a submission's ID to download its PDF.
731
641
  * @member {Boolean} public_submissions
732
642
  */
733
643
  Template.prototype['public_submissions'] = undefined;
734
644
 
735
645
  /**
646
+ * Allow anyone to fill in the template's web form.
736
647
  * @member {Boolean} public_web_form
737
648
  */
738
649
  Template.prototype['public_web_form'] = undefined;
739
650
 
740
651
  /**
652
+ * Where the web form sends people after they submit it.
741
653
  * @member {String} redirect_url
742
654
  */
743
655
  Template.prototype['redirect_url'] = undefined;
744
656
 
745
657
  /**
746
- * @member {String} slack_webhook_url
747
- */
748
- Template.prototype['slack_webhook_url'] = undefined;
749
-
750
- /**
751
- * @member {module:model/Template.TemplateTypeEnum} template_type
752
- */
753
- Template.prototype['template_type'] = undefined;
754
-
755
- /**
756
- * @member {String} updated_at
757
- */
758
- Template.prototype['updated_at'] = undefined;
759
-
760
- /**
761
- * @member {String} version_published_at
762
- */
763
- Template.prototype['version_published_at'] = undefined;
764
-
765
- /**
766
- * @member {String} version
767
- */
768
- Template.prototype['version'] = undefined;
769
-
770
- /**
771
- * @member {String} webhook_url
772
- */
773
- Template.prototype['webhook_url'] = undefined;
774
-
775
- /**
776
- * @member {String} embed_edit_token
777
- */
778
- Template.prototype['embed_edit_token'] = undefined;
779
-
780
- /**
781
- * @member {Boolean} demo
658
+ * Whether `slack_webhook_url` is set.
659
+ * @member {Boolean} has_slack_webhook_url
782
660
  */
783
- Template.prototype['demo'] = undefined;
661
+ Template.prototype['has_slack_webhook_url'] = undefined;
784
662
 
785
663
  /**
786
- * @member {String} latest_version
787
- */
788
- Template.prototype['latest_version'] = undefined;
789
-
790
- /**
791
- * @member {String} last_changed_at
664
+ * When the draft was last changed.
665
+ * @member {Date} last_changed_at
792
666
  */
793
667
  Template.prototype['last_changed_at'] = undefined;
794
668
 
795
669
  /**
796
- * @member {module:model/Template.LastChangedByTypeEnum} last_changed_by_type
797
- */
798
- Template.prototype['last_changed_by_type'] = undefined;
799
-
800
- /**
801
- * @member {String} last_changed_by_id
670
+ * 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.
671
+ * @member {module:model/TemplateActor} last_changed_by
802
672
  */
803
- Template.prototype['last_changed_by_id'] = undefined;
673
+ Template.prototype['last_changed_by'] = undefined;
804
674
 
805
675
  /**
806
- * @member {String} last_changed_by_external_name
676
+ * When the template was created.
677
+ * @member {Date} created_at
807
678
  */
808
- Template.prototype['last_changed_by_external_name'] = undefined;
679
+ Template.prototype['created_at'] = undefined;
809
680
 
810
681
  /**
811
- * @member {String} last_changed_by_external_email
682
+ * When the template was last updated.
683
+ * @member {Date} updated_at
812
684
  */
813
- Template.prototype['last_changed_by_external_email'] = undefined;
814
-
815
- /**
816
- * @member {String} last_changed_by_external_id
817
- */
818
- Template.prototype['last_changed_by_external_id'] = undefined;
685
+ Template.prototype['updated_at'] = undefined;
819
686
 
820
687
  /**
821
- * @member {Object} defaults
688
+ * @member {module:model/TemplateDefaults} defaults
822
689
  */
823
690
  Template.prototype['defaults'] = undefined;
824
691
 
825
692
  /**
826
- * @member {Array.<Object>} field_dependencies
693
+ * Conditional logic: each rule shows or hides its target fields, or makes them required, depending on the values of other fields.
694
+ * @member {Array.<module:model/TemplateFieldDependency>} field_dependencies
827
695
  */
828
696
  Template.prototype['field_dependencies'] = undefined;
829
697
 
830
698
  /**
831
- * @member {Array.<Array.<Number>>} field_order
832
- */
833
- Template.prototype['field_order'] = undefined;
834
-
835
- /**
836
- * @member {Object} fields
837
- */
838
- Template.prototype['fields'] = undefined;
839
-
840
- /**
841
- * @member {String} footer_html
699
+ * 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/~`.
700
+ * @member {Array.<module:model/FieldGroup>} field_groups
842
701
  */
843
- Template.prototype['footer_html'] = undefined;
702
+ Template.prototype['field_groups'] = undefined;
844
703
 
845
704
  /**
846
- * @member {String} header_html
705
+ * 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.
706
+ * @member {Array.<module:model/PredefinedField>} predefined_fields
847
707
  */
848
- Template.prototype['header_html'] = undefined;
708
+ Template.prototype['predefined_fields'] = undefined;
849
709
 
850
710
  /**
851
- * @member {Object} html_engine_options
711
+ * 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.
712
+ * @member {Object.<String, Object>} predefined_fields_sample_data
852
713
  */
853
- Template.prototype['html_engine_options'] = undefined;
714
+ Template.prototype['predefined_fields_sample_data'] = undefined;
854
715
 
855
716
  /**
717
+ * The HTML of an HTML template, as a Liquid template. Null for PDF templates.
856
718
  * @member {String} html
857
719
  */
858
720
  Template.prototype['html'] = undefined;
859
721
 
860
722
  /**
861
- * @member {Array.<Object>} predefined_fields
862
- */
863
- Template.prototype['predefined_fields'] = undefined;
864
-
865
- /**
723
+ * The SCSS of an HTML template.
866
724
  * @member {String} scss
867
725
  */
868
726
  Template.prototype['scss'] = undefined;
869
727
 
870
728
  /**
871
- * @member {Object} shared_field_data
872
- */
873
- Template.prototype['shared_field_data'] = undefined;
874
-
875
- /**
876
- * @member {Number} template_schema_version
729
+ * The HTML printed at the top of each page of an HTML template.
730
+ * @member {String} header_html
877
731
  */
878
- Template.prototype['template_schema_version'] = undefined;
732
+ Template.prototype['header_html'] = undefined;
879
733
 
880
734
  /**
881
- * @member {Array.<Object>} versions
735
+ * The HTML printed at the bottom of each page of an HTML template.
736
+ * @member {String} footer_html
882
737
  */
883
- Template.prototype['versions'] = undefined;
738
+ Template.prototype['footer_html'] = undefined;
884
739
 
885
740
  /**
886
- * Allowed values for the <code>document_state</code> property.
887
- * @enum {String}
888
- * @readonly
741
+ * How an HTML template's PDFs are printed. Null for PDF templates. Setting it replaces the whole object: options left out use their defaults.
742
+ * @member {module:model/HtmlEngineOptions} html_engine_options
889
743
  */
890
- Template['DocumentStateEnum'] = {
891
- /**
892
- * value: "pending"
893
- * @const
894
- */
895
- "pending": "pending",
896
- /**
897
- * value: "processed"
898
- * @const
899
- */
900
- "processed": "processed",
901
- /**
902
- * value: "password_required"
903
- * @const
904
- */
905
- "password_required": "password_required",
906
- /**
907
- * value: "malformed_pdf"
908
- * @const
909
- */
910
- "malformed_pdf": "malformed_pdf",
911
- /**
912
- * value: "unknown_error"
913
- * @const
914
- */
915
- "unknown_error": "unknown_error"
916
- };
744
+ Template.prototype['html_engine_options'] = undefined;
917
745
 
918
746
  /**
919
- * Allowed values for the <code>template_type</code> property.
920
- * @enum {String}
921
- * @readonly
747
+ * The token that opens the template in the embedded template editor.
748
+ * @member {String} embed_edit_token
922
749
  */
923
- Template['TemplateTypeEnum'] = {
924
- /**
925
- * value: "pdf"
926
- * @const
927
- */
928
- "pdf": "pdf",
929
- /**
930
- * value: "html"
931
- * @const
932
- */
933
- "html": "html"
934
- };
750
+ Template.prototype['embed_edit_token'] = undefined;
935
751
 
936
752
  /**
937
- * Allowed values for the <code>last_changed_by_type</code> property.
938
- * @enum {String}
939
- * @readonly
753
+ * The template's published versions, newest first (up to 100).
754
+ * @member {Array.<module:model/TemplateVersion>} versions
940
755
  */
941
- Template['LastChangedByTypeEnum'] = {
942
- /**
943
- * value: "user"
944
- * @const
945
- */
946
- "user": "user",
947
- /**
948
- * value: "api"
949
- * @const
950
- */
951
- "api": "api",
952
- /**
953
- * value: "external_user"
954
- * @const
955
- */
956
- "external_user": "external_user"
957
- };
756
+ Template.prototype['versions'] = undefined;
958
757
  var _default = exports["default"] = Template;