1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +01:00
This commit is contained in:
Kyle Spearrin 2018-07-16 12:30:45 -04:00
parent 76ece834d1
commit 3649e2fffe
3 changed files with 24 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import { ImportDirectoryRequest } from '../models/request/importDirectoryRequest
import { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';
import { KeysRequest } from '../models/request/keysRequest';
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
import { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';
import { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';
import { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';
@ -192,9 +193,12 @@ export abstract class ApiService {
postTwoFactorEmailSetup: (request: TwoFactorEmailRequest) => Promise<any>;
postTwoFactorEmail: (request: TwoFactorEmailRequest) => Promise<any>;
getOrganization: (id: string) => Promise<OrganizationResponse>;
postOrganization: (request: OrganizationCreateRequest) => Promise<OrganizationResponse>;
putOrganization: (id: string, request: OrganizationUpdateRequest) => Promise<OrganizationResponse>;
postLeaveOrganization: (id: string) => Promise<any>;
postOrganizationLicense: (data: FormData) => Promise<OrganizationResponse>;
deleteOrganization: (id: string) => Promise<any>;
getEvents: (start: string, end: string, token: string) => Promise<ListResponse<EventResponse>>;
getEventsCipher: (id: string, start: string, end: string, token: string) => Promise<ListResponse<EventResponse>>;

View File

@ -0,0 +1,5 @@
export class OrganizationUpdateRequest {
name: string;
businessName: string;
billingEmail: string;
}

View File

@ -23,6 +23,7 @@ import { ImportDirectoryRequest } from '../models/request/importDirectoryRequest
import { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';
import { KeysRequest } from '../models/request/keysRequest';
import { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';
import { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';
import { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';
import { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';
import { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';
@ -626,11 +627,21 @@ export class ApiService implements ApiServiceAbstraction {
// Organization APIs
async getOrganization(id: string): Promise<OrganizationResponse> {
const r = await this.send('GET', '/organizations/' + id, null, true, true);
return new OrganizationResponse(r);
}
async postOrganization(request: OrganizationCreateRequest): Promise<OrganizationResponse> {
const r = await this.send('POST', '/organizations', request, true, true);
return new OrganizationResponse(r);
}
async putOrganization(id: string, request: OrganizationUpdateRequest): Promise<OrganizationResponse> {
const r = await this.send('PUT', '/organizations/' + id, request, true, true);
return new OrganizationResponse(r);
}
postLeaveOrganization(id: string): Promise<any> {
return this.send('POST', '/organizations/' + id + '/leave', null, true, false);
}
@ -640,6 +651,10 @@ export class ApiService implements ApiServiceAbstraction {
return new OrganizationResponse(r);
}
deleteOrganization(id: string): Promise<any> {
return this.send('DELETE', '/organizations/' + id, null, true, false);
}
// Event APIs
async getEvents(start: string, end: string, token: string): Promise<ListResponse<EventResponse>> {