UNPKG

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