docspring 4.4.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/AGENTS.md +2 -0
  2. package/LICENSE +1 -1
  3. package/README.md +4 -1
  4. package/dist/ApiClient.js +2 -2
  5. package/dist/RequestSchemas.js +65 -10
  6. package/dist/api/Client.js +101 -98
  7. package/dist/index.js +14 -0
  8. package/dist/model/AddTemplateFieldsRequest.js +1 -1
  9. package/dist/model/AuthenticationCheck.js +1 -1
  10. package/dist/model/CombinedPdf.js +1 -1
  11. package/dist/model/CombinedPdfFiles.js +1 -1
  12. package/dist/model/CombinedPdfList.js +1 -1
  13. package/dist/model/CombinedPdfSource.js +1 -1
  14. package/dist/model/CombinedPdfSourceInput.js +1 -1
  15. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  16. package/dist/model/CopyTemplateRequest.js +1 -1
  17. package/dist/model/CreateAccountEmailActionRequest.js +1 -1
  18. package/dist/model/CreateCombinedPdfRequest.js +1 -1
  19. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  20. package/dist/model/CreateEmailActionRequest.js +1 -1
  21. package/dist/model/CreateEmailDomainRequest.js +1 -1
  22. package/dist/model/CreateFolderRequest.js +1 -1
  23. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  24. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  25. package/dist/model/CreateSubmissionBatchRequest.js +1 -1
  26. package/dist/model/CreateSubmissionRequest.js +4 -4
  27. package/dist/model/CreateTemplatePreviewRequest.js +1 -1
  28. package/dist/model/CreateTemplateRequest.js +47 -3
  29. package/dist/model/CreateWebhookRequest.js +1 -1
  30. package/dist/model/CustomFile.js +1 -1
  31. package/dist/model/CustomFileList.js +1 -1
  32. package/dist/model/CustomFileSourcePdf.js +1 -1
  33. package/dist/model/EmailAction.js +1 -1
  34. package/dist/model/EmailActionConditions.js +1 -1
  35. package/dist/model/EmailActionConditionsInput.js +1 -1
  36. package/dist/model/EmailActionCustomization.js +1 -1
  37. package/dist/model/EmailActionList.js +1 -1
  38. package/dist/model/EmailActionTestEmail.js +1 -1
  39. package/dist/model/EmailDomain.js +1 -1
  40. package/dist/model/EmailDomainDnsRecord.js +1 -1
  41. package/dist/model/EmailDomainList.js +1 -1
  42. package/dist/model/ErrorDetail.js +1 -1
  43. package/dist/model/ErrorInfo.js +30 -4
  44. package/dist/model/ErrorResponse.js +1 -1
  45. package/dist/model/Field.js +1 -1
  46. package/dist/model/FieldComparisonCondition.js +1 -1
  47. package/dist/model/FieldDependency.js +1 -1
  48. package/dist/model/FieldDependencyInput.js +1 -1
  49. package/dist/model/FieldEqualsCondition.js +1 -1
  50. package/dist/model/FieldGroup.js +1 -1
  51. package/dist/model/FieldGroupInput.js +1 -1
  52. package/dist/model/FieldInCondition.js +1 -1
  53. package/dist/model/FieldInput.js +1 -1
  54. package/dist/model/FieldOverride.js +1 -1
  55. package/dist/model/FieldPresenceCondition.js +1 -1
  56. package/dist/model/FieldRangeCondition.js +1 -1
  57. package/dist/model/Folder.js +1 -1
  58. package/dist/model/FolderList.js +1 -1
  59. package/dist/model/GenerateSubmissionFilesRequest.js +1 -1
  60. package/dist/model/GeneratedFile.js +1 -1
  61. package/dist/model/HtmlEngineOptions.js +7 -7
  62. package/dist/model/HtmlEngineOptionsInput.js +5 -5
  63. package/dist/model/MoveFolderRequest.js +1 -1
  64. package/dist/model/MoveTemplateRequest.js +1 -1
  65. package/dist/model/PageImage.js +1 -1
  66. package/dist/model/PageImages.js +1 -1
  67. package/dist/model/PredefinedField.js +1 -1
  68. package/dist/model/PredefinedFieldInput.js +1 -1
  69. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  70. package/dist/model/RemoveTemplateFieldsRequest.js +1 -1
  71. package/dist/model/RenameFolderRequest.js +1 -1
  72. package/dist/model/ReorderTemplateFieldsRequest.js +1 -1
  73. package/dist/model/RestoreTemplateVersionRequest.js +1 -1
  74. package/dist/model/SendAccountEmailActionTestEmailRequest.js +1 -1
  75. package/dist/model/SignatureRequest.js +1 -1
  76. package/dist/model/SignatureRequestEvent.js +1 -1
  77. package/dist/model/SignatureRequestInput.js +1 -1
  78. package/dist/model/SignatureRequestReminders.js +1 -1
  79. package/dist/model/SignatureRequestToken.js +1 -1
  80. package/dist/model/Submission.js +1 -1
  81. package/dist/model/SubmissionAction.js +1 -1
  82. package/dist/model/SubmissionBatch.js +1 -1
  83. package/dist/model/SubmissionFiles.js +1 -1
  84. package/dist/model/SubmissionInput.js +2 -2
  85. package/dist/model/SubmissionList.js +1 -1
  86. package/dist/model/SubmissionSourcePdf.js +1 -1
  87. package/dist/model/SubmissionSummary.js +1 -1
  88. package/dist/model/SubmissionValidation.js +1 -1
  89. package/dist/model/Template.js +66 -9
  90. package/dist/model/TemplateActor.js +1 -1
  91. package/dist/model/TemplateDefaults.js +1 -1
  92. package/dist/model/TemplateDefaultsInput.js +1 -1
  93. package/dist/model/TemplateDiff.js +1 -1
  94. package/dist/model/TemplateDiffSummary.js +1 -1
  95. package/dist/model/TemplateDocument.js +1 -1
  96. package/dist/model/TemplateDocumentSummary.js +1 -1
  97. package/dist/model/TemplateFieldChange.js +1 -1
  98. package/dist/model/TemplateFieldChanges.js +1 -1
  99. package/dist/model/TemplateFieldDependency.js +1 -1
  100. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  101. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  102. package/dist/model/TemplateFieldDependencyInput.js +1 -1
  103. package/dist/model/TemplateFieldMove.js +1 -1
  104. package/dist/model/TemplateFields.js +1 -1
  105. package/dist/model/TemplateFormSection.js +161 -0
  106. package/dist/model/TemplateFormSectionInput.js +157 -0
  107. package/dist/model/TemplateModelCode.js +1 -1
  108. package/dist/model/TemplatePageImages.js +1 -1
  109. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  110. package/dist/model/TemplatePreview.js +1 -1
  111. package/dist/model/TemplateSourcePdf.js +1 -1
  112. package/dist/model/TemplateSummary.js +1 -1
  113. package/dist/model/TemplateSummaryList.js +1 -1
  114. package/dist/model/TemplateVersion.js +1 -1
  115. package/dist/model/UpdateAccountEmailActionRequest.js +1 -1
  116. package/dist/model/UpdateEmailActionCustomizationRequest.js +1 -1
  117. package/dist/model/UpdateEmailActionRequest.js +1 -1
  118. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  119. package/dist/model/UpdateTemplateDocumentRequest.js +1 -1
  120. package/dist/model/UpdateTemplateFieldsRequest.js +1 -1
  121. package/dist/model/UpdateTemplateRequest.js +75 -9
  122. package/dist/model/UpdateWebhookRequest.js +1 -1
  123. package/dist/model/UploadPresign.js +1 -1
  124. package/dist/model/UrlSourcePdf.js +1 -1
  125. package/dist/model/ValidateSubmissionRequest.js +4 -4
  126. package/dist/model/Webhook.js +1 -1
  127. package/dist/model/WebhookList.js +1 -1
  128. package/package.json +1 -1
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
18
+ * DocSpring API
19
+ * Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
20
+ *
21
+ * The version of the OpenAPI document: v2
22
+ *
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The TemplateFormSectionInput model module.
31
+ * @module model/TemplateFormSectionInput
32
+ * @version 4.5.0
33
+ */
34
+ var TemplateFormSectionInput = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>TemplateFormSectionInput</code>.
37
+ * A section of the template's web form, with its fields in order.
38
+ * @alias module:model/TemplateFormSectionInput
39
+ * @param id {String} The section's ID, unique among the template's sections. Any string you choose.
40
+ * @param title {String} The section's heading on the web form.
41
+ * @param field_ids {Array.<Number>} The IDs of the section's fields (Field's `id`), in the order the web form shows them. A field can be in one section only.
42
+ */
43
+ function TemplateFormSectionInput(id, title, field_ids) {
44
+ _classCallCheck(this, TemplateFormSectionInput);
45
+ TemplateFormSectionInput.initialize(this, id, title, field_ids);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(TemplateFormSectionInput, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, id, title, field_ids) {
56
+ obj['id'] = id;
57
+ obj['title'] = title;
58
+ obj['field_ids'] = field_ids;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>TemplateFormSectionInput</code> from a plain JavaScript object, optionally creating a new instance.
63
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
64
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
65
+ * @param {module:model/TemplateFormSectionInput} obj Optional instance to populate.
66
+ * @return {module:model/TemplateFormSectionInput} The populated <code>TemplateFormSectionInput</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new TemplateFormSectionInput();
73
+ if (data.hasOwnProperty('id')) {
74
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
75
+ }
76
+ if (data.hasOwnProperty('title')) {
77
+ obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('description')) {
80
+ obj['description'] = _ApiClient["default"].convertToType(data['description'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('field_ids')) {
83
+ obj['field_ids'] = _ApiClient["default"].convertToType(data['field_ids'], ['Number']);
84
+ }
85
+ }
86
+ return obj;
87
+ }
88
+
89
+ /**
90
+ * Validates the JSON data with respect to <code>TemplateFormSectionInput</code>.
91
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
92
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateFormSectionInput</code>.
93
+ */
94
+ }, {
95
+ key: "validateJSON",
96
+ value: function validateJSON(data) {
97
+ // check to make sure all required properties are present in the JSON string
98
+ var _iterator = _createForOfIteratorHelper(TemplateFormSectionInput.RequiredProperties),
99
+ _step;
100
+ try {
101
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
102
+ var property = _step.value;
103
+ if (!data.hasOwnProperty(property)) {
104
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
105
+ }
106
+ }
107
+ // ensure the json data is a string
108
+ } catch (err) {
109
+ _iterator.e(err);
110
+ } finally {
111
+ _iterator.f();
112
+ }
113
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
114
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
115
+ }
116
+ // ensure the json data is a string
117
+ if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
118
+ throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
119
+ }
120
+ // ensure the json data is a string
121
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
122
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
123
+ }
124
+ // ensure the json data is an array
125
+ if (!Array.isArray(data['field_ids'])) {
126
+ throw new Error("Expected the field `field_ids` to be an array in the JSON data but got " + data['field_ids']);
127
+ }
128
+ return true;
129
+ }
130
+ }]);
131
+ }();
132
+ TemplateFormSectionInput.RequiredProperties = ["id", "title", "field_ids"];
133
+
134
+ /**
135
+ * The section's ID, unique among the template's sections. Any string you choose.
136
+ * @member {String} id
137
+ */
138
+ TemplateFormSectionInput.prototype['id'] = undefined;
139
+
140
+ /**
141
+ * The section's heading on the web form.
142
+ * @member {String} title
143
+ */
144
+ TemplateFormSectionInput.prototype['title'] = undefined;
145
+
146
+ /**
147
+ * Text shown under the section's heading. Null for none.
148
+ * @member {String} description
149
+ */
150
+ TemplateFormSectionInput.prototype['description'] = undefined;
151
+
152
+ /**
153
+ * The IDs of the section's fields (Field's `id`), in the order the web form shows them. A field can be in one section only.
154
+ * @member {Array.<Number>} field_ids
155
+ */
156
+ TemplateFormSectionInput.prototype['field_ids'] = undefined;
157
+ var _default = exports["default"] = TemplateFormSectionInput;
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The TemplateModelCode model module.
32
32
  * @module model/TemplateModelCode
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var TemplateModelCode = /*#__PURE__*/function () {
36
36
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The TemplatePageImages model module.
32
32
  * @module model/TemplatePageImages
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var TemplatePageImages = /*#__PURE__*/function () {
36
36
  /**
@@ -33,7 +33,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
33
33
  /**
34
34
  * The TemplatePageProcessingStatus model module.
35
35
  * @module model/TemplatePageProcessingStatus
36
- * @version 4.4.0
36
+ * @version 4.5.0
37
37
  */
38
38
  var TemplatePageProcessingStatus = /*#__PURE__*/function () {
39
39
  /**
@@ -31,7 +31,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
31
31
  /**
32
32
  * The TemplatePreview model module.
33
33
  * @module model/TemplatePreview
34
- * @version 4.4.0
34
+ * @version 4.5.0
35
35
  */
36
36
  var TemplatePreview = /*#__PURE__*/function () {
37
37
  /**
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The TemplateSourcePdf model module.
31
31
  * @module model/TemplateSourcePdf
32
- * @version 4.4.0
32
+ * @version 4.5.0
33
33
  */
34
34
  var TemplateSourcePdf = /*#__PURE__*/function () {
35
35
  /**
@@ -32,7 +32,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
32
32
  /**
33
33
  * The TemplateSummary model module.
34
34
  * @module model/TemplateSummary
35
- * @version 4.4.0
35
+ * @version 4.5.0
36
36
  */
37
37
  var TemplateSummary = /*#__PURE__*/function () {
38
38
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The TemplateSummaryList model module.
32
32
  * @module model/TemplateSummaryList
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var TemplateSummaryList = /*#__PURE__*/function () {
36
36
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The TemplateVersion model module.
32
32
  * @module model/TemplateVersion
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var TemplateVersion = /*#__PURE__*/function () {
36
36
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UpdateAccountEmailActionRequest model module.
32
32
  * @module model/UpdateAccountEmailActionRequest
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var UpdateAccountEmailActionRequest = /*#__PURE__*/function () {
36
36
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UpdateEmailActionCustomizationRequest model module.
32
32
  * @module model/UpdateEmailActionCustomizationRequest
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var UpdateEmailActionCustomizationRequest = /*#__PURE__*/function () {
36
36
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UpdateEmailActionRequest model module.
32
32
  * @module model/UpdateEmailActionRequest
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var UpdateEmailActionRequest = /*#__PURE__*/function () {
36
36
  /**
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
28
28
  /**
29
29
  * The UpdateSignatureRequestRequest model module.
30
30
  * @module model/UpdateSignatureRequestRequest
31
- * @version 4.4.0
31
+ * @version 4.5.0
32
32
  */
33
33
  var UpdateSignatureRequestRequest = /*#__PURE__*/function () {
34
34
  /**
@@ -26,7 +26,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
26
26
  /**
27
27
  * The UpdateTemplateDocumentRequest model module.
28
28
  * @module model/UpdateTemplateDocumentRequest
29
- * @version 4.4.0
29
+ * @version 4.5.0
30
30
  */
31
31
  var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
32
32
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UpdateTemplateFieldsRequest model module.
32
32
  * @module model/UpdateTemplateFieldsRequest
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var UpdateTemplateFieldsRequest = /*#__PURE__*/function () {
36
36
  /**
@@ -15,6 +15,7 @@ var _SignatureRequestEmailAttachments = _interopRequireDefault(require("./Signat
15
15
  var _TemplateDefaultsInput = _interopRequireDefault(require("./TemplateDefaultsInput"));
16
16
  var _TemplateFieldDependencyInput = _interopRequireDefault(require("./TemplateFieldDependencyInput"));
17
17
  var _TemplateFormMode = _interopRequireDefault(require("./TemplateFormMode"));
18
+ var _TemplateFormSectionInput = _interopRequireDefault(require("./TemplateFormSectionInput"));
18
19
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
20
  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); }
20
21
  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; } } }; }
@@ -39,7 +40,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
39
40
  /**
40
41
  * The UpdateTemplateRequest model module.
41
42
  * @module model/UpdateTemplateRequest
42
- * @version 4.4.0
43
+ * @version 4.5.0
43
44
  */
44
45
  var UpdateTemplateRequest = /*#__PURE__*/function () {
45
46
  /**
@@ -169,6 +170,15 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
169
170
  if (data.hasOwnProperty('signature_request_signing_url')) {
170
171
  obj['signature_request_signing_url'] = _ApiClient["default"].convertToType(data['signature_request_signing_url'], 'String');
171
172
  }
173
+ if (data.hasOwnProperty('success_title')) {
174
+ obj['success_title'] = _ApiClient["default"].convertToType(data['success_title'], 'String');
175
+ }
176
+ if (data.hasOwnProperty('success_message')) {
177
+ obj['success_message'] = _ApiClient["default"].convertToType(data['success_message'], 'String');
178
+ }
179
+ if (data.hasOwnProperty('show_fill_again_button')) {
180
+ obj['show_fill_again_button'] = _ApiClient["default"].convertToType(data['show_fill_again_button'], 'Boolean');
181
+ }
172
182
  if (data.hasOwnProperty('slack_webhook_url')) {
173
183
  obj['slack_webhook_url'] = _ApiClient["default"].convertToType(data['slack_webhook_url'], 'String');
174
184
  }
@@ -181,6 +191,9 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
181
191
  if (data.hasOwnProperty('field_groups')) {
182
192
  obj['field_groups'] = _ApiClient["default"].convertToType(data['field_groups'], [_FieldGroupInput["default"]]);
183
193
  }
194
+ if (data.hasOwnProperty('form_sections')) {
195
+ obj['form_sections'] = _ApiClient["default"].convertToType(data['form_sections'], [_TemplateFormSectionInput["default"]]);
196
+ }
184
197
  if (data.hasOwnProperty('predefined_fields')) {
185
198
  obj['predefined_fields'] = _ApiClient["default"].convertToType(data['predefined_fields'], [_PredefinedFieldInput["default"]]);
186
199
  }
@@ -269,6 +282,14 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
269
282
  throw new Error("Expected the field `signature_request_signing_url` to be a primitive type in the JSON string but got " + data['signature_request_signing_url']);
270
283
  }
271
284
  // ensure the json data is a string
285
+ if (data['success_title'] && !(typeof data['success_title'] === 'string' || data['success_title'] instanceof String)) {
286
+ throw new Error("Expected the field `success_title` to be a primitive type in the JSON string but got " + data['success_title']);
287
+ }
288
+ // ensure the json data is a string
289
+ if (data['success_message'] && !(typeof data['success_message'] === 'string' || data['success_message'] instanceof String)) {
290
+ throw new Error("Expected the field `success_message` to be a primitive type in the JSON string but got " + data['success_message']);
291
+ }
292
+ // ensure the json data is a string
272
293
  if (data['slack_webhook_url'] && !(typeof data['slack_webhook_url'] === 'string' || data['slack_webhook_url'] instanceof String)) {
273
294
  throw new Error("Expected the field `slack_webhook_url` to be a primitive type in the JSON string but got " + data['slack_webhook_url']);
274
295
  }
@@ -319,19 +340,19 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
319
340
  }
320
341
  ;
321
342
  }
322
- if (data['predefined_fields']) {
343
+ if (data['form_sections']) {
323
344
  // data not null
324
345
  // ensure the json data is an array
325
- if (!Array.isArray(data['predefined_fields'])) {
326
- throw new Error("Expected the field `predefined_fields` to be an array in the JSON data but got " + data['predefined_fields']);
346
+ if (!Array.isArray(data['form_sections'])) {
347
+ throw new Error("Expected the field `form_sections` to be an array in the JSON data but got " + data['form_sections']);
327
348
  }
328
- // validate the optional field `predefined_fields` (array)
329
- var _iterator3 = _createForOfIteratorHelper(data['predefined_fields']),
349
+ // validate the optional field `form_sections` (array)
350
+ var _iterator3 = _createForOfIteratorHelper(data['form_sections']),
330
351
  _step3;
331
352
  try {
332
353
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
333
354
  var _item2 = _step3.value;
334
- _PredefinedFieldInput["default"].validateJSON(_item2);
355
+ _TemplateFormSectionInput["default"].validateJSON(_item2);
335
356
  }
336
357
  } catch (err) {
337
358
  _iterator3.e(err);
@@ -340,6 +361,27 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
340
361
  }
341
362
  ;
342
363
  }
364
+ if (data['predefined_fields']) {
365
+ // data not null
366
+ // ensure the json data is an array
367
+ if (!Array.isArray(data['predefined_fields'])) {
368
+ throw new Error("Expected the field `predefined_fields` to be an array in the JSON data but got " + data['predefined_fields']);
369
+ }
370
+ // validate the optional field `predefined_fields` (array)
371
+ var _iterator4 = _createForOfIteratorHelper(data['predefined_fields']),
372
+ _step4;
373
+ try {
374
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
375
+ var _item3 = _step4.value;
376
+ _PredefinedFieldInput["default"].validateJSON(_item3);
377
+ }
378
+ } catch (err) {
379
+ _iterator4.e(err);
380
+ } finally {
381
+ _iterator4.f();
382
+ }
383
+ ;
384
+ }
343
385
  // ensure the json data is a string
344
386
  if (data['html'] && !(typeof data['html'] === 'string' || data['html'] instanceof String)) {
345
387
  throw new Error("Expected the field `html` to be a primitive type in the JSON string but got " + data['html']);
@@ -432,7 +474,7 @@ UpdateTemplateRequest.prototype['default_form_mode'] = undefined;
432
474
  UpdateTemplateRequest.prototype['editable_submissions'] = undefined;
433
475
 
434
476
  /**
435
- * The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work), without a path. Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted.
477
+ * The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work), without a path. Each one is stored in lowercase, without a trailing slash. Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and Web Forms JS) aren't restricted.
436
478
  * @member {Array.<String>} embed_domains
437
479
  */
438
480
  UpdateTemplateRequest.prototype['embed_domains'] = undefined;
@@ -510,7 +552,7 @@ UpdateTemplateRequest.prototype['public_submissions'] = undefined;
510
552
  UpdateTemplateRequest.prototype['public_web_form'] = undefined;
511
553
 
512
554
  /**
513
- * Where the web form sends people after they submit it.
555
+ * Where the web form sends people after they submit it, instead of showing its success screen. After its `?` or `#`, it can have variables such as `{{ data.first_name }}`, which the form fills in with what they submitted.
514
556
  * @member {String} redirect_url
515
557
  */
516
558
  UpdateTemplateRequest.prototype['redirect_url'] = undefined;
@@ -557,6 +599,24 @@ UpdateTemplateRequest.prototype['signature_request_reply_to'] = undefined;
557
599
  */
558
600
  UpdateTemplateRequest.prototype['signature_request_signing_url'] = undefined;
559
601
 
602
+ /**
603
+ * The title of the web form's success screen. When it's null or empty, the screen says "Thanks for filling out" and the template's name. It can have variables such as `{{ data.first_name }}`.
604
+ * @member {String} success_title
605
+ */
606
+ UpdateTemplateRequest.prototype['success_title'] = undefined;
607
+
608
+ /**
609
+ * A message under the title of the web form's success screen, as plain text. Line breaks show, and web addresses become links. It can have variables such as `{{ data.first_name }}`.
610
+ * @member {String} success_message
611
+ */
612
+ UpdateTemplateRequest.prototype['success_message'] = undefined;
613
+
614
+ /**
615
+ * Whether the web form's success screen has a "Fill out again" button, which clears the form so someone can fill it in again.
616
+ * @member {Boolean} show_fill_again_button
617
+ */
618
+ UpdateTemplateRequest.prototype['show_fill_again_button'] = undefined;
619
+
560
620
  /**
561
621
  * A Slack incoming webhook URL that is notified about the template's submissions. It's never returned; `has_slack_webhook_url` says if it's set.
562
622
  * @member {String} slack_webhook_url
@@ -581,6 +641,12 @@ UpdateTemplateRequest.prototype['field_dependencies'] = undefined;
581
641
  */
582
642
  UpdateTemplateRequest.prototype['field_groups'] = undefined;
583
643
 
644
+ /**
645
+ * The web form's sections, in order. Setting them replaces all of the sections; an empty list removes them.
646
+ * @member {Array.<module:model/TemplateFormSectionInput>} form_sections
647
+ */
648
+ UpdateTemplateRequest.prototype['form_sections'] = undefined;
649
+
584
650
  /**
585
651
  * 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.
586
652
  * @member {Array.<module:model/PredefinedFieldInput>} predefined_fields
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
28
28
  /**
29
29
  * The UpdateWebhookRequest model module.
30
30
  * @module model/UpdateWebhookRequest
31
- * @version 4.4.0
31
+ * @version 4.5.0
32
32
  */
33
33
  var UpdateWebhookRequest = /*#__PURE__*/function () {
34
34
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The UploadPresign model module.
32
32
  * @module model/UploadPresign
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var UploadPresign = /*#__PURE__*/function () {
36
36
  /**
@@ -29,7 +29,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
29
  /**
30
30
  * The UrlSourcePdf model module.
31
31
  * @module model/UrlSourcePdf
32
- * @version 4.4.0
32
+ * @version 4.5.0
33
33
  */
34
34
  var UrlSourcePdf = /*#__PURE__*/function () {
35
35
  /**
@@ -34,7 +34,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
34
34
  /**
35
35
  * The ValidateSubmissionRequest model module.
36
36
  * @module model/ValidateSubmissionRequest
37
- * @version 4.4.0
37
+ * @version 4.5.0
38
38
  */
39
39
  var ValidateSubmissionRequest = /*#__PURE__*/function () {
40
40
  /**
@@ -225,7 +225,7 @@ ValidateSubmissionRequest.prototype['test'] = undefined;
225
225
  ValidateSubmissionRequest.prototype['editable'] = undefined;
226
226
 
227
227
  /**
228
- * The values of the template's fields, by field name. Required for PDF templates, Word templates and page designs, unless `signature_requests` collects them (PDF templates only).
228
+ * The values of the template's fields, by field name. Required for PDF templates, Word templates and page designs, unless `signature_requests` collects them (PDF templates only). Signatures come only from signature requests: a value for a signature or initials field makes the submission `invalid_data`, in test mode too. To print an image or a name you send, use an Image or Text field.
229
229
  * @member {Object.<String, Object>} data
230
230
  */
231
231
  ValidateSubmissionRequest.prototype['data'] = undefined;
@@ -255,7 +255,7 @@ ValidateSubmissionRequest.prototype['output_formats'] = undefined;
255
255
  ValidateSubmissionRequest.prototype['expires_in'] = undefined;
256
256
 
257
257
  /**
258
- * Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`.
258
+ * Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. A `default` for a signature or initials field makes the submission `invalid_data`. With `signature_requests`, `editable: true` is a 422.
259
259
  * @member {Object.<String, module:model/FieldOverride>} field_overrides
260
260
  */
261
261
  ValidateSubmissionRequest.prototype['field_overrides'] = undefined;
@@ -273,7 +273,7 @@ ValidateSubmissionRequest.prototype['html'] = undefined;
273
273
  ValidateSubmissionRequest.prototype['css'] = undefined;
274
274
 
275
275
  /**
276
- * The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`.
276
+ * The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out.
277
277
  * @member {Array.<module:model/SignatureRequestInput>} signature_requests
278
278
  */
279
279
  ValidateSubmissionRequest.prototype['signature_requests'] = undefined;
@@ -31,7 +31,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
31
31
  /**
32
32
  * The Webhook model module.
33
33
  * @module model/Webhook
34
- * @version 4.4.0
34
+ * @version 4.5.0
35
35
  */
36
36
  var Webhook = /*#__PURE__*/function () {
37
37
  /**
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
30
30
  /**
31
31
  * The WebhookList model module.
32
32
  * @module model/WebhookList
33
- * @version 4.4.0
33
+ * @version 4.5.0
34
34
  */
35
35
  var WebhookList = /*#__PURE__*/function () {
36
36
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docspring",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "An API client for DocSpring: fill PDF forms, generate PDFs and Word documents, and collect e-signatures",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",