@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
106 lines • 5.67 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddSignature = void 0;
const index_1 = require("./../index");
class AddSignature {
constructor(data) {
this.appearance = index_1.AppearanceAdd.fromJson(data === null || data === void 0 ? void 0 : data.appearance);
let appendSignatureDefault = false;
this.appendSignature = typeof (data === null || data === void 0 ? void 0 : data.appendSignature) !== "undefined" ? data === null || data === void 0 ? void 0 : data.appendSignature : appendSignatureDefault;
let certificationLevelDefault = "noChanges";
this.certificationLevel = typeof (data === null || data === void 0 ? void 0 : data.certificationLevel) !== "undefined" ? data === null || data === void 0 ? void 0 : data.certificationLevel : certificationLevelDefault;
let contactDefault = "";
this.contact = typeof (data === null || data === void 0 ? void 0 : data.contact) !== "undefined" ? data === null || data === void 0 ? void 0 : data.contact : contactDefault;
let fieldNameDefault = "Signature1";
this.fieldName = typeof (data === null || data === void 0 ? void 0 : data.fieldName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fieldName : fieldNameDefault;
let keyNameDefault = "";
this.keyName = typeof (data === null || data === void 0 ? void 0 : data.keyName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.keyName : keyNameDefault;
let keyPasswordDefault = "";
this.keyPassword = typeof (data === null || data === void 0 ? void 0 : data.keyPassword) !== "undefined" ? data === null || data === void 0 ? void 0 : data.keyPassword : keyPasswordDefault;
let locationDefault = "";
this.location = typeof (data === null || data === void 0 ? void 0 : data.location) !== "undefined" ? data === null || data === void 0 ? void 0 : data.location : locationDefault;
let reasonDefault = "";
this.reason = typeof (data === null || data === void 0 ? void 0 : data.reason) !== "undefined" ? data === null || data === void 0 ? void 0 : data.reason : reasonDefault;
this.signer = index_1.SignerAdd.fromJson(data === null || data === void 0 ? void 0 : data.signer);
}
static getAppearanceDescription() {
return "";
}
static getAppendSignatureDefault() {
return false;
}
static getAppendSignatureDescription() {
return "**Deprecated:** Usage of this parameter is discouraged, as it is no longer in use.";
}
static getCertificationLevelDefault() {
return "noChanges";
}
static getCertificationLevelDescription() {
return "This parameter defines the level of the signature.\n\n* none = Sign, but do not certify, the document, i.e., additional signatures and changes will be allowed.\n* noChanges = Certify the document and do not allow any additional changes anymore.\n* formFillingAndSignatures = Certify the document, but allow for fields to be filled out.\n* formFillingAndSignaturesAndAnnotations = Certify the document, but allow for fields to be filled out and annotations to be added.";
}
static getContactDefault() {
return "";
}
static getContactDescription() {
return "Specifies the name of the person signing the document.";
}
static getFieldNameDefault() {
return "Signature1";
}
static getFieldNameDescription() {
return "Defines the name of the field (in the document) in which the signature will be saved. If a field name that is not unique is declared, then a unique name will be automatically created.";
}
static getKeyNameDefault() {
return "";
}
static getKeyNameDescription() {
return "Defines the name of the key (alias) that is to be used to sign the document. This option overwrites the server's configuration setting. Additional information can be found in the \"Keystore\" chapter.";
}
static getKeyPasswordDefault() {
return "";
}
static getKeyPasswordDescription() {
return "Used to define the password required in order to access the private key with \"keyName.\" This option overwrites the server's configuration setting. Additional information can be found in the \"Keystore\" chapter.";
}
static getLocationDefault() {
return "";
}
static getLocationDescription() {
return "Specifies the location of the signature.";
}
static getReasonDefault() {
return "";
}
static getReasonDescription() {
return "Specifies the reason why the document is being signed.";
}
static getSignerDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new AddSignature(data);
}
toJson() {
var _a, _b;
return {
'appearance': (_a = this.appearance) === null || _a === void 0 ? void 0 : _a.toJson(),
'appendSignature': this.appendSignature,
'certificationLevel': this.certificationLevel,
'contact': this.contact,
'fieldName': this.fieldName,
'keyName': this.keyName,
'keyPassword': this.keyPassword,
'location': this.location,
'reason': this.reason,
'signer': (_b = this.signer) === null || _b === void 0 ? void 0 : _b.toJson(),
};
}
clone() {
return AddSignature.fromJson(this.toJson());
}
}
exports.AddSignature = AddSignature;
//# sourceMappingURL=AddSignature.js.map