import { type PrivateFileReport } from "./private-file.js"; export declare const DEFAULT_API_URL = "https://api.relayapp.im"; export declare const DEFAULT_PROFILE = "default"; export declare const STAGING_API_URL = "https://api.staging.relayapp.im"; /** Relay-Auth, the one account per person; `relay login` runs its device flow. */ export declare const DEFAULT_AUTH_URL = "https://auth.relayapp.im"; export declare const STAGING_AUTH_URL = "https://auth.staging.relayapp.im"; /** This package's own version as published (`X.Y.Z` or `X.Y.Z-staging.N`). */ export declare const packageVersion: () => string; /** A `-staging` prerelease build targets the staging environment by itself. */ export declare const isStagingBuild: (version: string) => boolean; export declare const defaultCreationApiURL: (version?: string) => string; /** RELAY_AUTH_URL overrides, the way RELAY_CONSOLE_API_URL overrides the Console. */ export declare const defaultAuthURL: (env?: NodeJS.ProcessEnv, version?: string) => string; export interface RelayProfile { api_url?: string; agent_token?: string; /** The `whsec_` secret `listen` signs local forwards with. Made once per * profile and kept, the way Stripe keeps one per account, so a restart does * not force the developer to change RELAY_WEBHOOK_SECRET again. */ local_webhook_secret?: string; } /** A Relay-Auth session token from the device flow. It has no refresh: the * token lives 30 days and `relay login` renews it. */ export interface RelayConsoleOAuthSession { type?: "oauth"; access_token: string; expires_at: number; organization_id?: string; user: { id: string; email: string; name?: string; }; } export interface RelayConsoleOrganizationKey { type: "organization_key"; organization_key: string; organization_id: string; console_api_url: string; } export type RelayConsoleSession = RelayConsoleOAuthSession | RelayConsoleOrganizationKey; export interface RelayConfig { version: 1; current_profile: string; defaultAgent?: string; profiles: Record; console?: RelayConsoleSession; } export interface ConfigContext { env?: NodeJS.ProcessEnv; home?: string; platform?: NodeJS.Platform; /** The folder the command runs in: its link names the agent when no --profile does. */ cwd?: string; } export interface ResolvedAuth { profile: string; apiURL: string; token: string; tokenSource: "environment" | "profile"; configPath: string; } export declare const configPath: (context?: ConfigContext) => string; export declare const emptyConfig: (version?: string) => RelayConfig; export declare const validateOrganizationKey: (raw: string) => string; export declare const defaultConsoleApiURL: (apiURL?: string, env?: NodeJS.ProcessEnv) => string; export declare const readConfig: (context?: ConfigContext) => Promise; /** Probe private creation, writing, syncing, renaming and ACL inspection without * replacing any existing config. This is not a reservation or recovery journal. */ export declare const preflightConfigDestination: (context?: ConfigContext) => Promise; export declare const writeConfig: (config: RelayConfig, context?: ConfigContext) => Promise; export declare const mutateConfig: (change: (config: RelayConfig) => T, context?: ConfigContext) => Promise; export declare const validateProfileName: (name: string) => string; export declare const validateApiURL: (input: string) => string; export declare const validateForwardURL: (input: string) => string; /** A Standard Webhooks secret: `whsec_` and 32 random bytes in base64, the * shape Relay's own subscriptions use, so the receiver's verify code is the * same one it runs deployed. */ export declare const newLocalWebhookSecret: () => string; /** The saved local signing secret for a profile, made on first use and kept. */ export declare const localWebhookSecret: (profile: string, context?: ConfigContext) => Promise; export declare const validateToken: (value: string) => string; export declare const resolveAuth: (requestedProfile?: string, context?: ConfigContext) => Promise; export declare const inspectConfigPermissions: (context?: ConfigContext) => Promise; export declare const collectConfiguredTokens: (context?: ConfigContext) => Promise; //# sourceMappingURL=config.d.ts.map