UNPKG

zephyr-agent

Version:
29 lines (28 loc) • 1 kB
import "node:module"; import { getApplicationConfiguration } from "./get-application-configuration.mjs"; import { makeRequest } from "../http/http-request.mjs"; import { ZeErrors, ZephyrError } from "../errors/index.mjs"; async function getApplicationHashList({ application_uid, edge_url }) { let EDGE_URL = edge_url; if (!EDGE_URL) { const cfg = await 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 makeRequest(url, { method: 'GET' }); if (!ok || !data?.hashes) throw new ZephyrError(ZeErrors.ERR_GET_APPLICATION_HASH_LIST, { cause, data: { ...data, url: url.toString() } }); return data; } export { getApplicationHashList }; //# sourceMappingURL=get-application-hash-list.mjs.map