UNPKG

752 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const guards_1 = require("../guards");
4const http_1 = require("./http");
5class SecurityClient extends http_1.ResourceClient {
6 constructor({ client, token }) {
7 super();
8 this.client = client;
9 this.token = token;
10 }
11 async load(tag) {
12 const { req } = await this.client.make('GET', `/security/profiles/${tag}`);
13 this.applyAuthentication(req, this.token);
14 req.query({}).send();
15 const res = await this.client.do(req);
16 if (!guards_1.isSecurityProfileResponse(res)) {
17 throw http_1.createFatalAPIFormat(req, res);
18 }
19 return res.data;
20 }
21}
22exports.SecurityClient = SecurityClient;