UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

59 lines 2.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentPassword = void 0; const index_1 = require("./../index"); class DocumentPassword { constructor(data) { let isCertificateSetDefault = false; this.isCertificateSet = typeof (data === null || data === void 0 ? void 0 : data.isCertificateSet) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isCertificateSet : isCertificateSetDefault; let isOpenSetDefault = false; this.isOpenSet = typeof (data === null || data === void 0 ? void 0 : data.isOpenSet) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isOpenSet : isOpenSetDefault; let isPermissionSetDefault = false; this.isPermissionSet = typeof (data === null || data === void 0 ? void 0 : data.isPermissionSet) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isPermissionSet : isPermissionSetDefault; this.recipients = (data.recipients || []).map(index_1.DocumentRecipient.fromJson); } static getIsCertificateSetDefault() { return false; } static getIsCertificateSetDescription() { return "True, if an certificate is set"; } static getIsOpenSetDefault() { return false; } static getIsOpenSetDescription() { return "True, if an open password is set"; } static getIsPermissionSetDefault() { return false; } static getIsPermissionSetDescription() { return "True, if an permission password is set"; } static getRecipientsDefault() { return []; } static getRecipientsDescription() { return "List of recipients which are allowed to open the document"; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new DocumentPassword(data); } toJson() { var _a; return { 'isCertificateSet': this.isCertificateSet, 'isOpenSet': this.isOpenSet, 'isPermissionSet': this.isPermissionSet, 'recipients': (_a = this.recipients) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()), }; } clone() { return DocumentPassword.fromJson(this.toJson()); } } exports.DocumentPassword = DocumentPassword; //# sourceMappingURL=DocumentPassword.js.map