zephyr-agent
Version:
Zephyr plugin agent
89 lines (88 loc) • 4.08 kB
JavaScript
;
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__, {
getAllAppDeployResults: ()=>getAllAppDeployResults,
getAllDeployedApps: ()=>getAllDeployedApps,
getAppDeployResult: ()=>getAppDeployResult,
removeAppDeployResult: ()=>removeAppDeployResult,
setAppDeployResult: ()=>setAppDeployResult
});
const external_storage_js_namespaceObject = require("./storage.js");
const external_storage_keys_js_namespaceObject = require("./storage-keys.js");
async function setAppDeployResult(application_uid, value) {
await external_storage_js_namespaceObject.storage;
await (0, external_storage_js_namespaceObject.setItem)(`${external_storage_keys_js_namespaceObject.StorageKeys.ze_app_deploy_result}:${application_uid}`, value, {
ttl: 86400000
});
}
async function getAppDeployResult(application_uid) {
await external_storage_js_namespaceObject.storage;
return (0, external_storage_js_namespaceObject.getItem)(`${external_storage_keys_js_namespaceObject.StorageKeys.ze_app_deploy_result}:${application_uid}`);
}
async function removeAppDeployResult(application_uid) {
await external_storage_js_namespaceObject.storage;
await (0, external_storage_js_namespaceObject.removeItem)(`${external_storage_keys_js_namespaceObject.StorageKeys.ze_app_deploy_result}:${application_uid}`);
}
async function getAllDeployedApps() {
await external_storage_js_namespaceObject.storage;
const allKeys = await (0, external_storage_js_namespaceObject.keys)();
if (!Array.isArray(allKeys)) return [];
const prefix = `${external_storage_keys_js_namespaceObject.StorageKeys.ze_app_deploy_result}:`;
const resultKeys = allKeys.filter((key)=>'string' == typeof key && key.startsWith(prefix) && key.length > prefix.length);
return resultKeys.map((key)=>key.substring(prefix.length));
}
async function getAllAppDeployResults() {
await external_storage_js_namespaceObject.storage;
const results = {};
const prefix = `${external_storage_keys_js_namespaceObject.StorageKeys.ze_app_deploy_result}:`;
await (0, external_storage_js_namespaceObject.forEachItem)((entry)=>{
if ('string' == typeof entry.key && entry.key.startsWith(prefix) && entry.key.length > prefix.length) {
const application_uid = entry.key.substring(prefix.length);
results[application_uid] = entry.value;
}
});
return results;
}
exports.getAllAppDeployResults = __webpack_exports__.getAllAppDeployResults;
exports.getAllDeployedApps = __webpack_exports__.getAllDeployedApps;
exports.getAppDeployResult = __webpack_exports__.getAppDeployResult;
exports.removeAppDeployResult = __webpack_exports__.removeAppDeployResult;
exports.setAppDeployResult = __webpack_exports__.setAppDeployResult;
for(var __rspack_i in __webpack_exports__)if (-1 === [
"getAllAppDeployResults",
"getAllDeployedApps",
"getAppDeployResult",
"removeAppDeployResult",
"setAppDeployResult"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
value: true
});
//# sourceMappingURL=app-deploy-result-cache.js.map