1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[Provider] Add initial support for providers (#399)

This commit is contained in:
Oscar Hinton
2021-07-15 15:07:38 +02:00
committed by GitHub
parent c9b13e4d1b
commit 9f0ca7e4d2
34 changed files with 680 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
import { BaseResponse } from './baseResponse';
import { ProfileOrganizationResponse } from './profileOrganizationResponse';
import { ProfileProviderOrganizationResponse } from './profileProviderOrganizationResponse';
import { ProfileProviderResponse } from './profileProviderResponse';
export class ProfileResponse extends BaseResponse {
id: string;
@@ -14,6 +16,8 @@ export class ProfileResponse extends BaseResponse {
privateKey: string;
securityStamp: string;
organizations: ProfileOrganizationResponse[] = [];
providers: ProfileProviderResponse[] = [];
providerOrganizations: ProfileProviderOrganizationResponse[] = [];
constructor(response: any) {
super(response);
@@ -33,5 +37,13 @@ export class ProfileResponse extends BaseResponse {
if (organizations != null) {
this.organizations = organizations.map((o: any) => new ProfileOrganizationResponse(o));
}
const providers = this.getResponseProperty('Providers');
if (providers != null) {
this.providers = providers.map((o: any) => new ProfileProviderResponse(o));
}
const providerOrganizations = this.getResponseProperty('ProviderOrganizations');
if (providerOrganizations != null) {
this.providerOrganizations = providerOrganizations.map((o: any) => new ProfileProviderOrganizationResponse(o));
}
}
}