MCPcopy
hub / github.com/Kong/insomnia / resolveOverHTTP

Method resolveOverHTTP

packages/insomnia/bin/yarn-standalone.js:35343–35413  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

35341 }
35342
35343 resolveOverHTTP(url) {
35344 var _this2 = this;
35345
35346 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
35347 const commit = yield _this2.getRefOverHTTP(url);
35348 const config = _this2.config;
35349
35350
35351 const tarballUrl = _this2.constructor.getTarballUrl(_this2.exploded, commit);
35352
35353 const tryRegistry = (() => {
35354 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) {
35355 const filename = (_index || _load_index()).registries[registry].filename;
35356
35357 const href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit);
35358 const file = yield config.requestManager.request({
35359 url: href,
35360 queue: _this2.resolver.fetchingQueue
35361 });
35362 if (!file) {
35363 return null;
35364 }
35365
35366 const json = yield config.readJson(href, function () {
35367 return JSON.parse(file);
35368 });
35369 json._uid = commit;
35370 json._remote = {
35371 resolved: tarballUrl,
35372 type: 'tarball',
35373 reference: tarballUrl,
35374 registry
35375 };
35376 return json;
35377 });
35378
35379 return function tryRegistry(_x) {
35380 return _ref.apply(this, arguments);
35381 };
35382 })();
35383
35384 const file = yield tryRegistry(_this2.registry);
35385 if (file) {
35386 return file;
35387 }
35388
35389 for (const registry in (_index || _load_index()).registries) {
35390 if (registry === _this2.registry) {
35391 continue;
35392 }
35393
35394 const file = yield tryRegistry(registry);
35395 if (file) {
35396 return file;
35397 }
35398 }
35399
35400 return {

Callers 1

resolveMethod · 0.80

Calls 9

_load_asyncToGeneratorFunction · 0.85
_load_indexFunction · 0.85
_load_guessNameFunction · 0.85
getRefOverHTTPMethod · 0.80
readJsonMethod · 0.80
getTarballUrlMethod · 0.45
getHTTPFileUrlMethod · 0.45
requestMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected