1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

[PM-4360] Move organization-domain and organization-user to admin console (#6630)

* Move organization-domain and organization-user to admin console
This commit is contained in:
Oscar Hinton
2023-10-30 22:32:57 +01:00
committed by GitHub
parent 97b91133a5
commit 485be21826
71 changed files with 129 additions and 129 deletions

View File

@@ -0,0 +1,19 @@
import { OrganizationDomainRequest } from "../../services/organization-domain/requests/organization-domain.request";
import { OrganizationDomainSsoDetailsResponse } from "./responses/organization-domain-sso-details.response";
import { OrganizationDomainResponse } from "./responses/organization-domain.response";
export abstract class OrgDomainApiServiceAbstraction {
getAllByOrgId: (orgId: string) => Promise<Array<OrganizationDomainResponse>>;
getByOrgIdAndOrgDomainId: (
orgId: string,
orgDomainId: string
) => Promise<OrganizationDomainResponse>;
post: (
orgId: string,
orgDomain: OrganizationDomainRequest
) => Promise<OrganizationDomainResponse>;
verify: (orgId: string, orgDomainId: string) => Promise<OrganizationDomainResponse>;
delete: (orgId: string, orgDomainId: string) => Promise<any>;
getClaimedOrgDomainByEmail: (email: string) => Promise<OrganizationDomainSsoDetailsResponse>;
}

View File

@@ -0,0 +1,20 @@
import { Observable } from "rxjs";
import { OrganizationDomainResponse } from "./responses/organization-domain.response";
export abstract class OrgDomainServiceAbstraction {
orgDomains$: Observable<OrganizationDomainResponse[]>;
get: (orgDomainId: string) => OrganizationDomainResponse;
copyDnsTxt: (dnsTxt: string) => void;
}
// Note: this separate class is designed to hold methods that are not
// meant to be used in components (e.g., data write methods)
export abstract class OrgDomainInternalServiceAbstraction extends OrgDomainServiceAbstraction {
upsert: (orgDomains: OrganizationDomainResponse[]) => void;
replace: (orgDomains: OrganizationDomainResponse[]) => void;
clearCache: () => void;
delete: (orgDomainIds: string[]) => void;
}

View File

@@ -0,0 +1,18 @@
import { BaseResponse } from "../../../../models/response/base.response";
export class OrganizationDomainSsoDetailsResponse extends BaseResponse {
id: string;
organizationIdentifier: string;
ssoAvailable: boolean;
domainName: string;
verifiedDate?: Date;
constructor(response: any) {
super(response);
this.id = this.getResponseProperty("id");
this.organizationIdentifier = this.getResponseProperty("organizationIdentifier");
this.ssoAvailable = this.getResponseProperty("ssoAvailable");
this.domainName = this.getResponseProperty("domainName");
this.verifiedDate = this.getResponseProperty("verifiedDate");
}
}

View File

@@ -0,0 +1,26 @@
import { BaseResponse } from "../../../../models/response/base.response";
export class OrganizationDomainResponse extends BaseResponse {
id: string;
organizationId: string;
txt: string;
domainName: string;
creationDate: string;
nextRunDate: string;
jobRunCount: number;
verifiedDate?: string;
lastCheckedDate?: string;
constructor(response: any) {
super(response);
this.id = this.getResponseProperty("id");
this.organizationId = this.getResponseProperty("organizationId");
this.txt = this.getResponseProperty("txt");
this.domainName = this.getResponseProperty("domainName");
this.creationDate = this.getResponseProperty("creationDate");
this.nextRunDate = this.getResponseProperty("nextRunDate");
this.jobRunCount = this.getResponseProperty("jobRunCount");
this.verifiedDate = this.getResponseProperty("verifiedDate");
this.lastCheckedDate = this.getResponseProperty("lastCheckedDate");
}
}