mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-30 13:03:53 +01:00
standardize date types
This commit is contained in:
parent
d0c51bacfd
commit
9bd8b73e27
@ -4,7 +4,7 @@ export class LoginApi {
|
|||||||
uris: LoginUriApi[];
|
uris: LoginUriApi[];
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
passwordRevisionDate?: Date;
|
passwordRevisionDate: string;
|
||||||
totp: string;
|
totp: string;
|
||||||
|
|
||||||
constructor(data: any) {
|
constructor(data: any) {
|
||||||
|
@ -6,7 +6,7 @@ export class LoginData {
|
|||||||
uris: LoginUriData[];
|
uris: LoginUriData[];
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
passwordRevisionDate?: Date;
|
passwordRevisionDate: string;
|
||||||
totp: string;
|
totp: string;
|
||||||
|
|
||||||
constructor(data?: LoginApi) {
|
constructor(data?: LoginApi) {
|
||||||
|
@ -20,7 +20,7 @@ export class Login extends Domain {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.passwordRevisionDate = obj.passwordRevisionDate;
|
this.passwordRevisionDate = obj.passwordRevisionDate != null ? new Date(obj.passwordRevisionDate) : null;
|
||||||
this.buildDomainModel(this, obj, {
|
this.buildDomainModel(this, obj, {
|
||||||
username: null,
|
username: null,
|
||||||
password: null,
|
password: null,
|
||||||
@ -55,7 +55,7 @@ export class Login extends Domain {
|
|||||||
|
|
||||||
toLoginData(): LoginData {
|
toLoginData(): LoginData {
|
||||||
const l = new LoginData();
|
const l = new LoginData();
|
||||||
l.passwordRevisionDate = this.passwordRevisionDate;
|
l.passwordRevisionDate = this.passwordRevisionDate != null ? this.passwordRevisionDate.toISOString() : null;
|
||||||
this.buildDataModel(this, l, {
|
this.buildDataModel(this, l, {
|
||||||
username: null,
|
username: null,
|
||||||
password: null,
|
password: null,
|
||||||
|
@ -39,7 +39,8 @@ export class CipherRequest {
|
|||||||
uris: null,
|
uris: null,
|
||||||
username: cipher.login.username ? cipher.login.username.encryptedString : null,
|
username: cipher.login.username ? cipher.login.username.encryptedString : null,
|
||||||
password: cipher.login.password ? cipher.login.password.encryptedString : null,
|
password: cipher.login.password ? cipher.login.password.encryptedString : null,
|
||||||
passwordRevisionDate: cipher.login.passwordRevisionDate,
|
passwordRevisionDate: cipher.login.passwordRevisionDate != null ?
|
||||||
|
cipher.login.passwordRevisionDate.toISOString() : null,
|
||||||
totp: cipher.login.totp ? cipher.login.totp.encryptedString : null,
|
totp: cipher.login.totp ? cipher.login.totp.encryptedString : null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ export class BillingResponse {
|
|||||||
upcomingInvoice: BillingInvoiceResponse;
|
upcomingInvoice: BillingInvoiceResponse;
|
||||||
charges: BillingChargeResponse[] = [];
|
charges: BillingChargeResponse[] = [];
|
||||||
license: any;
|
license: any;
|
||||||
expiration: Date;
|
expiration: string;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
this.storageName = response.StorageName;
|
this.storageName = response.StorageName;
|
||||||
@ -43,11 +43,11 @@ export class BillingSourceResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BillingSubscriptionResponse {
|
export class BillingSubscriptionResponse {
|
||||||
trialStartDate: Date;
|
trialStartDate: string;
|
||||||
trialEndDate: Date;
|
trialEndDate: string;
|
||||||
periodStartDate: Date;
|
periodStartDate: string;
|
||||||
periodEndDate: Date;
|
periodEndDate: string;
|
||||||
cancelledDate: Date;
|
cancelledDate: string;
|
||||||
cancelAtEndDate: boolean;
|
cancelAtEndDate: boolean;
|
||||||
status: string;
|
status: string;
|
||||||
cancelled: boolean;
|
cancelled: boolean;
|
||||||
@ -83,7 +83,7 @@ export class BillingSubscriptionItemResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BillingInvoiceResponse {
|
export class BillingInvoiceResponse {
|
||||||
date: Date;
|
date: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
@ -93,7 +93,7 @@ export class BillingInvoiceResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BillingChargeResponse {
|
export class BillingChargeResponse {
|
||||||
createdDate: Date;
|
createdDate: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
paymentSource: BillingSourceResponse;
|
paymentSource: BillingSourceResponse;
|
||||||
status: string;
|
status: string;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
export class BreachAccountResponse {
|
export class BreachAccountResponse {
|
||||||
addedDate: Date;
|
addedDate: string;
|
||||||
breachDate: Date;
|
breachDate: string;
|
||||||
dataClasses: string[];
|
dataClasses: string[];
|
||||||
description: string;
|
description: string;
|
||||||
domain: string;
|
domain: string;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
isVerified: boolean;
|
isVerified: boolean;
|
||||||
logoType: string;
|
logoType: string;
|
||||||
modifiedDate: Date;
|
modifiedDate: string;
|
||||||
name: string;
|
name: string;
|
||||||
pwnCount: number;
|
pwnCount: number;
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -10,7 +10,7 @@ export class EventResponse {
|
|||||||
groupId: string;
|
groupId: string;
|
||||||
organizationUserId: string;
|
organizationUserId: string;
|
||||||
actingUserId: string;
|
actingUserId: string;
|
||||||
date: Date;
|
date: string;
|
||||||
deviceType: DeviceType;
|
deviceType: DeviceType;
|
||||||
ipAddress: string;
|
ipAddress: string;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export class OrganizationBillingResponse extends OrganizationResponse {
|
|||||||
subscription: BillingSubscriptionResponse;
|
subscription: BillingSubscriptionResponse;
|
||||||
upcomingInvoice: BillingInvoiceResponse;
|
upcomingInvoice: BillingInvoiceResponse;
|
||||||
charges: BillingChargeResponse[] = [];
|
charges: BillingChargeResponse[] = [];
|
||||||
expiration: Date;
|
expiration: string;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
super(response);
|
super(response);
|
||||||
@ -27,6 +27,6 @@ export class OrganizationBillingResponse extends OrganizationResponse {
|
|||||||
if (response.Charges != null) {
|
if (response.Charges != null) {
|
||||||
this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));
|
this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));
|
||||||
}
|
}
|
||||||
this.expiration = response.Expiration != null ? new Date(response.Expiration) : null;
|
this.expiration = response.Expiration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import { Folder } from '../domain/folder';
|
|||||||
export class FolderView implements View {
|
export class FolderView implements View {
|
||||||
id: string = null;
|
id: string = null;
|
||||||
name: string;
|
name: string;
|
||||||
|
revisionDate: Date;
|
||||||
|
|
||||||
constructor(f?: Folder) {
|
constructor(f?: Folder) {
|
||||||
if (!f) {
|
if (!f) {
|
||||||
@ -12,5 +13,6 @@ export class FolderView implements View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.id = f.id;
|
this.id = f.id;
|
||||||
|
this.revisionDate = f.revisionDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user