docspring 4.0.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 (108) hide show
  1. package/README.md +10 -1
  2. package/dist/ApiClient.js +2 -2
  3. package/dist/RequestSchemas.js +1171 -16
  4. package/dist/api/Client.js +474 -24
  5. package/dist/index.js +196 -0
  6. package/dist/model/AddTemplateFieldsRequest.js +132 -0
  7. package/dist/model/AuthenticationCheck.js +1 -1
  8. package/dist/model/CombinedPdf.js +1 -1
  9. package/dist/model/CombinedPdfFiles.js +1 -1
  10. package/dist/model/CombinedPdfList.js +1 -1
  11. package/dist/model/CombinedPdfSource.js +1 -1
  12. package/dist/model/CombinedPdfSourceInput.js +1 -1
  13. package/dist/model/CombinedPdfSourcePdf.js +1 -1
  14. package/dist/model/CopyTemplateRequest.js +1 -1
  15. package/dist/model/CreateCombinedPdfRequest.js +1 -1
  16. package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
  17. package/dist/model/CreateFolderRequest.js +1 -1
  18. package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
  19. package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
  20. package/dist/model/CreateSubmissionBatchRequest.js +15 -1
  21. package/dist/model/CreateSubmissionRequest.js +15 -1
  22. package/dist/model/CreateTemplateRequest.js +71 -3
  23. package/dist/model/CreateWebhookRequest.js +1 -1
  24. package/dist/model/CustomFile.js +1 -1
  25. package/dist/model/CustomFileList.js +1 -1
  26. package/dist/model/CustomFileSourcePdf.js +1 -1
  27. package/dist/model/ErrorDetail.js +1 -1
  28. package/dist/model/ErrorInfo.js +1 -1
  29. package/dist/model/ErrorResponse.js +1 -1
  30. package/dist/model/Field.js +1230 -0
  31. package/dist/model/FieldComparisonCondition.js +1 -1
  32. package/dist/model/FieldDependency.js +154 -0
  33. package/dist/model/FieldDependencyInput.js +154 -0
  34. package/dist/model/FieldEqualsCondition.js +1 -1
  35. package/dist/model/FieldGroup.js +206 -0
  36. package/dist/model/FieldGroupInput.js +180 -0
  37. package/dist/model/FieldGroupType.js +59 -0
  38. package/dist/model/FieldInCondition.js +1 -1
  39. package/dist/model/FieldInput.js +1012 -0
  40. package/dist/model/FieldOverride.js +1 -1
  41. package/dist/model/FieldPresenceCondition.js +1 -1
  42. package/dist/model/FieldRangeCondition.js +1 -1
  43. package/dist/model/FieldType.js +124 -0
  44. package/dist/model/Folder.js +1 -1
  45. package/dist/model/FolderList.js +1 -1
  46. package/dist/model/GenerateFilesFormat.js +54 -0
  47. package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
  48. package/dist/model/GeneratedFile.js +1 -1
  49. package/dist/model/HtmlEngineOptions.js +1 -1
  50. package/dist/model/HtmlEngineOptionsInput.js +1 -1
  51. package/dist/model/MoveFolderRequest.js +1 -1
  52. package/dist/model/MoveTemplateRequest.js +1 -1
  53. package/dist/model/OutputFormat.js +59 -0
  54. package/dist/model/PageImage.js +220 -0
  55. package/dist/model/PageImages.js +155 -0
  56. package/dist/model/PredefinedField.js +183 -0
  57. package/dist/model/PredefinedFieldInput.js +183 -0
  58. package/dist/model/PublishTemplateVersionRequest.js +1 -1
  59. package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
  60. package/dist/model/RenameFolderRequest.js +1 -1
  61. package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
  62. package/dist/model/RestoreTemplateVersionRequest.js +1 -1
  63. package/dist/model/SignatureRequest.js +1 -1
  64. package/dist/model/SignatureRequestEvent.js +1 -1
  65. package/dist/model/SignatureRequestInput.js +1 -1
  66. package/dist/model/SignatureRequestToken.js +1 -1
  67. package/dist/model/Submission.js +23 -7
  68. package/dist/model/SubmissionAction.js +1 -1
  69. package/dist/model/SubmissionBatch.js +1 -1
  70. package/dist/model/SubmissionFiles.js +10 -1
  71. package/dist/model/SubmissionInput.js +15 -1
  72. package/dist/model/SubmissionList.js +1 -1
  73. package/dist/model/SubmissionSourcePdf.js +1 -1
  74. package/dist/model/SubmissionValidation.js +151 -0
  75. package/dist/model/Template.js +67 -5
  76. package/dist/model/TemplateActor.js +1 -1
  77. package/dist/model/TemplateDefaults.js +1 -1
  78. package/dist/model/TemplateDefaultsInput.js +1 -1
  79. package/dist/model/TemplateDiff.js +206 -0
  80. package/dist/model/TemplateDiffSummary.js +165 -0
  81. package/dist/model/TemplateDocument.js +7 -7
  82. package/dist/model/TemplateDocumentState.js +11 -1
  83. package/dist/model/TemplateFieldChange.js +146 -0
  84. package/dist/model/TemplateFieldChanges.js +196 -0
  85. package/dist/model/TemplateFieldDependency.js +3 -3
  86. package/dist/model/TemplateFieldDependencyCondition.js +1 -1
  87. package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
  88. package/dist/model/TemplateFieldDependencyInput.js +3 -3
  89. package/dist/model/TemplateFieldMove.js +132 -0
  90. package/dist/model/TemplateFields.js +147 -0
  91. package/dist/model/TemplateModelCode.js +1 -1
  92. package/dist/model/TemplatePageImages.js +158 -0
  93. package/dist/model/TemplatePageProcessingStatus.js +1 -1
  94. package/dist/model/TemplateSourcePdf.js +1 -1
  95. package/dist/model/TemplateSummary.js +1 -1
  96. package/dist/model/TemplateSummaryList.js +1 -1
  97. package/dist/model/TemplateVersion.js +1 -1
  98. package/dist/model/UpdateSignatureRequestRequest.js +1 -1
  99. package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
  100. package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
  101. package/dist/model/UpdateTemplateRequest.js +74 -1
  102. package/dist/model/UpdateWebhookRequest.js +1 -1
  103. package/dist/model/UploadPresign.js +1 -1
  104. package/dist/model/UrlSourcePdf.js +1 -1
  105. package/dist/model/ValidateSubmissionRequest.js +226 -0
  106. package/dist/model/Webhook.js +1 -1
  107. package/dist/model/WebhookList.js +1 -1
  108. package/package.json +1 -1
@@ -0,0 +1,132 @@
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 TemplateFieldMove model module.
31
+ * @module model/TemplateFieldMove
32
+ * @version 4.1.0
33
+ */
34
+ var TemplateFieldMove = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>TemplateFieldMove</code>.
37
+ * A field that moved in a template's field order.
38
+ * @alias module:model/TemplateFieldMove
39
+ * @param id {Number} The field's ID.
40
+ * @param old_index {Number} Its place in `from_version`'s field order, starting at 0.
41
+ * @param new_index {Number} Its place in `to_version`'s field order, starting at 0.
42
+ */
43
+ function TemplateFieldMove(id, old_index, new_index) {
44
+ _classCallCheck(this, TemplateFieldMove);
45
+ TemplateFieldMove.initialize(this, id, old_index, new_index);
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(TemplateFieldMove, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, id, old_index, new_index) {
56
+ obj['id'] = id;
57
+ obj['old_index'] = old_index;
58
+ obj['new_index'] = new_index;
59
+ }
60
+
61
+ /**
62
+ * Constructs a <code>TemplateFieldMove</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/TemplateFieldMove} obj Optional instance to populate.
66
+ * @return {module:model/TemplateFieldMove} The populated <code>TemplateFieldMove</code> instance.
67
+ */
68
+ }, {
69
+ key: "constructFromObject",
70
+ value: function constructFromObject(data, obj) {
71
+ if (data) {
72
+ obj = obj || new TemplateFieldMove();
73
+ if (data.hasOwnProperty('id')) {
74
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'Number');
75
+ }
76
+ if (data.hasOwnProperty('old_index')) {
77
+ obj['old_index'] = _ApiClient["default"].convertToType(data['old_index'], 'Number');
78
+ }
79
+ if (data.hasOwnProperty('new_index')) {
80
+ obj['new_index'] = _ApiClient["default"].convertToType(data['new_index'], 'Number');
81
+ }
82
+ }
83
+ return obj;
84
+ }
85
+
86
+ /**
87
+ * Validates the JSON data with respect to <code>TemplateFieldMove</code>.
88
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
89
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateFieldMove</code>.
90
+ */
91
+ }, {
92
+ key: "validateJSON",
93
+ value: function validateJSON(data) {
94
+ // check to make sure all required properties are present in the JSON string
95
+ var _iterator = _createForOfIteratorHelper(TemplateFieldMove.RequiredProperties),
96
+ _step;
97
+ try {
98
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
99
+ var property = _step.value;
100
+ if (!data.hasOwnProperty(property)) {
101
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
102
+ }
103
+ }
104
+ } catch (err) {
105
+ _iterator.e(err);
106
+ } finally {
107
+ _iterator.f();
108
+ }
109
+ return true;
110
+ }
111
+ }]);
112
+ }();
113
+ TemplateFieldMove.RequiredProperties = ["id", "old_index", "new_index"];
114
+
115
+ /**
116
+ * The field's ID.
117
+ * @member {Number} id
118
+ */
119
+ TemplateFieldMove.prototype['id'] = undefined;
120
+
121
+ /**
122
+ * Its place in `from_version`'s field order, starting at 0.
123
+ * @member {Number} old_index
124
+ */
125
+ TemplateFieldMove.prototype['old_index'] = undefined;
126
+
127
+ /**
128
+ * Its place in `to_version`'s field order, starting at 0.
129
+ * @member {Number} new_index
130
+ */
131
+ TemplateFieldMove.prototype['new_index'] = undefined;
132
+ var _default = exports["default"] = TemplateFieldMove;
@@ -0,0 +1,147 @@
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 _Field = _interopRequireDefault(require("./Field"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ 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; } } }; }
12
+ 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; } }
13
+ 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; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * DocSpring API
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
21
+ *
22
+ * The version of the OpenAPI document: v2
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The TemplateFields model module.
32
+ * @module model/TemplateFields
33
+ * @version 4.1.0
34
+ */
35
+ var TemplateFields = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>TemplateFields</code>.
38
+ * A template's fields, page by page.
39
+ * @alias module:model/TemplateFields
40
+ * @extends Object
41
+ * @param template_id {String} The template's ID.
42
+ * @param version {String} The published version the fields are of, such as `1.2.0`. Null for the draft.
43
+ * @param fields {Array.<module:model/Field>} The fields.
44
+ */
45
+ function TemplateFields(template_id, version, fields) {
46
+ _classCallCheck(this, TemplateFields);
47
+ TemplateFields.initialize(this, template_id, version, fields);
48
+ }
49
+
50
+ /**
51
+ * Initializes the fields of this object.
52
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
53
+ * Only for internal use.
54
+ */
55
+ return _createClass(TemplateFields, null, [{
56
+ key: "initialize",
57
+ value: function initialize(obj, template_id, version, fields) {
58
+ obj['template_id'] = template_id;
59
+ obj['version'] = version;
60
+ obj['fields'] = fields;
61
+ }
62
+
63
+ /**
64
+ * Constructs a <code>TemplateFields</code> from a plain JavaScript object, optionally creating a new instance.
65
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
66
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
67
+ * @param {module:model/TemplateFields} obj Optional instance to populate.
68
+ * @return {module:model/TemplateFields} The populated <code>TemplateFields</code> instance.
69
+ */
70
+ }, {
71
+ key: "constructFromObject",
72
+ value: function constructFromObject(data, obj) {
73
+ if (data) {
74
+ obj = obj || new TemplateFields();
75
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
76
+ if (data.hasOwnProperty('template_id')) {
77
+ obj['template_id'] = _ApiClient["default"].convertToType(data['template_id'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('version')) {
80
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('fields')) {
83
+ obj['fields'] = _ApiClient["default"].convertToType(data['fields'], [_Field["default"]]);
84
+ }
85
+ }
86
+ return obj;
87
+ }
88
+
89
+ /**
90
+ * Validates the JSON data with respect to <code>TemplateFields</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>TemplateFields</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(TemplateFields.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['template_id'] && !(typeof data['template_id'] === 'string' || data['template_id'] instanceof String)) {
114
+ throw new Error("Expected the field `template_id` to be a primitive type in the JSON string but got " + data['template_id']);
115
+ }
116
+ // ensure the json data is a string
117
+ if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
118
+ throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
119
+ }
120
+ // ensure the json data is an array
121
+ if (!Array.isArray(data['fields'])) {
122
+ throw new Error("Expected the field `fields` to be an array in the JSON data but got " + data['fields']);
123
+ }
124
+ return true;
125
+ }
126
+ }]);
127
+ }();
128
+ TemplateFields.RequiredProperties = ["template_id", "version", "fields"];
129
+
130
+ /**
131
+ * The template's ID.
132
+ * @member {String} template_id
133
+ */
134
+ TemplateFields.prototype['template_id'] = undefined;
135
+
136
+ /**
137
+ * The published version the fields are of, such as `1.2.0`. Null for the draft.
138
+ * @member {String} version
139
+ */
140
+ TemplateFields.prototype['version'] = undefined;
141
+
142
+ /**
143
+ * The fields.
144
+ * @member {Array.<module:model/Field>} fields
145
+ */
146
+ TemplateFields.prototype['fields'] = undefined;
147
+ var _default = exports["default"] = TemplateFields;
@@ -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.0.0
33
+ * @version 4.1.0
34
34
  */
35
35
  var TemplateModelCode = /*#__PURE__*/function () {
36
36
  /**
@@ -0,0 +1,158 @@
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 _PageImage = _interopRequireDefault(require("./PageImage"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ 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; } } }; }
12
+ 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; } }
13
+ 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; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * DocSpring API
20
+ * Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
21
+ *
22
+ * The version of the OpenAPI document: v2
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * The TemplatePageImages model module.
32
+ * @module model/TemplatePageImages
33
+ * @version 4.1.0
34
+ */
35
+ var TemplatePageImages = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>TemplatePageImages</code>.
38
+ * A JPEG image of each page of a PDF template's PDF, at 140 DPI (a US Letter page is 1190 x 1540 pixels), to see the pages that fields are placed on. The template's `document.page_dimensions` gives each page's size in PDF points. Fields are placed in units where every page is 2480 wide: to place a field at a point on an image, multiply the point's pixel coordinates by 2480 and divide them by the image's `width`.
39
+ * @alias module:model/TemplatePageImages
40
+ * @extends Object
41
+ * @param template_id {String} The template's ID.
42
+ * @param version {String} The published version the images are of, such as `1.2.0`. Null for the draft.
43
+ * @param page_count {Number} How many pages the PDF has.
44
+ * @param pages {Array.<module:model/PageImage>} An image of each page, in order: `pages[0]` is page 1. Their `download_url`s expire, so get them again when you need them.
45
+ */
46
+ function TemplatePageImages(template_id, version, page_count, pages) {
47
+ _classCallCheck(this, TemplatePageImages);
48
+ TemplatePageImages.initialize(this, template_id, version, page_count, pages);
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(TemplatePageImages, null, [{
57
+ key: "initialize",
58
+ value: function initialize(obj, template_id, version, page_count, pages) {
59
+ obj['template_id'] = template_id;
60
+ obj['version'] = version;
61
+ obj['page_count'] = page_count;
62
+ obj['pages'] = pages;
63
+ }
64
+
65
+ /**
66
+ * Constructs a <code>TemplatePageImages</code> from a plain JavaScript object, optionally creating a new instance.
67
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @param {module:model/TemplatePageImages} obj Optional instance to populate.
70
+ * @return {module:model/TemplatePageImages} The populated <code>TemplatePageImages</code> instance.
71
+ */
72
+ }, {
73
+ key: "constructFromObject",
74
+ value: function constructFromObject(data, obj) {
75
+ if (data) {
76
+ obj = obj || new TemplatePageImages();
77
+ _ApiClient["default"].constructFromObject(data, obj, 'Object');
78
+ if (data.hasOwnProperty('template_id')) {
79
+ obj['template_id'] = _ApiClient["default"].convertToType(data['template_id'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('version')) {
82
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('page_count')) {
85
+ obj['page_count'] = _ApiClient["default"].convertToType(data['page_count'], 'Number');
86
+ }
87
+ if (data.hasOwnProperty('pages')) {
88
+ obj['pages'] = _ApiClient["default"].convertToType(data['pages'], [_PageImage["default"]]);
89
+ }
90
+ }
91
+ return obj;
92
+ }
93
+
94
+ /**
95
+ * Validates the JSON data with respect to <code>TemplatePageImages</code>.
96
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
97
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplatePageImages</code>.
98
+ */
99
+ }, {
100
+ key: "validateJSON",
101
+ value: function validateJSON(data) {
102
+ // check to make sure all required properties are present in the JSON string
103
+ var _iterator = _createForOfIteratorHelper(TemplatePageImages.RequiredProperties),
104
+ _step;
105
+ try {
106
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
107
+ var property = _step.value;
108
+ if (!data.hasOwnProperty(property)) {
109
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
110
+ }
111
+ }
112
+ // ensure the json data is a string
113
+ } catch (err) {
114
+ _iterator.e(err);
115
+ } finally {
116
+ _iterator.f();
117
+ }
118
+ if (data['template_id'] && !(typeof data['template_id'] === 'string' || data['template_id'] instanceof String)) {
119
+ throw new Error("Expected the field `template_id` to be a primitive type in the JSON string but got " + data['template_id']);
120
+ }
121
+ // ensure the json data is a string
122
+ if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
123
+ throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
124
+ }
125
+ // ensure the json data is an array
126
+ if (!Array.isArray(data['pages'])) {
127
+ throw new Error("Expected the field `pages` to be an array in the JSON data but got " + data['pages']);
128
+ }
129
+ return true;
130
+ }
131
+ }]);
132
+ }();
133
+ TemplatePageImages.RequiredProperties = ["template_id", "version", "page_count", "pages"];
134
+
135
+ /**
136
+ * The template's ID.
137
+ * @member {String} template_id
138
+ */
139
+ TemplatePageImages.prototype['template_id'] = undefined;
140
+
141
+ /**
142
+ * The published version the images are of, such as `1.2.0`. Null for the draft.
143
+ * @member {String} version
144
+ */
145
+ TemplatePageImages.prototype['version'] = undefined;
146
+
147
+ /**
148
+ * How many pages the PDF has.
149
+ * @member {Number} page_count
150
+ */
151
+ TemplatePageImages.prototype['page_count'] = undefined;
152
+
153
+ /**
154
+ * An image of each page, in order: `pages[0]` is page 1. Their `download_url`s expire, so get them again when you need them.
155
+ * @member {Array.<module:model/PageImage>} pages
156
+ */
157
+ TemplatePageImages.prototype['pages'] = undefined;
158
+ var _default = exports["default"] = TemplatePageImages;
@@ -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.0.0
36
+ * @version 4.1.0
37
37
  */
38
38
  var TemplatePageProcessingStatus = /*#__PURE__*/function () {
39
39
  /**
@@ -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.0.0
32
+ * @version 4.1.0
33
33
  */
34
34
  var TemplateSourcePdf = /*#__PURE__*/function () {
35
35
  /**
@@ -35,7 +35,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
35
35
  /**
36
36
  * The TemplateSummary model module.
37
37
  * @module model/TemplateSummary
38
- * @version 4.0.0
38
+ * @version 4.1.0
39
39
  */
40
40
  var TemplateSummary = /*#__PURE__*/function () {
41
41
  /**
@@ -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.0.0
33
+ * @version 4.1.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.0.0
33
+ * @version 4.1.0
34
34
  */
35
35
  var TemplateVersion = /*#__PURE__*/function () {
36
36
  /**
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
28
28
  /**
29
29
  * The UpdateSignatureRequestRequest model module.
30
30
  * @module model/UpdateSignatureRequestRequest
31
- * @version 4.0.0
31
+ * @version 4.1.0
32
32
  */
33
33
  var UpdateSignatureRequestRequest = /*#__PURE__*/function () {
34
34
  /**
@@ -7,9 +7,6 @@ exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
9
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
10
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
11
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
12
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -29,18 +26,17 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
29
26
  /**
30
27
  * The UpdateTemplateDocumentRequest model module.
31
28
  * @module model/UpdateTemplateDocumentRequest
32
- * @version 4.0.0
29
+ * @version 4.1.0
33
30
  */
34
31
  var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
35
32
  /**
36
33
  * Constructs a new <code>UpdateTemplateDocumentRequest</code>.
37
- * The new PDF.
34
+ * The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
38
35
  * @alias module:model/UpdateTemplateDocumentRequest
39
- * @param cache_id {String} The `fields.key` of the new PDF, uploaded with the presigned upload (GET /uploads/presign).
40
36
  */
41
- function UpdateTemplateDocumentRequest(cache_id) {
37
+ function UpdateTemplateDocumentRequest() {
42
38
  _classCallCheck(this, UpdateTemplateDocumentRequest);
43
- UpdateTemplateDocumentRequest.initialize(this, cache_id);
39
+ UpdateTemplateDocumentRequest.initialize(this);
44
40
  }
45
41
 
46
42
  /**
@@ -50,9 +46,7 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
50
46
  */
51
47
  return _createClass(UpdateTemplateDocumentRequest, null, [{
52
48
  key: "initialize",
53
- value: function initialize(obj, cache_id) {
54
- obj['cache_id'] = cache_id;
55
- }
49
+ value: function initialize(obj) {}
56
50
 
57
51
  /**
58
52
  * Constructs a <code>UpdateTemplateDocumentRequest</code> from a plain JavaScript object, optionally creating a new instance.
@@ -69,6 +63,12 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
69
63
  if (data.hasOwnProperty('cache_id')) {
70
64
  obj['cache_id'] = _ApiClient["default"].convertToType(data['cache_id'], 'String');
71
65
  }
66
+ if (data.hasOwnProperty('document_url')) {
67
+ obj['document_url'] = _ApiClient["default"].convertToType(data['document_url'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('document_base64')) {
70
+ obj['document_base64'] = _ApiClient["default"].convertToType(data['document_base64'], 'String');
71
+ }
72
72
  if (data.hasOwnProperty('filename')) {
73
73
  obj['filename'] = _ApiClient["default"].convertToType(data['filename'], 'String');
74
74
  }
@@ -87,26 +87,19 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
87
87
  }, {
88
88
  key: "validateJSON",
89
89
  value: function validateJSON(data) {
90
- // check to make sure all required properties are present in the JSON string
91
- var _iterator = _createForOfIteratorHelper(UpdateTemplateDocumentRequest.RequiredProperties),
92
- _step;
93
- try {
94
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
95
- var property = _step.value;
96
- if (!data.hasOwnProperty(property)) {
97
- throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
98
- }
99
- }
100
- // ensure the json data is a string
101
- } catch (err) {
102
- _iterator.e(err);
103
- } finally {
104
- _iterator.f();
105
- }
90
+ // ensure the json data is a string
106
91
  if (data['cache_id'] && !(typeof data['cache_id'] === 'string' || data['cache_id'] instanceof String)) {
107
92
  throw new Error("Expected the field `cache_id` to be a primitive type in the JSON string but got " + data['cache_id']);
108
93
  }
109
94
  // ensure the json data is a string
95
+ if (data['document_url'] && !(typeof data['document_url'] === 'string' || data['document_url'] instanceof String)) {
96
+ throw new Error("Expected the field `document_url` to be a primitive type in the JSON string but got " + data['document_url']);
97
+ }
98
+ // ensure the json data is a string
99
+ if (data['document_base64'] && !(typeof data['document_base64'] === 'string' || data['document_base64'] instanceof String)) {
100
+ throw new Error("Expected the field `document_base64` to be a primitive type in the JSON string but got " + data['document_base64']);
101
+ }
102
+ // ensure the json data is a string
110
103
  if (data['filename'] && !(typeof data['filename'] === 'string' || data['filename'] instanceof String)) {
111
104
  throw new Error("Expected the field `filename` to be a primitive type in the JSON string but got " + data['filename']);
112
105
  }
@@ -114,8 +107,6 @@ var UpdateTemplateDocumentRequest = /*#__PURE__*/function () {
114
107
  }
115
108
  }]);
116
109
  }();
117
- UpdateTemplateDocumentRequest.RequiredProperties = ["cache_id"];
118
-
119
110
  /**
120
111
  * The `fields.key` of the new PDF, uploaded with the presigned upload (GET /uploads/presign).
121
112
  * @member {String} cache_id
@@ -123,7 +114,19 @@ UpdateTemplateDocumentRequest.RequiredProperties = ["cache_id"];
123
114
  UpdateTemplateDocumentRequest.prototype['cache_id'] = undefined;
124
115
 
125
116
  /**
126
- * The PDF's file name, for a `cache_id` (presigned uploads don't send one).
117
+ * An https:// link to the template's PDF (up to 100 MB), instead of `cache_id`. DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then (sync.api hosts wait for it). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why.
118
+ * @member {String} document_url
119
+ */
120
+ UpdateTemplateDocumentRequest.prototype['document_url'] = undefined;
121
+
122
+ /**
123
+ * The template's PDF, encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`.
124
+ * @member {String} document_base64
125
+ */
126
+ UpdateTemplateDocumentRequest.prototype['document_base64'] = undefined;
127
+
128
+ /**
129
+ * The PDF's file name, for a `cache_id` (presigned uploads don't send one) or `document_base64`. A `document_url`'s is the last part of its path unless you set it.
127
130
  * @member {String} filename
128
131
  */
129
132
  UpdateTemplateDocumentRequest.prototype['filename'] = undefined;