37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ServiceAccount = void 0;
|
|
class ServiceAccount {
|
|
id;
|
|
clientId;
|
|
clientSecretHash;
|
|
name;
|
|
role;
|
|
permissions;
|
|
status;
|
|
metadata;
|
|
constructor(id, clientId, clientSecretHash, name, role, permissions, status, metadata) {
|
|
this.id = id;
|
|
this.clientId = clientId;
|
|
this.clientSecretHash = clientSecretHash;
|
|
this.name = name;
|
|
this.role = role;
|
|
this.permissions = permissions;
|
|
this.status = status;
|
|
this.metadata = metadata;
|
|
}
|
|
static create(data) {
|
|
return new ServiceAccount(crypto.randomUUID(), data.clientId, data.clientSecretHash, data.name, data.role, data.permissions, 'ACTIVE', data.metadata);
|
|
}
|
|
static restore(data) {
|
|
return new ServiceAccount(data.id, data.clientId, data.clientSecretHash, data.name, data.role, data.permissions, data.status, data.metadata);
|
|
}
|
|
disable() {
|
|
this.status = 'DISABLED';
|
|
}
|
|
enable() {
|
|
this.status = 'ACTIVE';
|
|
}
|
|
}
|
|
exports.ServiceAccount = ServiceAccount;
|
|
//# sourceMappingURL=service-account.entity.js.map
|