@signatu/policy
Version:
signatu policy components
64 lines • 2.72 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var common_lib_1 = require("@signatu/common-lib");
var policyElement_1 = require("./policyElement");
var PolicyController = /** @class */ (function (_super) {
__extends(PolicyController, _super);
// TODO: some type checking here would be nice
function PolicyController(controller) {
var _this = _super.call(this, policyElement_1.PolicyElementType.PolicyController) || this;
_this.name = controller.name;
_this.address = controller.address;
_this.isoCountry = controller.isoCountry;
_this.phone = controller.phone;
_this.email = controller.email;
_this.website = controller.website;
_this.organizationId = controller.organizationId;
return _this;
}
Object.defineProperty(PolicyController.prototype, "masterText", {
get: function () {
var text;
text = this.name + ": " + this.address + ", " + new common_lib_1.Country(this.isoCountry).name + ". Organization ID: " + this.organizationId + ". Phone: " + this.phone + ". Email: " + this.email + ".";
return text;
},
enumerable: true,
configurable: true
});
PolicyController.fromJSON = function (json) {
var controller = new PolicyController(json);
controller.ref = json.ref;
return controller;
};
PolicyController.reviver = function (key, value) {
return key === "" ? PolicyController.fromJSON(value) : value;
};
PolicyController.prototype.toJSON = function () {
var json = _super.prototype.toJSON.call(this);
json.address = this.address;
json.name = this.name;
json.isoCountry = this.isoCountry;
json.phone = this.phone;
json.email = this.email;
json.website = this.website;
json.organizationId = this.organizationId;
json.ref = this.ref;
return json;
};
return PolicyController;
}(policyElement_1.PolicyElement));
exports.PolicyController = PolicyController;
//# sourceMappingURL=policyController.js.map