docspring 3.3.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.
- package/AGENTS.md +79 -19
- package/README.md +74 -63
- package/dist/ApiClient.js +63 -28
- package/dist/RequestSchemas.js +3452 -0
- package/dist/RequestValidator.js +494 -0
- package/dist/api/Client.js +1769 -921
- package/dist/index.js +847 -154
- package/dist/model/AddTemplateFieldsRequest.js +132 -0
- package/dist/model/AiFieldNamingLanguage.js +64 -0
- package/dist/model/{CreateWebhookData.js → AuthenticationCheck.js} +32 -28
- package/dist/model/BarcodeSymbology.js +89 -0
- package/dist/model/CheckCharacter.js +74 -0
- package/dist/model/CombinedFieldType.js +59 -0
- package/dist/model/CombinedPdf.js +294 -0
- package/dist/model/{MoveFolderData.js → CombinedPdfFiles.js} +27 -27
- package/dist/model/CombinedPdfList.js +132 -0
- package/dist/model/{ForbiddenErrorResponse.js → CombinedPdfSource.js} +59 -73
- package/dist/model/CombinedPdfSourceInput.js +270 -0
- package/dist/model/CombinedPdfSourcePdf.js +130 -0
- package/dist/model/CombinedPdfSourceType.js +74 -0
- package/dist/model/CombinedPdfState.js +74 -0
- package/dist/model/{CopyTemplateOptions.js → CopyTemplateRequest.js} +26 -22
- package/dist/model/{CombinePdfsData.js → CreateCombinedPdfRequest.js} +69 -53
- package/dist/model/{CreateCustomFileData.js → CreateCustomFileFromUploadRequest.js} +25 -23
- package/dist/model/{CreateFolderData.js → CreateFolderRequest.js} +47 -28
- package/dist/model/{CreateCustomFileResponse.js → CreateSignatureRequestEventRequest.js} +49 -73
- package/dist/model/CreateSignatureRequestTokenRequest.js +88 -0
- package/dist/model/CreateSubmissionBatchRequest.js +192 -0
- package/dist/model/CreateSubmissionRequest.js +226 -0
- package/dist/model/CreateTemplateRequest.js +613 -0
- package/dist/model/CreateWebhookRequest.js +234 -0
- package/dist/model/CustomFile.js +67 -16
- package/dist/model/CustomFileList.js +132 -0
- package/dist/model/CustomFileSourcePdf.js +130 -0
- package/dist/model/ErrorCode.js +154 -0
- package/dist/model/{CreateSubmissionResponse.js → ErrorDetail.js} +65 -75
- package/dist/model/ErrorInfo.js +211 -0
- package/dist/model/ErrorResponse.js +12 -41
- package/dist/model/ExpirationInterval.js +64 -0
- package/dist/model/Field.js +1230 -0
- package/dist/model/FieldComparisonCondition.js +137 -0
- package/dist/model/FieldComparisonOperator.js +69 -0
- package/dist/model/FieldDependency.js +154 -0
- package/dist/model/FieldDependencyInput.js +154 -0
- package/dist/model/FieldDisplayType.js +79 -0
- package/dist/model/{MultipleErrorsResponse.js → FieldEqualsCondition.js} +48 -52
- package/dist/model/FieldEqualsOperator.js +59 -0
- package/dist/model/FieldGroup.js +206 -0
- package/dist/model/FieldGroupInput.js +180 -0
- package/dist/model/FieldGroupType.js +59 -0
- package/dist/model/{SuccessMultipleErrorsResponse.js → FieldInCondition.js} +54 -53
- package/dist/model/FieldInput.js +1012 -0
- package/dist/model/FieldOverride.js +722 -0
- package/dist/model/FieldPresenceCondition.js +126 -0
- package/dist/model/FieldPresenceOperator.js +59 -0
- package/dist/model/FieldRangeCondition.js +148 -0
- package/dist/model/FieldReimportState.js +69 -0
- package/dist/model/FieldSetupLogic.js +59 -0
- package/dist/model/FieldSetupNaming.js +59 -0
- package/dist/model/FieldSetupSource.js +64 -0
- package/dist/model/FieldType.js +124 -0
- package/dist/model/Folder.js +38 -11
- package/dist/model/FolderList.js +132 -0
- package/dist/model/GenerateFilesFormat.js +54 -0
- package/dist/model/GenerateSubmissionFilesRequest.js +115 -0
- package/dist/model/GeneratedFile.js +214 -0
- package/dist/model/GeneratedFileState.js +64 -0
- package/dist/model/HtmlEngineOptions.js +230 -0
- package/dist/model/HtmlEngineOptionsInput.js +193 -0
- package/dist/model/ImageGravity.js +94 -0
- package/dist/model/ImageScaleType.js +64 -0
- package/dist/model/ModelCodeLanguage.js +94 -0
- package/dist/model/{UpdatePdfTemplate.js → MoveFolderRequest.js} +34 -28
- package/dist/model/{MoveTemplateData.js → MoveTemplateRequest.js} +25 -35
- package/dist/model/NumberConditionType.js +79 -0
- package/dist/model/OutputFormat.js +59 -0
- package/dist/model/PageFormat.js +114 -0
- package/dist/model/PageImage.js +220 -0
- package/dist/model/{TemplateDeleteResponse.js → PageImages.js} +57 -70
- package/dist/model/PredefinedField.js +183 -0
- package/dist/model/PredefinedFieldInput.js +183 -0
- package/dist/model/{PublishVersionData.js → PublishTemplateVersionRequest.js} +33 -33
- package/dist/model/{AddFieldsData.js → RemoveTemplateFieldsRequest.js} +32 -30
- package/dist/model/{RenameFolderData.js → RenameFolderRequest.js} +25 -23
- package/dist/model/ReorderTemplateFieldsRequest.js +114 -0
- package/dist/model/{RestoreVersionData.js → RestoreTemplateVersionRequest.js} +25 -23
- package/dist/model/ShapeType.js +79 -0
- package/dist/model/{SubmissionDataRequestShow.js → SignatureRequest.js} +165 -240
- package/dist/model/SignatureRequestAuthSecondFactorType.js +79 -0
- package/dist/model/SignatureRequestAuthType.js +84 -0
- package/dist/model/{SubmissionDataRequestEvent.js → SignatureRequestEvent.js} +67 -149
- package/dist/model/SignatureRequestEventType.js +79 -0
- package/dist/model/SignatureRequestInput.js +278 -0
- package/dist/model/SignatureRequestMessageType.js +94 -0
- package/dist/model/SignatureRequestState.js +64 -0
- package/dist/model/SignatureRequestToken.js +195 -0
- package/dist/model/SignatureRequestTokenType.js +59 -0
- package/dist/model/StringConditionType.js +74 -0
- package/dist/model/Submission.js +198 -341
- package/dist/model/SubmissionAction.js +30 -115
- package/dist/model/SubmissionActionState.js +69 -0
- package/dist/model/SubmissionActionType.js +84 -0
- package/dist/model/SubmissionBatch.js +74 -55
- package/dist/model/SubmissionBatchState.js +64 -0
- package/dist/model/SubmissionFiles.js +117 -0
- package/dist/model/SubmissionInput.js +218 -0
- package/dist/model/{ListSubmissionsResponse.js → SubmissionList.js} +35 -42
- package/dist/model/SubmissionSource.js +69 -0
- package/dist/model/SubmissionSourcePdf.js +130 -0
- package/dist/model/SubmissionState.js +114 -0
- package/dist/model/{SubmissionBatchData.js → SubmissionValidation.js} +46 -48
- package/dist/model/Template.js +359 -560
- package/dist/model/TemplateActor.js +171 -0
- package/dist/model/TemplateActorType.js +64 -0
- package/dist/model/TemplateDefaults.js +307 -0
- package/dist/model/TemplateDefaultsInput.js +305 -0
- package/dist/model/TemplateDiff.js +206 -0
- package/dist/model/TemplateDiffSummary.js +165 -0
- package/dist/model/TemplateDocument.js +280 -0
- package/dist/model/TemplateDocumentState.js +84 -0
- package/dist/model/TemplateFieldChange.js +146 -0
- package/dist/model/TemplateFieldChanges.js +196 -0
- package/dist/model/{CreatePdfSubmissionData.js → TemplateFieldDependency.js} +70 -89
- package/dist/model/TemplateFieldDependencyAction.js +64 -0
- package/dist/model/{TemplatePublishVersionResponse.js → TemplateFieldDependencyCondition.js} +51 -61
- package/dist/model/TemplateFieldDependencyConditionInput.js +304 -0
- package/dist/model/TemplateFieldDependencyInput.js +182 -0
- package/dist/model/TemplateFieldDependencyMatch.js +59 -0
- package/dist/model/TemplateFieldDependencyOperator.js +99 -0
- package/dist/model/TemplateFieldLogicStatus.js +74 -0
- package/dist/model/{CreatePdfTemplate.js → TemplateFieldMove.js} +52 -28
- package/dist/model/TemplateFields.js +147 -0
- package/dist/model/TemplateFormMode.js +64 -0
- package/dist/model/{TemplateModelCodeResponse.js → TemplateModelCode.js} +34 -86
- package/dist/model/TemplatePageAiError.js +69 -0
- package/dist/model/TemplatePageAiNamingStatus.js +59 -0
- package/dist/model/TemplatePageFieldsStatus.js +74 -0
- package/dist/model/TemplatePageImageStatus.js +59 -0
- package/dist/model/TemplatePageImages.js +158 -0
- package/dist/model/TemplatePageProcessingStatus.js +162 -0
- package/dist/model/{SubmissionDataRequestToken.js → TemplateSourcePdf.js} +52 -56
- package/dist/model/TemplateSummary.js +560 -0
- package/dist/model/{SuccessErrorResponse.js → TemplateSummaryList.js} +43 -55
- package/dist/model/TemplateType.js +59 -0
- package/dist/model/{Submission422Response.js → TemplateVersion.js} +60 -63
- package/dist/model/TemplateVersionType.js +64 -0
- package/dist/model/TextAlignment.js +69 -0
- package/dist/model/TextOverflow.js +59 -0
- package/dist/model/TextVerticalAlignment.js +64 -0
- package/dist/model/Typeface.js +134 -0
- package/dist/model/UpdateSignatureRequestRequest.js +183 -0
- package/dist/model/UpdateTemplateDocumentRequest.js +139 -0
- package/dist/model/UpdateTemplateFieldsRequest.js +132 -0
- package/dist/model/UpdateTemplateRequest.js +523 -0
- package/dist/model/UpdateWebhookRequest.js +209 -0
- package/dist/model/UploadMethod.js +54 -0
- package/dist/model/{UploadPresignResponse.js → UploadPresign.js} +53 -58
- package/dist/model/UrlSourcePdf.js +130 -0
- package/dist/model/ValidateSubmissionRequest.js +226 -0
- package/dist/model/Webhook.js +58 -73
- package/dist/model/WebhookEventType.js +174 -0
- package/dist/model/WebhookList.js +132 -0
- package/dist/model/WebhookMode.js +59 -0
- package/package.json +1 -1
- package/dist/model/BatchGeneratePdfs201Response.js +0 -194
- package/dist/model/CombinedSubmission.js +0 -313
- package/dist/model/CombinedSubmissionAction.js +0 -268
- package/dist/model/CreateCombinedSubmissionResponse.js +0 -180
- package/dist/model/CreateHtmlTemplate.js +0 -108
- package/dist/model/CreateSubmissionDataRequestData.js +0 -314
- package/dist/model/CreateSubmissionDataRequestEventRequest.js +0 -239
- package/dist/model/CreateSubmissionDataRequestEventResponse.js +0 -167
- package/dist/model/CreateSubmissionDataRequestResponse.js +0 -167
- package/dist/model/CreateSubmissionDataRequestTokenResponse.js +0 -167
- package/dist/model/ErrorOrMultipleErrorsResponse.js +0 -153
- package/dist/model/JsonSchema.js +0 -205
- package/dist/model/SubmissionBatchWithSubmissions.js +0 -228
- package/dist/model/SubmissionDataRequest.js +0 -496
- package/dist/model/SubmissionPreview.js +0 -509
- package/dist/model/TemplateAddFieldsResponse.js +0 -156
- package/dist/model/TemplatePreview.js +0 -796
- package/dist/model/UpdateHtmlTemplate.js +0 -108
- package/dist/model/UpdateSubmissionDataRequestData.js +0 -311
- package/dist/model/UpdateWebhookData.js +0 -108
|
@@ -0,0 +1,305 @@
|
|
|
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 _CheckCharacter = _interopRequireDefault(require("./CheckCharacter"));
|
|
9
|
+
var _TextAlignment = _interopRequireDefault(require("./TextAlignment"));
|
|
10
|
+
var _Typeface = _interopRequireDefault(require("./Typeface"));
|
|
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 _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 TemplateDefaultsInput model module.
|
|
31
|
+
* @module model/TemplateDefaultsInput
|
|
32
|
+
* @version 4.1.0
|
|
33
|
+
*/
|
|
34
|
+
var TemplateDefaultsInput = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>TemplateDefaultsInput</code>.
|
|
37
|
+
* The default style of the template's fields. Each field can override it.
|
|
38
|
+
* @alias module:model/TemplateDefaultsInput
|
|
39
|
+
*/
|
|
40
|
+
function TemplateDefaultsInput() {
|
|
41
|
+
_classCallCheck(this, TemplateDefaultsInput);
|
|
42
|
+
TemplateDefaultsInput.initialize(this);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes the fields of this object.
|
|
47
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
48
|
+
* Only for internal use.
|
|
49
|
+
*/
|
|
50
|
+
return _createClass(TemplateDefaultsInput, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj) {}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a <code>TemplateDefaultsInput</code> from a plain JavaScript object, optionally creating a new instance.
|
|
56
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
57
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
58
|
+
* @param {module:model/TemplateDefaultsInput} obj Optional instance to populate.
|
|
59
|
+
* @return {module:model/TemplateDefaultsInput} The populated <code>TemplateDefaultsInput</code> instance.
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "constructFromObject",
|
|
63
|
+
value: function constructFromObject(data, obj) {
|
|
64
|
+
if (data) {
|
|
65
|
+
obj = obj || new TemplateDefaultsInput();
|
|
66
|
+
if (data.hasOwnProperty('typeface')) {
|
|
67
|
+
obj['typeface'] = _ApiClient["default"].convertToType(data['typeface'], _Typeface["default"]);
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('font_size')) {
|
|
70
|
+
obj['font_size'] = _ApiClient["default"].convertToType(data['font_size'], 'Number');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('character_spacing')) {
|
|
73
|
+
obj['character_spacing'] = _ApiClient["default"].convertToType(data['character_spacing'], 'Number');
|
|
74
|
+
}
|
|
75
|
+
if (data.hasOwnProperty('color')) {
|
|
76
|
+
obj['color'] = _ApiClient["default"].convertToType(data['color'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('background_color')) {
|
|
79
|
+
obj['background_color'] = _ApiClient["default"].convertToType(data['background_color'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('bold')) {
|
|
82
|
+
obj['bold'] = _ApiClient["default"].convertToType(data['bold'], 'Boolean');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('uppercase')) {
|
|
85
|
+
obj['uppercase'] = _ApiClient["default"].convertToType(data['uppercase'], 'Boolean');
|
|
86
|
+
}
|
|
87
|
+
if (data.hasOwnProperty('alignment')) {
|
|
88
|
+
obj['alignment'] = _ApiClient["default"].convertToType(data['alignment'], _TextAlignment["default"]);
|
|
89
|
+
}
|
|
90
|
+
if (data.hasOwnProperty('opacity')) {
|
|
91
|
+
obj['opacity'] = _ApiClient["default"].convertToType(data['opacity'], 'Number');
|
|
92
|
+
}
|
|
93
|
+
if (data.hasOwnProperty('date_format')) {
|
|
94
|
+
obj['date_format'] = _ApiClient["default"].convertToType(data['date_format'], 'String');
|
|
95
|
+
}
|
|
96
|
+
if (data.hasOwnProperty('date_time_format')) {
|
|
97
|
+
obj['date_time_format'] = _ApiClient["default"].convertToType(data['date_time_format'], 'String');
|
|
98
|
+
}
|
|
99
|
+
if (data.hasOwnProperty('check_color')) {
|
|
100
|
+
obj['check_color'] = _ApiClient["default"].convertToType(data['check_color'], 'String');
|
|
101
|
+
}
|
|
102
|
+
if (data.hasOwnProperty('check_character')) {
|
|
103
|
+
obj['check_character'] = _ApiClient["default"].convertToType(data['check_character'], _CheckCharacter["default"]);
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('check_background_color')) {
|
|
106
|
+
obj['check_background_color'] = _ApiClient["default"].convertToType(data['check_background_color'], 'String');
|
|
107
|
+
}
|
|
108
|
+
if (data.hasOwnProperty('required_field_background_color')) {
|
|
109
|
+
obj['required_field_background_color'] = _ApiClient["default"].convertToType(data['required_field_background_color'], 'String');
|
|
110
|
+
}
|
|
111
|
+
if (data.hasOwnProperty('true_text')) {
|
|
112
|
+
obj['true_text'] = _ApiClient["default"].convertToType(data['true_text'], 'String');
|
|
113
|
+
}
|
|
114
|
+
if (data.hasOwnProperty('false_text')) {
|
|
115
|
+
obj['false_text'] = _ApiClient["default"].convertToType(data['false_text'], 'String');
|
|
116
|
+
}
|
|
117
|
+
if (data.hasOwnProperty('shape_fill_color')) {
|
|
118
|
+
obj['shape_fill_color'] = _ApiClient["default"].convertToType(data['shape_fill_color'], 'String');
|
|
119
|
+
}
|
|
120
|
+
if (data.hasOwnProperty('shape_border_color')) {
|
|
121
|
+
obj['shape_border_color'] = _ApiClient["default"].convertToType(data['shape_border_color'], 'String');
|
|
122
|
+
}
|
|
123
|
+
if (data.hasOwnProperty('shape_border_width')) {
|
|
124
|
+
obj['shape_border_width'] = _ApiClient["default"].convertToType(data['shape_border_width'], 'Number');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return obj;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Validates the JSON data with respect to <code>TemplateDefaultsInput</code>.
|
|
132
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
133
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateDefaultsInput</code>.
|
|
134
|
+
*/
|
|
135
|
+
}, {
|
|
136
|
+
key: "validateJSON",
|
|
137
|
+
value: function validateJSON(data) {
|
|
138
|
+
// ensure the json data is a string
|
|
139
|
+
if (data['color'] && !(typeof data['color'] === 'string' || data['color'] instanceof String)) {
|
|
140
|
+
throw new Error("Expected the field `color` to be a primitive type in the JSON string but got " + data['color']);
|
|
141
|
+
}
|
|
142
|
+
// ensure the json data is a string
|
|
143
|
+
if (data['background_color'] && !(typeof data['background_color'] === 'string' || data['background_color'] instanceof String)) {
|
|
144
|
+
throw new Error("Expected the field `background_color` to be a primitive type in the JSON string but got " + data['background_color']);
|
|
145
|
+
}
|
|
146
|
+
// ensure the json data is a string
|
|
147
|
+
if (data['date_format'] && !(typeof data['date_format'] === 'string' || data['date_format'] instanceof String)) {
|
|
148
|
+
throw new Error("Expected the field `date_format` to be a primitive type in the JSON string but got " + data['date_format']);
|
|
149
|
+
}
|
|
150
|
+
// ensure the json data is a string
|
|
151
|
+
if (data['date_time_format'] && !(typeof data['date_time_format'] === 'string' || data['date_time_format'] instanceof String)) {
|
|
152
|
+
throw new Error("Expected the field `date_time_format` to be a primitive type in the JSON string but got " + data['date_time_format']);
|
|
153
|
+
}
|
|
154
|
+
// ensure the json data is a string
|
|
155
|
+
if (data['check_color'] && !(typeof data['check_color'] === 'string' || data['check_color'] instanceof String)) {
|
|
156
|
+
throw new Error("Expected the field `check_color` to be a primitive type in the JSON string but got " + data['check_color']);
|
|
157
|
+
}
|
|
158
|
+
// ensure the json data is a string
|
|
159
|
+
if (data['check_background_color'] && !(typeof data['check_background_color'] === 'string' || data['check_background_color'] instanceof String)) {
|
|
160
|
+
throw new Error("Expected the field `check_background_color` to be a primitive type in the JSON string but got " + data['check_background_color']);
|
|
161
|
+
}
|
|
162
|
+
// ensure the json data is a string
|
|
163
|
+
if (data['required_field_background_color'] && !(typeof data['required_field_background_color'] === 'string' || data['required_field_background_color'] instanceof String)) {
|
|
164
|
+
throw new Error("Expected the field `required_field_background_color` to be a primitive type in the JSON string but got " + data['required_field_background_color']);
|
|
165
|
+
}
|
|
166
|
+
// ensure the json data is a string
|
|
167
|
+
if (data['true_text'] && !(typeof data['true_text'] === 'string' || data['true_text'] instanceof String)) {
|
|
168
|
+
throw new Error("Expected the field `true_text` to be a primitive type in the JSON string but got " + data['true_text']);
|
|
169
|
+
}
|
|
170
|
+
// ensure the json data is a string
|
|
171
|
+
if (data['false_text'] && !(typeof data['false_text'] === 'string' || data['false_text'] instanceof String)) {
|
|
172
|
+
throw new Error("Expected the field `false_text` to be a primitive type in the JSON string but got " + data['false_text']);
|
|
173
|
+
}
|
|
174
|
+
// ensure the json data is a string
|
|
175
|
+
if (data['shape_fill_color'] && !(typeof data['shape_fill_color'] === 'string' || data['shape_fill_color'] instanceof String)) {
|
|
176
|
+
throw new Error("Expected the field `shape_fill_color` to be a primitive type in the JSON string but got " + data['shape_fill_color']);
|
|
177
|
+
}
|
|
178
|
+
// ensure the json data is a string
|
|
179
|
+
if (data['shape_border_color'] && !(typeof data['shape_border_color'] === 'string' || data['shape_border_color'] instanceof String)) {
|
|
180
|
+
throw new Error("Expected the field `shape_border_color` to be a primitive type in the JSON string but got " + data['shape_border_color']);
|
|
181
|
+
}
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}]);
|
|
185
|
+
}();
|
|
186
|
+
/**
|
|
187
|
+
* The font of text fields.
|
|
188
|
+
* @member {module:model/Typeface} typeface
|
|
189
|
+
*/
|
|
190
|
+
TemplateDefaultsInput.prototype['typeface'] = undefined;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The font size in points, a whole number.
|
|
194
|
+
* @member {Number} font_size
|
|
195
|
+
*/
|
|
196
|
+
TemplateDefaultsInput.prototype['font_size'] = undefined;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Extra space between characters, in points (0 to 50).
|
|
200
|
+
* @member {Number} character_spacing
|
|
201
|
+
*/
|
|
202
|
+
TemplateDefaultsInput.prototype['character_spacing'] = undefined;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The text color, as 6 hex digits without `#`, such as `444444`.
|
|
206
|
+
* @member {String} color
|
|
207
|
+
*/
|
|
208
|
+
TemplateDefaultsInput.prototype['color'] = undefined;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The field's background color, as 6 hex digits.
|
|
212
|
+
* @member {String} background_color
|
|
213
|
+
*/
|
|
214
|
+
TemplateDefaultsInput.prototype['background_color'] = undefined;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Print text in bold.
|
|
218
|
+
* @member {Boolean} bold
|
|
219
|
+
*/
|
|
220
|
+
TemplateDefaultsInput.prototype['bold'] = undefined;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Print text in capital letters.
|
|
224
|
+
* @member {Boolean} uppercase
|
|
225
|
+
*/
|
|
226
|
+
TemplateDefaultsInput.prototype['uppercase'] = undefined;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* How text is aligned in its field. `justify` lines up both edges of every line of multiline text except the last of each paragraph.
|
|
230
|
+
* @member {module:model/TextAlignment} alignment
|
|
231
|
+
*/
|
|
232
|
+
TemplateDefaultsInput.prototype['alignment'] = undefined;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The opacity of the field's content, from 0 (invisible) to 1.
|
|
236
|
+
* @member {Number} opacity
|
|
237
|
+
*/
|
|
238
|
+
TemplateDefaultsInput.prototype['opacity'] = undefined;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* How date fields are printed, as a strftime format such as `%m/%d/%Y`.
|
|
242
|
+
* @member {String} date_format
|
|
243
|
+
*/
|
|
244
|
+
TemplateDefaultsInput.prototype['date_format'] = undefined;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* How date-time fields are printed, as a strftime format such as `%m/%d/%Y %H:%M:%S`.
|
|
248
|
+
* @member {String} date_time_format
|
|
249
|
+
*/
|
|
250
|
+
TemplateDefaultsInput.prototype['date_time_format'] = undefined;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The color of check marks, as 6 hex digits.
|
|
254
|
+
* @member {String} check_color
|
|
255
|
+
*/
|
|
256
|
+
TemplateDefaultsInput.prototype['check_color'] = undefined;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The character that a ticked check box prints.
|
|
260
|
+
* @member {module:model/CheckCharacter} check_character
|
|
261
|
+
*/
|
|
262
|
+
TemplateDefaultsInput.prototype['check_character'] = undefined;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The check box's background color, as 6 hex digits.
|
|
266
|
+
* @member {String} check_background_color
|
|
267
|
+
*/
|
|
268
|
+
TemplateDefaultsInput.prototype['check_background_color'] = undefined;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The background color that highlights required fields on visual forms and signature request forms, as 6 hex digits. PDFs don't print it.
|
|
272
|
+
* @member {String} required_field_background_color
|
|
273
|
+
*/
|
|
274
|
+
TemplateDefaultsInput.prototype['required_field_background_color'] = undefined;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The text a boolean field prints for `true`.
|
|
278
|
+
* @member {String} true_text
|
|
279
|
+
*/
|
|
280
|
+
TemplateDefaultsInput.prototype['true_text'] = undefined;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The text a boolean field prints for `false`.
|
|
284
|
+
* @member {String} false_text
|
|
285
|
+
*/
|
|
286
|
+
TemplateDefaultsInput.prototype['false_text'] = undefined;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* The fill color of shapes, as 6 hex digits.
|
|
290
|
+
* @member {String} shape_fill_color
|
|
291
|
+
*/
|
|
292
|
+
TemplateDefaultsInput.prototype['shape_fill_color'] = undefined;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The border color of shapes, as 6 hex digits.
|
|
296
|
+
* @member {String} shape_border_color
|
|
297
|
+
*/
|
|
298
|
+
TemplateDefaultsInput.prototype['shape_border_color'] = undefined;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* The border width of shapes, in whole points (at least 1).
|
|
302
|
+
* @member {Number} shape_border_width
|
|
303
|
+
*/
|
|
304
|
+
TemplateDefaultsInput.prototype['shape_border_width'] = undefined;
|
|
305
|
+
var _default = exports["default"] = TemplateDefaultsInput;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _TemplateDiffSummary = _interopRequireDefault(require("./TemplateDiffSummary"));
|
|
9
|
+
var _TemplateFieldChanges = _interopRequireDefault(require("./TemplateFieldChanges"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
20
|
+
* DocSpring API
|
|
21
|
+
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
22
|
+
*
|
|
23
|
+
* The version of the OpenAPI document: v2
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
+
* https://openapi-generator.tech
|
|
28
|
+
* Do not edit the class manually.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* The TemplateDiff model module.
|
|
33
|
+
* @module model/TemplateDiff
|
|
34
|
+
* @version 4.1.0
|
|
35
|
+
*/
|
|
36
|
+
var TemplateDiff = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>TemplateDiff</code>.
|
|
39
|
+
* What changed in a version of a template since the version before it: the draft since the latest published version, or a published version since the one before it. Fields are compared with all their settings, so `y` is measured from the top of each field's page.
|
|
40
|
+
* @alias module:model/TemplateDiff
|
|
41
|
+
* @extends Object
|
|
42
|
+
* @param template_id {String} The template's ID.
|
|
43
|
+
* @param from_version {String} The earlier version, such as `1.1.0`. Null when no version was published before `to_version`: it's compared with a new template, so all of its fields are added.
|
|
44
|
+
* @param to_version {String} The later version, such as `1.2.0`. Null for the draft.
|
|
45
|
+
* @param summary {module:model/TemplateDiffSummary} How many changes of each kind there are.
|
|
46
|
+
* @param fields {module:model/TemplateFieldChanges} The fields that changed.
|
|
47
|
+
* @param changed_settings {Array.<String>} The names of the template's settings that changed, as they're named on the Template (`name`, `html`, `defaults`, `expire_after`, ...). Values aren't included, and secrets like `encrypt_pdfs_password` are named when they change.
|
|
48
|
+
* @param document_changed {Boolean} The template's PDF was replaced (or added, when there's no `from_version`).
|
|
49
|
+
*/
|
|
50
|
+
function TemplateDiff(template_id, from_version, to_version, summary, fields, changed_settings, document_changed) {
|
|
51
|
+
_classCallCheck(this, TemplateDiff);
|
|
52
|
+
TemplateDiff.initialize(this, template_id, from_version, to_version, summary, fields, changed_settings, document_changed);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Initializes the fields of this object.
|
|
57
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
58
|
+
* Only for internal use.
|
|
59
|
+
*/
|
|
60
|
+
return _createClass(TemplateDiff, null, [{
|
|
61
|
+
key: "initialize",
|
|
62
|
+
value: function initialize(obj, template_id, from_version, to_version, summary, fields, changed_settings, document_changed) {
|
|
63
|
+
obj['template_id'] = template_id;
|
|
64
|
+
obj['from_version'] = from_version;
|
|
65
|
+
obj['to_version'] = to_version;
|
|
66
|
+
obj['summary'] = summary;
|
|
67
|
+
obj['fields'] = fields;
|
|
68
|
+
obj['changed_settings'] = changed_settings;
|
|
69
|
+
obj['document_changed'] = document_changed;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Constructs a <code>TemplateDiff</code> from a plain JavaScript object, optionally creating a new instance.
|
|
74
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
75
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
76
|
+
* @param {module:model/TemplateDiff} obj Optional instance to populate.
|
|
77
|
+
* @return {module:model/TemplateDiff} The populated <code>TemplateDiff</code> instance.
|
|
78
|
+
*/
|
|
79
|
+
}, {
|
|
80
|
+
key: "constructFromObject",
|
|
81
|
+
value: function constructFromObject(data, obj) {
|
|
82
|
+
if (data) {
|
|
83
|
+
obj = obj || new TemplateDiff();
|
|
84
|
+
_ApiClient["default"].constructFromObject(data, obj, 'Object');
|
|
85
|
+
if (data.hasOwnProperty('template_id')) {
|
|
86
|
+
obj['template_id'] = _ApiClient["default"].convertToType(data['template_id'], 'String');
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('from_version')) {
|
|
89
|
+
obj['from_version'] = _ApiClient["default"].convertToType(data['from_version'], 'String');
|
|
90
|
+
}
|
|
91
|
+
if (data.hasOwnProperty('to_version')) {
|
|
92
|
+
obj['to_version'] = _ApiClient["default"].convertToType(data['to_version'], 'String');
|
|
93
|
+
}
|
|
94
|
+
if (data.hasOwnProperty('summary')) {
|
|
95
|
+
obj['summary'] = _ApiClient["default"].convertToType(data['summary'], _TemplateDiffSummary["default"]);
|
|
96
|
+
}
|
|
97
|
+
if (data.hasOwnProperty('fields')) {
|
|
98
|
+
obj['fields'] = _ApiClient["default"].convertToType(data['fields'], _TemplateFieldChanges["default"]);
|
|
99
|
+
}
|
|
100
|
+
if (data.hasOwnProperty('changed_settings')) {
|
|
101
|
+
obj['changed_settings'] = _ApiClient["default"].convertToType(data['changed_settings'], ['String']);
|
|
102
|
+
}
|
|
103
|
+
if (data.hasOwnProperty('document_changed')) {
|
|
104
|
+
obj['document_changed'] = _ApiClient["default"].convertToType(data['document_changed'], 'Boolean');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return obj;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Validates the JSON data with respect to <code>TemplateDiff</code>.
|
|
112
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
113
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TemplateDiff</code>.
|
|
114
|
+
*/
|
|
115
|
+
}, {
|
|
116
|
+
key: "validateJSON",
|
|
117
|
+
value: function validateJSON(data) {
|
|
118
|
+
// check to make sure all required properties are present in the JSON string
|
|
119
|
+
var _iterator = _createForOfIteratorHelper(TemplateDiff.RequiredProperties),
|
|
120
|
+
_step;
|
|
121
|
+
try {
|
|
122
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
123
|
+
var property = _step.value;
|
|
124
|
+
if (!data.hasOwnProperty(property)) {
|
|
125
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is a string
|
|
129
|
+
} catch (err) {
|
|
130
|
+
_iterator.e(err);
|
|
131
|
+
} finally {
|
|
132
|
+
_iterator.f();
|
|
133
|
+
}
|
|
134
|
+
if (data['template_id'] && !(typeof data['template_id'] === 'string' || data['template_id'] instanceof String)) {
|
|
135
|
+
throw new Error("Expected the field `template_id` to be a primitive type in the JSON string but got " + data['template_id']);
|
|
136
|
+
}
|
|
137
|
+
// ensure the json data is a string
|
|
138
|
+
if (data['from_version'] && !(typeof data['from_version'] === 'string' || data['from_version'] instanceof String)) {
|
|
139
|
+
throw new Error("Expected the field `from_version` to be a primitive type in the JSON string but got " + data['from_version']);
|
|
140
|
+
}
|
|
141
|
+
// ensure the json data is a string
|
|
142
|
+
if (data['to_version'] && !(typeof data['to_version'] === 'string' || data['to_version'] instanceof String)) {
|
|
143
|
+
throw new Error("Expected the field `to_version` to be a primitive type in the JSON string but got " + data['to_version']);
|
|
144
|
+
}
|
|
145
|
+
// validate the optional field `summary`
|
|
146
|
+
if (data['summary']) {
|
|
147
|
+
// data not null
|
|
148
|
+
_TemplateDiffSummary["default"].validateJSON(data['summary']);
|
|
149
|
+
}
|
|
150
|
+
// validate the optional field `fields`
|
|
151
|
+
if (data['fields']) {
|
|
152
|
+
// data not null
|
|
153
|
+
_TemplateFieldChanges["default"].validateJSON(data['fields']);
|
|
154
|
+
}
|
|
155
|
+
// ensure the json data is an array
|
|
156
|
+
if (!Array.isArray(data['changed_settings'])) {
|
|
157
|
+
throw new Error("Expected the field `changed_settings` to be an array in the JSON data but got " + data['changed_settings']);
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
}();
|
|
163
|
+
TemplateDiff.RequiredProperties = ["template_id", "from_version", "to_version", "summary", "fields", "changed_settings", "document_changed"];
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The template's ID.
|
|
167
|
+
* @member {String} template_id
|
|
168
|
+
*/
|
|
169
|
+
TemplateDiff.prototype['template_id'] = undefined;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The earlier version, such as `1.1.0`. Null when no version was published before `to_version`: it's compared with a new template, so all of its fields are added.
|
|
173
|
+
* @member {String} from_version
|
|
174
|
+
*/
|
|
175
|
+
TemplateDiff.prototype['from_version'] = undefined;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The later version, such as `1.2.0`. Null for the draft.
|
|
179
|
+
* @member {String} to_version
|
|
180
|
+
*/
|
|
181
|
+
TemplateDiff.prototype['to_version'] = undefined;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* How many changes of each kind there are.
|
|
185
|
+
* @member {module:model/TemplateDiffSummary} summary
|
|
186
|
+
*/
|
|
187
|
+
TemplateDiff.prototype['summary'] = undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The fields that changed.
|
|
191
|
+
* @member {module:model/TemplateFieldChanges} fields
|
|
192
|
+
*/
|
|
193
|
+
TemplateDiff.prototype['fields'] = undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The names of the template's settings that changed, as they're named on the Template (`name`, `html`, `defaults`, `expire_after`, ...). Values aren't included, and secrets like `encrypt_pdfs_password` are named when they change.
|
|
197
|
+
* @member {Array.<String>} changed_settings
|
|
198
|
+
*/
|
|
199
|
+
TemplateDiff.prototype['changed_settings'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The template's PDF was replaced (or added, when there's no `from_version`).
|
|
203
|
+
* @member {Boolean} document_changed
|
|
204
|
+
*/
|
|
205
|
+
TemplateDiff.prototype['document_changed'] = undefined;
|
|
206
|
+
var _default = exports["default"] = TemplateDiff;
|