docspring 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/AGENTS.md +3 -2
  2. package/README.md +13 -1
  3. package/dist/ApiClient.js +2 -2
  4. package/dist/RequestSchemas.js +1231 -9
  5. package/dist/WebhookSignature.js +86 -0
  6. package/dist/api/Client.js +620 -38
  7. package/dist/index.js +238 -0
  8. package/dist/model/AddTemplateFieldsRequest.js +132 -0
  9. package/dist/model/AuthenticationCheck.js +1 -1
  10. package/dist/model/CombinedPdf.js +3 -3
  11. package/dist/model/CombinedPdfFiles.js +1 -1
  12. package/dist/model/CombinedPdfList.js +1 -1
  13. package/dist/model/CombinedPdfSource.js +1 -1
  14. package/dist/model/CombinedPdfSourceInput.js +1 -1
  15. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  16. package/dist/model/CopyTemplateRequest.js +1 -1
  17. package/dist/model/CreateCombinedPdfRequest.js +2 -2
  18. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  19. package/dist/model/CreateFolderRequest.js +1 -1
  20. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  21. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  22. package/dist/model/CreateSubmissionBatchRequest.js +15 -1
  23. package/dist/model/CreateSubmissionRequest.js +17 -3
  24. package/dist/model/CreateTemplatePreviewRequest.js +112 -0
  25. package/dist/model/CreateTemplateRequest.js +81 -4
  26. package/dist/model/CreateWebhookRequest.js +1 -1
  27. package/dist/model/CustomFile.js +1 -1
  28. package/dist/model/CustomFileList.js +1 -1
  29. package/dist/model/CustomFileSourcePdf.js +1 -1
  30. package/dist/model/ErrorCode.js +11 -1
  31. package/dist/model/ErrorDetail.js +2 -2
  32. package/dist/model/ErrorInfo.js +6 -6
  33. package/dist/model/ErrorResponse.js +1 -1
  34. package/dist/model/Field.js +1230 -0
  35. package/dist/model/FieldComparisonCondition.js +1 -1
  36. package/dist/model/FieldDependency.js +154 -0
  37. package/dist/model/FieldDependencyInput.js +154 -0
  38. package/dist/model/FieldEqualsCondition.js +1 -1
  39. package/dist/model/FieldGroup.js +206 -0
  40. package/dist/model/FieldGroupInput.js +180 -0
  41. package/dist/model/FieldGroupType.js +59 -0
  42. package/dist/model/FieldInCondition.js +1 -1
  43. package/dist/model/FieldInput.js +1012 -0
  44. package/dist/model/FieldOverride.js +1 -1
  45. package/dist/model/FieldPresenceCondition.js +1 -1
  46. package/dist/model/FieldRangeCondition.js +1 -1
  47. package/dist/model/FieldType.js +124 -0
  48. package/dist/model/Folder.js +1 -1
  49. package/dist/model/FolderList.js +1 -1
  50. package/dist/model/GenerateFilesFormat.js +54 -0
  51. package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
  52. package/dist/model/GeneratedFile.js +1 -1
  53. package/dist/model/HtmlEngineOptions.js +1 -1
  54. package/dist/model/HtmlEngineOptionsInput.js +1 -1
  55. package/dist/model/MoveFolderRequest.js +1 -1
  56. package/dist/model/MoveTemplateRequest.js +1 -1
  57. package/dist/model/OutputFormat.js +59 -0
  58. package/dist/model/PageImage.js +220 -0
  59. package/dist/model/PageImages.js +155 -0
  60. package/dist/model/PredefinedField.js +183 -0
  61. package/dist/model/PredefinedFieldInput.js +183 -0
  62. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  63. package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
  64. package/dist/model/RenameFolderRequest.js +1 -1
  65. package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
  66. package/dist/model/RestoreTemplateVersionRequest.js +1 -1
  67. package/dist/model/SignatureRequest.js +1 -1
  68. package/dist/model/SignatureRequestEvent.js +1 -1
  69. package/dist/model/SignatureRequestInput.js +1 -1
  70. package/dist/model/SignatureRequestToken.js +1 -1
  71. package/dist/model/Submission.js +84 -68
  72. package/dist/model/SubmissionAction.js +1 -1
  73. package/dist/model/SubmissionBatch.js +1 -1
  74. package/dist/model/SubmissionFiles.js +10 -1
  75. package/dist/model/SubmissionInput.js +17 -3
  76. package/dist/model/SubmissionList.js +5 -5
  77. package/dist/model/SubmissionSourcePdf.js +1 -1
  78. package/dist/model/SubmissionSummary.js +343 -0
  79. package/dist/model/SubmissionValidation.js +151 -0
  80. package/dist/model/Template.js +129 -56
  81. package/dist/model/TemplateActor.js +3 -3
  82. package/dist/model/TemplateDefaults.js +1 -1
  83. package/dist/model/TemplateDefaultsInput.js +1 -1
  84. package/dist/model/TemplateDiff.js +206 -0
  85. package/dist/model/TemplateDiffSummary.js +165 -0
  86. package/dist/model/TemplateDocument.js +36 -36
  87. package/dist/model/TemplateDocumentState.js +11 -1
  88. package/dist/model/TemplateDocumentSummary.js +152 -0
  89. package/dist/model/TemplateFieldChange.js +146 -0
  90. package/dist/model/TemplateFieldChanges.js +196 -0
  91. package/dist/model/TemplateFieldDependency.js +3 -3
  92. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  93. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  94. package/dist/model/TemplateFieldDependencyInput.js +3 -3
  95. package/dist/model/TemplateFieldMove.js +132 -0
  96. package/dist/model/TemplateFields.js +147 -0
  97. package/dist/model/TemplateModelCode.js +1 -1
  98. package/dist/model/TemplatePageImages.js +158 -0
  99. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  100. package/dist/model/TemplatePreview.js +211 -0
  101. package/dist/model/TemplatePreviewState.js +64 -0
  102. package/dist/model/TemplateSourcePdf.js +1 -1
  103. package/dist/model/TemplateSummary.js +14 -288
  104. package/dist/model/TemplateSummaryList.js +1 -1
  105. package/dist/model/TemplateVersion.js +1 -1
  106. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  107. package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
  108. package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
  109. package/dist/model/UpdateTemplateRequest.js +84 -2
  110. package/dist/model/UpdateWebhookRequest.js +1 -1
  111. package/dist/model/UploadPresign.js +1 -1
  112. package/dist/model/UrlSourcePdf.js +1 -1
  113. package/dist/model/ValidateSubmissionRequest.js +226 -0
  114. package/dist/model/Webhook.js +1 -1
  115. package/dist/model/WebhookList.js +1 -1
  116. package/package.json +3 -2
@@ -0,0 +1,206 @@
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
+ var _TemplateDiffSummary = _interopRequireDefault(require("./TemplateDiffSummary"));
9
+ var _TemplateFieldChanges = _interopRequireDefault(require("./TemplateFieldChanges"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ 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; } } }; }
13
+ 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; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ 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); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ 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); } /**
20
+ * DocSpring API
21
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
22
+ *
23
+ * The version of the OpenAPI document: v2
24
+ *
25
+ *
26
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
27
+ * https://openapi-generator.tech
28
+ * Do not edit the class manually.
29
+ *
30
+ */
31
+ /**
32
+ * The TemplateDiff model module.
33
+ * @module model/TemplateDiff
34
+ * @version 4.2.0
35
+ */
36
+ var TemplateDiff = /*#__PURE__*/function () {
37
+ /**
38
+ * Constructs a new <code>TemplateDiff</code>.
39
+ * What changed in a version of a template since the version before it: the draft since the latest published version, or a published version since the one before it. Fields are compared with all their settings, so `y` is measured from the top of each field's page.
40
+ * @alias module:model/TemplateDiff
41
+ * @extends Object
42
+ * @param template_id {String} The template's ID.
43
+ * @param from_version {String} The earlier version, such as `1.1.0`. Null when no version was published before `to_version`: it's compared with a new template, so all of its fields are added.
44
+ * @param to_version {String} The later version, such as `1.2.0`. Null for the draft.
45
+ * @param summary {module:model/TemplateDiffSummary} How many changes of each kind there are.
46
+ * @param fields {module:model/TemplateFieldChanges} The fields that changed.
47
+ * @param changed_settings {Array.<String>} The names of the template's settings that changed, as they're named on the Template (`name`, `html`, `defaults`, `expire_after`, ...). Values aren't included, and secrets like `encrypt_pdfs_password` are named when they change.
48
+ * @param document_changed {Boolean} The template's PDF was replaced (or added, when there's no `from_version`).
49
+ */
50
+ function TemplateDiff(template_id, from_version, to_version, summary, fields, changed_settings, document_changed) {
51
+ _classCallCheck(this, TemplateDiff);
52
+ TemplateDiff.initialize(this, template_id, from_version, to_version, summary, fields, changed_settings, document_changed);
53
+ }
54
+
55
+ /**
56
+ * Initializes the fields of this object.
57
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
58
+ * Only for internal use.
59
+ */
60
+ return _createClass(TemplateDiff, null, [{
61
+ key: "initialize",
62
+ value: function initialize(obj, template_id, from_version, to_version, summary, fields, changed_settings, document_changed) {
63
+ obj['template_id'] = template_id;
64
+ obj['from_version'] = from_version;
65
+ obj['to_version'] = to_version;
66
+ obj['summary'] = summary;
67
+ obj['fields'] = fields;
68
+ obj['changed_settings'] = changed_settings;
69
+ obj['document_changed'] = document_changed;
70
+ }
71
+
72
+ /**
73
+ * Constructs a <code>TemplateDiff</code> from a plain JavaScript object, optionally creating a new instance.
74
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
75
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
76
+ * @param {module:model/TemplateDiff} obj Optional instance to populate.
77
+ * @return {module:model/TemplateDiff} The populated <code>TemplateDiff</code> instance.
78
+ */
79
+ }, {
80
+ key: "constructFromObject",
81
+ value: function constructFromObject(data, obj) {
82
+ if (data) {
83
+ obj = obj || new TemplateDiff();
84
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
85
+ if (data.hasOwnProperty('template_id')) {
86
+ obj['template_id'] = _ApiClient["default"].convertToType(data['template_id'], 'String');
87
+ }
88
+ if (data.hasOwnProperty('from_version')) {
89
+ obj['from_version'] = _ApiClient["default"].convertToType(data['from_version'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('to_version')) {
92
+ obj['to_version'] = _ApiClient["default"].convertToType(data['to_version'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('summary')) {
95
+ obj['summary'] = _ApiClient["default"].convertToType(data['summary'], _TemplateDiffSummary["default"]);
96
+ }
97
+ if (data.hasOwnProperty('fields')) {
98
+ obj['fields'] = _ApiClient["default"].convertToType(data['fields'], _TemplateFieldChanges["default"]);
99
+ }
100
+ if (data.hasOwnProperty('changed_settings')) {
101
+ obj['changed_settings'] = _ApiClient["default"].convertToType(data['changed_settings'], ['String']);
102
+ }
103
+ if (data.hasOwnProperty('document_changed')) {
104
+ obj['document_changed'] = _ApiClient["default"].convertToType(data['document_changed'], 'Boolean');
105
+ }
106
+ }
107
+ return obj;
108
+ }
109
+
110
+ /**
111
+ * Validates the JSON data with respect to <code>TemplateDiff</code>.
112
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
113
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateDiff</code>.
114
+ */
115
+ }, {
116
+ key: "validateJSON",
117
+ value: function validateJSON(data) {
118
+ // check to make sure all required properties are present in the JSON string
119
+ var _iterator = _createForOfIteratorHelper(TemplateDiff.RequiredProperties),
120
+ _step;
121
+ try {
122
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
123
+ var property = _step.value;
124
+ if (!data.hasOwnProperty(property)) {
125
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
126
+ }
127
+ }
128
+ // ensure the json data is a string
129
+ } catch (err) {
130
+ _iterator.e(err);
131
+ } finally {
132
+ _iterator.f();
133
+ }
134
+ if (data['template_id'] && !(typeof data['template_id'] === 'string' || data['template_id'] instanceof String)) {
135
+ throw new Error("Expected the field `template_id` to be a primitive type in the JSON string but got " + data['template_id']);
136
+ }
137
+ // ensure the json data is a string
138
+ if (data['from_version'] && !(typeof data['from_version'] === 'string' || data['from_version'] instanceof String)) {
139
+ throw new Error("Expected the field `from_version` to be a primitive type in the JSON string but got " + data['from_version']);
140
+ }
141
+ // ensure the json data is a string
142
+ if (data['to_version'] && !(typeof data['to_version'] === 'string' || data['to_version'] instanceof String)) {
143
+ throw new Error("Expected the field `to_version` to be a primitive type in the JSON string but got " + data['to_version']);
144
+ }
145
+ // validate the optional field `summary`
146
+ if (data['summary']) {
147
+ // data not null
148
+ _TemplateDiffSummary["default"].validateJSON(data['summary']);
149
+ }
150
+ // validate the optional field `fields`
151
+ if (data['fields']) {
152
+ // data not null
153
+ _TemplateFieldChanges["default"].validateJSON(data['fields']);
154
+ }
155
+ // ensure the json data is an array
156
+ if (!Array.isArray(data['changed_settings'])) {
157
+ throw new Error("Expected the field `changed_settings` to be an array in the JSON data but got " + data['changed_settings']);
158
+ }
159
+ return true;
160
+ }
161
+ }]);
162
+ }();
163
+ TemplateDiff.RequiredProperties = ["template_id", "from_version", "to_version", "summary", "fields", "changed_settings", "document_changed"];
164
+
165
+ /**
166
+ * The template's ID.
167
+ * @member {String} template_id
168
+ */
169
+ TemplateDiff.prototype['template_id'] = undefined;
170
+
171
+ /**
172
+ * The earlier version, such as `1.1.0`. Null when no version was published before `to_version`: it's compared with a new template, so all of its fields are added.
173
+ * @member {String} from_version
174
+ */
175
+ TemplateDiff.prototype['from_version'] = undefined;
176
+
177
+ /**
178
+ * The later version, such as `1.2.0`. Null for the draft.
179
+ * @member {String} to_version
180
+ */
181
+ TemplateDiff.prototype['to_version'] = undefined;
182
+
183
+ /**
184
+ * How many changes of each kind there are.
185
+ * @member {module:model/TemplateDiffSummary} summary
186
+ */
187
+ TemplateDiff.prototype['summary'] = undefined;
188
+
189
+ /**
190
+ * The fields that changed.
191
+ * @member {module:model/TemplateFieldChanges} fields
192
+ */
193
+ TemplateDiff.prototype['fields'] = undefined;
194
+
195
+ /**
196
+ * The names of the template's settings that changed, as they're named on the Template (`name`, `html`, `defaults`, `expire_after`, ...). Values aren't included, and secrets like `encrypt_pdfs_password` are named when they change.
197
+ * @member {Array.<String>} changed_settings
198
+ */
199
+ TemplateDiff.prototype['changed_settings'] = undefined;
200
+
201
+ /**
202
+ * The template's PDF was replaced (or added, when there's no `from_version`).
203
+ * @member {Boolean} document_changed
204
+ */
205
+ TemplateDiff.prototype['document_changed'] = undefined;
206
+ var _default = exports["default"] = TemplateDiff;
@@ -0,0 +1,165 @@
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 programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or 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 TemplateDiffSummary model module.
31
+ * @module model/TemplateDiffSummary
32
+ * @version 4.2.0
33
+ */
34
+ var TemplateDiffSummary = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>TemplateDiffSummary</code>.
37
+ * How many changes of each kind a template diff has.
38
+ * @alias module:model/TemplateDiffSummary
39
+ * @param fields_added {Number} How many fields were added.
40
+ * @param fields_removed {Number} How many fields were removed.
41
+ * @param fields_changed {Number} How many fields have changed settings.
42
+ * @param fields_reordered {Number} How many fields moved in the template's field order.
43
+ * @param settings_changed {Number} How many of the template's settings changed.
44
+ * @param total_changes {Number} All the changes, counting a new document as one. Zero when the versions are the same.
45
+ */
46
+ function TemplateDiffSummary(fields_added, fields_removed, fields_changed, fields_reordered, settings_changed, total_changes) {
47
+ _classCallCheck(this, TemplateDiffSummary);
48
+ TemplateDiffSummary.initialize(this, fields_added, fields_removed, fields_changed, fields_reordered, settings_changed, total_changes);
49
+ }
50
+
51
+ /**
52
+ * Initializes the fields of this object.
53
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
54
+ * Only for internal use.
55
+ */
56
+ return _createClass(TemplateDiffSummary, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, fields_added, fields_removed, fields_changed, fields_reordered, settings_changed, total_changes) {
59
+ obj['fields_added'] = fields_added;
60
+ obj['fields_removed'] = fields_removed;
61
+ obj['fields_changed'] = fields_changed;
62
+ obj['fields_reordered'] = fields_reordered;
63
+ obj['settings_changed'] = settings_changed;
64
+ obj['total_changes'] = total_changes;
65
+ }
66
+
67
+ /**
68
+ * Constructs a <code>TemplateDiffSummary</code> from a plain JavaScript object, optionally creating a new instance.
69
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
70
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
71
+ * @param {module:model/TemplateDiffSummary} obj Optional instance to populate.
72
+ * @return {module:model/TemplateDiffSummary} The populated <code>TemplateDiffSummary</code> instance.
73
+ */
74
+ }, {
75
+ key: "constructFromObject",
76
+ value: function constructFromObject(data, obj) {
77
+ if (data) {
78
+ obj = obj || new TemplateDiffSummary();
79
+ if (data.hasOwnProperty('fields_added')) {
80
+ obj['fields_added'] = _ApiClient["default"].convertToType(data['fields_added'], 'Number');
81
+ }
82
+ if (data.hasOwnProperty('fields_removed')) {
83
+ obj['fields_removed'] = _ApiClient["default"].convertToType(data['fields_removed'], 'Number');
84
+ }
85
+ if (data.hasOwnProperty('fields_changed')) {
86
+ obj['fields_changed'] = _ApiClient["default"].convertToType(data['fields_changed'], 'Number');
87
+ }
88
+ if (data.hasOwnProperty('fields_reordered')) {
89
+ obj['fields_reordered'] = _ApiClient["default"].convertToType(data['fields_reordered'], 'Number');
90
+ }
91
+ if (data.hasOwnProperty('settings_changed')) {
92
+ obj['settings_changed'] = _ApiClient["default"].convertToType(data['settings_changed'], 'Number');
93
+ }
94
+ if (data.hasOwnProperty('total_changes')) {
95
+ obj['total_changes'] = _ApiClient["default"].convertToType(data['total_changes'], 'Number');
96
+ }
97
+ }
98
+ return obj;
99
+ }
100
+
101
+ /**
102
+ * Validates the JSON data with respect to <code>TemplateDiffSummary</code>.
103
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
104
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateDiffSummary</code>.
105
+ */
106
+ }, {
107
+ key: "validateJSON",
108
+ value: function validateJSON(data) {
109
+ // check to make sure all required properties are present in the JSON string
110
+ var _iterator = _createForOfIteratorHelper(TemplateDiffSummary.RequiredProperties),
111
+ _step;
112
+ try {
113
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
114
+ var property = _step.value;
115
+ if (!data.hasOwnProperty(property)) {
116
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
117
+ }
118
+ }
119
+ } catch (err) {
120
+ _iterator.e(err);
121
+ } finally {
122
+ _iterator.f();
123
+ }
124
+ return true;
125
+ }
126
+ }]);
127
+ }();
128
+ TemplateDiffSummary.RequiredProperties = ["fields_added", "fields_removed", "fields_changed", "fields_reordered", "settings_changed", "total_changes"];
129
+
130
+ /**
131
+ * How many fields were added.
132
+ * @member {Number} fields_added
133
+ */
134
+ TemplateDiffSummary.prototype['fields_added'] = undefined;
135
+
136
+ /**
137
+ * How many fields were removed.
138
+ * @member {Number} fields_removed
139
+ */
140
+ TemplateDiffSummary.prototype['fields_removed'] = undefined;
141
+
142
+ /**
143
+ * How many fields have changed settings.
144
+ * @member {Number} fields_changed
145
+ */
146
+ TemplateDiffSummary.prototype['fields_changed'] = undefined;
147
+
148
+ /**
149
+ * How many fields moved in the template's field order.
150
+ * @member {Number} fields_reordered
151
+ */
152
+ TemplateDiffSummary.prototype['fields_reordered'] = undefined;
153
+
154
+ /**
155
+ * How many of the template's settings changed.
156
+ * @member {Number} settings_changed
157
+ */
158
+ TemplateDiffSummary.prototype['settings_changed'] = undefined;
159
+
160
+ /**
161
+ * All the changes, counting a new document as one. Zero when the versions are the same.
162
+ * @member {Number} total_changes
163
+ */
164
+ TemplateDiffSummary.prototype['total_changes'] = undefined;
165
+ var _default = exports["default"] = TemplateDiffSummary;
@@ -33,19 +33,19 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
33
33
  /**
34
34
  * The TemplateDocument model module.
35
35
  * @module model/TemplateDocument
36
- * @version 4.0.0
36
+ * @version 4.2.0
37
37
  */
38
38
  var TemplateDocument = /*#__PURE__*/function () {
39
39
  /**
40
40
  * Constructs a new <code>TemplateDocument</code>.
41
41
  * A PDF template's PDF.
42
42
  * @alias module:model/TemplateDocument
43
- * @param filename {String} The PDF's file name.
43
+ * @param filename {String} The PDF's file name. Null until a `document_url` has been downloaded.
44
+ * @param state {module:model/TemplateDocumentState} `pending` while DocSpring processes the PDF, then `processed` (`ready` says when its pages are done too). `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one. `downloading` while DocSpring downloads a `document_url`, then as for an upload. `download_failed` means it couldn't be downloaded, and `error_message` says why. A template keeps its PDF while a new one is downloaded, and when it couldn't be.
45
+ * @param error_message {String} Why the PDF couldn't be processed or downloaded, and how to fix it. Null unless `state` is an error.
46
+ * @param page_count {Number} 0 until the PDF has been processed.
44
47
  * @param md5 {String} The MD5 hash of the PDF.
45
- * @param state {module:model/TemplateDocumentState} `pending` while DocSpring processes the PDF, then `processed`. `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one.
46
- * @param error_message {String} Why the PDF couldn't be processed, and how to fix it. Null unless `state` is an error.
47
48
  * @param field_reimport_state {module:model/FieldReimportState} Whether the fields are being re-imported from this PDF (`reimport_fields` when the PDF was replaced): `requested` while DocSpring processes the PDF, then `imported`, or `no_fields` when the PDF had no fillable fields and the template kept its fields. `none` when no re-import was asked for, or when it couldn't run (the PDF couldn't be processed, or the template was locked or published while it was).
48
- * @param page_count {Number} 0 until the PDF has been processed.
49
49
  * @param page_dimensions {Array.<Array.<Number>>} Each page's width and height in PDF points. Null until the PDF has been processed.
50
50
  * @param has_fillable_fields {Boolean} Whether the PDF has fillable form fields. Null until DocSpring has read the PDF.
51
51
  * @param page_processing_statuses {Array.<module:model/TemplatePageProcessingStatus>} How processing is going on each page, in page order: its image, and its fields when DocSpring sets them up (`detect_fields` when the template was created). `state` becomes `processed` once every page is done. Empty until DocSpring has read the PDF, and for PDFs uploaded before DocSpring recorded page statuses.
@@ -53,9 +53,9 @@ var TemplateDocument = /*#__PURE__*/function () {
53
53
  * @param download_url {String} A temporary link to download the PDF.
54
54
  * @param permanent_url {String} A link to download the PDF that doesn't expire. Null until the PDF has been processed.
55
55
  */
56
- function TemplateDocument(filename, md5, state, error_message, field_reimport_state, page_count, page_dimensions, has_fillable_fields, page_processing_statuses, field_logic_status, download_url, permanent_url) {
56
+ function TemplateDocument(filename, state, error_message, page_count, md5, field_reimport_state, page_dimensions, has_fillable_fields, page_processing_statuses, field_logic_status, download_url, permanent_url) {
57
57
  _classCallCheck(this, TemplateDocument);
58
- TemplateDocument.initialize(this, filename, md5, state, error_message, field_reimport_state, page_count, page_dimensions, has_fillable_fields, page_processing_statuses, field_logic_status, download_url, permanent_url);
58
+ TemplateDocument.initialize(this, filename, state, error_message, page_count, md5, field_reimport_state, page_dimensions, has_fillable_fields, page_processing_statuses, field_logic_status, download_url, permanent_url);
59
59
  }
60
60
 
61
61
  /**
@@ -65,13 +65,13 @@ var TemplateDocument = /*#__PURE__*/function () {
65
65
  */
66
66
  return _createClass(TemplateDocument, null, [{
67
67
  key: "initialize",
68
- value: function initialize(obj, filename, md5, state, error_message, field_reimport_state, page_count, page_dimensions, has_fillable_fields, page_processing_statuses, field_logic_status, download_url, permanent_url) {
68
+ value: function initialize(obj, filename, state, error_message, page_count, md5, field_reimport_state, page_dimensions, has_fillable_fields, page_processing_statuses, field_logic_status, download_url, permanent_url) {
69
69
  obj['filename'] = filename;
70
- obj['md5'] = md5;
71
70
  obj['state'] = state;
72
71
  obj['error_message'] = error_message;
73
- obj['field_reimport_state'] = field_reimport_state;
74
72
  obj['page_count'] = page_count;
73
+ obj['md5'] = md5;
74
+ obj['field_reimport_state'] = field_reimport_state;
75
75
  obj['page_dimensions'] = page_dimensions;
76
76
  obj['has_fillable_fields'] = has_fillable_fields;
77
77
  obj['page_processing_statuses'] = page_processing_statuses;
@@ -95,21 +95,21 @@ var TemplateDocument = /*#__PURE__*/function () {
95
95
  if (data.hasOwnProperty('filename')) {
96
96
  obj['filename'] = _ApiClient["default"].convertToType(data['filename'], 'String');
97
97
  }
98
- if (data.hasOwnProperty('md5')) {
99
- obj['md5'] = _ApiClient["default"].convertToType(data['md5'], 'String');
100
- }
101
98
  if (data.hasOwnProperty('state')) {
102
99
  obj['state'] = _ApiClient["default"].convertToType(data['state'], _TemplateDocumentState["default"]);
103
100
  }
104
101
  if (data.hasOwnProperty('error_message')) {
105
102
  obj['error_message'] = _ApiClient["default"].convertToType(data['error_message'], 'String');
106
103
  }
107
- if (data.hasOwnProperty('field_reimport_state')) {
108
- obj['field_reimport_state'] = _ApiClient["default"].convertToType(data['field_reimport_state'], _FieldReimportState["default"]);
109
- }
110
104
  if (data.hasOwnProperty('page_count')) {
111
105
  obj['page_count'] = _ApiClient["default"].convertToType(data['page_count'], 'Number');
112
106
  }
107
+ if (data.hasOwnProperty('md5')) {
108
+ obj['md5'] = _ApiClient["default"].convertToType(data['md5'], 'String');
109
+ }
110
+ if (data.hasOwnProperty('field_reimport_state')) {
111
+ obj['field_reimport_state'] = _ApiClient["default"].convertToType(data['field_reimport_state'], _FieldReimportState["default"]);
112
+ }
113
113
  if (data.hasOwnProperty('page_dimensions')) {
114
114
  obj['page_dimensions'] = _ApiClient["default"].convertToType(data['page_dimensions'], [['Number']]);
115
115
  }
@@ -160,13 +160,13 @@ var TemplateDocument = /*#__PURE__*/function () {
160
160
  throw new Error("Expected the field `filename` to be a primitive type in the JSON string but got " + data['filename']);
161
161
  }
162
162
  // ensure the json data is a string
163
- if (data['md5'] && !(typeof data['md5'] === 'string' || data['md5'] instanceof String)) {
164
- throw new Error("Expected the field `md5` to be a primitive type in the JSON string but got " + data['md5']);
165
- }
166
- // ensure the json data is a string
167
163
  if (data['error_message'] && !(typeof data['error_message'] === 'string' || data['error_message'] instanceof String)) {
168
164
  throw new Error("Expected the field `error_message` to be a primitive type in the JSON string but got " + data['error_message']);
169
165
  }
166
+ // ensure the json data is a string
167
+ if (data['md5'] && !(typeof data['md5'] === 'string' || data['md5'] instanceof String)) {
168
+ throw new Error("Expected the field `md5` to be a primitive type in the JSON string but got " + data['md5']);
169
+ }
170
170
  // ensure the json data is an array
171
171
  if (!Array.isArray(data['page_dimensions'])) {
172
172
  throw new Error("Expected the field `page_dimensions` to be an array in the JSON data but got " + data['page_dimensions']);
@@ -204,44 +204,44 @@ var TemplateDocument = /*#__PURE__*/function () {
204
204
  }
205
205
  }]);
206
206
  }();
207
- TemplateDocument.RequiredProperties = ["filename", "md5", "state", "error_message", "field_reimport_state", "page_count", "page_dimensions", "has_fillable_fields", "page_processing_statuses", "field_logic_status", "download_url", "permanent_url"];
207
+ TemplateDocument.RequiredProperties = ["filename", "state", "error_message", "page_count", "md5", "field_reimport_state", "page_dimensions", "has_fillable_fields", "page_processing_statuses", "field_logic_status", "download_url", "permanent_url"];
208
208
 
209
209
  /**
210
- * The PDF's file name.
210
+ * The PDF's file name. Null until a `document_url` has been downloaded.
211
211
  * @member {String} filename
212
212
  */
213
213
  TemplateDocument.prototype['filename'] = undefined;
214
214
 
215
215
  /**
216
- * The MD5 hash of the PDF.
217
- * @member {String} md5
218
- */
219
- TemplateDocument.prototype['md5'] = undefined;
220
-
221
- /**
222
- * `pending` while DocSpring processes the PDF, then `processed`. `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one.
216
+ * `pending` while DocSpring processes the PDF, then `processed` (`ready` says when its pages are done too). `password_required`, `malformed_pdf` and `unknown_error` mean the PDF couldn't be processed, and `error_message` says why: upload it again or upload another one. `downloading` while DocSpring downloads a `document_url`, then as for an upload. `download_failed` means it couldn't be downloaded, and `error_message` says why. A template keeps its PDF while a new one is downloaded, and when it couldn't be.
223
217
  * @member {module:model/TemplateDocumentState} state
224
218
  */
225
219
  TemplateDocument.prototype['state'] = undefined;
226
220
 
227
221
  /**
228
- * Why the PDF couldn't be processed, and how to fix it. Null unless `state` is an error.
222
+ * Why the PDF couldn't be processed or downloaded, and how to fix it. Null unless `state` is an error.
229
223
  * @member {String} error_message
230
224
  */
231
225
  TemplateDocument.prototype['error_message'] = undefined;
232
226
 
233
- /**
234
- * Whether the fields are being re-imported from this PDF (`reimport_fields` when the PDF was replaced): `requested` while DocSpring processes the PDF, then `imported`, or `no_fields` when the PDF had no fillable fields and the template kept its fields. `none` when no re-import was asked for, or when it couldn't run (the PDF couldn't be processed, or the template was locked or published while it was).
235
- * @member {module:model/FieldReimportState} field_reimport_state
236
- */
237
- TemplateDocument.prototype['field_reimport_state'] = undefined;
238
-
239
227
  /**
240
228
  * 0 until the PDF has been processed.
241
229
  * @member {Number} page_count
242
230
  */
243
231
  TemplateDocument.prototype['page_count'] = undefined;
244
232
 
233
+ /**
234
+ * The MD5 hash of the PDF.
235
+ * @member {String} md5
236
+ */
237
+ TemplateDocument.prototype['md5'] = undefined;
238
+
239
+ /**
240
+ * Whether the fields are being re-imported from this PDF (`reimport_fields` when the PDF was replaced): `requested` while DocSpring processes the PDF, then `imported`, or `no_fields` when the PDF had no fillable fields and the template kept its fields. `none` when no re-import was asked for, or when it couldn't run (the PDF couldn't be processed, or the template was locked or published while it was).
241
+ * @member {module:model/FieldReimportState} field_reimport_state
242
+ */
243
+ TemplateDocument.prototype['field_reimport_state'] = undefined;
244
+
245
245
  /**
246
246
  * Each page's width and height in PDF points. Null until the PDF has been processed.
247
247
  * @member {Array.<Array.<Number>>} page_dimensions
@@ -71,4 +71,14 @@ _defineProperty(TemplateDocumentState, "malformed_pdf", "malformed_pdf");
71
71
  * value: "unknown_error"
72
72
  * @const
73
73
  */
74
- _defineProperty(TemplateDocumentState, "unknown_error", "unknown_error");
74
+ _defineProperty(TemplateDocumentState, "unknown_error", "unknown_error");
75
+ /**
76
+ * value: "downloading"
77
+ * @const
78
+ */
79
+ _defineProperty(TemplateDocumentState, "downloading", "downloading");
80
+ /**
81
+ * value: "download_failed"
82
+ * @const
83
+ */
84
+ _defineProperty(TemplateDocumentState, "download_failed", "download_failed");