UNPKG

zephyr-agent

Version:
66 lines (65 loc) • 2.51 kB
"use strict"; var __webpack_require__ = {}; (()=>{ __webpack_require__.d = (exports1, getters, values)=>{ var define = (defs, kind)=>{ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, { enumerable: true, [kind]: defs[key] }); }; define(getters, "get"); define(values, "value"); }; })(); (()=>{ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop); })(); (()=>{ __webpack_require__.r = (exports1)=>{ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, { value: 'Module' }); Object.defineProperty(exports1, '__esModule', { value: true }); }; })(); var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { getApplicationHashList: ()=>getApplicationHashList }); const external_get_application_configuration_js_namespaceObject = require("./get-application-configuration.js"); const http_request_js_namespaceObject = require("../http/http-request.js"); const index_js_namespaceObject = require("../errors/index.js"); async function getApplicationHashList({ application_uid, edge_url }) { let EDGE_URL = edge_url; if (!EDGE_URL) { const cfg = await (0, external_get_application_configuration_js_namespaceObject.getApplicationConfiguration)({ application_uid }); EDGE_URL = cfg.EDGE_URL; } const url = new URL('/__get_application_hash_list__', EDGE_URL); url.searchParams.append('application_uid', application_uid); const [ok, cause, data] = await (0, http_request_js_namespaceObject.makeRequest)(url, { method: 'GET' }); if (!ok || !data?.hashes) throw new index_js_namespaceObject.ZephyrError(index_js_namespaceObject.ZeErrors.ERR_GET_APPLICATION_HASH_LIST, { cause, data: { ...data, url: url.toString() } }); return data; } exports.getApplicationHashList = __webpack_exports__.getApplicationHashList; for(var __rspack_i in __webpack_exports__)if (-1 === [ "getApplicationHashList" ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i]; Object.defineProperty(exports, '__esModule', { value: true }); //# sourceMappingURL=get-application-hash-list.js.map