add domain rules apis

This commit is contained in:
Kyle Spearrin 2018-06-25 23:04:59 -04:00
parent 6ae6a79f43
commit 3cf8ffab8d
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,4 @@
export class UpdateDomainsRequest {
equivalentDomains: string[][];
excludedGlobalEquivalentDomains: number[];
}

View File

@ -24,9 +24,11 @@ import { PasswordVerificationRequest } from '../models/request/passwordVerificat
import { RegisterRequest } from '../models/request/registerRequest';
import { TokenRequest } from '../models/request/tokenRequest';
import { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest';
import { UpdateDomainsRequest } from '../models/request/updateDomainsRequest';
import { UpdateProfileRequest } from '../models/request/updateProfileRequest';
import { CipherResponse } from '../models/response/cipherResponse';
import { DomainsResponse } from '../models/response/domainsResponse';
import { ErrorResponse } from '../models/response/errorResponse';
import { FolderResponse } from '../models/response/folderResponse';
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
@ -266,6 +268,18 @@ export class ApiService implements ApiServiceAbstraction {
return this.send('POST', '/organizations/' + organizationId + '/import', request, true, false);
}
// Settings
async getSettingsDomains(): Promise<DomainsResponse> {
const r = await this.send('GET', '/settings/domains', null, true, true);
return new DomainsResponse(r);
}
async putSettingsDomains(request: UpdateDomainsRequest): Promise<DomainsResponse> {
const r = await this.send('PUT', '/settings/domains', request, true, true);
return new DomainsResponse(r);
}
// Helpers
private async send(method: 'GET' | 'POST' | 'PUT' | 'DELETE', path: string, body: any,