import { A as EnvRuntimeRegistry, B as PublicEnv, C as EnvMode, D as EnvProviderValues, E as EnvProviderContext, F as EnvTypedVariableOptions, G as ServerEnvInspection, H as ServerEnv, I as EnvValueSchema, K as ServerEnvInspectionEntry, L as EnvVariableDeclaration, M as EnvSource, N as EnvSourceContext, O as EnvProviders, P as EnvSourceResolver, Q as SecretEnv, R as EnvVariableOptions, S as EnvDiagnostics, T as EnvProvider, U as ServerEnvDescription, V as ReadonlyServerEnv, W as ServerEnvDescriptionEntry, b as EnvDeclarations, j as EnvSchemaModuleReference, k as EnvRuntimeConfigOptions, q as ServerEnvInspectionStatus, w as EnvOptions, x as EnvDiagnosticEntry, y as DeepReadonly, z as LoadServerEnvOptions } from "./bridge-Cs9YfQWk.js"; import { t as env } from "./declarations-C5XR3aKw.js"; import { C as parseSchema, S as StandardSchemaV1, _ as unseal, b as StandardSchemaResultFailure, d as SealOptions, f as UnsealErrorCode, g as seal, m as UnsealSchemaOptions, p as UnsealOptions, s as isBlockingServerEnvEntry, v as SealUsesDatabase, x as StandardSchemaResultSuccess, y as RequestEvent } from "./server-CgKAEAE6.js"; import { Result, ViteHubError } from "@vite-hub/runtime"; import { deriveSecret, describeServerEnv, inspectServerEnv, loadServerEnv, runWithServerEnv, useServerEnv } from "#vitehub/env/server"; import { usePublicEnv } from "#vitehub/env/public"; //#region src/presets.d.ts interface OpenWorkflowEnvOptions { namespaceId?: string; schema?: string; workerConcurrency?: string; } export declare function openWorkflowEnv(options?: OpenWorkflowEnvOptions): EnvRuntimeConfigOptions; interface TypesafeEnvOptions { /** Default model when `TYPESAFE_DEFAULT_MODEL` is not set. Default: `jev-latest`. */ model?: string; } /** * Declares the Server Env of the `typesafe()` AI gateway from `vite-hub/gateways`: Secret `apiKey` * (`TYPESAFE_API_KEY`) and `model` (`TYPESAFE_DEFAULT_MODEL`). `defineAgent({ driver: { ask } })` uses `typesafe()` * when it gets no other gateway. The values are optional here: Jev diagnoses a * missing key when it runs, so an application without AI still starts. */ export declare function typesafeEnv(options?: TypesafeEnvOptions): EnvRuntimeConfigOptions; //#endregion //#region src/provider.d.ts export declare function defineEnvProvider = Record, const TProvider extends EnvProvider = EnvProvider>(provider: TProvider): TProvider; //#endregion //#region src/service-token.d.ts /** The codes that `checkServiceToken()` returns. */ type ServiceTokenErrorCode = "ENV_SERVICE_TOKEN_INVALID" | "ENV_SERVICE_TOKEN_UNSET"; /** * The request to check: an H3 event, another event with Standard Context, or a web `Request`. An H3 event matches * `{ req }` even when the app does not load the types that add `~standard` to it. */ type ServiceTokenEvent = RequestEvent; /** * Checks that a request carries `Authorization: Bearer ` with a token from the host variable `name`, and * returns `[error, undefined]`. The variable holds one token, or a comma-separated list, so the old and the new token * both pass while you rotate. It compares in constant time. Without a token in the variable, every request fails with * `ENV_SERVICE_TOKEN_UNSET`. * * ```ts [server/api/health.get.ts] * import { defineEventHandler } from "h3" * import { checkServiceToken } from "vite-hub/env" * * export default defineEventHandler((event) => { * const [error] = checkServiceToken(event, "ADMIN_TOKEN") * return error ? { ok: true } : { ok: true, queue: 3 } * }) * ``` */ export declare function checkServiceToken(event: ServiceTokenEvent, name: string): Result; /** * Returns when a request carries `Authorization: Bearer ` with a token from the host variable `name`. Otherwise * it throws an `HTTPError`: `401` with `ENV_SERVICE_TOKEN_INVALID`, or `503` with `ENV_SERVICE_TOKEN_UNSET` when the * variable has no token. Use it for routes that scripts, runners, and webhooks call. * * ```ts [server/api/ingest.post.ts] * import { defineEventHandler } from "h3" * import { requireServiceToken } from "vite-hub/env" * * export default defineEventHandler((event) => { * requireServiceToken(event, "INGEST_TOKEN") * return { ok: true } * }) * ``` */ export declare function requireServiceToken(event: ServiceTokenEvent, name: string): void; //#endregion //#region src/webhook.d.ts /** The codes that `verifyWebhook()` returns. */ type WebhookErrorCode = "ENV_WEBHOOK_BODY_INVALID" | "ENV_WEBHOOK_SCHEMA_MISMATCH" | "ENV_WEBHOOK_SECRET_UNSET" | "ENV_WEBHOOK_SIGNATURE_INVALID"; /** How `verifyWebhook()` checks the signature. `secret` is the name of the server variable that holds the signing secret. */ type VerifyWebhookOptions = { /** `Stripe-Signature: t=