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.
- package/AGENTS.md +3 -2
- package/README.md +13 -1
- package/dist/ApiClient.js +2 -2
- package/dist/RequestSchemas.js +1231 -9
- package/dist/WebhookSignature.js +86 -0
- package/dist/api/Client.js +620 -38
- package/dist/index.js +238 -0
- package/dist/model/AddTemplateFieldsRequest.js +132 -0
- package/dist/model/AuthenticationCheck.js +1 -1
- package/dist/model/CombinedPdf.js +3 -3
- package/dist/model/CombinedPdfFiles.js +1 -1
- package/dist/model/CombinedPdfList.js +1 -1
- package/dist/model/CombinedPdfSource.js +1 -1
- package/dist/model/CombinedPdfSourceInput.js +1 -1
- package/dist/model/CombinedPdfSourcePdf.js +1 -1
- package/dist/model/CopyTemplateRequest.js +1 -1
- package/dist/model/CreateCombinedPdfRequest.js +2 -2
- package/dist/model/CreateCustomFileFromUploadRequest.js +1 -1
- package/dist/model/CreateFolderRequest.js +1 -1
- package/dist/model/CreateSignatureRequestEventRequest.js +1 -1
- package/dist/model/CreateSignatureRequestTokenRequest.js +1 -1
- package/dist/model/CreateSubmissionBatchRequest.js +15 -1
- package/dist/model/CreateSubmissionRequest.js +17 -3
- package/dist/model/CreateTemplatePreviewRequest.js +112 -0
- package/dist/model/CreateTemplateRequest.js +81 -4
- package/dist/model/CreateWebhookRequest.js +1 -1
- package/dist/model/CustomFile.js +1 -1
- package/dist/model/CustomFileList.js +1 -1
- package/dist/model/CustomFileSourcePdf.js +1 -1
- package/dist/model/ErrorCode.js +11 -1
- package/dist/model/ErrorDetail.js +2 -2
- package/dist/model/ErrorInfo.js +6 -6
- package/dist/model/ErrorResponse.js +1 -1
- package/dist/model/Field.js +1230 -0
- package/dist/model/FieldComparisonCondition.js +1 -1
- package/dist/model/FieldDependency.js +154 -0
- package/dist/model/FieldDependencyInput.js +154 -0
- package/dist/model/FieldEqualsCondition.js +1 -1
- package/dist/model/FieldGroup.js +206 -0
- package/dist/model/FieldGroupInput.js +180 -0
- package/dist/model/FieldGroupType.js +59 -0
- package/dist/model/FieldInCondition.js +1 -1
- package/dist/model/FieldInput.js +1012 -0
- package/dist/model/FieldOverride.js +1 -1
- package/dist/model/FieldPresenceCondition.js +1 -1
- package/dist/model/FieldRangeCondition.js +1 -1
- package/dist/model/FieldType.js +124 -0
- package/dist/model/Folder.js +1 -1
- package/dist/model/FolderList.js +1 -1
- package/dist/model/GenerateFilesFormat.js +54 -0
- package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
- package/dist/model/GeneratedFile.js +1 -1
- package/dist/model/HtmlEngineOptions.js +1 -1
- package/dist/model/HtmlEngineOptionsInput.js +1 -1
- package/dist/model/MoveFolderRequest.js +1 -1
- package/dist/model/MoveTemplateRequest.js +1 -1
- package/dist/model/OutputFormat.js +59 -0
- package/dist/model/PageImage.js +220 -0
- package/dist/model/PageImages.js +155 -0
- package/dist/model/PredefinedField.js +183 -0
- package/dist/model/PredefinedFieldInput.js +183 -0
- package/dist/model/PublishTemplateVersionRequest.js +1 -1
- package/dist/model/RemoveTemplateFieldsRequest.js +114 -0
- package/dist/model/RenameFolderRequest.js +1 -1
- package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
- package/dist/model/RestoreTemplateVersionRequest.js +1 -1
- package/dist/model/SignatureRequest.js +1 -1
- package/dist/model/SignatureRequestEvent.js +1 -1
- package/dist/model/SignatureRequestInput.js +1 -1
- package/dist/model/SignatureRequestToken.js +1 -1
- package/dist/model/Submission.js +84 -68
- package/dist/model/SubmissionAction.js +1 -1
- package/dist/model/SubmissionBatch.js +1 -1
- package/dist/model/SubmissionFiles.js +10 -1
- package/dist/model/SubmissionInput.js +17 -3
- package/dist/model/SubmissionList.js +5 -5
- package/dist/model/SubmissionSourcePdf.js +1 -1
- package/dist/model/SubmissionSummary.js +343 -0
- package/dist/model/SubmissionValidation.js +151 -0
- package/dist/model/Template.js +129 -56
- package/dist/model/TemplateActor.js +3 -3
- package/dist/model/TemplateDefaults.js +1 -1
- package/dist/model/TemplateDefaultsInput.js +1 -1
- package/dist/model/TemplateDiff.js +206 -0
- package/dist/model/TemplateDiffSummary.js +165 -0
- package/dist/model/TemplateDocument.js +36 -36
- package/dist/model/TemplateDocumentState.js +11 -1
- package/dist/model/TemplateDocumentSummary.js +152 -0
- package/dist/model/TemplateFieldChange.js +146 -0
- package/dist/model/TemplateFieldChanges.js +196 -0
- package/dist/model/TemplateFieldDependency.js +3 -3
- package/dist/model/TemplateFieldDependencyCondition.js +1 -1
- package/dist/model/TemplateFieldDependencyConditionInput.js +1 -1
- package/dist/model/TemplateFieldDependencyInput.js +3 -3
- package/dist/model/TemplateFieldMove.js +132 -0
- package/dist/model/TemplateFields.js +147 -0
- package/dist/model/TemplateModelCode.js +1 -1
- package/dist/model/TemplatePageImages.js +158 -0
- package/dist/model/TemplatePageProcessingStatus.js +1 -1
- package/dist/model/TemplatePreview.js +211 -0
- package/dist/model/TemplatePreviewState.js +64 -0
- package/dist/model/TemplateSourcePdf.js +1 -1
- package/dist/model/TemplateSummary.js +14 -288
- package/dist/model/TemplateSummaryList.js +1 -1
- package/dist/model/TemplateVersion.js +1 -1
- package/dist/model/UpdateSignatureRequestRequest.js +1 -1
- package/dist/model/UpdateTemplateDocumentRequest.js +33 -30
- package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
- package/dist/model/UpdateTemplateRequest.js +84 -2
- package/dist/model/UpdateWebhookRequest.js +1 -1
- package/dist/model/UploadPresign.js +1 -1
- package/dist/model/UrlSourcePdf.js +1 -1
- package/dist/model/ValidateSubmissionRequest.js +226 -0
- package/dist/model/Webhook.js +1 -1
- package/dist/model/WebhookList.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,220 @@
|
|
|
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 PageImage model module.
|
|
31
|
+
* @module model/PageImage
|
|
32
|
+
* @version 4.2.0
|
|
33
|
+
*/
|
|
34
|
+
var PageImage = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>PageImage</code>.
|
|
37
|
+
* An image of one page of a PDF, a PNG of a submission's page or a JPEG of a template's.
|
|
38
|
+
* @alias module:model/PageImage
|
|
39
|
+
* @extends Object
|
|
40
|
+
* @param page {Number} The page number, from 1.
|
|
41
|
+
* @param width {Number} The image's width in pixels.
|
|
42
|
+
* @param height {Number} The image's height in pixels.
|
|
43
|
+
* @param download_url {String} A temporary link to download the image. A submission's is null when your account turns off download links for submissions.
|
|
44
|
+
* @param permanent_url {String} A link to download a submission's image that doesn't expire: it redirects to a new temporary link. It needs your API token or a signed-in session, except for a submission of a template that makes its submissions public. Null for a template's page images.
|
|
45
|
+
* @param filename {String} The image's file name, such as `sub_123_page_1.png`.
|
|
46
|
+
* @param content_type {String} The image's media type, `image/png` for a submission's pages or `image/jpeg` for a template's.
|
|
47
|
+
* @param size {Number} The image's size in bytes.
|
|
48
|
+
* @param sha256 {String} The SHA-256 hash of the image. Null for a template's page images.
|
|
49
|
+
*/
|
|
50
|
+
function PageImage(page, width, height, download_url, permanent_url, filename, content_type, size, sha256) {
|
|
51
|
+
_classCallCheck(this, PageImage);
|
|
52
|
+
PageImage.initialize(this, page, width, height, download_url, permanent_url, filename, content_type, size, sha256);
|
|
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(PageImage, null, [{
|
|
61
|
+
key: "initialize",
|
|
62
|
+
value: function initialize(obj, page, width, height, download_url, permanent_url, filename, content_type, size, sha256) {
|
|
63
|
+
obj['page'] = page;
|
|
64
|
+
obj['width'] = width;
|
|
65
|
+
obj['height'] = height;
|
|
66
|
+
obj['download_url'] = download_url;
|
|
67
|
+
obj['permanent_url'] = permanent_url;
|
|
68
|
+
obj['filename'] = filename;
|
|
69
|
+
obj['content_type'] = content_type;
|
|
70
|
+
obj['size'] = size;
|
|
71
|
+
obj['sha256'] = sha256;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Constructs a <code>PageImage</code> from a plain JavaScript object, optionally creating a new instance.
|
|
76
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
77
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
78
|
+
* @param {module:model/PageImage} obj Optional instance to populate.
|
|
79
|
+
* @return {module:model/PageImage} The populated <code>PageImage</code> instance.
|
|
80
|
+
*/
|
|
81
|
+
}, {
|
|
82
|
+
key: "constructFromObject",
|
|
83
|
+
value: function constructFromObject(data, obj) {
|
|
84
|
+
if (data) {
|
|
85
|
+
obj = obj || new PageImage();
|
|
86
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
87
|
+
if (data.hasOwnProperty('page')) {
|
|
88
|
+
obj['page'] = _ApiClient["default"].convertToType(data['page'], 'Number');
|
|
89
|
+
}
|
|
90
|
+
if (data.hasOwnProperty('width')) {
|
|
91
|
+
obj['width'] = _ApiClient["default"].convertToType(data['width'], 'Number');
|
|
92
|
+
}
|
|
93
|
+
if (data.hasOwnProperty('height')) {
|
|
94
|
+
obj['height'] = _ApiClient["default"].convertToType(data['height'], 'Number');
|
|
95
|
+
}
|
|
96
|
+
if (data.hasOwnProperty('download_url')) {
|
|
97
|
+
obj['download_url'] = _ApiClient["default"].convertToType(data['download_url'], 'String');
|
|
98
|
+
}
|
|
99
|
+
if (data.hasOwnProperty('permanent_url')) {
|
|
100
|
+
obj['permanent_url'] = _ApiClient["default"].convertToType(data['permanent_url'], 'String');
|
|
101
|
+
}
|
|
102
|
+
if (data.hasOwnProperty('filename')) {
|
|
103
|
+
obj['filename'] = _ApiClient["default"].convertToType(data['filename'], 'String');
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('content_type')) {
|
|
106
|
+
obj['content_type'] = _ApiClient["default"].convertToType(data['content_type'], 'String');
|
|
107
|
+
}
|
|
108
|
+
if (data.hasOwnProperty('size')) {
|
|
109
|
+
obj['size'] = _ApiClient["default"].convertToType(data['size'], 'Number');
|
|
110
|
+
}
|
|
111
|
+
if (data.hasOwnProperty('sha256')) {
|
|
112
|
+
obj['sha256'] = _ApiClient["default"].convertToType(data['sha256'], 'String');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return obj;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Validates the JSON data with respect to <code>PageImage</code>.
|
|
120
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
121
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>PageImage</code>.
|
|
122
|
+
*/
|
|
123
|
+
}, {
|
|
124
|
+
key: "validateJSON",
|
|
125
|
+
value: function validateJSON(data) {
|
|
126
|
+
// check to make sure all required properties are present in the JSON string
|
|
127
|
+
var _iterator = _createForOfIteratorHelper(PageImage.RequiredProperties),
|
|
128
|
+
_step;
|
|
129
|
+
try {
|
|
130
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
131
|
+
var property = _step.value;
|
|
132
|
+
if (!data.hasOwnProperty(property)) {
|
|
133
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// ensure the json data is a string
|
|
137
|
+
} catch (err) {
|
|
138
|
+
_iterator.e(err);
|
|
139
|
+
} finally {
|
|
140
|
+
_iterator.f();
|
|
141
|
+
}
|
|
142
|
+
if (data['download_url'] && !(typeof data['download_url'] === 'string' || data['download_url'] instanceof String)) {
|
|
143
|
+
throw new Error("Expected the field `download_url` to be a primitive type in the JSON string but got " + data['download_url']);
|
|
144
|
+
}
|
|
145
|
+
// ensure the json data is a string
|
|
146
|
+
if (data['permanent_url'] && !(typeof data['permanent_url'] === 'string' || data['permanent_url'] instanceof String)) {
|
|
147
|
+
throw new Error("Expected the field `permanent_url` to be a primitive type in the JSON string but got " + data['permanent_url']);
|
|
148
|
+
}
|
|
149
|
+
// ensure the json data is a string
|
|
150
|
+
if (data['filename'] && !(typeof data['filename'] === 'string' || data['filename'] instanceof String)) {
|
|
151
|
+
throw new Error("Expected the field `filename` to be a primitive type in the JSON string but got " + data['filename']);
|
|
152
|
+
}
|
|
153
|
+
// ensure the json data is a string
|
|
154
|
+
if (data['content_type'] && !(typeof data['content_type'] === 'string' || data['content_type'] instanceof String)) {
|
|
155
|
+
throw new Error("Expected the field `content_type` to be a primitive type in the JSON string but got " + data['content_type']);
|
|
156
|
+
}
|
|
157
|
+
// ensure the json data is a string
|
|
158
|
+
if (data['sha256'] && !(typeof data['sha256'] === 'string' || data['sha256'] instanceof String)) {
|
|
159
|
+
throw new Error("Expected the field `sha256` to be a primitive type in the JSON string but got " + data['sha256']);
|
|
160
|
+
}
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
}]);
|
|
164
|
+
}();
|
|
165
|
+
PageImage.RequiredProperties = ["page", "width", "height", "download_url", "permanent_url", "filename", "content_type", "size", "sha256"];
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The page number, from 1.
|
|
169
|
+
* @member {Number} page
|
|
170
|
+
*/
|
|
171
|
+
PageImage.prototype['page'] = undefined;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The image's width in pixels.
|
|
175
|
+
* @member {Number} width
|
|
176
|
+
*/
|
|
177
|
+
PageImage.prototype['width'] = undefined;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The image's height in pixels.
|
|
181
|
+
* @member {Number} height
|
|
182
|
+
*/
|
|
183
|
+
PageImage.prototype['height'] = undefined;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A temporary link to download the image. A submission's is null when your account turns off download links for submissions.
|
|
187
|
+
* @member {String} download_url
|
|
188
|
+
*/
|
|
189
|
+
PageImage.prototype['download_url'] = undefined;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* A link to download a submission's image that doesn't expire: it redirects to a new temporary link. It needs your API token or a signed-in session, except for a submission of a template that makes its submissions public. Null for a template's page images.
|
|
193
|
+
* @member {String} permanent_url
|
|
194
|
+
*/
|
|
195
|
+
PageImage.prototype['permanent_url'] = undefined;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The image's file name, such as `sub_123_page_1.png`.
|
|
199
|
+
* @member {String} filename
|
|
200
|
+
*/
|
|
201
|
+
PageImage.prototype['filename'] = undefined;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The image's media type, `image/png` for a submission's pages or `image/jpeg` for a template's.
|
|
205
|
+
* @member {String} content_type
|
|
206
|
+
*/
|
|
207
|
+
PageImage.prototype['content_type'] = undefined;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The image's size in bytes.
|
|
211
|
+
* @member {Number} size
|
|
212
|
+
*/
|
|
213
|
+
PageImage.prototype['size'] = undefined;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The SHA-256 hash of the image. Null for a template's page images.
|
|
217
|
+
* @member {String} sha256
|
|
218
|
+
*/
|
|
219
|
+
PageImage.prototype['sha256'] = undefined;
|
|
220
|
+
var _default = exports["default"] = PageImage;
|
|
@@ -0,0 +1,155 @@
|
|
|
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 _GeneratedFileState = _interopRequireDefault(require("./GeneratedFileState"));
|
|
9
|
+
var _PageImage = _interopRequireDefault(require("./PageImage"));
|
|
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 PageImages model module.
|
|
33
|
+
* @module model/PageImages
|
|
34
|
+
* @version 4.2.0
|
|
35
|
+
*/
|
|
36
|
+
var PageImages = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>PageImages</code>.
|
|
39
|
+
* A PNG image of each page of the submission's PDF (the `png` output format), at 140 DPI: a US Letter page is 1190 x 1540 pixels.
|
|
40
|
+
* @alias module:model/PageImages
|
|
41
|
+
* @extends Object
|
|
42
|
+
* @param state {module:model/GeneratedFileState} `processed` once the images have been made, with the PDF or by POST /submissions/{submission_id}/generate_files. `pending` until then, and `error` if they couldn't be made (see `error_message`).
|
|
43
|
+
* @param error_message {String} Why the images couldn't be made, when `state` is `error`.
|
|
44
|
+
* @param page_count {Number} How many pages have an image. Null until the images have been made.
|
|
45
|
+
* @param pages {Array.<module:model/PageImage>} An image of each page, in order: `pages[0]` is page 1. Lists of submissions leave it out (null): get the submission to see them. Empty until the images have been made.
|
|
46
|
+
*/
|
|
47
|
+
function PageImages(state, error_message, page_count, pages) {
|
|
48
|
+
_classCallCheck(this, PageImages);
|
|
49
|
+
PageImages.initialize(this, state, error_message, page_count, pages);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Initializes the fields of this object.
|
|
54
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
55
|
+
* Only for internal use.
|
|
56
|
+
*/
|
|
57
|
+
return _createClass(PageImages, null, [{
|
|
58
|
+
key: "initialize",
|
|
59
|
+
value: function initialize(obj, state, error_message, page_count, pages) {
|
|
60
|
+
obj['state'] = state;
|
|
61
|
+
obj['error_message'] = error_message;
|
|
62
|
+
obj['page_count'] = page_count;
|
|
63
|
+
obj['pages'] = pages;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Constructs a <code>PageImages</code> from a plain JavaScript object, optionally creating a new instance.
|
|
68
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
69
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
70
|
+
* @param {module:model/PageImages} obj Optional instance to populate.
|
|
71
|
+
* @return {module:model/PageImages} The populated <code>PageImages</code> instance.
|
|
72
|
+
*/
|
|
73
|
+
}, {
|
|
74
|
+
key: "constructFromObject",
|
|
75
|
+
value: function constructFromObject(data, obj) {
|
|
76
|
+
if (data) {
|
|
77
|
+
obj = obj || new PageImages();
|
|
78
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
79
|
+
if (data.hasOwnProperty('state')) {
|
|
80
|
+
obj['state'] = _ApiClient["default"].convertToType(data['state'], _GeneratedFileState["default"]);
|
|
81
|
+
}
|
|
82
|
+
if (data.hasOwnProperty('error_message')) {
|
|
83
|
+
obj['error_message'] = _ApiClient["default"].convertToType(data['error_message'], 'String');
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('page_count')) {
|
|
86
|
+
obj['page_count'] = _ApiClient["default"].convertToType(data['page_count'], 'Number');
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('pages')) {
|
|
89
|
+
obj['pages'] = _ApiClient["default"].convertToType(data['pages'], [_PageImage["default"]]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return obj;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Validates the JSON data with respect to <code>PageImages</code>.
|
|
97
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
98
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>PageImages</code>.
|
|
99
|
+
*/
|
|
100
|
+
}, {
|
|
101
|
+
key: "validateJSON",
|
|
102
|
+
value: function validateJSON(data) {
|
|
103
|
+
// check to make sure all required properties are present in the JSON string
|
|
104
|
+
var _iterator = _createForOfIteratorHelper(PageImages.RequiredProperties),
|
|
105
|
+
_step;
|
|
106
|
+
try {
|
|
107
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
108
|
+
var property = _step.value;
|
|
109
|
+
if (!data.hasOwnProperty(property)) {
|
|
110
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// ensure the json data is a string
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_iterator.e(err);
|
|
116
|
+
} finally {
|
|
117
|
+
_iterator.f();
|
|
118
|
+
}
|
|
119
|
+
if (data['error_message'] && !(typeof data['error_message'] === 'string' || data['error_message'] instanceof String)) {
|
|
120
|
+
throw new Error("Expected the field `error_message` to be a primitive type in the JSON string but got " + data['error_message']);
|
|
121
|
+
}
|
|
122
|
+
// ensure the json data is an array
|
|
123
|
+
if (!Array.isArray(data['pages'])) {
|
|
124
|
+
throw new Error("Expected the field `pages` to be an array in the JSON data but got " + data['pages']);
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
}();
|
|
130
|
+
PageImages.RequiredProperties = ["state", "error_message", "page_count", "pages"];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* `processed` once the images have been made, with the PDF or by POST /submissions/{submission_id}/generate_files. `pending` until then, and `error` if they couldn't be made (see `error_message`).
|
|
134
|
+
* @member {module:model/GeneratedFileState} state
|
|
135
|
+
*/
|
|
136
|
+
PageImages.prototype['state'] = undefined;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Why the images couldn't be made, when `state` is `error`.
|
|
140
|
+
* @member {String} error_message
|
|
141
|
+
*/
|
|
142
|
+
PageImages.prototype['error_message'] = undefined;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* How many pages have an image. Null until the images have been made.
|
|
146
|
+
* @member {Number} page_count
|
|
147
|
+
*/
|
|
148
|
+
PageImages.prototype['page_count'] = undefined;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* An image of each page, in order: `pages[0]` is page 1. Lists of submissions leave it out (null): get the submission to see them. Empty until the images have been made.
|
|
152
|
+
* @member {Array.<module:model/PageImage>} pages
|
|
153
|
+
*/
|
|
154
|
+
PageImages.prototype['pages'] = undefined;
|
|
155
|
+
var _default = exports["default"] = PageImages;
|
|
@@ -0,0 +1,183 @@
|
|
|
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 _FieldType = _interopRequireDefault(require("./FieldType"));
|
|
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 PredefinedField model module.
|
|
32
|
+
* @module model/PredefinedField
|
|
33
|
+
* @version 4.2.0
|
|
34
|
+
*/
|
|
35
|
+
var PredefinedField = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>PredefinedField</code>.
|
|
38
|
+
* A field name that people using the embedded template editor can choose from, with the data type and settings a field gets when it's given that name.
|
|
39
|
+
* @alias module:model/PredefinedField
|
|
40
|
+
* @param name {String} The field's name, the key of its value in submission data. A `/` nests the key in objects and arrays (`customer/email`, `signers/0/name`).
|
|
41
|
+
* @param type {module:model/FieldType} The data type a field gets when it's given this name, as a field's `type`.
|
|
42
|
+
*/
|
|
43
|
+
function PredefinedField(name, type) {
|
|
44
|
+
_classCallCheck(this, PredefinedField);
|
|
45
|
+
PredefinedField.initialize(this, name, type);
|
|
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(PredefinedField, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj, name, type) {
|
|
56
|
+
obj['name'] = name;
|
|
57
|
+
obj['type'] = type;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Constructs a <code>PredefinedField</code> from a plain JavaScript object, optionally creating a new instance.
|
|
62
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
63
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
64
|
+
* @param {module:model/PredefinedField} obj Optional instance to populate.
|
|
65
|
+
* @return {module:model/PredefinedField} The populated <code>PredefinedField</code> instance.
|
|
66
|
+
*/
|
|
67
|
+
}, {
|
|
68
|
+
key: "constructFromObject",
|
|
69
|
+
value: function constructFromObject(data, obj) {
|
|
70
|
+
if (data) {
|
|
71
|
+
obj = obj || new PredefinedField();
|
|
72
|
+
if (data.hasOwnProperty('name')) {
|
|
73
|
+
obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('display_name')) {
|
|
76
|
+
obj['display_name'] = _ApiClient["default"].convertToType(data['display_name'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('title')) {
|
|
79
|
+
obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('type')) {
|
|
82
|
+
obj['type'] = _ApiClient["default"].convertToType(data['type'], _FieldType["default"]);
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('option_list')) {
|
|
85
|
+
obj['option_list'] = _ApiClient["default"].convertToType(data['option_list'], 'String');
|
|
86
|
+
}
|
|
87
|
+
if (data.hasOwnProperty('required_in_template')) {
|
|
88
|
+
obj['required_in_template'] = _ApiClient["default"].convertToType(data['required_in_template'], 'Boolean');
|
|
89
|
+
}
|
|
90
|
+
if (data.hasOwnProperty('field_required')) {
|
|
91
|
+
obj['field_required'] = _ApiClient["default"].convertToType(data['field_required'], 'Boolean');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return obj;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Validates the JSON data with respect to <code>PredefinedField</code>.
|
|
99
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
100
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>PredefinedField</code>.
|
|
101
|
+
*/
|
|
102
|
+
}, {
|
|
103
|
+
key: "validateJSON",
|
|
104
|
+
value: function validateJSON(data) {
|
|
105
|
+
// check to make sure all required properties are present in the JSON string
|
|
106
|
+
var _iterator = _createForOfIteratorHelper(PredefinedField.RequiredProperties),
|
|
107
|
+
_step;
|
|
108
|
+
try {
|
|
109
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
110
|
+
var property = _step.value;
|
|
111
|
+
if (!data.hasOwnProperty(property)) {
|
|
112
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// ensure the json data is a string
|
|
116
|
+
} catch (err) {
|
|
117
|
+
_iterator.e(err);
|
|
118
|
+
} finally {
|
|
119
|
+
_iterator.f();
|
|
120
|
+
}
|
|
121
|
+
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
|
|
122
|
+
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
|
|
123
|
+
}
|
|
124
|
+
// ensure the json data is a string
|
|
125
|
+
if (data['display_name'] && !(typeof data['display_name'] === 'string' || data['display_name'] instanceof String)) {
|
|
126
|
+
throw new Error("Expected the field `display_name` to be a primitive type in the JSON string but got " + data['display_name']);
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is a string
|
|
129
|
+
if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
|
|
130
|
+
throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
|
|
131
|
+
}
|
|
132
|
+
// ensure the json data is a string
|
|
133
|
+
if (data['option_list'] && !(typeof data['option_list'] === 'string' || data['option_list'] instanceof String)) {
|
|
134
|
+
throw new Error("Expected the field `option_list` to be a primitive type in the JSON string but got " + data['option_list']);
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
}]);
|
|
139
|
+
}();
|
|
140
|
+
PredefinedField.RequiredProperties = ["name", "type"];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The field's name, the key of its value in submission data. A `/` nests the key in objects and arrays (`customer/email`, `signers/0/name`).
|
|
144
|
+
* @member {String} name
|
|
145
|
+
*/
|
|
146
|
+
PredefinedField.prototype['name'] = undefined;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The name the template editor shows instead of `name`, where a `/` puts it in a folder, such as `Defendant/Name`. Null shows `name`. Two names can't share a display name.
|
|
150
|
+
* @member {String} display_name
|
|
151
|
+
*/
|
|
152
|
+
PredefinedField.prototype['display_name'] = undefined;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The Title setting a field gets when it's given this name. Null leaves the field's title as it is.
|
|
156
|
+
* @member {String} title
|
|
157
|
+
*/
|
|
158
|
+
PredefinedField.prototype['title'] = undefined;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The data type a field gets when it's given this name, as a field's `type`.
|
|
162
|
+
* @member {module:model/FieldType} type
|
|
163
|
+
*/
|
|
164
|
+
PredefinedField.prototype['type'] = undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* String fields only: the values allowed, separated by commas, such as `Yes,No`. Null allows any value.
|
|
168
|
+
* @member {String} option_list
|
|
169
|
+
*/
|
|
170
|
+
PredefinedField.prototype['option_list'] = undefined;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Whether the template must have a field with this name. The embedded editor shows the names that are missing, and with `disableDoneButtonIfPredefinedFieldsMissing` keeps its Done button disabled until the template has them. Default false.
|
|
174
|
+
* @member {Boolean} required_in_template
|
|
175
|
+
*/
|
|
176
|
+
PredefinedField.prototype['required_in_template'] = undefined;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The Required setting a field gets when it's given this name. Default true.
|
|
180
|
+
* @member {Boolean} field_required
|
|
181
|
+
*/
|
|
182
|
+
PredefinedField.prototype['field_required'] = undefined;
|
|
183
|
+
var _default = exports["default"] = PredefinedField;
|