diff --git a/eslint.config.js b/eslint.config.js index 8a79c72bb3..7aa9aba7b9 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -9,13 +9,29 @@ import { defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescri // This returns an ARRAY of config objects optimized for Vue+TS const vueTsGeneratedConfigs = defineConfigWithVueTs(pluginVue.configs["flat/recommended"], vueTsConfigs.recommended, { rules: { - "@typescript-eslint/no-explicit-any": "warn", - "vue/multi-word-component-names": "warn", + // --- OFF rules --- + // TODO: enable this rule after https://github.com/threefoldtech/tfgrid-sdk-ts/issues/4075 + "@typescript-eslint/no-explicit-any": "off", "vue/no-v-text-v-html-on-component": "off", - "@typescript-eslint/no-unused-expressions": "warn", - "@typescript-eslint/no-unused-vars": `warn`, + "vue/max-attributes-per-line": "off", + "vue/no-v-html": "off", + "vue/singleline-html-element-content-newline": "off", + "vue/html-self-closing": "off", + "vue/html-indent": "off", + "vue/require-explicit-emits": "off", + "vue/require-default-prop": "off", + "@typescript-eslint/no-unused-expressions": "off", + + // --- WARN rules --- "@typescript-eslint/no-duplicate-enum-values": "warn", - "vue/no-dupe-keys": "warn", + + // --- ERROR rules --- + "vue/multi-word-component-names": "error", + "@typescript-eslint/no-unused-vars": "error", + "vue/no-template-shadow": "error", + "vue/multiline-html-element-content-newline": "error", + "vue/component-definition-name-casing": "error", + "vue/no-dupe-keys": "error", }, }); @@ -62,23 +78,24 @@ export default [ }, rules: { ...tseslint.configs.eslintRecommended.rules, - "@typescript-eslint/no-unused-vars": "warn", + // --- OFF rules --- "no-console": "off", - "prettier/prettier": "warn", - "simple-import-sort/imports": "warn", - "@typescript-eslint/no-var-requires": "off", + // TODO: enable this rule after https://github.com/threefoldtech/tfgrid-sdk-ts/issues/4075 "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-empty-object-type": "off", + + // --- WARN rules --- + "prettier/prettier": "warn", "prefer-spread": "warn", "@typescript-eslint/no-restricted-types": [ "warn", { types: { - "{}": "Use `unknown` instead.", "Function": "Use specific function types instead.", "Object": "Use `Record` or specific object types instead.", "String": "Use `string` instead.", @@ -87,9 +104,12 @@ export default [ }, }, ], - "@typescript-eslint/no-empty-object-type": "warn", "@typescript-eslint/no-unsafe-function-type": "warn", "@typescript-eslint/no-wrapper-object-types": "warn", + + // --- ERROR rules --- + "@typescript-eslint/no-unused-vars": "error", + "simple-import-sort/imports": "error", }, }, ...vueConfig, diff --git a/packages/graphql_client/src/clients/abstract_client.ts b/packages/graphql_client/src/clients/abstract_client.ts index 378a353f3c..cc52572112 100644 --- a/packages/graphql_client/src/clients/abstract_client.ts +++ b/packages/graphql_client/src/clients/abstract_client.ts @@ -102,10 +102,13 @@ export abstract class AbstractClient { private static normalizeFields(fields: PartialBoolean): string { return Object.entries(fields) - .reduce((out, [key, value]: any) => { - out.push(value === true ? key : `${key}{${AbstractClient.normalizeFields(value)}}`); - return out; - }, []) + .reduce( + (out, [key, value]: any) => { + out.push(value === true ? key : `${key}{${AbstractClient.normalizeFields(value)}}`); + return out; + }, + [], + ) .join(","); } } diff --git a/packages/graphql_client/src/clients/client.ts b/packages/graphql_client/src/clients/client.ts index 0b1227d0ce..61b6884f97 100644 --- a/packages/graphql_client/src/clients/client.ts +++ b/packages/graphql_client/src/clients/client.ts @@ -40,6 +40,7 @@ export class TFGridGqlClient extends AbstractClient { public merge(queries: T) { const options: RequestOptions[] = []; for (const query in queries) { + // eslint-disable-next-line prefer-spread options.push(this[`__${query}` as any].apply(this, queries[query])); } @@ -68,14 +69,14 @@ type NormalizeMerge = { ? Q[] : unknown : K extends keyof ByIdQueries - ? ReturnType extends Promise - ? Q - : unknown - : K extends keyof ConnectionQueries - ? ReturnType extends Promise - ? Q - : unknown - : unknown; + ? ReturnType extends Promise + ? Q + : unknown + : K extends keyof ConnectionQueries + ? ReturnType extends Promise + ? Q + : unknown + : unknown; }; export interface TFGridGqlClient extends ListQueries, ByIdQueries, ConnectionQueries {} diff --git a/packages/graphql_client/src/clients/list_queries.ts b/packages/graphql_client/src/clients/list_queries.ts index 180a00b11f..5fbb6e82ec 100644 --- a/packages/graphql_client/src/clients/list_queries.ts +++ b/packages/graphql_client/src/clients/list_queries.ts @@ -3,7 +3,6 @@ import { Account, ArrayWhere, BaseWhere, - BigInt, BoolWhere, BurnTransaction, City, diff --git a/packages/graphql_client/src/types/index.ts b/packages/graphql_client/src/types/index.ts index c36abcc558..215eb9b2c5 100644 --- a/packages/graphql_client/src/types/index.ts +++ b/packages/graphql_client/src/types/index.ts @@ -12,8 +12,8 @@ export type PartialBoolean = { ? PartialBoolean : true : T[K] extends object - ? PartialBoolean - : true; + ? PartialBoolean + : true; }; type __BaseWhere = { eq: T; not_eq: T; gt: T; gte: T; lt: T; lte: T; in: T[]; not_in: T[]; }; // prettier-ignore diff --git a/packages/graphql_client/src/utils/index.ts b/packages/graphql_client/src/utils/index.ts index 926603f5b7..03551d46e8 100644 --- a/packages/graphql_client/src/utils/index.ts +++ b/packages/graphql_client/src/utils/index.ts @@ -1,8 +1,5 @@ import { ValidationError } from "@threefold/types"; type AssertReturn = void | never; -function panic(message: string): never { - throw new Error(message); -} /** * @description diff --git a/packages/grid_client/scripts/applications/algorand.ts b/packages/grid_client/scripts/applications/algorand.ts index f702bd1f66..88002f6230 100644 --- a/packages/grid_client/scripts/applications/algorand.ts +++ b/packages/grid_client/scripts/applications/algorand.ts @@ -17,6 +17,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const resultVM = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/applications/casperlabs.ts b/packages/grid_client/scripts/applications/casperlabs.ts index c6c8a2cb25..2409e9e787 100644 --- a/packages/grid_client/scripts/applications/casperlabs.ts +++ b/packages/grid_client/scripts/applications/casperlabs.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/discourse.ts b/packages/grid_client/scripts/applications/discourse.ts index 477a4ddc5b..2c0f6d979f 100644 --- a/packages/grid_client/scripts/applications/discourse.ts +++ b/packages/grid_client/scripts/applications/discourse.ts @@ -37,6 +37,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/funkwhale.ts b/packages/grid_client/scripts/applications/funkwhale.ts index 7e24c5efa2..887b332116 100644 --- a/packages/grid_client/scripts/applications/funkwhale.ts +++ b/packages/grid_client/scripts/applications/funkwhale.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/gitea.ts b/packages/grid_client/scripts/applications/gitea.ts index d167d13081..af7570db4e 100644 --- a/packages/grid_client/scripts/applications/gitea.ts +++ b/packages/grid_client/scripts/applications/gitea.ts @@ -35,6 +35,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/jenkins.ts b/packages/grid_client/scripts/applications/jenkins.ts index 2c82b83428..6a2fd84d1d 100644 --- a/packages/grid_client/scripts/applications/jenkins.ts +++ b/packages/grid_client/scripts/applications/jenkins.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/jitsi.ts b/packages/grid_client/scripts/applications/jitsi.ts index b64e7817b6..8b0badbb14 100644 --- a/packages/grid_client/scripts/applications/jitsi.ts +++ b/packages/grid_client/scripts/applications/jitsi.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/mattermost.ts b/packages/grid_client/scripts/applications/mattermost.ts index bbe21d6de4..51a728be52 100644 --- a/packages/grid_client/scripts/applications/mattermost.ts +++ b/packages/grid_client/scripts/applications/mattermost.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/nextcloud.ts b/packages/grid_client/scripts/applications/nextcloud.ts index f522895ee4..83ccc152cf 100644 --- a/packages/grid_client/scripts/applications/nextcloud.ts +++ b/packages/grid_client/scripts/applications/nextcloud.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/nodepilot.ts b/packages/grid_client/scripts/applications/nodepilot.ts index 759b38532c..5f553f112e 100644 --- a/packages/grid_client/scripts/applications/nodepilot.ts +++ b/packages/grid_client/scripts/applications/nodepilot.ts @@ -17,6 +17,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const resultVM = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/applications/nostr.ts b/packages/grid_client/scripts/applications/nostr.ts index 098724a5b2..96cab87388 100644 --- a/packages/grid_client/scripts/applications/nostr.ts +++ b/packages/grid_client/scripts/applications/nostr.ts @@ -43,6 +43,7 @@ async function getDeployment(client: GridClient, name: string, subdomain: string log("================= Getting Gateway Deployment ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client: GridClient, name: string, subdomain: string) { // Cancel VM deployment const resultVM = await client.machines.delete({ name }); diff --git a/packages/grid_client/scripts/applications/peertube.ts b/packages/grid_client/scripts/applications/peertube.ts index 3cd4a58000..b9c3176125 100644 --- a/packages/grid_client/scripts/applications/peertube.ts +++ b/packages/grid_client/scripts/applications/peertube.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/presearch.ts b/packages/grid_client/scripts/applications/presearch.ts index 291c181661..91e99f2936 100644 --- a/packages/grid_client/scripts/applications/presearch.ts +++ b/packages/grid_client/scripts/applications/presearch.ts @@ -17,6 +17,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const resultVM = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/applications/subsquid.ts b/packages/grid_client/scripts/applications/subsquid.ts index e60eabd904..b0cf82c5d8 100644 --- a/packages/grid_client/scripts/applications/subsquid.ts +++ b/packages/grid_client/scripts/applications/subsquid.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/taiga.ts b/packages/grid_client/scripts/applications/taiga.ts index 84ddc65acb..b23015aec3 100644 --- a/packages/grid_client/scripts/applications/taiga.ts +++ b/packages/grid_client/scripts/applications/taiga.ts @@ -34,6 +34,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/applications/umbrel.ts b/packages/grid_client/scripts/applications/umbrel.ts index 3f8c47338f..b230b5c006 100644 --- a/packages/grid_client/scripts/applications/umbrel.ts +++ b/packages/grid_client/scripts/applications/umbrel.ts @@ -18,6 +18,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const resultVM = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/applications/wordpress.ts b/packages/grid_client/scripts/applications/wordpress.ts index 0766f91c8d..c92842a0cf 100644 --- a/packages/grid_client/scripts/applications/wordpress.ts +++ b/packages/grid_client/scripts/applications/wordpress.ts @@ -35,6 +35,7 @@ async function getDeployment(client, vms, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms, gw) { const resultVM = await client.machines.delete(vms); const resultGateway = await client.gateway.delete_name(gw); diff --git a/packages/grid_client/scripts/compare_locked_balance.ts b/packages/grid_client/scripts/compare_locked_balance.ts index bbb7d0b85e..f23a461d12 100644 --- a/packages/grid_client/scripts/compare_locked_balance.ts +++ b/packages/grid_client/scripts/compare_locked_balance.ts @@ -1,7 +1,7 @@ import TFGridGqlClient from "@threefold/graphql_client"; import { ContractState } from "@threefold/gridproxy_client"; -import { BalanceGetModel, GridClient } from "../src"; +import { GridClient } from "../src"; import { getClient } from "./client_loader"; interface Contract { diff --git a/packages/grid_client/scripts/connection.ts b/packages/grid_client/scripts/connection.ts index b5a93986a0..250d6e2a04 100644 --- a/packages/grid_client/scripts/connection.ts +++ b/packages/grid_client/scripts/connection.ts @@ -29,11 +29,14 @@ async function newClient(mnemonic: string) { const gridClient = new GridClient(options); await gridClient.connect(); - setTimeout(async () => { - console.log(`Request the grid to get the twin id.`); - const twinID = await gridClient.twins.get_my_twin_id(); - console.log(`Twin id: ${twinID}`); - }, 10 * 60 * 1000); + setTimeout( + async () => { + console.log(`Request the grid to get the twin id.`); + const twinID = await gridClient.twins.get_my_twin_id(); + console.log(`Twin id: ${twinID}`); + }, + 10 * 60 * 1000, + ); } catch (error) { console.error("Error connecting to Grid:", error); } @@ -45,9 +48,12 @@ async function main() { await newClient(clientMnemonic2); console.log(`Please disconnect your internet connection.`); - setTimeout(async () => { - console.log(`Please re-connect your internet connection.`); - }, 9 * 60 * 1000); + setTimeout( + async () => { + console.log(`Please re-connect your internet connection.`); + }, + 9 * 60 * 1000, + ); } main(); diff --git a/packages/grid_client/scripts/dynamic_single_vm.ts b/packages/grid_client/scripts/dynamic_single_vm.ts index fbdc0bd3e3..ad69721c02 100644 --- a/packages/grid_client/scripts/dynamic_single_vm.ts +++ b/packages/grid_client/scripts/dynamic_single_vm.ts @@ -17,6 +17,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const res = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/fqdn_gateway.ts b/packages/grid_client/scripts/fqdn_gateway.ts index 5328fa103e..7fb8327d5e 100644 --- a/packages/grid_client/scripts/fqdn_gateway.ts +++ b/packages/grid_client/scripts/fqdn_gateway.ts @@ -16,6 +16,7 @@ async function getDeployment(client, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, gw) { const res = await client.gateway.delete_fqdn(gw); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/mass_deployments.ts b/packages/grid_client/scripts/mass_deployments.ts index d694bccf9a..0f32d893e3 100644 --- a/packages/grid_client/scripts/mass_deployments.ts +++ b/packages/grid_client/scripts/mass_deployments.ts @@ -150,6 +150,7 @@ async function main() { const deploymentPromises = batchVMs.map(async (vms, index) => { try { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const [twinDeployments, _, __] = await grid3.machines._createDeployment(vms); return { twinDeployments, batchIndex: index }; } catch (error) { diff --git a/packages/grid_client/scripts/migrate.ts b/packages/grid_client/scripts/migrate.ts index 81dc81dce3..f222afce2f 100644 --- a/packages/grid_client/scripts/migrate.ts +++ b/packages/grid_client/scripts/migrate.ts @@ -20,7 +20,7 @@ async function main() { await newDB.get({ key: oldKey }); alreadyMigratedCount++; console.log(`${oldKey} key is migrated`); - } catch (error) { + } catch { failedCount++; } } diff --git a/packages/grid_client/scripts/multiple_vms.ts b/packages/grid_client/scripts/multiple_vms.ts index 0b26fcdcba..87131ff8ea 100644 --- a/packages/grid_client/scripts/multiple_vms.ts +++ b/packages/grid_client/scripts/multiple_vms.ts @@ -17,6 +17,7 @@ async function getDeployment(client: GridClient, name: string) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client: GridClient, name: string) { const res = await client.machines.delete({ name }); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/multiple_vms_zos_3_lite.ts b/packages/grid_client/scripts/multiple_vms_zos_3_lite.ts index 48d9529350..53dcc073bb 100644 --- a/packages/grid_client/scripts/multiple_vms_zos_3_lite.ts +++ b/packages/grid_client/scripts/multiple_vms_zos_3_lite.ts @@ -17,6 +17,7 @@ async function getDeployment(client: GridClient, name: string) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client: GridClient, name: string) { const res = await client.machines.delete({ name }); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/name_gateway.ts b/packages/grid_client/scripts/name_gateway.ts index e3e2747de0..66d3773860 100644 --- a/packages/grid_client/scripts/name_gateway.ts +++ b/packages/grid_client/scripts/name_gateway.ts @@ -16,6 +16,7 @@ async function getDeployment(client, gw) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, gw) { const res = await client.gateway.delete_name(gw); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/orchestrators/caprover_leader.ts b/packages/grid_client/scripts/orchestrators/caprover_leader.ts index 6b78428017..f9be75b2cd 100644 --- a/packages/grid_client/scripts/orchestrators/caprover_leader.ts +++ b/packages/grid_client/scripts/orchestrators/caprover_leader.ts @@ -18,6 +18,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const res = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/orchestrators/caprover_worker.ts b/packages/grid_client/scripts/orchestrators/caprover_worker.ts index 6b6ca17868..35ee5d7262 100644 --- a/packages/grid_client/scripts/orchestrators/caprover_worker.ts +++ b/packages/grid_client/scripts/orchestrators/caprover_worker.ts @@ -17,6 +17,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const res = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/orchestrators/kubernetes_leader.ts b/packages/grid_client/scripts/orchestrators/kubernetes_leader.ts index aca51e25ec..69ca23057d 100644 --- a/packages/grid_client/scripts/orchestrators/kubernetes_leader.ts +++ b/packages/grid_client/scripts/orchestrators/kubernetes_leader.ts @@ -16,6 +16,7 @@ async function getDeployment(client, k8s) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, k8s) { const res = await client.k8s.delete(k8s); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/orchestrators/kubernetes_mycelium.ts b/packages/grid_client/scripts/orchestrators/kubernetes_mycelium.ts index d8305cda18..443005f36c 100644 --- a/packages/grid_client/scripts/orchestrators/kubernetes_mycelium.ts +++ b/packages/grid_client/scripts/orchestrators/kubernetes_mycelium.ts @@ -1,4 +1,4 @@ -import { FilterOptions, K8SModel } from "../../src"; +import { K8SModel } from "../../src"; import { config, getClient } from "../client_loader"; import { log } from "../utils"; @@ -16,6 +16,7 @@ async function getDeployment(client, k8s) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, k8s) { const res = await client.k8s.delete(k8s); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts b/packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts index 6bfd8786ad..7317eb72f8 100644 --- a/packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts +++ b/packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts @@ -23,6 +23,7 @@ async function getDeployment(client: GridClient, k8s: string) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client: GridClient, k8s: string) { const res = await client.k8s.delete({ name: k8s }); log("================= Canceling the deployment ================="); @@ -30,6 +31,7 @@ async function cancel(client: GridClient, k8s: string) { log("================= Canceling the deployment ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function deleteQsfs(client: GridClient, qsfs: string) { const res = await client.qsfs_zdbs.delete({ name: qsfs }); log("================= Deleting QSFS ================="); diff --git a/packages/grid_client/scripts/orchestrators/kubernetes_worker.ts b/packages/grid_client/scripts/orchestrators/kubernetes_worker.ts index 027e45a2f3..5ade740b09 100644 --- a/packages/grid_client/scripts/orchestrators/kubernetes_worker.ts +++ b/packages/grid_client/scripts/orchestrators/kubernetes_worker.ts @@ -17,7 +17,7 @@ async function getWorker(client, worker) { log(res); log("================= Getting worker information ================="); } - +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function deleteWorker(client, worker) { const res = await client.k8s.delete_worker(worker); log("================= Deleting the worker ================="); diff --git a/packages/grid_client/scripts/renting.ts b/packages/grid_client/scripts/renting.ts index a395eba433..0b13b22e5a 100644 --- a/packages/grid_client/scripts/renting.ts +++ b/packages/grid_client/scripts/renting.ts @@ -49,6 +49,7 @@ async function getRentableNodes(client: GridClient) { } // Unreserve a node +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function unreserve(client: GridClient, nodeId: number) { const unreserved = await client.nodes.unreserve({ nodeId }); log("================= Unreserved Node ================="); diff --git a/packages/grid_client/scripts/single_vm.ts b/packages/grid_client/scripts/single_vm.ts index 741d8dc52d..96223e76a2 100644 --- a/packages/grid_client/scripts/single_vm.ts +++ b/packages/grid_client/scripts/single_vm.ts @@ -19,6 +19,7 @@ async function getDeployment(client: GridClient, name: string): Promise try { await client.zos.pingNode({ nodeId: node.nodeId }); return node.nodeId; - } catch (error) { + } catch { log("node " + node.nodeId + " is not responding, trying different node."); } } diff --git a/packages/grid_client/scripts/vm_with_gpu.ts b/packages/grid_client/scripts/vm_with_gpu.ts index 2f44344737..b151b90b5d 100644 --- a/packages/grid_client/scripts/vm_with_gpu.ts +++ b/packages/grid_client/scripts/vm_with_gpu.ts @@ -17,6 +17,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const res = await client.machines.delete(vms); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/vm_with_qsfs.ts b/packages/grid_client/scripts/vm_with_qsfs.ts index c2c7d3bd20..99e98a2060 100644 --- a/packages/grid_client/scripts/vm_with_qsfs.ts +++ b/packages/grid_client/scripts/vm_with_qsfs.ts @@ -24,6 +24,7 @@ async function getDeployment(client, vms) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, vms) { const res = await client.machines.delete(vms); log("================= Canceling the deployment ================="); @@ -31,6 +32,7 @@ async function cancel(client, vms) { log("================= Canceling the deployment ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function deleteQsfs(client, qsfs) { const res = await client.qsfs_zdbs.delete(qsfs); log("================= Deleting QSFS ================="); diff --git a/packages/grid_client/scripts/wireguard_vm.ts b/packages/grid_client/scripts/wireguard_vm.ts index eb50373d6f..a703c13b24 100644 --- a/packages/grid_client/scripts/wireguard_vm.ts +++ b/packages/grid_client/scripts/wireguard_vm.ts @@ -86,6 +86,7 @@ async function deleteVM(client, vms) { log("================= Canceling the VM deployment ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function deleteGw(client, gw) { const res = await client.gateway.delete_name(gw); log("================= Canceling the GW deployment ================="); diff --git a/packages/grid_client/scripts/zdb.ts b/packages/grid_client/scripts/zdb.ts index db2088e081..e2862896f3 100644 --- a/packages/grid_client/scripts/zdb.ts +++ b/packages/grid_client/scripts/zdb.ts @@ -16,6 +16,7 @@ async function getDeployment(client, zdb) { log("================= Getting deployment information ================="); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, zdb) { const res = await client.zdbs.delete(zdb); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/scripts/zos3lite_gateway_domain.ts b/packages/grid_client/scripts/zos3lite_gateway_domain.ts index ac1922ae11..00756b814f 100644 --- a/packages/grid_client/scripts/zos3lite_gateway_domain.ts +++ b/packages/grid_client/scripts/zos3lite_gateway_domain.ts @@ -15,7 +15,7 @@ async function getDeployment(client, gw) { log(res); log("================= Getting deployment information ================="); } - +// eslint-disable-next-line @typescript-eslint/no-unused-vars async function cancel(client, gw) { const res = await client.gateway.delete_name(gw); log("================= Canceling the deployment ================="); diff --git a/packages/grid_client/src/clients/kyc/client.ts b/packages/grid_client/src/clients/kyc/client.ts index b247e2bb40..f89ab89a68 100644 --- a/packages/grid_client/src/clients/kyc/client.ts +++ b/packages/grid_client/src/clients/kyc/client.ts @@ -191,7 +191,7 @@ export class KYC { const { status } = res.data.result; if (status !== `Healthy`) return false; return true; - } catch (error) { + } catch { return false; } } diff --git a/packages/grid_client/src/clients/tf-grid/contracts.ts b/packages/grid_client/src/clients/tf-grid/contracts.ts index 3d599e3773..be5084abd1 100644 --- a/packages/grid_client/src/clients/tf-grid/contracts.ts +++ b/packages/grid_client/src/clients/tf-grid/contracts.ts @@ -6,10 +6,8 @@ import GridProxyClient, { ContractType, } from "@threefold/gridproxy_client"; import { - BillingInformation, ContractLock, ContractLockOptions, - ContractPaymentState, Contracts, ExtrinsicResult, GetDedicatedNodePriceOptions, @@ -144,21 +142,6 @@ export interface CalculateOverdueOptions { gridProxyClient: GridProxyClient; } -/** - * Represents the total cost associated with the provided contracts. - * - * @interface TotalContractsCost - * - * @property {number} ipsCost - Total cost for the provided amount for ips per mount in USD. - * @property {Decimal} nuCost - The total unbilled amount of network usage (NU), represented as a Decimal Unit USD. - * @property {Decimal} overdraft - The overdraft amount, the sum of `additionalOverdraft` and `standardOverdraft` represented as a Decimal as Unit TFT. - */ -interface TotalContractsCost { - ipsCost: number; - nuCost: number; - overdraft: Decimal; -} - const SECONDS_ONE_HOUR = 60 * 60; const HOURS_ONE_MONTH = 24 * 30; @@ -229,12 +212,10 @@ class TFContracts extends Contracts { filterQuery += " , AND: ["; if (options.type) { - // eslint-disable-next-line no-useless-escape filterQuery += `{ deploymentData_contains: \"\\\"type\\\":\\\"${options.type}\\\"\" },`; } if (options.projectName) { - // eslint-disable-next-line no-useless-escape filterQuery += `{ deploymentData_contains: \"\\\"projectName\\\":\\\"${options.projectName}\" }`; } diff --git a/packages/grid_client/src/clients/tf-grid/kvstore.ts b/packages/grid_client/src/clients/tf-grid/kvstore.ts index 6110534f71..fee99f3a34 100644 --- a/packages/grid_client/src/clients/tf-grid/kvstore.ts +++ b/packages/grid_client/src/clients/tf-grid/kvstore.ts @@ -54,7 +54,7 @@ class TFKVStore extends KVStore { if (encryptedValue) { try { return this.decrypt(encryptedValue); - } catch (e) { + } catch { throw new GridClientError(`Couldn't decrypt key: ${options.key}.`); } } diff --git a/packages/grid_client/src/helpers/utils.ts b/packages/grid_client/src/helpers/utils.ts index ff0e30f0c7..d4e2b3d8ed 100644 --- a/packages/grid_client/src/helpers/utils.ts +++ b/packages/grid_client/src/helpers/utils.ts @@ -84,6 +84,7 @@ function zeroPadding(length: number, num: number) { function convertObjectToQueryString(obj: Record): string { // Filter out undefined or empty string values const filteredParams = Object.fromEntries( + // eslint-disable-next-line @typescript-eslint/no-unused-vars Object.entries(obj).filter(([_, value]) => value !== undefined && value !== ""), ); diff --git a/packages/grid_client/src/high_level/machine.ts b/packages/grid_client/src/high_level/machine.ts index e19a929cce..c8b179f273 100644 --- a/packages/grid_client/src/high_level/machine.ts +++ b/packages/grid_client/src/high_level/machine.ts @@ -12,7 +12,6 @@ import { DeploymentFactory, DiskPrimitive, Network, - Nodes, PublicIPPrimitive, VMLightPrimitive, VMPrimitive, diff --git a/packages/grid_client/src/high_level/twinDeploymentHandler.ts b/packages/grid_client/src/high_level/twinDeploymentHandler.ts index ef368fd3cc..8721807c41 100644 --- a/packages/grid_client/src/high_level/twinDeploymentHandler.ts +++ b/packages/grid_client/src/high_level/twinDeploymentHandler.ts @@ -333,11 +333,14 @@ class TwinDeploymentHandler { } async checkNodesCapacity(twinDeployments: TwinDeployment[]) { - const deployments = twinDeployments.reduce((res, twinDeployment) => { - res[twinDeployment.nodeId] = res[twinDeployment.nodeId] || []; - res[twinDeployment.nodeId].push(twinDeployment); - return res; - }, {} as { [nodeId: number]: TwinDeployment[] }); + const deployments = twinDeployments.reduce( + (res, twinDeployment) => { + res[twinDeployment.nodeId] = res[twinDeployment.nodeId] || []; + res[twinDeployment.nodeId].push(twinDeployment); + return res; + }, + {} as { [nodeId: number]: TwinDeployment[] }, + ); await Promise.all(Object.keys(deployments).map(nodeId => this._checkNodeCapacity(+nodeId, deployments[nodeId]))); } diff --git a/packages/grid_client/src/modules/currency.ts b/packages/grid_client/src/modules/currency.ts index 72a30c9af9..6462341c31 100644 --- a/packages/grid_client/src/modules/currency.ts +++ b/packages/grid_client/src/modules/currency.ts @@ -9,7 +9,10 @@ class TFTUSDConversionService { * Class representing a service for converting between TFT (ThreeFold Token) and USD (United States Dollar). * The service provides methods for normalizing currency amounts, converting between TFT and USD, and calculating daily, monthly, and yearly amounts in both currencies. */ - constructor(private _rate: number, private decimals = 2) {} + constructor( + private _rate: number, + private decimals = 2, + ) {} get rate() { return this._rate; diff --git a/packages/grid_client/src/modules/gateway.ts b/packages/grid_client/src/modules/gateway.ts index 73c3b11971..9e01ceb848 100644 --- a/packages/grid_client/src/modules/gateway.ts +++ b/packages/grid_client/src/modules/gateway.ts @@ -1,4 +1,3 @@ -import { Contract } from "@threefold/tfchain_client"; import { ValidationError } from "@threefold/types"; import { GridClientConfig } from "../config"; diff --git a/packages/grid_client/src/modules/k8s.ts b/packages/grid_client/src/modules/k8s.ts index 4423ddffbe..dd0620d353 100644 --- a/packages/grid_client/src/modules/k8s.ts +++ b/packages/grid_client/src/modules/k8s.ts @@ -1,4 +1,3 @@ -import { Contract } from "@threefold/tfchain_client"; import { GridClientErrors, ValidationError } from "@threefold/types"; import { Addr } from "netaddr"; diff --git a/packages/grid_client/src/modules/tfchain.ts b/packages/grid_client/src/modules/tfchain.ts index dc8819780c..c981025830 100644 --- a/packages/grid_client/src/modules/tfchain.ts +++ b/packages/grid_client/src/modules/tfchain.ts @@ -478,7 +478,8 @@ class TFChain implements blockchainInterface { } await ( await client.termsAndConditions.accept({ - documentLink: "https://raw.githubusercontent.com/threefoldtech/info_grid/development/labs/docs/knowledge_base/terms_conditions_all3/terms_conditions_all3.md", + documentLink: + "https://raw.githubusercontent.com/threefoldtech/info_grid/development/labs/docs/knowledge_base/terms_conditions_all3/terms_conditions_all3.md", }) ).apply(); const ret = await (await client.twins.create({ relay })).apply(); diff --git a/packages/grid_client/src/modules/utility.ts b/packages/grid_client/src/modules/utility.ts index 254beee936..f59e779ae8 100644 --- a/packages/grid_client/src/modules/utility.ts +++ b/packages/grid_client/src/modules/utility.ts @@ -4,10 +4,6 @@ import { expose } from "../helpers/expose"; import { BatchModel } from "./models"; import { checkBalance } from "./utils"; -interface Extrinsic { - extrinsic: []; -} - class Utility { client: TFClient; diff --git a/packages/grid_client/src/modules/zdb.ts b/packages/grid_client/src/modules/zdb.ts index 8ef1c480ed..6eff9b7829 100644 --- a/packages/grid_client/src/modules/zdb.ts +++ b/packages/grid_client/src/modules/zdb.ts @@ -1,4 +1,3 @@ -import { Contract } from "@threefold/tfchain_client"; import { ValidationError } from "@threefold/types"; import { GridClientConfig } from "../config"; diff --git a/packages/grid_client/src/primitives/deployment.ts b/packages/grid_client/src/primitives/deployment.ts index bb5cbbe54f..69844cb8aa 100644 --- a/packages/grid_client/src/primitives/deployment.ts +++ b/packages/grid_client/src/primitives/deployment.ts @@ -114,7 +114,7 @@ class DeploymentFactory { async fromObj(deployment): Promise { // Deep copy to create plain objects with deletable properties (needed for class-transformer's discriminator) const deploymentCopy = JSON.parse(JSON.stringify(deployment)); - + for (const workload of deploymentCopy.workloads) { workload.data["__type"] = workload.type; if (workload.result && workload.result.data) { diff --git a/packages/grid_client/src/primitives/network.ts b/packages/grid_client/src/primitives/network.ts index f137c4b2e4..525893df09 100644 --- a/packages/grid_client/src/primitives/network.ts +++ b/packages/grid_client/src/primitives/network.ts @@ -17,7 +17,6 @@ import { validateHexSeed } from "../helpers/validator"; import { ContractStates, MyceliumNetworkModel } from "../modules"; import { DeploymentFactory } from "../primitives/deployment"; import { BackendStorage, BackendStorageType } from "../storage/backend"; -import { Zmachine } from "../zos"; import { Deployment } from "../zos/deployment"; import { Workload, WorkloadTypes } from "../zos/workload"; import { Mycelium, Peer, Znet } from "../zos/znet"; diff --git a/packages/grid_client/src/primitives/networklight.ts b/packages/grid_client/src/primitives/networklight.ts index 6ddcba8906..5352eebb2e 100644 --- a/packages/grid_client/src/primitives/networklight.ts +++ b/packages/grid_client/src/primitives/networklight.ts @@ -1,6 +1,4 @@ -import { Contract } from "@threefold/tfchain_client"; import { ValidationError } from "@threefold/types"; -import { Buffer } from "buffer"; import { plainToInstance } from "class-transformer"; import { Addr } from "netaddr"; import { default as PrivateIp } from "private-ip"; diff --git a/packages/grid_client/src/storage/BackendStorageInterface.ts b/packages/grid_client/src/storage/BackendStorageInterface.ts index ca20f6ae46..32b8a2bb7d 100644 --- a/packages/grid_client/src/storage/BackendStorageInterface.ts +++ b/packages/grid_client/src/storage/BackendStorageInterface.ts @@ -1,4 +1,4 @@ -import { ExtrinsicResult, KVStoreSetOptions } from "@threefold/tfchain_client"; +import { ExtrinsicResult } from "@threefold/tfchain_client"; interface BackendStorageInterface { // get a value from the storage diff --git a/packages/grid_client/src/storage/tfkvstore.ts b/packages/grid_client/src/storage/tfkvstore.ts index 592031c70d..9af7ca1841 100644 --- a/packages/grid_client/src/storage/tfkvstore.ts +++ b/packages/grid_client/src/storage/tfkvstore.ts @@ -1,6 +1,6 @@ import { SubmittableExtrinsic } from "@polkadot/api-base/types"; import { ISubmittableResult } from "@polkadot/types/types"; -import { ExtrinsicResult, KVStoreSetOptions } from "@threefold/tfchain_client"; +import { ExtrinsicResult } from "@threefold/tfchain_client"; import { TFClient } from "../clients/tf-grid/client"; import { KeypairType } from "../zos/deployment"; diff --git a/packages/grid_client/src/zos/gateway.ts b/packages/grid_client/src/zos/gateway.ts index cf4456d1b6..edbfacc50d 100644 --- a/packages/grid_client/src/zos/gateway.ts +++ b/packages/grid_client/src/zos/gateway.ts @@ -2,8 +2,8 @@ import { Expose } from "class-transformer"; import { ArrayNotEmpty, IsBoolean, IsFQDN, IsNotEmpty, IsOptional, IsString, IsUrl } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { WorkloadTypes } from "."; +import { WorkloadData, WorkloadDataResult } from "./workload_base"; @ValidateMembers() class GatewayFQDNProxy extends WorkloadData { diff --git a/packages/grid_client/src/zos/network_light.ts b/packages/grid_client/src/zos/network_light.ts index 0f88e9c93f..19d5a202f1 100644 --- a/packages/grid_client/src/zos/network_light.ts +++ b/packages/grid_client/src/zos/network_light.ts @@ -2,8 +2,8 @@ import { Expose, Type } from "class-transformer"; import { IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData } from "./workload_base"; import { WorkloadTypes } from "./workload"; +import { WorkloadData } from "./workload_base"; class Mycelium { @Expose() @IsString() @IsNotEmpty() hex_key: string; diff --git a/packages/grid_client/src/zos/public_ip.ts b/packages/grid_client/src/zos/public_ip.ts index fb92a28ab7..df876d4de9 100644 --- a/packages/grid_client/src/zos/public_ip.ts +++ b/packages/grid_client/src/zos/public_ip.ts @@ -2,8 +2,8 @@ import { Expose } from "class-transformer"; import { IsBoolean } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { WorkloadTypes } from "."; +import { WorkloadData, WorkloadDataResult } from "./workload_base"; @ValidateMembers() class PublicIP extends WorkloadData { diff --git a/packages/grid_client/src/zos/qsfs.ts b/packages/grid_client/src/zos/qsfs.ts index 11f9a1bc5d..a46af30cb7 100644 --- a/packages/grid_client/src/zos/qsfs.ts +++ b/packages/grid_client/src/zos/qsfs.ts @@ -2,8 +2,8 @@ import { Expose, Type } from "class-transformer"; import { IsInt, IsNotEmpty, IsString, Min, ValidateNested } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { WorkloadTypes } from "./workload"; +import { WorkloadData, WorkloadDataResult } from "./workload_base"; class Encryption { @Expose() @IsNotEmpty() @IsString() algorithm: string; diff --git a/packages/grid_client/src/zos/volume.ts b/packages/grid_client/src/zos/volume.ts index c61d9e87f8..e3213a45ef 100644 --- a/packages/grid_client/src/zos/volume.ts +++ b/packages/grid_client/src/zos/volume.ts @@ -2,8 +2,8 @@ import { Expose } from "class-transformer"; import { IsInt, Max, Min } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { WorkloadTypes } from "./workload"; +import { WorkloadData, WorkloadDataResult } from "./workload_base"; @ValidateMembers() class Volume extends WorkloadData { diff --git a/packages/grid_client/src/zos/zdb.ts b/packages/grid_client/src/zos/zdb.ts index 1a7b8958a8..1fbd3eb85e 100644 --- a/packages/grid_client/src/zos/zdb.ts +++ b/packages/grid_client/src/zos/zdb.ts @@ -2,8 +2,8 @@ import { Expose, Transform } from "class-transformer"; import { IsBoolean, IsEnum, IsInt, IsNotEmpty, IsString, Min } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { WorkloadTypes } from "./workload"; +import { WorkloadData, WorkloadDataResult } from "./workload_base"; enum ZdbModes { seq = "seq", diff --git a/packages/grid_client/src/zos/zlogs.ts b/packages/grid_client/src/zos/zlogs.ts index aa190e61df..aed3f993b0 100644 --- a/packages/grid_client/src/zos/zlogs.ts +++ b/packages/grid_client/src/zos/zlogs.ts @@ -1,7 +1,8 @@ import { Expose } from "class-transformer"; +import { IsString } from "class-validator"; + import { ValidateMembers } from "../helpers"; import { WorkloadData, WorkloadDataResult } from "./workload_base"; -import { IsString } from "class-validator"; @ValidateMembers() class Zlogs extends WorkloadData { diff --git a/packages/grid_client/src/zos/zmachine.ts b/packages/grid_client/src/zos/zmachine.ts index ec4560a2ba..59c1c6e20b 100644 --- a/packages/grid_client/src/zos/zmachine.ts +++ b/packages/grid_client/src/zos/zmachine.ts @@ -14,9 +14,9 @@ import { } from "class-validator"; import { ValidateMembers } from "../helpers"; +import { WorkloadTypes } from "."; import { ComputeCapacity } from "./computecapacity"; import { WorkloadData, WorkloadDataResult } from "./workload_base"; -import { WorkloadTypes } from "."; class ZNetworkInterface { @Expose() @IsString() @IsNotEmpty() network: string; diff --git a/packages/grid_client/src/zos/zmachine_light.ts b/packages/grid_client/src/zos/zmachine_light.ts index 69f24c0457..ba02e50edb 100644 --- a/packages/grid_client/src/zos/zmachine_light.ts +++ b/packages/grid_client/src/zos/zmachine_light.ts @@ -14,10 +14,10 @@ import { } from "class-validator"; import { ValidateMembers } from "../helpers"; +import { WorkloadTypes } from "."; import { ComputeCapacity } from "./computecapacity"; import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { Mount, MyceliumIP } from "./zmachine"; -import { WorkloadTypes } from "."; class MachineInterface { @Expose() @IsString() @IsNotEmpty() network: string; diff --git a/packages/grid_client/src/zos/zmount.ts b/packages/grid_client/src/zos/zmount.ts index c08771c093..f2cdde005e 100644 --- a/packages/grid_client/src/zos/zmount.ts +++ b/packages/grid_client/src/zos/zmount.ts @@ -2,8 +2,8 @@ import { Expose } from "class-transformer"; import { IsInt, Max, Min } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData, WorkloadDataResult } from "./workload_base"; import { WorkloadTypes } from "./workload"; +import { WorkloadData, WorkloadDataResult } from "./workload_base"; @ValidateMembers() class Zmount extends WorkloadData { diff --git a/packages/grid_client/src/zos/znet.ts b/packages/grid_client/src/zos/znet.ts index 4cd400d1bb..76f9c2b16c 100644 --- a/packages/grid_client/src/zos/znet.ts +++ b/packages/grid_client/src/zos/znet.ts @@ -2,8 +2,8 @@ import { Expose, Type } from "class-transformer"; import { ArrayNotEmpty, IsDefined, IsInt, IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator"; import { ValidateMembers } from "../helpers"; -import { WorkloadData } from "./workload_base"; import { WorkloadTypes } from "./workload"; +import { WorkloadData } from "./workload_base"; class Peer { @Expose() @IsString() @IsNotEmpty() subnet: string; diff --git a/packages/grid_client/tests/modules/algorand.test.ts b/packages/grid_client/tests/modules/algorand.test.ts index 368d0685c9..499b6bace6 100644 --- a/packages/grid_client/tests/modules/algorand.test.ts +++ b/packages/grid_client/tests/modules/algorand.test.ts @@ -63,7 +63,6 @@ test("TC1248 - Algorand: Import Account", async () => { //Test Data const accountName = "Test" + generateString(5); const newAccountName = "Test" + generateString(5); - const blockchainType = "algorand"; //Create Account const account: AlgorandAccountCreateModel = { @@ -135,7 +134,6 @@ test("TC1250 - Algorand: Check if Account exists", async () => { //Test Data const accountName = "Test" + generateString(5); - const blockchainType = "algorand"; //Create Account const account: AlgorandAccountCreateModel = { @@ -234,7 +232,6 @@ test.skip("TC1253 - Algorand: Get Account assets by address", async () => { //Test Data const accountName = "Test" + generateString(5); - const blockchainType = "algorand"; //Create Account const account: AlgorandAccountCreateModel = { diff --git a/packages/grid_client/tests/modules/applications/jitsi.test.ts b/packages/grid_client/tests/modules/applications/jitsi.test.ts index 0b5a358671..b5e9714cae 100644 --- a/packages/grid_client/tests/modules/applications/jitsi.test.ts +++ b/packages/grid_client/tests/modules/applications/jitsi.test.ts @@ -1,15 +1,7 @@ import axios from "axios"; import { setTimeout } from "timers/promises"; -import { - Features, - FilterOptions, - GatewayNameModel, - generateString, - GridClient, - MachinesModel, - randomChoice, -} from "../../../src"; +import { Features, FilterOptions, GatewayNameModel, generateString, GridClient, MachinesModel } from "../../../src"; import { config, getClient } from "../../client_loader"; import { generateInt, getOnlineNode, log } from "../../utils"; diff --git a/packages/grid_client/tests/modules/applications/nostr.test.ts b/packages/grid_client/tests/modules/applications/nostr.test.ts index e4e6b85c20..1b340c7600 100644 --- a/packages/grid_client/tests/modules/applications/nostr.test.ts +++ b/packages/grid_client/tests/modules/applications/nostr.test.ts @@ -45,7 +45,6 @@ test("TC2954 - Applications: Deploy Nostr", async () => { **********************************************/ const name = "gw" + generateString(10).toLowerCase(); const subdomain = name; // Using the same variable for gateway subdomain - const tlsPassthrough = false; const cpu = 1; const memory = 2; const rootfsSize = 2; diff --git a/packages/grid_client/tests/modules/applications/umbrel.test.ts b/packages/grid_client/tests/modules/applications/umbrel.test.ts index a14e02a611..e08c1e7707 100644 --- a/packages/grid_client/tests/modules/applications/umbrel.test.ts +++ b/packages/grid_client/tests/modules/applications/umbrel.test.ts @@ -88,7 +88,6 @@ test("TC2694 - Applications: Deploy Umbrel", async () => { } as FilterOptions); const nodeId = await getOnlineNode(nodes); if (nodeId === -1) throw new Error("No nodes available to complete this test"); - const domain = subdomain + "." + GatewayNode.publicConfig.domain; const vms: MachinesModel = { name: deploymentName, diff --git a/packages/grid_client/tests/modules/currency.test.ts b/packages/grid_client/tests/modules/currency.test.ts index b5eb4f9f77..02d6a2c1b7 100644 --- a/packages/grid_client/tests/modules/currency.test.ts +++ b/packages/grid_client/tests/modules/currency.test.ts @@ -45,7 +45,7 @@ describe("Testing TFT module", () => { const result = () => currency.convertTFTtoUSD({ amount: -1 }); try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -63,7 +63,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -82,7 +82,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -101,7 +101,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -120,7 +120,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -139,7 +139,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -158,7 +158,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); @@ -177,7 +177,7 @@ describe("Testing TFT module", () => { try { expect(result).toThrow(); - } catch (error) { + } catch { expect(result).toBeInstanceOf(ValidationError); } }); diff --git a/packages/grid_client/tests/modules/gateways.test.ts b/packages/grid_client/tests/modules/gateways.test.ts index 40431140e3..78e9fd6b5c 100644 --- a/packages/grid_client/tests/modules/gateways.test.ts +++ b/packages/grid_client/tests/modules/gateways.test.ts @@ -31,7 +31,7 @@ async function waitForGateway(domain: string) { try { await axios.get(domain); return true; - } catch (error) { + } catch { await setTimeout(5000, "Waiting for gateway to be ready"); } } diff --git a/packages/grid_client/tests/modules/stellar.test.ts b/packages/grid_client/tests/modules/stellar.test.ts index 6f122de651..6983e2005f 100644 --- a/packages/grid_client/tests/modules/stellar.test.ts +++ b/packages/grid_client/tests/modules/stellar.test.ts @@ -62,7 +62,6 @@ test("TC1255 - Stellar: Import Account", async () => { //Test Data const accountName = "Test" + generateString(5); const newAccountName = "Test" + generateString(5); - const blockchainType = "stellar"; //Create Account const account: StellarWalletCreateModel = { @@ -134,7 +133,6 @@ test("TC1257 - Stellar: Check if Account exists", async () => { //Test Data const accountName = "Test" + generateString(5); - const blockchainType = "stellar"; //Create Account const account: StellarWalletCreateModel = { @@ -235,7 +233,6 @@ test("TC1260 - Stellar: Get Account assets by address", async () => { //Test Data const accountName = "Test" + generateString(5); - const blockchainType = "stellar"; //Create Account const account: StellarWalletCreateModel = { diff --git a/packages/grid_client/tests/modules/stellar_v13_updates.test.ts b/packages/grid_client/tests/modules/stellar_v13_updates.test.ts index 64d9087e4c..d3129a0a06 100644 --- a/packages/grid_client/tests/modules/stellar_v13_updates.test.ts +++ b/packages/grid_client/tests/modules/stellar_v13_updates.test.ts @@ -1,4 +1,3 @@ - import { BlockchainSignModel, generateString, diff --git a/packages/grid_client/tests/modules/workload.test.ts b/packages/grid_client/tests/modules/workload.test.ts index b89413617f..15e211e68b 100644 --- a/packages/grid_client/tests/modules/workload.test.ts +++ b/packages/grid_client/tests/modules/workload.test.ts @@ -3,7 +3,6 @@ import { plainToClass } from "class-transformer"; import { DeploymentResult, Encryption, - MachineInterface, Mycelium, MyceliumIP, NetworkLight, @@ -45,7 +44,6 @@ const createDataInstance = (type: WorkloadTypes) => { let instance; const network = new ZmachineNetwork(); const networklight = new ZmachineLightNetwork(); - const interfaces = new MachineInterface(); const myceliumip = new MyceliumIP(); const computeCapacity = new ComputeCapacity(); @@ -152,7 +150,6 @@ const createDataInstance = (type: WorkloadTypes) => { instance.v6 = false; break; - case WorkloadTypes.qsfs: instance = new QuantumSafeFS(); @@ -210,9 +207,7 @@ const createDataInstance = (type: WorkloadTypes) => { }; // Filter out the deprecated IPv4 from general tests -const workloadTypesWithoutIPv4 = Object.values(WorkloadTypes).filter( - type => type !== WorkloadTypes.ipv4 -); +const workloadTypesWithoutIPv4 = Object.values(WorkloadTypes).filter(type => type !== WorkloadTypes.ipv4); describe.each(workloadTypesWithoutIPv4)("Workload Tests for %s", type => { beforeEach(() => { @@ -250,7 +245,7 @@ describe.each(workloadTypesWithoutIPv4)("Workload Tests for %s", type => { const serialized = JSON.stringify(workload); const deserialized = plainToClass(Workload, JSON.parse(serialized)); expect(deserialized).toBeInstanceOf(Workload); - + // Check basic properties expect(deserialized.version).toEqual(workload.version); expect(deserialized.name).toEqual(workload.name); @@ -284,7 +279,7 @@ describe.each(workloadTypesWithoutIPv4)("Workload Tests for %s", type => { }); }); -// Specific test for IPv4 deployment result as the PublicIPv4 class is deprecated +// Specific test for IPv4 deployment result as the PublicIPv4 class is deprecated describe("IPv4 Deployment Result Tests", () => { let ipv4Workload: Workload; @@ -296,12 +291,12 @@ describe("IPv4 Deployment Result Tests", () => { ipv4Workload.type = WorkloadTypes.ipv4; ipv4Workload.metadata = "IPv4 Metadata"; ipv4Workload.description = "IPv4 test workload"; - + // Create deployment result with specific IPv4 result data const ipv4Result = new PublicIPv4Result(); ipv4Result.ip = "185.206.122.33"; ipv4Result.gateway = "185.206.122.1"; - + ipv4Workload.result = new DeploymentResult(); ipv4Workload.result.created = Date.now(); ipv4Workload.result.state = ResultStates.ok; @@ -312,21 +307,20 @@ describe("IPv4 Deployment Result Tests", () => { test("should correctly serialize and deserialize IPv4 deployment result", () => { const serialized = JSON.stringify(ipv4Workload); const deserialized = plainToClass(Workload, JSON.parse(serialized)); - - + const deserializedResult = deserialized.result.data as PublicIPv4Result; expect(deserializedResult.ip).toEqual("185.206.122.33"); expect(deserializedResult.gateway).toEqual("185.206.122.1"); }); - + test("should correctly serialize and deserialize PublicIPv4Result directly", () => { const ipv4Result = new PublicIPv4Result(); ipv4Result.ip = "192.168.1.100"; ipv4Result.gateway = "192.168.1.1"; - + const serialized = JSON.stringify(ipv4Result); const deserialized = plainToClass(PublicIPv4Result, JSON.parse(serialized)); - + expect(deserialized.ip).toEqual("192.168.1.100"); expect(deserialized.gateway).toEqual("192.168.1.1"); }); diff --git a/packages/grid_client/tests/modules/zmachine.test.ts b/packages/grid_client/tests/modules/zmachine.test.ts index 2dae030bfd..93ea9dddab 100644 --- a/packages/grid_client/tests/modules/zmachine.test.ts +++ b/packages/grid_client/tests/modules/zmachine.test.ts @@ -5,7 +5,7 @@ import { ComputeCapacity, Mount, MyceliumIP, Zmachine, ZmachineNetwork, ZNetwork let zmachine = new Zmachine(); const computeCapacity = new ComputeCapacity(); const network = new ZmachineNetwork(); -const networkInterface = new ZNetworkInterface() +const networkInterface = new ZNetworkInterface(); const disks = new Mount(); beforeEach(() => { @@ -14,11 +14,9 @@ beforeEach(() => { network.planetary = true; network.public_ip = "10.249.0.0/16"; - networkInterface.ip = "10.20.2.2" - networkInterface.network= "znetwork" - network.interfaces = [ - networkInterface - ]; + networkInterface.ip = "10.20.2.2"; + networkInterface.network = "znetwork"; + network.interfaces = [networkInterface]; const myceliumInstance = new MyceliumIP(); myceliumInstance.hex_seed = "abc123"; myceliumInstance.network = "mycelium_net"; diff --git a/packages/grid_client/tests/modules/zmachine_light.test.ts b/packages/grid_client/tests/modules/zmachine_light.test.ts index 67061f84ed..a915343121 100644 --- a/packages/grid_client/tests/modules/zmachine_light.test.ts +++ b/packages/grid_client/tests/modules/zmachine_light.test.ts @@ -1,6 +1,14 @@ import { plainToClass } from "class-transformer"; -import { ComputeCapacity, MachineInterface, Mount, MyceliumIP, ZmachineLight, ZmachineLightNetwork, ZNetworkInterface } from "../../src"; +import { + ComputeCapacity, + MachineInterface, + Mount, + MyceliumIP, + ZmachineLight, + ZmachineLightNetwork, + ZNetworkInterface, +} from "../../src"; let zmachineLight = new ZmachineLight(); const computeCapacity = new ComputeCapacity(); @@ -12,11 +20,9 @@ beforeEach(() => { computeCapacity.cpu = 1; computeCapacity.memory = 256 * 1024 ** 2; - networkInterface.ip = "10.20.2.2" - networkInterface.network= "znetwork" - network.interfaces = [ - networkInterface - ]; + networkInterface.ip = "10.20.2.2"; + networkInterface.network = "znetwork"; + network.interfaces = [networkInterface]; const myceliumInstance = new MyceliumIP(); myceliumInstance.hex_seed = "abc123"; diff --git a/packages/grid_client/tests/utils.ts b/packages/grid_client/tests/utils.ts index 52f9729df9..7756bc4d03 100644 --- a/packages/grid_client/tests/utils.ts +++ b/packages/grid_client/tests/utils.ts @@ -93,7 +93,7 @@ async function getOnlineNode(Nodes) { try { log(await gridClient.zos.pingNode({ nodeId: node.nodeId })); break; - } catch (error) { + } catch { log("node " + node.nodeId + " is not responding, trying different node."); Nodes.splice(+[Nodes.indexOf(node)], 1); } diff --git a/packages/grid_http_server/src/server.ts b/packages/grid_http_server/src/server.ts index cbe90ac97a..603da47284 100644 --- a/packages/grid_http_server/src/server.ts +++ b/packages/grid_http_server/src/server.ts @@ -42,6 +42,7 @@ class HttpServer { } handle(gridClient, module, method) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars this.router.post(`/${module}/${method}`, async (req, res, next) => { const payload = req.body; @@ -83,9 +84,11 @@ class HttpServer { run() { // ping-pong the server + // eslint-disable-next-line @typescript-eslint/no-unused-vars this.server.use("/ping", (req, res, next) => res.status(200).json("pong")); /** Error handling */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars this.server.use((req, res, next) => { const error = new Error("not found"); return res.status(404).json({ diff --git a/packages/gridproxy_client/src/builders/contracts.ts b/packages/gridproxy_client/src/builders/contracts.ts index ea2b16ef57..8b22bd13fa 100644 --- a/packages/gridproxy_client/src/builders/contracts.ts +++ b/packages/gridproxy_client/src/builders/contracts.ts @@ -91,7 +91,10 @@ const CONTRACTS_VALIDATOR: BuilderValidator = { }; export class ContractsBuilder extends AbstractBuilder { - constructor(public readonly uri: string, queries: Partial = {}) { + constructor( + public readonly uri: string, + queries: Partial = {}, + ) { super({ mapper: CONTRACTS_MAPPER, validator: CONTRACTS_VALIDATOR, @@ -99,5 +102,5 @@ export class ContractsBuilder extends AbstractBuilder { }); } } -// eslint-disable-next-line @typescript-eslint/no-empty-interface + export interface ContractsBuilder extends BuilderMethods {} diff --git a/packages/gridproxy_client/src/builders/farms.ts b/packages/gridproxy_client/src/builders/farms.ts index 35421d81c0..3f723021e6 100644 --- a/packages/gridproxy_client/src/builders/farms.ts +++ b/packages/gridproxy_client/src/builders/farms.ts @@ -70,7 +70,10 @@ const FARMS_VALIDATOR: BuilderValidator = { }; export class FarmsBuilder extends AbstractBuilder { - constructor(public uri: string, queries: Partial = {}) { + constructor( + public uri: string, + queries: Partial = {}, + ) { super({ mapper: FARMS_MAPPER, validator: FARMS_VALIDATOR, @@ -78,5 +81,5 @@ export class FarmsBuilder extends AbstractBuilder { }); } } -// eslint-disable-next-line @typescript-eslint/no-empty-interface + export interface FarmsBuilder extends BuilderMethods {} diff --git a/packages/gridproxy_client/src/builders/gateways.ts b/packages/gridproxy_client/src/builders/gateways.ts index 971aca9356..9ba0eff6d7 100644 --- a/packages/gridproxy_client/src/builders/gateways.ts +++ b/packages/gridproxy_client/src/builders/gateways.ts @@ -89,7 +89,10 @@ const GATEWAYS_VALIDATOR: BuilderValidator = { }; export class GatewayBuilder extends AbstractBuilder { - constructor(public uri: string, queries: Partial = {}) { + constructor( + public uri: string, + queries: Partial = {}, + ) { super({ mapper: GATEWAYS_MAPPER, validator: GATEWAYS_VALIDATOR, @@ -97,5 +100,5 @@ export class GatewayBuilder extends AbstractBuilder { }); } } -// eslint-disable-next-line @typescript-eslint/no-empty-interface + export interface GatewayBuilder extends BuilderMethods {} diff --git a/packages/gridproxy_client/src/builders/nodes.ts b/packages/gridproxy_client/src/builders/nodes.ts index 57433448e7..a5fa562bea 100644 --- a/packages/gridproxy_client/src/builders/nodes.ts +++ b/packages/gridproxy_client/src/builders/nodes.ts @@ -182,7 +182,10 @@ const NODES_VALIDATOR: BuilderValidator = { }; export class NodesBuilder extends AbstractBuilder { - constructor(public uri: string, queries: Partial = {}) { + constructor( + public uri: string, + queries: Partial = {}, + ) { super({ mapper: NODES_MAPPER, validator: NODES_VALIDATOR, @@ -191,5 +194,4 @@ export class NodesBuilder extends AbstractBuilder { } } -// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface NodesBuilder extends BuilderMethods {} diff --git a/packages/gridproxy_client/src/builders/public_ips.ts b/packages/gridproxy_client/src/builders/public_ips.ts index cb78be16a1..efe9b54fc9 100644 --- a/packages/gridproxy_client/src/builders/public_ips.ts +++ b/packages/gridproxy_client/src/builders/public_ips.ts @@ -1,5 +1,5 @@ import { assertBoolean, assertId, assertNatural, assertString } from "../utils"; -import { AbstractBuilder, BuilderMapper, BuilderMethods, BuilderValidator } from "./abstract_builder"; +import { AbstractBuilder, BuilderMapper, BuilderValidator } from "./abstract_builder"; import { SortBy, SortOrder } from "./nodes"; export interface PublicIpQuery { @@ -42,7 +42,10 @@ const PUBLICIPS_VALIDATOR: BuilderValidator = { }; export class PublicIpBuilder extends AbstractBuilder { - constructor(public uri: string, queries: Partial = {}) { + constructor( + public uri: string, + queries: Partial = {}, + ) { super({ mapper: PUBLICIPS_MAPPER, validator: PUBLICIPS_VALIDATOR, diff --git a/packages/gridproxy_client/src/builders/stats.ts b/packages/gridproxy_client/src/builders/stats.ts index 5394a10b52..213967fba8 100644 --- a/packages/gridproxy_client/src/builders/stats.ts +++ b/packages/gridproxy_client/src/builders/stats.ts @@ -17,7 +17,10 @@ const STATS_VALIDATOR: BuilderValidator = { }; export class StatsBuilder extends AbstractBuilder { - constructor(public uri: string, queries: Partial = {}) { + constructor( + public uri: string, + queries: Partial = {}, + ) { super({ mapper: STATS_MAPPER, validator: STATS_VALIDATOR, @@ -26,5 +29,4 @@ export class StatsBuilder extends AbstractBuilder { } } -// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface StatuBuilder extends BuilderMethods {} diff --git a/packages/gridproxy_client/src/builders/twins.ts b/packages/gridproxy_client/src/builders/twins.ts index f81470503d..650454f59e 100644 --- a/packages/gridproxy_client/src/builders/twins.ts +++ b/packages/gridproxy_client/src/builders/twins.ts @@ -26,7 +26,10 @@ const TWINS_VALIDATOR: BuilderValidator = { }; export class TwinsBuilder extends AbstractBuilder { - constructor(public uri: string, queries: Partial = {}) { + constructor( + public uri: string, + queries: Partial = {}, + ) { super({ mapper: TWINS_MAPPER, validator: TWINS_VALIDATOR, @@ -35,5 +38,4 @@ export class TwinsBuilder extends AbstractBuilder { } } -// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface TwinsBuilder extends BuilderMethods {} diff --git a/packages/gridproxy_client/src/modules/nodes.ts b/packages/gridproxy_client/src/modules/nodes.ts index 0ca7029565..ef6bf4d69c 100644 --- a/packages/gridproxy_client/src/modules/nodes.ts +++ b/packages/gridproxy_client/src/modules/nodes.ts @@ -15,7 +15,11 @@ export class NodesClient extends AbstractClient { public farms: Map; public twins: Map; - constructor(uri: string, private readonly __farmsClient: FarmsClient, private readonly __twinsClient: TwinsClient) { + constructor( + uri: string, + private readonly __farmsClient: FarmsClient, + private readonly __twinsClient: TwinsClient, + ) { super({ uri, Builder: NodesBuilder, diff --git a/packages/monitoring/src/serviceMonitor/alivenessChecker.ts b/packages/monitoring/src/serviceMonitor/alivenessChecker.ts index eb625f2ec2..c73ed5574a 100644 --- a/packages/monitoring/src/serviceMonitor/alivenessChecker.ts +++ b/packages/monitoring/src/serviceMonitor/alivenessChecker.ts @@ -12,7 +12,12 @@ export class ServiceMonitor { * @param retries - The number of retries in case a service is determined to be down (default is 2 retries). * @param retryInterval - The interval, in seconds, between retries (default is 2 seconds). */ - constructor(public services: ILivenessChecker[], public interval = 2, public retries = 2, public retryInterval = 2) {} + constructor( + public services: ILivenessChecker[], + public interval = 2, + public retries = 2, + public retryInterval = 2, + ) {} /** * Checks the liveness of each service once and logs events accordingly. diff --git a/packages/monitoring/src/serviceMonitor/serviceURLManager.ts b/packages/monitoring/src/serviceMonitor/serviceURLManager.ts index f8f27cb9a0..69125050aa 100644 --- a/packages/monitoring/src/serviceMonitor/serviceURLManager.ts +++ b/packages/monitoring/src/serviceMonitor/serviceURLManager.ts @@ -155,7 +155,7 @@ export class ServiceUrlManager { } const entries = Object.entries(result); - const values = await Promise.all(entries.map(([_, promise]) => promise)); + const values = await Promise.all(entries.map(([_, promise]) => promise)); // eslint-disable-line @typescript-eslint/no-unused-vars for (let i = 0; i < entries.length; i++) { this.results[entries[i][0]] = values[i]; } diff --git a/packages/playground/src/App.vue b/packages/playground/src/App.vue index 0af1e850c8..48775f6e97 100644 --- a/packages/playground/src/App.vue +++ b/packages/playground/src/App.vue @@ -19,12 +19,12 @@