1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const guards_1 = require("../guards");
|
4 | const http_1 = require("./http");
|
5 | class AuthClient extends http_1.ResourceClient {
|
6 | constructor(e) {
|
7 | super();
|
8 | this.e = e;
|
9 | this.connections = new AuthConnectionClient(e);
|
10 | }
|
11 | }
|
12 | exports.AuthClient = AuthClient;
|
13 | class AuthConnectionClient extends http_1.ResourceClient {
|
14 | constructor(e) {
|
15 | super();
|
16 | this.e = e;
|
17 | }
|
18 | async load(email) {
|
19 | const { req } = await this.e.client.make('GET', `/auth/connections/${email}`);
|
20 | const res = await this.e.client.do(req);
|
21 | if (!guards_1.isAuthConnectionResponse(res)) {
|
22 | throw http_1.createFatalAPIFormat(req, res);
|
23 | }
|
24 | return res.data;
|
25 | }
|
26 | }
|
27 | exports.AuthConnectionClient = AuthConnectionClient;
|