mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-31 22:51:28 +01:00
react to policy api changes
This commit is contained in:
parent
6c8407196b
commit
7d8143b288
@ -1,3 +1,5 @@
|
||||
import { PolicyType } from '../enums/policyType';
|
||||
|
||||
import { EnvironmentUrls } from '../models/domain/environmentUrls';
|
||||
|
||||
import { BitPayInvoiceRequest } from '../models/request/bitPayInvoiceRequest';
|
||||
@ -188,11 +190,9 @@ export abstract class ApiService {
|
||||
deleteGroup: (organizationId: string, id: string) => Promise<any>;
|
||||
deleteGroupUser: (organizationId: string, id: string, organizationUserId: string) => Promise<any>;
|
||||
|
||||
getPolicy: (organizationId: string, id: string) => Promise<PolicyResponse>;
|
||||
getPolicy: (organizationId: string, type: PolicyType) => Promise<PolicyResponse>;
|
||||
getPolicies: (organizationId: string) => Promise<ListResponse<PolicyResponse>>;
|
||||
postPolicy: (organizationId: string, request: PolicyRequest) => Promise<PolicyResponse>;
|
||||
putPolicy: (organizationId: string, id: string, request: PolicyRequest) => Promise<PolicyResponse>;
|
||||
deletePolicy: (organizationId: string, id: string) => Promise<any>;
|
||||
putPolicy: (organizationId: string, type: PolicyType, request: PolicyRequest) => Promise<PolicyResponse>;
|
||||
|
||||
getOrganizationUser: (organizationId: string, id: string) => Promise<OrganizationUserDetailsResponse>;
|
||||
getOrganizationUserGroups: (organizationId: string, id: string) => Promise<string[]>;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { DeviceType } from '../enums/deviceType';
|
||||
import { PolicyType } from '../enums/policyType';
|
||||
|
||||
import { ApiService as ApiServiceAbstraction } from '../abstractions/api.service';
|
||||
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
||||
@ -553,8 +554,8 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
|
||||
// Policy APIs
|
||||
|
||||
async getPolicy(organizationId: string, id: string): Promise<PolicyResponse> {
|
||||
const r = await this.send('GET', '/organizations/' + organizationId + '/policies/' + id, null, true, true);
|
||||
async getPolicy(organizationId: string, type: PolicyType): Promise<PolicyResponse> {
|
||||
const r = await this.send('GET', '/organizations/' + organizationId + '/policies/' + type, null, true, true);
|
||||
return new PolicyResponse(r);
|
||||
}
|
||||
|
||||
@ -563,20 +564,11 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return new ListResponse(r, PolicyResponse);
|
||||
}
|
||||
|
||||
async postPolicy(organizationId: string, request: PolicyRequest): Promise<PolicyResponse> {
|
||||
const r = await this.send('POST', '/organizations/' + organizationId + '/policies', request, true, true);
|
||||
async putPolicy(organizationId: string, type: PolicyType, request: PolicyRequest): Promise<PolicyResponse> {
|
||||
const r = await this.send('PUT', '/organizations/' + organizationId + '/policies/' + type, request, true, true);
|
||||
return new PolicyResponse(r);
|
||||
}
|
||||
|
||||
async putPolicy(organizationId: string, id: string, request: PolicyRequest): Promise<PolicyResponse> {
|
||||
const r = await this.send('PUT', '/organizations/' + organizationId + '/policies/' + id, request, true, true);
|
||||
return new PolicyResponse(r);
|
||||
}
|
||||
|
||||
deletePolicy(organizationId: string, id: string): Promise<any> {
|
||||
return this.send('DELETE', '/organizations/' + organizationId + '/policies/' + id, null, true, false);
|
||||
}
|
||||
|
||||
// Organization User APIs
|
||||
|
||||
async getOrganizationUser(organizationId: string, id: string): Promise<OrganizationUserDetailsResponse> {
|
||||
|
Loading…
Reference in New Issue
Block a user