1 | "use strict";
|
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4 | return new (P || (P = Promise))(function (resolve, reject) {
|
5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9 | });
|
10 | };
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | const logging_1 = require("./../logging");
|
13 | const RootDescription_1 = require("./RootDescription");
|
14 | class RootDescriptionRequest {
|
15 | constructor(remoteAddress, location, httpClient) {
|
16 | this.remoteAddress = remoteAddress;
|
17 | this.location = location;
|
18 | this.httpClient = httpClient;
|
19 | }
|
20 | send() {
|
21 | return __awaiter(this, void 0, void 0, function* () {
|
22 | logging_1.log('RootDescriptionRequest#send - %s', this.remoteAddress);
|
23 | const body = yield this.httpClient.get(this.location);
|
24 | return RootDescription_1.RootDescription.parse(this.remoteAddress, body);
|
25 | });
|
26 | }
|
27 | }
|
28 | exports.RootDescriptionRequest = RootDescriptionRequest;
|
29 |
|
\ | No newline at end of file |