mirror of
https://github.com/bitwarden/browser
synced 2025-01-21 00:38:44 +01:00
apis for org api keys
This commit is contained in:
parent
0fa88b44b8
commit
3b3b71d841
@ -52,6 +52,7 @@ import { VerifyBankRequest } from '../models/request/verifyBankRequest';
|
||||
import { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';
|
||||
import { VerifyEmailRequest } from '../models/request/verifyEmailRequest';
|
||||
|
||||
import { ApiKeyResponse } from '../models/response/apiKeyResponse';
|
||||
import { BillingResponse } from '../models/response/billingResponse';
|
||||
import { BreachAccountResponse } from '../models/response/breachAccountResponse';
|
||||
import { CipherResponse } from '../models/response/cipherResponse';
|
||||
@ -235,6 +236,8 @@ export abstract class ApiService {
|
||||
postLeaveOrganization: (id: string) => Promise<any>;
|
||||
postOrganizationLicense: (data: FormData) => Promise<OrganizationResponse>;
|
||||
postOrganizationLicenseUpdate: (id: string, data: FormData) => Promise<any>;
|
||||
postOrganizationApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
||||
postOrganizationRotateApiKey: (id: string, request: PasswordVerificationRequest) => Promise<ApiKeyResponse>;
|
||||
postOrganizationSeat: (id: string, request: SeatRequest) => Promise<any>;
|
||||
postOrganizationStorage: (id: string, request: StorageRequest) => Promise<any>;
|
||||
postOrganizationPayment: (id: string, request: PaymentRequest) => Promise<any>;
|
||||
|
10
src/models/response/apiKeyResponse.ts
Normal file
10
src/models/response/apiKeyResponse.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { BaseResponse } from './baseResponse';
|
||||
|
||||
export class ApiKeyResponse extends BaseResponse {
|
||||
apiKey: string;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.apiKey = this.getResponseProperty('ApiKey');
|
||||
}
|
||||
}
|
@ -58,6 +58,7 @@ import { VerifyBankRequest } from '../models/request/verifyBankRequest';
|
||||
import { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';
|
||||
import { VerifyEmailRequest } from '../models/request/verifyEmailRequest';
|
||||
|
||||
import { ApiKeyResponse } from '../models/response/apiKeyResponse';
|
||||
import { BillingResponse } from '../models/response/billingResponse';
|
||||
import { BreachAccountResponse } from '../models/response/breachAccountResponse';
|
||||
import { CipherResponse } from '../models/response/cipherResponse';
|
||||
@ -767,6 +768,16 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return this.send('POST', '/organizations/' + id + '/license', data, true, false);
|
||||
}
|
||||
|
||||
async postOrganizationApiKey(id: string, request: PasswordVerificationRequest): Promise<ApiKeyResponse> {
|
||||
const r = await this.send('POST', '/organizations/' + id + '/api-key', request, true, true);
|
||||
return new ApiKeyResponse(r);
|
||||
}
|
||||
|
||||
async postOrganizationRotateApiKey(id: string, request: PasswordVerificationRequest): Promise<ApiKeyResponse> {
|
||||
const r = await this.send('POST', '/organizations/' + id + '/rotate-api-key', request, true, true);
|
||||
return new ApiKeyResponse(r);
|
||||
}
|
||||
|
||||
postOrganizationSeat(id: string, request: SeatRequest): Promise<any> {
|
||||
return this.send('POST', '/organizations/' + id + '/seat', request, true, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user