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,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
|
+
var _FieldInput = _interopRequireDefault(require("./FieldInput"));
|
|
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 UpdateTemplateFieldsRequest model module.
|
|
32
|
+
* @module model/UpdateTemplateFieldsRequest
|
|
33
|
+
* @version 4.2.0
|
|
34
|
+
*/
|
|
35
|
+
var UpdateTemplateFieldsRequest = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>UpdateTemplateFieldsRequest</code>.
|
|
38
|
+
* The fields to change in the template's draft.
|
|
39
|
+
* @alias module:model/UpdateTemplateFieldsRequest
|
|
40
|
+
* @param fields {Array.<module:model/FieldInput>} The changes, each with the `id` of the field it changes. Settings left out keep their values. Changing a shared setting changes it for every field with the same name. Renaming a field moves it to the shared settings of its new name, and conditional logic and formulas that use the old name follow it when no other field has that name.
|
|
41
|
+
*/
|
|
42
|
+
function UpdateTemplateFieldsRequest(fields) {
|
|
43
|
+
_classCallCheck(this, UpdateTemplateFieldsRequest);
|
|
44
|
+
UpdateTemplateFieldsRequest.initialize(this, fields);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the fields of this object.
|
|
49
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
50
|
+
* Only for internal use.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(UpdateTemplateFieldsRequest, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, fields) {
|
|
55
|
+
obj['fields'] = fields;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a <code>UpdateTemplateFieldsRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
60
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
61
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
62
|
+
* @param {module:model/UpdateTemplateFieldsRequest} obj Optional instance to populate.
|
|
63
|
+
* @return {module:model/UpdateTemplateFieldsRequest} The populated <code>UpdateTemplateFieldsRequest</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "constructFromObject",
|
|
67
|
+
value: function constructFromObject(data, obj) {
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new UpdateTemplateFieldsRequest();
|
|
70
|
+
if (data.hasOwnProperty('fields')) {
|
|
71
|
+
obj['fields'] = _ApiClient["default"].convertToType(data['fields'], [_FieldInput["default"]]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Validates the JSON data with respect to <code>UpdateTemplateFieldsRequest</code>.
|
|
79
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
80
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>UpdateTemplateFieldsRequest</code>.
|
|
81
|
+
*/
|
|
82
|
+
}, {
|
|
83
|
+
key: "validateJSON",
|
|
84
|
+
value: function validateJSON(data) {
|
|
85
|
+
// check to make sure all required properties are present in the JSON string
|
|
86
|
+
var _iterator = _createForOfIteratorHelper(UpdateTemplateFieldsRequest.RequiredProperties),
|
|
87
|
+
_step;
|
|
88
|
+
try {
|
|
89
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
90
|
+
var property = _step.value;
|
|
91
|
+
if (!data.hasOwnProperty(property)) {
|
|
92
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
} catch (err) {
|
|
96
|
+
_iterator.e(err);
|
|
97
|
+
} finally {
|
|
98
|
+
_iterator.f();
|
|
99
|
+
}
|
|
100
|
+
if (data['fields']) {
|
|
101
|
+
// data not null
|
|
102
|
+
// ensure the json data is an array
|
|
103
|
+
if (!Array.isArray(data['fields'])) {
|
|
104
|
+
throw new Error("Expected the field `fields` to be an array in the JSON data but got " + data['fields']);
|
|
105
|
+
}
|
|
106
|
+
// validate the optional field `fields` (array)
|
|
107
|
+
var _iterator2 = _createForOfIteratorHelper(data['fields']),
|
|
108
|
+
_step2;
|
|
109
|
+
try {
|
|
110
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
111
|
+
var item = _step2.value;
|
|
112
|
+
_FieldInput["default"].validateJSON(item);
|
|
113
|
+
}
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_iterator2.e(err);
|
|
116
|
+
} finally {
|
|
117
|
+
_iterator2.f();
|
|
118
|
+
}
|
|
119
|
+
;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}]);
|
|
124
|
+
}();
|
|
125
|
+
UpdateTemplateFieldsRequest.RequiredProperties = ["fields"];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The changes, each with the `id` of the field it changes. Settings left out keep their values. Changing a shared setting changes it for every field with the same name. Renaming a field moves it to the shared settings of its new name, and conditional logic and formulas that use the old name follow it when no other field has that name.
|
|
129
|
+
* @member {Array.<module:model/FieldInput>} fields
|
|
130
|
+
*/
|
|
131
|
+
UpdateTemplateFieldsRequest.prototype['fields'] = undefined;
|
|
132
|
+
var _default = exports["default"] = UpdateTemplateFieldsRequest;
|
|
@@ -7,7 +7,9 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
var _AiFieldNamingLanguage = _interopRequireDefault(require("./AiFieldNamingLanguage"));
|
|
9
9
|
var _ExpirationInterval = _interopRequireDefault(require("./ExpirationInterval"));
|
|
10
|
+
var _FieldGroupInput = _interopRequireDefault(require("./FieldGroupInput"));
|
|
10
11
|
var _HtmlEngineOptionsInput = _interopRequireDefault(require("./HtmlEngineOptionsInput"));
|
|
12
|
+
var _PredefinedFieldInput = _interopRequireDefault(require("./PredefinedFieldInput"));
|
|
11
13
|
var _TemplateDefaultsInput = _interopRequireDefault(require("./TemplateDefaultsInput"));
|
|
12
14
|
var _TemplateFieldDependencyInput = _interopRequireDefault(require("./TemplateFieldDependencyInput"));
|
|
13
15
|
var _TemplateFormMode = _interopRequireDefault(require("./TemplateFormMode"));
|
|
@@ -35,7 +37,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
35
37
|
/**
|
|
36
38
|
* The UpdateTemplateRequest model module.
|
|
37
39
|
* @module model/UpdateTemplateRequest
|
|
38
|
-
* @version 4.
|
|
40
|
+
* @version 4.2.0
|
|
39
41
|
*/
|
|
40
42
|
var UpdateTemplateRequest = /*#__PURE__*/function () {
|
|
41
43
|
/**
|
|
@@ -150,6 +152,17 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
|
|
|
150
152
|
if (data.hasOwnProperty('field_dependencies')) {
|
|
151
153
|
obj['field_dependencies'] = _ApiClient["default"].convertToType(data['field_dependencies'], [_TemplateFieldDependencyInput["default"]]);
|
|
152
154
|
}
|
|
155
|
+
if (data.hasOwnProperty('field_groups')) {
|
|
156
|
+
obj['field_groups'] = _ApiClient["default"].convertToType(data['field_groups'], [_FieldGroupInput["default"]]);
|
|
157
|
+
}
|
|
158
|
+
if (data.hasOwnProperty('predefined_fields')) {
|
|
159
|
+
obj['predefined_fields'] = _ApiClient["default"].convertToType(data['predefined_fields'], [_PredefinedFieldInput["default"]]);
|
|
160
|
+
}
|
|
161
|
+
if (data.hasOwnProperty('predefined_fields_sample_data')) {
|
|
162
|
+
obj['predefined_fields_sample_data'] = _ApiClient["default"].convertToType(data['predefined_fields_sample_data'], {
|
|
163
|
+
'String': Object
|
|
164
|
+
});
|
|
165
|
+
}
|
|
153
166
|
if (data.hasOwnProperty('html')) {
|
|
154
167
|
obj['html'] = _ApiClient["default"].convertToType(data['html'], 'String');
|
|
155
168
|
}
|
|
@@ -165,6 +178,9 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
|
|
|
165
178
|
if (data.hasOwnProperty('html_engine_options')) {
|
|
166
179
|
obj['html_engine_options'] = _ApiClient["default"].convertToType(data['html_engine_options'], _HtmlEngineOptionsInput["default"]);
|
|
167
180
|
}
|
|
181
|
+
if (data.hasOwnProperty('html_escape_data')) {
|
|
182
|
+
obj['html_escape_data'] = _ApiClient["default"].convertToType(data['html_escape_data'], 'Boolean');
|
|
183
|
+
}
|
|
168
184
|
}
|
|
169
185
|
return obj;
|
|
170
186
|
}
|
|
@@ -231,6 +247,48 @@ var UpdateTemplateRequest = /*#__PURE__*/function () {
|
|
|
231
247
|
}
|
|
232
248
|
;
|
|
233
249
|
}
|
|
250
|
+
if (data['field_groups']) {
|
|
251
|
+
// data not null
|
|
252
|
+
// ensure the json data is an array
|
|
253
|
+
if (!Array.isArray(data['field_groups'])) {
|
|
254
|
+
throw new Error("Expected the field `field_groups` to be an array in the JSON data but got " + data['field_groups']);
|
|
255
|
+
}
|
|
256
|
+
// validate the optional field `field_groups` (array)
|
|
257
|
+
var _iterator2 = _createForOfIteratorHelper(data['field_groups']),
|
|
258
|
+
_step2;
|
|
259
|
+
try {
|
|
260
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
261
|
+
var _item = _step2.value;
|
|
262
|
+
_FieldGroupInput["default"].validateJSON(_item);
|
|
263
|
+
}
|
|
264
|
+
} catch (err) {
|
|
265
|
+
_iterator2.e(err);
|
|
266
|
+
} finally {
|
|
267
|
+
_iterator2.f();
|
|
268
|
+
}
|
|
269
|
+
;
|
|
270
|
+
}
|
|
271
|
+
if (data['predefined_fields']) {
|
|
272
|
+
// data not null
|
|
273
|
+
// ensure the json data is an array
|
|
274
|
+
if (!Array.isArray(data['predefined_fields'])) {
|
|
275
|
+
throw new Error("Expected the field `predefined_fields` to be an array in the JSON data but got " + data['predefined_fields']);
|
|
276
|
+
}
|
|
277
|
+
// validate the optional field `predefined_fields` (array)
|
|
278
|
+
var _iterator3 = _createForOfIteratorHelper(data['predefined_fields']),
|
|
279
|
+
_step3;
|
|
280
|
+
try {
|
|
281
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
282
|
+
var _item2 = _step3.value;
|
|
283
|
+
_PredefinedFieldInput["default"].validateJSON(_item2);
|
|
284
|
+
}
|
|
285
|
+
} catch (err) {
|
|
286
|
+
_iterator3.e(err);
|
|
287
|
+
} finally {
|
|
288
|
+
_iterator3.f();
|
|
289
|
+
}
|
|
290
|
+
;
|
|
291
|
+
}
|
|
234
292
|
// ensure the json data is a string
|
|
235
293
|
if (data['html'] && !(typeof data['html'] === 'string' || data['html'] instanceof String)) {
|
|
236
294
|
throw new Error("Expected the field `html` to be a primitive type in the JSON string but got " + data['html']);
|
|
@@ -317,7 +375,7 @@ UpdateTemplateRequest.prototype['default_form_mode'] = undefined;
|
|
|
317
375
|
UpdateTemplateRequest.prototype['editable_submissions'] = undefined;
|
|
318
376
|
|
|
319
377
|
/**
|
|
320
|
-
* The sites
|
|
378
|
+
* The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted.
|
|
321
379
|
* @member {Array.<String>} embed_domains
|
|
322
380
|
*/
|
|
323
381
|
UpdateTemplateRequest.prototype['embed_domains'] = undefined;
|
|
@@ -418,6 +476,24 @@ UpdateTemplateRequest.prototype['defaults'] = undefined;
|
|
|
418
476
|
*/
|
|
419
477
|
UpdateTemplateRequest.prototype['field_dependencies'] = undefined;
|
|
420
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Changes to the settings of the template's field groups, each with the `name` of the group it changes. Settings left out keep their values, and groups left out are unchanged.
|
|
481
|
+
* @member {Array.<module:model/FieldGroupInput>} field_groups
|
|
482
|
+
*/
|
|
483
|
+
UpdateTemplateRequest.prototype['field_groups'] = undefined;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off.
|
|
487
|
+
* @member {Array.<module:model/PredefinedFieldInput>} predefined_fields
|
|
488
|
+
*/
|
|
489
|
+
UpdateTemplateRequest.prototype['predefined_fields'] = undefined;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Sample submission data that sets `predefined_fields`: each value becomes a predefined field, with a type that fits it (`string`, `number`, `boolean`, `date`, `email` or `url`) and `required_in_template` true. Nested objects and arrays become names with `/`, such as `customer/email`. Without `predefined_fields` in the same request, it replaces them; with them, it adds to them and sets the types of the ones it has values for.
|
|
493
|
+
* @member {Object.<String, Object>} predefined_fields_sample_data
|
|
494
|
+
*/
|
|
495
|
+
UpdateTemplateRequest.prototype['predefined_fields_sample_data'] = undefined;
|
|
496
|
+
|
|
421
497
|
/**
|
|
422
498
|
* The HTML of an HTML template, as a Liquid template. Null for PDF templates.
|
|
423
499
|
* @member {String} html
|
|
@@ -447,4 +523,10 @@ UpdateTemplateRequest.prototype['footer_html'] = undefined;
|
|
|
447
523
|
* @member {module:model/HtmlEngineOptionsInput} html_engine_options
|
|
448
524
|
*/
|
|
449
525
|
UpdateTemplateRequest.prototype['html_engine_options'] = undefined;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates.
|
|
529
|
+
* @member {Boolean} html_escape_data
|
|
530
|
+
*/
|
|
531
|
+
UpdateTemplateRequest.prototype['html_escape_data'] = undefined;
|
|
450
532
|
var _default = exports["default"] = UpdateTemplateRequest;
|
|
@@ -28,7 +28,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
28
28
|
/**
|
|
29
29
|
* The UpdateWebhookRequest model module.
|
|
30
30
|
* @module model/UpdateWebhookRequest
|
|
31
|
-
* @version 4.
|
|
31
|
+
* @version 4.2.0
|
|
32
32
|
*/
|
|
33
33
|
var UpdateWebhookRequest = /*#__PURE__*/function () {
|
|
34
34
|
/**
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r;
|
|
|
30
30
|
/**
|
|
31
31
|
* The UploadPresign model module.
|
|
32
32
|
* @module model/UploadPresign
|
|
33
|
-
* @version 4.
|
|
33
|
+
* @version 4.2.0
|
|
34
34
|
*/
|
|
35
35
|
var UploadPresign = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
@@ -0,0 +1,226 @@
|
|
|
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 _FieldOverride = _interopRequireDefault(require("./FieldOverride"));
|
|
9
|
+
var _OutputFormat = _interopRequireDefault(require("./OutputFormat"));
|
|
10
|
+
var _SignatureRequestInput = _interopRequireDefault(require("./SignatureRequestInput"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; } } }; }
|
|
14
|
+
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; } }
|
|
15
|
+
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; }
|
|
16
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
|
+
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); } }
|
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
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); } /**
|
|
21
|
+
* DocSpring API
|
|
22
|
+
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
23
|
+
*
|
|
24
|
+
* The version of the OpenAPI document: v2
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
28
|
+
* https://openapi-generator.tech
|
|
29
|
+
* Do not edit the class manually.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The ValidateSubmissionRequest model module.
|
|
34
|
+
* @module model/ValidateSubmissionRequest
|
|
35
|
+
* @version 4.2.0
|
|
36
|
+
*/
|
|
37
|
+
var ValidateSubmissionRequest = /*#__PURE__*/function () {
|
|
38
|
+
/**
|
|
39
|
+
* Constructs a new <code>ValidateSubmissionRequest</code>.
|
|
40
|
+
* The submission's data and settings.
|
|
41
|
+
* @alias module:model/ValidateSubmissionRequest
|
|
42
|
+
*/
|
|
43
|
+
function ValidateSubmissionRequest() {
|
|
44
|
+
_classCallCheck(this, ValidateSubmissionRequest);
|
|
45
|
+
ValidateSubmissionRequest.initialize(this);
|
|
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(ValidateSubmissionRequest, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj) {}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a <code>ValidateSubmissionRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
59
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
60
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
61
|
+
* @param {module:model/ValidateSubmissionRequest} obj Optional instance to populate.
|
|
62
|
+
* @return {module:model/ValidateSubmissionRequest} The populated <code>ValidateSubmissionRequest</code> instance.
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value: function constructFromObject(data, obj) {
|
|
67
|
+
if (data) {
|
|
68
|
+
obj = obj || new ValidateSubmissionRequest();
|
|
69
|
+
if (data.hasOwnProperty('test')) {
|
|
70
|
+
obj['test'] = _ApiClient["default"].convertToType(data['test'], 'Boolean');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('editable')) {
|
|
73
|
+
obj['editable'] = _ApiClient["default"].convertToType(data['editable'], 'Boolean');
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('data')) {
|
|
76
|
+
obj['data'] = _ApiClient["default"].convertToType(data['data'], {
|
|
77
|
+
'String': Object
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('metadata')) {
|
|
81
|
+
obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], {
|
|
82
|
+
'String': Object
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('password')) {
|
|
86
|
+
obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('output_formats')) {
|
|
89
|
+
obj['output_formats'] = _ApiClient["default"].convertToType(data['output_formats'], [_OutputFormat["default"]]);
|
|
90
|
+
}
|
|
91
|
+
if (data.hasOwnProperty('expires_in')) {
|
|
92
|
+
obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
|
|
93
|
+
}
|
|
94
|
+
if (data.hasOwnProperty('field_overrides')) {
|
|
95
|
+
obj['field_overrides'] = _ApiClient["default"].convertToType(data['field_overrides'], {
|
|
96
|
+
'String': _FieldOverride["default"]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (data.hasOwnProperty('html')) {
|
|
100
|
+
obj['html'] = _ApiClient["default"].convertToType(data['html'], 'String');
|
|
101
|
+
}
|
|
102
|
+
if (data.hasOwnProperty('css')) {
|
|
103
|
+
obj['css'] = _ApiClient["default"].convertToType(data['css'], 'String');
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('signature_requests')) {
|
|
106
|
+
obj['signature_requests'] = _ApiClient["default"].convertToType(data['signature_requests'], [_SignatureRequestInput["default"]]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return obj;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Validates the JSON data with respect to <code>ValidateSubmissionRequest</code>.
|
|
114
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
115
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ValidateSubmissionRequest</code>.
|
|
116
|
+
*/
|
|
117
|
+
}, {
|
|
118
|
+
key: "validateJSON",
|
|
119
|
+
value: function validateJSON(data) {
|
|
120
|
+
// ensure the json data is a string
|
|
121
|
+
if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
|
|
122
|
+
throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
|
|
123
|
+
}
|
|
124
|
+
// ensure the json data is an array
|
|
125
|
+
if (!Array.isArray(data['output_formats'])) {
|
|
126
|
+
throw new Error("Expected the field `output_formats` to be an array in the JSON data but got " + data['output_formats']);
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is a string
|
|
129
|
+
if (data['html'] && !(typeof data['html'] === 'string' || data['html'] instanceof String)) {
|
|
130
|
+
throw new Error("Expected the field `html` to be a primitive type in the JSON string but got " + data['html']);
|
|
131
|
+
}
|
|
132
|
+
// ensure the json data is a string
|
|
133
|
+
if (data['css'] && !(typeof data['css'] === 'string' || data['css'] instanceof String)) {
|
|
134
|
+
throw new Error("Expected the field `css` to be a primitive type in the JSON string but got " + data['css']);
|
|
135
|
+
}
|
|
136
|
+
if (data['signature_requests']) {
|
|
137
|
+
// data not null
|
|
138
|
+
// ensure the json data is an array
|
|
139
|
+
if (!Array.isArray(data['signature_requests'])) {
|
|
140
|
+
throw new Error("Expected the field `signature_requests` to be an array in the JSON data but got " + data['signature_requests']);
|
|
141
|
+
}
|
|
142
|
+
// validate the optional field `signature_requests` (array)
|
|
143
|
+
var _iterator = _createForOfIteratorHelper(data['signature_requests']),
|
|
144
|
+
_step;
|
|
145
|
+
try {
|
|
146
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
147
|
+
var item = _step.value;
|
|
148
|
+
_SignatureRequestInput["default"].validateJSON(item);
|
|
149
|
+
}
|
|
150
|
+
} catch (err) {
|
|
151
|
+
_iterator.e(err);
|
|
152
|
+
} finally {
|
|
153
|
+
_iterator.f();
|
|
154
|
+
}
|
|
155
|
+
;
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
}]);
|
|
160
|
+
}();
|
|
161
|
+
/**
|
|
162
|
+
* Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions.
|
|
163
|
+
* @member {Boolean} test
|
|
164
|
+
*/
|
|
165
|
+
ValidateSubmissionRequest.prototype['test'] = undefined;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`.
|
|
169
|
+
* @member {Boolean} editable
|
|
170
|
+
*/
|
|
171
|
+
ValidateSubmissionRequest.prototype['editable'] = undefined;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The values of the template's fields, by field name. Required for a PDF template, unless `signature_requests` collects the values.
|
|
175
|
+
* @member {Object.<String, Object>} data
|
|
176
|
+
*/
|
|
177
|
+
ValidateSubmissionRequest.prototype['data'] = undefined;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`).
|
|
181
|
+
* @member {Object.<String, Object>} metadata
|
|
182
|
+
*/
|
|
183
|
+
ValidateSubmissionRequest.prototype['metadata'] = undefined;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set.
|
|
187
|
+
* @member {String} password
|
|
188
|
+
*/
|
|
189
|
+
ValidateSubmissionRequest.prototype['password'] = undefined;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
|
|
193
|
+
* @member {Array.<module:model/OutputFormat>} output_formats
|
|
194
|
+
*/
|
|
195
|
+
ValidateSubmissionRequest.prototype['output_formats'] = undefined;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours.
|
|
199
|
+
* @member {Number} expires_in
|
|
200
|
+
*/
|
|
201
|
+
ValidateSubmissionRequest.prototype['expires_in'] = undefined;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Changes to field settings for this submission only, by field name, such as `{"name": {"required": false, "font_size": 9}}`. A setting that identifies the field (`id`, `name`, `type`), that only the template sets (such as `description`), or that doesn't apply to the field's type and display type (such as `check_character` on a field displayed as text) is a 422. With `signature_requests`, `editable: true` is a 422, and a `default` for a signature or initials field makes the submission `invalid_data`.
|
|
205
|
+
* @member {Object.<String, module:model/FieldOverride>} field_overrides
|
|
206
|
+
*/
|
|
207
|
+
ValidateSubmissionRequest.prototype['field_overrides'] = undefined;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* For an HTML template, HTML to use instead of the template's.
|
|
211
|
+
* @member {String} html
|
|
212
|
+
*/
|
|
213
|
+
ValidateSubmissionRequest.prototype['html'] = undefined;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity.
|
|
217
|
+
* @member {String} css
|
|
218
|
+
*/
|
|
219
|
+
ValidateSubmissionRequest.prototype['css'] = undefined;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`.
|
|
223
|
+
* @member {Array.<module:model/SignatureRequestInput>} signature_requests
|
|
224
|
+
*/
|
|
225
|
+
ValidateSubmissionRequest.prototype['signature_requests'] = undefined;
|
|
226
|
+
var _default = exports["default"] = ValidateSubmissionRequest;
|
package/dist/model/Webhook.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docspring",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "An API client for the DocSpring PDF generation service",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"test": "mocha --require @babel/register --recursive"
|
|
11
11
|
},
|
|
12
12
|
"browser": {
|
|
13
|
-
"fs": false
|
|
13
|
+
"fs": false,
|
|
14
|
+
"crypto": false
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
17
|
"@babel/cli": "^7.0.0",
|