minauth
Version:
A TypeScript library for building authentication systems on top of the Mina blockchain and other zero-knowledge proofs solutions.
61 lines (60 loc) • 1.93 kB
TypeScript
import { z } from 'zod';
import { TaskEither } from 'fp-ts/lib/TaskEither.js';
import { PluginServerEnv } from './types.js';
/**
* The plugin server configuration schema
*/
export declare const configurationSchema: z.ZodObject<{
plugins: z.ZodRecord<z.ZodString, z.ZodObject<{
path: z.ZodOptional<z.ZodString>;
config: z.ZodUnknown;
}, "strip", z.ZodTypeAny, {
path?: string | undefined;
config?: unknown;
}, {
path?: string | undefined;
config?: unknown;
}>>;
pluginDir: z.ZodOptional<z.ZodString>;
address: z.ZodDefault<z.ZodString>;
port: z.ZodDefault<z.ZodNumber>;
logLevel: z.ZodDefault<z.ZodNumber>;
logType: z.ZodDefault<z.ZodEnum<["pretty", "json", "hidden"]>>;
}, "strip", z.ZodTypeAny, {
plugins: Record<string, {
path?: string | undefined;
config?: unknown;
}>;
address: string;
port: number;
logLevel: number;
logType: "json" | "pretty" | "hidden";
pluginDir?: string | undefined;
}, {
plugins: Record<string, {
path?: string | undefined;
config?: unknown;
}>;
pluginDir?: string | undefined;
address?: string | undefined;
port?: number | undefined;
logLevel?: number | undefined;
logType?: "json" | "pretty" | "hidden" | undefined;
}>;
/**
* The plugin server configuration
*/
export type Configuration = z.infer<typeof configurationSchema>;
/**
* The plugin server default configuration
*/
export declare const defaultConfiguration: Configuration;
/**
* Call _readConfiguration with the preConfigurationLogger
* and fallback to default configuration.
*/
export declare const readConfigurationFallback: () => TaskEither<string, Configuration>;
/**
* Initializes the plugin server environment based on a given configuration.
*/
export declare const mkPluginServerEnv: (config: Configuration) => TaskEither<string, PluginServerEnv>;