diff --git a/supabase/functions/_shared/paddle.ts b/supabase/functions/_shared/paddle.ts index f2358b4..62cb0df 100644 --- a/supabase/functions/_shared/paddle.ts +++ b/supabase/functions/_shared/paddle.ts @@ -1,3 +1,4 @@ +// @ts-ignore deno npm specifier resolved at runtime import { Environment, Paddle, EventName } from 'npm:@paddle/paddle-node-sdk'; export { EventName }; diff --git a/supabase/functions/configure-telegram-webhook/index.ts b/supabase/functions/configure-telegram-webhook/index.ts index 66cd8e7..550807f 100644 --- a/supabase/functions/configure-telegram-webhook/index.ts +++ b/supabase/functions/configure-telegram-webhook/index.ts @@ -20,8 +20,9 @@ function randomHex(bytes: number): string { .join(""); } +// deno-lint-ignore no-explicit-any async function getDecryptedSecret( - admin: ReturnType, + admin: any, secretId: string, ): Promise { const { data, error } = await admin diff --git a/supabase/functions/deno.json b/supabase/functions/deno.json new file mode 100644 index 0000000..fbd70ec --- /dev/null +++ b/supabase/functions/deno.json @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "auto" +} diff --git a/supabase/functions/disconnect-integration/index.ts b/supabase/functions/disconnect-integration/index.ts index 4760b5b..4a940c8 100644 --- a/supabase/functions/disconnect-integration/index.ts +++ b/supabase/functions/disconnect-integration/index.ts @@ -19,8 +19,9 @@ function jsonResponse(body: unknown, status = 200): Response { }); } +// deno-lint-ignore no-explicit-any async function getDecryptedSecret( - admin: ReturnType, + admin: any, secretId: string, ): Promise { const { data, error } = await admin diff --git a/supabase/functions/disconnect-telegram/index.ts b/supabase/functions/disconnect-telegram/index.ts index cac881e..55bfae8 100644 --- a/supabase/functions/disconnect-telegram/index.ts +++ b/supabase/functions/disconnect-telegram/index.ts @@ -13,8 +13,9 @@ function jsonResponse(body: unknown, status = 200): Response { }); } +// deno-lint-ignore no-explicit-any async function getDecryptedSecret( - admin: ReturnType, + admin: any, secretId: string, ): Promise { const { data, error } = await admin diff --git a/supabase/functions/parse-cronjob-natural-language/index.ts b/supabase/functions/parse-cronjob-natural-language/index.ts index c4a5dc5..d238ba7 100644 --- a/supabase/functions/parse-cronjob-natural-language/index.ts +++ b/supabase/functions/parse-cronjob-natural-language/index.ts @@ -3,9 +3,7 @@ // valida com cron-parser, gera human_readable em pt-BR via cronstrue. import { corsHeaders } from "../_shared/cors.ts"; import { createClient } from "npm:@supabase/supabase-js@2"; -// @ts-expect-error remote esm import cronParser from "https://esm.sh/cron-parser@4.9.0"; -// @ts-expect-error remote esm import cronstrue from "https://esm.sh/cronstrue@2.50.0/i18n"; const LOVABLE_API_KEY = Deno.env.get("LOVABLE_API_KEY")!; diff --git a/supabase/functions/provision-agent/index.ts b/supabase/functions/provision-agent/index.ts index beb8870..d858792 100644 --- a/supabase/functions/provision-agent/index.ts +++ b/supabase/functions/provision-agent/index.ts @@ -315,7 +315,8 @@ function jsonResponse(status: number, body: unknown) { } async function failJob( - supabase: ReturnType, + // deno-lint-ignore no-explicit-any + supabase: any, agent: { id: string }, jobId: string | null, message: string, @@ -330,7 +331,8 @@ async function failJob( } async function scheduleRetry( - supabase: ReturnType, + // deno-lint-ignore no-explicit-any + supabase: any, agent: { id: string }, jobId: string, message: string, @@ -341,8 +343,8 @@ async function scheduleRetry( .eq("id", jobId) .single(); - const attempt = job?.attempt ?? 1; - const max = job?.max_attempts ?? 5; + const attempt: number = (job?.attempt as number | undefined) ?? 1; + const max: number = (job?.max_attempts as number | undefined) ?? 5; if (attempt >= max) { await failJob(supabase, agent, jobId, `Max attempts reached. Last error: ${message}`); diff --git a/supabase/functions/railway-webhook/index.ts b/supabase/functions/railway-webhook/index.ts index 840669e..67dfc01 100644 --- a/supabase/functions/railway-webhook/index.ts +++ b/supabase/functions/railway-webhook/index.ts @@ -96,6 +96,7 @@ Deno.serve(async (req) => { // Carrega nome do cliente para a notificação (best-effort) async function loadFullName(): Promise { + if (!agent) return "—"; const { data } = await supabase .from("profiles") .select("full_name") diff --git a/supabase/functions/refresh-integration-token/index.ts b/supabase/functions/refresh-integration-token/index.ts index 5cd6a04..1de3936 100644 --- a/supabase/functions/refresh-integration-token/index.ts +++ b/supabase/functions/refresh-integration-token/index.ts @@ -16,8 +16,9 @@ function jsonResponse(body: unknown, status = 200): Response { }); } +// deno-lint-ignore no-explicit-any async function getDecryptedSecret( - admin: ReturnType, + admin: any, secretId: string, ): Promise { const { data, error } = await admin diff --git a/supabase/functions/telegram-webhook/index.ts b/supabase/functions/telegram-webhook/index.ts index 3a61b95..6f0ac89 100644 --- a/supabase/functions/telegram-webhook/index.ts +++ b/supabase/functions/telegram-webhook/index.ts @@ -16,8 +16,9 @@ function firstName(fullName: string | null | undefined): string { return parts[0] || "Mika"; } +// deno-lint-ignore no-explicit-any async function getDecryptedSecret( - admin: ReturnType, + admin: any, secretId: string, ): Promise { const { data, error } = await admin diff --git a/supabase/functions/validate-telegram-bot/index.ts b/supabase/functions/validate-telegram-bot/index.ts index 89f3446..c3051c8 100644 --- a/supabase/functions/validate-telegram-bot/index.ts +++ b/supabase/functions/validate-telegram-bot/index.ts @@ -125,7 +125,7 @@ Deno.serve(async (req) => { // 5) Se já houver um vault_id antigo, remove (reconexão) if (agent.telegram_bot_token_vault_id) { - await admin.rpc("exec_sql_void", {}).catch(() => {}); + try { await admin.rpc("exec_sql_void", {} as never); } catch { /* ignore */ } // tenta remover diretamente; ignora falha const { error: delErr } = await admin .from("vault.secrets" as unknown as never)