Files
ipal-kit/dist/modules/env/ipalEnvRules.d.ts
T

45 lines
1.8 KiB
TypeScript

import type { EnvRule } from './assertEnv.js';
type TurnstileNames = {
secretVar?: string;
siteKeyVar?: string;
};
export type IpalEnvFeatures = {
/** Override the database var. Default 'DATABASE_URI'. */
databaseVar?: string;
/** Microsoft Graph e-mail (graphAdapter). Adds the GRAPH_* vars. */
emailGraph?: boolean;
/** Override the Payload secret var. Default 'PAYLOAD_SECRET'. */
secretVar?: string;
/** Override the site-URL var. Default 'NEXT_PUBLIC_SERVER_URL'. */
serverUrlVar?: string;
/** R2 object storage (buildR2Storage). Adds the R2_* vars. */
storage?: boolean;
/**
* Cloudflare Turnstile. true uses the common var names
* (NEXT_PUBLIC_TURNSTILE_SITE_KEY + TURNSTILE_SECRET_KEY); pass an object to
* override either name if your project differs.
*/
turnstile?: boolean | TurnstileNames;
};
/**
* The env schema for a standard ipal-kit deploy, assembled from the features the
* project actually uses — so a site on local-disk storage isn't forced to set
* R2_*, and a site with no forms isn't forced to set Turnstile. Opt-in, not a
* fixed required set (A0: the plugin never demands config a project doesn't use).
*
* Variable names match what the plugin's own modules read (R2_*, GRAPH_*,
* NEXT_PUBLIC_SERVER_URL). DATABASE_URI and PAYLOAD_SECRET are Payload-core.
* Override any name via the options if your project names them differently.
*
* assertEnv(ipalEnvRules({ storage: true, emailGraph: true, turnstile: true }))
*
* Extend with project-specific vars by spreading:
*
* assertEnv([
* ...ipalEnvRules({ storage: true }),
* { name: 'MY_API_KEY', description: 'Third-party integration key' },
* ])
*/
export declare function ipalEnvRules(features?: IpalEnvFeatures): EnvRule[];
export {};