/** * Navidrome MCP Server - Web remote auth store (webui-auth-.json) * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import { z } from 'zod'; declare const AdminSessionSchema: z.ZodObject<{ role: z.ZodLiteral<"admin">; credentialEpoch: z.ZodString; hostNickname: z.ZodDefault>; lastLocal: z.ZodDefault; id: z.ZodString; secretDigest: z.ZodString; createdAt: z.ZodNumber; lastSeenAt: z.ZodNumber; expiresAt: z.ZodNumber; csrfToken: z.ZodString; lastAddress: z.ZodString; }, z.core.$strip>; declare const GuestSessionSchema: z.ZodObject<{ role: z.ZodLiteral<"guest">; keyId: z.ZodString; label: z.ZodString; nickname: z.ZodNullable; deviceId: z.ZodDefault>; id: z.ZodString; secretDigest: z.ZodString; createdAt: z.ZodNumber; lastSeenAt: z.ZodNumber; expiresAt: z.ZodNumber; csrfToken: z.ZodString; lastAddress: z.ZodString; }, z.core.$strip>; declare const SessionRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ role: z.ZodLiteral<"admin">; credentialEpoch: z.ZodString; hostNickname: z.ZodDefault>; lastLocal: z.ZodDefault; id: z.ZodString; secretDigest: z.ZodString; createdAt: z.ZodNumber; lastSeenAt: z.ZodNumber; expiresAt: z.ZodNumber; csrfToken: z.ZodString; lastAddress: z.ZodString; }, z.core.$strip>, z.ZodObject<{ role: z.ZodLiteral<"guest">; keyId: z.ZodString; label: z.ZodString; nickname: z.ZodNullable; deviceId: z.ZodDefault>; id: z.ZodString; secretDigest: z.ZodString; createdAt: z.ZodNumber; lastSeenAt: z.ZodNumber; expiresAt: z.ZodNumber; csrfToken: z.ZodString; lastAddress: z.ZodString; }, z.core.$strip>], "role">; /** * `secret` is the raw key, kept so the admin can show the QR again. A join compares `digest` in * constant time. `lastGuestNumber` numbers the guest labels. */ declare const JukeboxCodeSchema: z.ZodObject<{ id: z.ZodString; secret: z.ZodString; digest: z.ZodString; createdAt: z.ZodNumber; expiresAt: z.ZodNumber; lastGuestNumber: z.ZodNumber; }, z.core.$strip>; /** * A `guest` ban refuses a join from the browser whose device cookie holds `deviceId`. It lasts while * the jukebox stays open, so a new code moves its expiry and closing the jukebox ends it. A `network` * ban refuses every request from a source whose `networkKey` matches, and its `deviceId` is null. */ declare const BanSchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<{ network: "network"; guest: "guest"; }>; label: z.ZodString; nickname: z.ZodNullable; networkKey: z.ZodString; deviceId: z.ZodDefault>; createdAt: z.ZodNumber; expiresAt: z.ZodNumber; }, z.core.$strip>; /** * A file written before jukebox codes or bans existed lacks those fields, so it reads as none. A code * record that fails validation, such as one stored before `secret` existed, reads as closed, so the * admin sessions and network bans survive. The guests and their guest bans end with the code. */ declare const AuthFileSchema: z.ZodObject<{ version: z.ZodLiteral<1>; sessions: z.ZodArray; credentialEpoch: z.ZodString; hostNickname: z.ZodDefault>; lastLocal: z.ZodDefault; id: z.ZodString; secretDigest: z.ZodString; createdAt: z.ZodNumber; lastSeenAt: z.ZodNumber; expiresAt: z.ZodNumber; csrfToken: z.ZodString; lastAddress: z.ZodString; }, z.core.$strip>, z.ZodObject<{ role: z.ZodLiteral<"guest">; keyId: z.ZodString; label: z.ZodString; nickname: z.ZodNullable; deviceId: z.ZodDefault>; id: z.ZodString; secretDigest: z.ZodString; createdAt: z.ZodNumber; lastSeenAt: z.ZodNumber; expiresAt: z.ZodNumber; csrfToken: z.ZodString; lastAddress: z.ZodString; }, z.core.$strip>], "role">>; envAdminHash: z.ZodNullable; jukeboxCode: z.ZodCatch>>>; bans: z.ZodDefault; label: z.ZodString; nickname: z.ZodNullable; networkKey: z.ZodString; deviceId: z.ZodDefault>; createdAt: z.ZodNumber; expiresAt: z.ZodNumber; }, z.core.$strip>>>; }, z.core.$strip>; export type AdminSession = z.infer; export type GuestSession = z.infer; export type SessionRecord = z.infer; export type JukeboxCode = z.infer; export type Ban = z.infer; export type AuthFile = z.infer; type AuthFileInput = z.input; /** * Beside settings.json, so `NAVIDROME_CONFIG_PATH` moves both and a container keeps both on one volume. * The port owner owns the file, so two players on one config directory never overwrite each other. */ export declare function getAuthStorePath(port: number): string; /** `droppedJukeboxCode` is true when the file held a code record that failed validation and reads as null. */ interface AuthFileRead { file: AuthFile; droppedJukeboxCode: boolean; } /** A lost file costs only the open sessions, the jukebox code and the bans, so every failure starts empty instead of stopping the player. */ export declare function readAuthFileWithStatus(port: number): AuthFileRead; export declare function readAuthFile(port: number): AuthFile; export declare function writeAuthFile(port: number, file: AuthFileInput): void; export {}; //# sourceMappingURL=auth-store.d.ts.map