mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import { CardData } from '../data/cardData';
|
|
|
|
import { CipherString } from './cipherString';
|
|
import Domain from './domain';
|
|
|
|
class Card extends Domain {
|
|
cardholderName: CipherString;
|
|
brand: CipherString;
|
|
number: CipherString;
|
|
expMonth: CipherString;
|
|
expYear: CipherString;
|
|
code: CipherString;
|
|
|
|
constructor(obj?: CardData, alreadyEncrypted: boolean = false) {
|
|
super();
|
|
if (obj == null) {
|
|
return;
|
|
}
|
|
|
|
this.buildDomainModel(this, obj, {
|
|
cardholderName: null,
|
|
brand: null,
|
|
number: null,
|
|
expMonth: null,
|
|
expYear: null,
|
|
code: null,
|
|
}, alreadyEncrypted, []);
|
|
}
|
|
|
|
decrypt(orgId: string): Promise<any> {
|
|
return this.decryptObj({}, this, {
|
|
cardholderName: null,
|
|
brand: null,
|
|
number: null,
|
|
expMonth: null,
|
|
expYear: null,
|
|
code: null,
|
|
}, orgId);
|
|
}
|
|
}
|
|
|
|
export { Card };
|
|
(window as any).Card = Card;
|