1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-22 11:13:17 +00:00

add additional familySponsorship properties to profile org data

This commit is contained in:
Jacob Fink
2022-03-02 10:03:26 -05:00
parent 8f5f694a1e
commit 198305814c
4 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
export enum SponsorshipStatus {
None = 0,
Pending = 1,
Sent = 2,
Active = 3,
PendingRevoke = 4,
Revoked = 5,
}

View File

@@ -1,6 +1,7 @@
import { OrganizationUserStatusType } from "../../enums/organizationUserStatusType";
import { OrganizationUserType } from "../../enums/organizationUserType";
import { ProductType } from "../../enums/productType";
import { SponsorshipStatus } from "../../enums/sponsorshipStatus";
import { PermissionsApi } from "../api/permissionsApi";
import { ProfileOrganizationResponse } from "../response/profileOrganizationResponse";
@@ -36,6 +37,8 @@ export class OrganizationData {
isProviderUser: boolean;
familySponsorshipFriendlyName: string;
familySponsorshipAvailable: boolean;
familySponsorshipStatus: SponsorshipStatus;
familySponsorshipValidUntil: string;
planProductType: ProductType;
keyConnectorEnabled: boolean;
keyConnectorUrl: string;
@@ -71,6 +74,8 @@ export class OrganizationData {
this.providerName = response.providerName;
this.familySponsorshipFriendlyName = response.familySponsorshipFriendlyName;
this.familySponsorshipAvailable = response.familySponsorshipAvailable;
this.familySponsorshipStatus = response.familySponsorshipStatus;
this.familySponsorshipValidUntil = response.familySponsorshipValidUntil;
this.planProductType = response.planProductType;
this.keyConnectorEnabled = response.keyConnectorEnabled;
this.keyConnectorUrl = response.keyConnectorUrl;

View File

@@ -1,6 +1,7 @@
import { OrganizationUserStatusType } from "../../enums/organizationUserStatusType";
import { OrganizationUserType } from "../../enums/organizationUserType";
import { ProductType } from "../../enums/productType";
import { SponsorshipStatus } from "../../enums/sponsorshipStatus";
import { PermissionsApi } from "../api/permissionsApi";
import { OrganizationData } from "../data/organizationData";
@@ -36,6 +37,8 @@ export class Organization {
isProviderUser: boolean;
familySponsorshipFriendlyName: string;
familySponsorshipAvailable: boolean;
familySponsorshipStatus: SponsorshipStatus;
familySponsorshipValidUntil: string;
planProductType: ProductType;
keyConnectorEnabled: boolean;
keyConnectorUrl: string;
@@ -76,6 +79,8 @@ export class Organization {
this.isProviderUser = obj.isProviderUser;
this.familySponsorshipFriendlyName = obj.familySponsorshipFriendlyName;
this.familySponsorshipAvailable = obj.familySponsorshipAvailable;
this.familySponsorshipStatus = obj.familySponsorshipStatus;
this.familySponsorshipValidUntil = obj.familySponsorshipValidUntil;
this.planProductType = obj.planProductType;
this.keyConnectorEnabled = obj.keyConnectorEnabled;
this.keyConnectorUrl = obj.keyConnectorUrl;

View File

@@ -1,6 +1,7 @@
import { OrganizationUserStatusType } from "../../enums/organizationUserStatusType";
import { OrganizationUserType } from "../../enums/organizationUserType";
import { ProductType } from "../../enums/productType";
import { SponsorshipStatus } from "../../enums/sponsorshipStatus";
import { PermissionsApi } from "../api/permissionsApi";
import { BaseResponse } from "./baseResponse";
@@ -37,6 +38,8 @@ export class ProfileOrganizationResponse extends BaseResponse {
providerName: string;
familySponsorshipFriendlyName: string;
familySponsorshipAvailable: boolean;
familySponsorshipStatus: SponsorshipStatus;
familySponsorshipValidUntil: string;
planProductType: ProductType;
keyConnectorEnabled: boolean;
keyConnectorUrl: string;
@@ -74,6 +77,8 @@ export class ProfileOrganizationResponse extends BaseResponse {
this.providerName = this.getResponseProperty("ProviderName");
this.familySponsorshipFriendlyName = this.getResponseProperty("FamilySponsorshipFriendlyName");
this.familySponsorshipAvailable = this.getResponseProperty("FamilySponsorshipAvailable");
this.familySponsorshipStatus = this.getResponseProperty("FamilySponsorshipStatus");
this.familySponsorshipValidUntil = this.getResponseProperty("FamilySponsorshipValidUntil");
this.planProductType = this.getResponseProperty("PlanProductType");
this.keyConnectorEnabled = this.getResponseProperty("KeyConnectorEnabled") ?? false;
this.keyConnectorUrl = this.getResponseProperty("KeyConnectorUrl");