@platform/cell.client
Version:
A strongly typed HTTP client for operating with a CellOS service end-point.
38 lines (37 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClientFile = void 0;
var tslib_1 = require("tslib");
var common_1 = require("../common");
var HttpClientFile = (function () {
function HttpClientFile(args) {
var urls = args.urls;
this.args = args;
this.uri = args.uri;
this.url = urls.file(args.uri);
}
HttpClientFile.create = function (args) {
return new HttpClientFile(args);
};
HttpClientFile.prototype.toString = function () {
return this.uri.toString();
};
HttpClientFile.prototype.info = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var http, url, res;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
http = this.args.http;
url = this.url.info;
return [4, http.get(url.toString())];
case 1:
res = _a.sent();
return [2, common_1.util.fromHttpResponse(res).toClientResponse()];
}
});
});
};
return HttpClientFile;
}());
exports.HttpClientFile = HttpClientFile;