@eang/core
Version:
eang - model driven enterprise event processing
45 lines • 1.19 kB
JavaScript
import { Obj } from '../entity.js';
export class OrganizationObj extends Obj {
typeOf = 'Organization';
constructor(opts) {
super({ ...opts, typeOf: 'Organization' });
}
}
export function isOrganizationObj(obj) {
return obj.typeOf === 'Organization';
}
export class GroupObj extends Obj {
typeOf = 'Group';
constructor(opts) {
super({ ...opts, typeOf: 'Group' });
}
}
export function isGroupObj(obj) {
return obj.typeOf === 'Group';
}
export class PersonObj extends Obj {
typeOf = 'Person';
username;
get displayName() {
return this.name || this.username || this.key;
}
constructor(opts) {
super({ ...opts, typeOf: 'Person' });
this.username = opts.username ?? undefined;
}
}
export function isPersonObj(obj) {
return obj.typeOf === 'Person';
}
export class ServiceAccountObj extends Obj {
typeOf = 'ServiceAccount';
username;
constructor(opts) {
super({ ...opts, typeOf: 'ServiceAccount' });
this.username = opts.username;
}
}
export function isServiceAccountObj(obj) {
return obj.typeOf === 'ServiceAccount';
}
//# sourceMappingURL=organizational.js.map