mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-11 13:53:22 +00:00
Copy jslib into Directory Connector [TI-6] (#262)
This commit is contained in:
45
jslib/common/src/models/domain/collection.ts
Normal file
45
jslib/common/src/models/domain/collection.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { CollectionData } from "../data/collectionData";
|
||||
import { CollectionView } from "../view/collectionView";
|
||||
|
||||
import Domain from "./domainBase";
|
||||
import { EncString } from "./encString";
|
||||
|
||||
export class Collection extends Domain {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
name: EncString;
|
||||
externalId: string;
|
||||
readOnly: boolean;
|
||||
hidePasswords: boolean;
|
||||
|
||||
constructor(obj?: CollectionData) {
|
||||
super();
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.buildDomainModel(
|
||||
this,
|
||||
obj,
|
||||
{
|
||||
id: null,
|
||||
organizationId: null,
|
||||
name: null,
|
||||
externalId: null,
|
||||
readOnly: null,
|
||||
hidePasswords: null,
|
||||
},
|
||||
["id", "organizationId", "externalId", "readOnly", "hidePasswords"]
|
||||
);
|
||||
}
|
||||
|
||||
decrypt(): Promise<CollectionView> {
|
||||
return this.decryptObj(
|
||||
new CollectionView(this),
|
||||
{
|
||||
name: null,
|
||||
},
|
||||
this.organizationId
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user