/* eslint-disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ export interface PlatformaticServiceConfig { basePath?: string; server?: { hostname?: string; port?: number | string; pluginTimeout?: number; healthCheck?: | boolean | { enabled?: boolean; interval?: number; [k: string]: unknown; }; ignoreTrailingSlash?: boolean; ignoreDuplicateSlashes?: boolean; connectionTimeout?: number; keepAliveTimeout?: number; maxRequestsPerSocket?: number; forceCloseConnections?: boolean | string; requestTimeout?: number; bodyLimit?: number; maxParamLength?: number; disableRequestLogging?: boolean; exposeHeadRoutes?: boolean; logger?: | boolean | { level?: ( | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent") | { [k: string]: unknown; } ) & string; transport?: | { target?: string; options?: { [k: string]: unknown; }; } | { targets?: { target?: string; options?: { [k: string]: unknown; }; level?: string; }[]; options?: { [k: string]: unknown; }; }; pipeline?: { target?: string; options?: { [k: string]: unknown; }; }; formatters?: { path: string; }; timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime"; redact?: { paths: string[]; censor?: string; }; base?: { [k: string]: unknown; } | null; messageKey?: string; customLevels?: { [k: string]: unknown; }; openTelemetryExporter?: { protocol: "grpc" | "http"; url: string; }; [k: string]: unknown; }; loggerInstance?: { [k: string]: unknown; }; serializerOpts?: { schema?: { [k: string]: unknown; }; ajv?: { [k: string]: unknown; }; rounding?: "floor" | "ceil" | "round" | "trunc"; debugMode?: boolean; mode?: "debug" | "standalone"; largeArraySize?: number | string; largeArrayMechanism?: "default" | "json-stringify"; [k: string]: unknown; }; /** * Options for the Fastify request-validation Ajv instance (the Fastify `ajv` server option). Only `customOptions` is configurable from the config file; for example set `customOptions.coerceTypes` to `false` to reject empty strings on fields that allow the `null` type instead of coercing them to `null`. */ ajv?: { customOptions?: { [k: string]: unknown; }; }; caseSensitive?: boolean; requestIdHeader?: string | false; requestIdLogLabel?: string; jsonShorthand?: boolean; trustProxy?: boolean | string | string[] | number; http2?: boolean; https?: { allowHTTP1?: boolean; key: | string | { path?: string; } | ( | string | { path?: string; } )[]; cert: | string | { path?: string; } | ( | string | { path?: string; } )[]; requestCert?: boolean; rejectUnauthorized?: boolean; }; cors?: { origin?: | boolean | string | ( | string | { regexp: string; [k: string]: unknown; } )[] | { regexp: string; [k: string]: unknown; }; methods?: string[]; /** * Comma separated string of allowed headers. */ allowedHeaders?: string; exposedHeaders?: string[] | string; credentials?: boolean; maxAge?: number; preflightContinue?: boolean; optionsSuccessStatus?: number; preflight?: boolean; strictPreflight?: boolean; hideOptionsRoute?: boolean; }; /** * Path to a file or name of a package whose default export is a Fastify error handler. It is installed on the root instance before any route is registered, so it also covers the routes registered by the capability itself, such as the auto generated CRUD routes of @platformatic/db. Plugins can still override it for their own encapsulation context. */ errorHandler?: string; }; plugins?: { [k: string]: unknown; }; telemetry?: { enabled?: boolean | string; /** * The name of the application. Defaults to the folder name if not specified. */ applicationName: string; /** * The version of the application (optional) */ version?: string; /** * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced. */ skip?: { /** * The path to skip. Can be a string or a regex. */ path?: string; /** * HTTP method to skip */ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS"; [k: string]: unknown; }[]; exporter?: | { type?: "console" | "otlp" | "zipkin" | "memory" | "file"; /** * Options for the exporter. These are passed directly to the exporter. */ options?: { /** * The URL to send the traces to. Not used for console or memory exporters. */ url?: string; /** * Headers to send to the exporter. Not used for console or memory exporters. */ headers?: { [k: string]: unknown; }; /** * The path to write the traces to. Only for file exporter. */ path?: string; /** * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http. */ protocol?: "http" | "grpc"; /** * Alias for protocol. Only for the otlp exporter. Defaults to http. */ transport?: "http" | "grpc"; [k: string]: unknown; }; additionalProperties?: never; [k: string]: unknown; }[] | { type?: "console" | "otlp" | "zipkin" | "memory" | "file"; /** * Options for the exporter. These are passed directly to the exporter. */ options?: { /** * The URL to send the traces to. Not used for console or memory exporters. */ url?: string; /** * Headers to send to the exporter. Not used for console or memory exporters. */ headers?: { [k: string]: unknown; }; /** * The path to write the traces to. Only for file exporter. */ path?: string; /** * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http. */ protocol?: "http" | "grpc"; /** * Alias for protocol. Only for the otlp exporter. Defaults to http. */ transport?: "http" | "grpc"; [k: string]: unknown; }; additionalProperties?: never; [k: string]: unknown; }; /** * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level. */ diagLogger?: boolean | string; }; watch?: | { enabled?: boolean | string; /** * @minItems 1 */ allow?: [string, ...string[]]; ignore?: string[]; } | boolean | string; $schema?: string; module?: string; application?: {}; service?: { openapi?: | { info?: Info; jsonSchemaDialect?: string; servers?: Server[]; paths?: Paths; webhooks?: { [k: string]: PathItemOrReference; }; components?: Components; security?: SecurityRequirement[]; tags?: Tag[]; externalDocs?: ExternalDocumentation; /** * Base URL for the OpenAPI Swagger Documentation */ swaggerPrefix?: string; /** * Serve the interactive API reference UI under the documentation prefix. The JSON and YAML spec routes are always served. */ ui?: boolean; /** * Path to an OpenAPI spec file */ path?: string; } | boolean; graphql?: | { graphiql?: boolean; } | boolean; proxy?: | false | { upstream?: string; prefix?: string; hostname?: string; ws?: { upstream?: string; reconnect?: { pingInterval?: number; maxReconnectionRetries?: number; reconnectInterval?: number; reconnectDecay?: number; connectionTimeout?: number; reconnectOnClose?: boolean; logs?: boolean; [k: string]: unknown; }; hooks?: { path: string; }; }; }; }; runtime?: { preload?: string | string[]; extensions?: | string | { path: string; options?: { [k: string]: unknown; }; build?: boolean; } | ( | string | { path: string; options?: { [k: string]: unknown; }; build?: boolean; } )[]; basePath?: string; services?: { [k: string]: unknown; }[]; workers?: | number | string | { static?: number; dynamic?: boolean; minimum?: number; maximum?: number; total?: number; maxMemory?: number; cooldown?: number; gracePeriod?: number; scaleUpELU?: number; scaleDownELU?: number; [k: string]: unknown; }; workersRestartDelay?: number | string; logger?: { level?: ( | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent") | { [k: string]: unknown; } ) & string; transport?: | { target?: string; options?: { [k: string]: unknown; }; } | { targets?: { target?: string; options?: { [k: string]: unknown; }; level?: string; }[]; options?: { [k: string]: unknown; }; }; pipeline?: { target?: string; options?: { [k: string]: unknown; }; }; formatters?: { path: string; }; timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime"; redact?: { paths: string[]; censor?: string; }; base?: { [k: string]: unknown; } | null; messageKey?: string; customLevels?: { [k: string]: unknown; }; openTelemetryExporter?: { protocol: "grpc" | "http"; url: string; }; [k: string]: unknown; }; server?: { hostname?: string; port?: number | string; /** * Configures how entrypoint server worker ports are assigned. When set to shared, all workers listen on the same port. When set to perWorkerIncrement, each worker will use its own port, starting from port (worker 0). */ portAssignment?: "shared" | "perWorkerIncrement"; /** * The maximum length of the queue of pending connections */ backlog?: number; http2?: boolean; https?: { allowHTTP1?: boolean; key: | string | { path?: string; } | ( | string | { path?: string; } )[]; cert: | string | { path?: string; } | ( | string | { path?: string; } )[]; requestCert?: boolean; rejectUnauthorized?: boolean; }; }; reuseTcpPorts?: boolean; startTimeout?: number; restartOnError?: boolean | number; exitOnUnhandledErrors?: boolean | number; gracefulShutdown?: { runtime: number | string; application: number | string; /** * Add Connection: close header to HTTP responses during graceful shutdown */ closeConnections?: boolean; }; health?: { enabled?: boolean | string; interval?: number | string; gracePeriod?: number | string; maxUnhealthyChecks?: number | string; maxELU?: number | string; maxEventLoopDelay?: number | string; maxEventLoopDelayP99?: number | string; maxHeapUsed?: number | string; maxHeapTotal?: number | string; maxYoungGeneration?: number | string; codeRangeSize?: number | string; bufferPoolSize?: number | string; defaultHighWaterMark?: number | string; }; healthProbes?: | boolean | string | { enabled?: boolean | string; hostname?: string; port?: number | string; readiness?: | boolean | { endpoint?: string; success?: { statusCode?: number; body?: string; }; fail?: { statusCode?: number; body?: string; }; }; liveness?: | boolean | { endpoint?: string; success?: { statusCode?: number; body?: string; }; fail?: { statusCode?: number; body?: string; }; }; }; undici?: { agentOptions?: { [k: string]: unknown; }; interceptors?: | { module: string; options: { [k: string]: unknown; }; [k: string]: unknown; }[] | { Client?: { module: string; options: { [k: string]: unknown; }; [k: string]: unknown; }[]; Pool?: { module: string; options: { [k: string]: unknown; }; [k: string]: unknown; }[]; Agent?: { module: string; options: { [k: string]: unknown; }; [k: string]: unknown; }[]; [k: string]: unknown; }; [k: string]: unknown; }; httpCache?: | boolean | { store?: string; /** * @minItems 1 */ methods?: [string, ...string[]]; cacheTagsHeader?: string; maxSize?: number; maxEntrySize?: number; maxCount?: number; /** * Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., "/https:\\/\\/.*\\.example\\.com/"). */ origins?: string[]; /** * Default cache duration in seconds for responses without explicit expiration headers. */ cacheByDefault?: number; /** * Cache type. "shared" caches may be shared between users, "private" caches are user-specific. */ type?: "shared" | "private"; [k: string]: unknown; }; watch?: boolean | string; managementApi?: | boolean | string | { logs?: { maxSize?: number; }; /** * Custom path for the control socket. If not specified, uses the default platform-specific location. */ socket?: string; }; management?: | boolean | { enabled?: boolean; operations?: string[]; }; metrics?: | boolean | { port?: number | string; enabled?: boolean | string; hostname?: string; endpoint?: string; https?: { allowHTTP1?: boolean; key: | string | { path?: string; } | ( | string | { path?: string; } )[]; cert: | string | { path?: string; } | ( | string | { path?: string; } )[]; requestCert?: boolean; rejectUnauthorized?: boolean; }; auth?: { username: string; password: string; }; labels?: { [k: string]: string; }; /** * The label name to use for the application identifier in metrics (e.g., applicationId, serviceId) */ applicationLabel?: string; /** * Enable outgoing HTTP client request duration metrics */ httpClientMetrics?: boolean | string; readiness?: | boolean | { endpoint?: string; success?: { statusCode?: number; body?: string; }; fail?: { statusCode?: number; body?: string; }; }; liveness?: | boolean | { endpoint?: string; success?: { statusCode?: number; body?: string; }; fail?: { statusCode?: number; body?: string; }; }; /** * @deprecated * Deprecated. Health probe timeout configuration is no longer used. */ healthChecksTimeouts?: number | string; plugins?: string[]; timeout?: number | string; /** * Configuration for exporting metrics to an OTLP endpoint */ otlpExporter?: { /** * Enable or disable OTLP metrics export */ enabled?: boolean | string; /** * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics) */ endpoint: string; /** * Interval in milliseconds between metric pushes */ interval?: number | string; /** * Additional HTTP headers for authentication */ headers?: { [k: string]: string; }; /** * Service name for OTLP resource attributes */ serviceName?: string; /** * Service version for OTLP resource attributes */ serviceVersion?: string; }; /** * Configuration for forwarding user OpenTelemetry metrics to an OTLP endpoint */ opentelemetry?: { /** * Enable or disable OpenTelemetry metrics forwarding */ enabled?: boolean | string; /** * OTLP metrics endpoint URL (e.g., http://collector:4318/v1/metrics) */ endpoint: string; /** * Interval in milliseconds between metric forwards */ interval?: number | string; /** * Additional HTTP headers for authentication */ headers?: { [k: string]: string; }; }; /** * Custom labels to add to HTTP metrics (http_request_all_duration_seconds). Each label extracts its value from an HTTP request header. */ httpCustomLabels?: { /** * The label name to use in metrics */ name: string; /** * The HTTP request header to extract the value from */ header: string; /** * Default value when header is missing (defaults to "unknown") */ default?: string; }[]; }; telemetry?: { enabled?: boolean | string; /** * The name of the application. Defaults to the folder name if not specified. */ applicationName: string; /** * The version of the application (optional) */ version?: string; /** * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced. */ skip?: { /** * The path to skip. Can be a string or a regex. */ path?: string; /** * HTTP method to skip */ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS"; [k: string]: unknown; }[]; exporter?: | { type?: "console" | "otlp" | "zipkin" | "memory" | "file"; /** * Options for the exporter. These are passed directly to the exporter. */ options?: { /** * The URL to send the traces to. Not used for console or memory exporters. */ url?: string; /** * Headers to send to the exporter. Not used for console or memory exporters. */ headers?: { [k: string]: unknown; }; /** * The path to write the traces to. Only for file exporter. */ path?: string; /** * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http. */ protocol?: "http" | "grpc"; /** * Alias for protocol. Only for the otlp exporter. Defaults to http. */ transport?: "http" | "grpc"; [k: string]: unknown; }; additionalProperties?: never; [k: string]: unknown; }[] | { type?: "console" | "otlp" | "zipkin" | "memory" | "file"; /** * Options for the exporter. These are passed directly to the exporter. */ options?: { /** * The URL to send the traces to. Not used for console or memory exporters. */ url?: string; /** * Headers to send to the exporter. Not used for console or memory exporters. */ headers?: { [k: string]: unknown; }; /** * The path to write the traces to. Only for file exporter. */ path?: string; /** * The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http. */ protocol?: "http" | "grpc"; /** * Alias for protocol. Only for the otlp exporter. Defaults to http. */ transport?: "http" | "grpc"; [k: string]: unknown; }; additionalProperties?: never; [k: string]: unknown; }; /** * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level. */ diagLogger?: boolean | string; }; verticalScaler?: { enabled?: boolean; maxTotalWorkers?: number; maxTotalMemory?: number; minWorkers?: number; maxWorkers?: number; cooldownSec?: number; gracePeriod?: number; scaleUpELU?: number; scaleDownELU?: number; /** * @deprecated */ timeWindowSec?: number; /** * @deprecated */ scaleDownTimeWindowSec?: number; /** * @deprecated */ scaleIntervalSec?: number; }; inspectorOptions?: { host?: string; port?: number; breakFirstLine?: boolean; watchDisabled?: boolean; [k: string]: unknown; }; applicationTimeout?: number | string; startupConcurrency?: number | string; messagingTimeout?: number | string; env?: { [k: string]: string; }; envfile?: string; /** * When set to true, the configuration loading fails if a {PLT_*} placeholder references an environment variable which is not set. When set to "warn", a warning listing the missing variables is logged but the placeholders are still replaced with an empty string. Defaults to false. */ strictEnv?: boolean | string; sourceMaps?: boolean; nodeModulesSourceMaps?: string[]; scheduler?: { enabled?: boolean | string; name: string; cron: string; callbackUrl: string; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; headers?: { [k: string]: string; }; body?: | string | { [k: string]: unknown; }; maxRetries?: number; [k: string]: unknown; }[]; policies?: { deny: { /** * This interface was referenced by `undefined`'s JSON-Schema definition * via the `patternProperty` "^.*$". */ [k: string]: string | [string, ...string[]]; }; }; compileCache?: | boolean | { /** * Enable Node.js module compile cache for faster startup */ enabled?: boolean; /** * Directory to store compile cache. Defaults to .plt/compile-cache in app root */ directory?: string; }; application?: { reuseTcpPorts?: boolean; workers?: | number | string | { static?: number; minimum?: number; maximum?: number; scaleUpELU?: number; scaleDownELU?: number; [k: string]: unknown; }; health?: { enabled?: boolean | string; interval?: number | string; gracePeriod?: number | string; maxUnhealthyChecks?: number | string; maxELU?: number | string; maxEventLoopDelay?: number | string; maxEventLoopDelayP99?: number | string; maxHeapUsed?: number | string; maxHeapTotal?: number | string; maxYoungGeneration?: number | string; codeRangeSize?: number | string; bufferPoolSize?: number | string; defaultHighWaterMark?: number | string; }; /** * Overrides the runtime-level restartOnError for this application. Set to false or 0 to never restart the application when it crashes, a positive number to wait that amount of milliseconds between restarts, or true to use the default delay. */ restartOnError?: boolean | number; arguments?: string[]; env?: { [k: string]: string; }; envfile?: string; sourceMaps?: boolean; nodeModulesSourceMaps?: string[]; packageManager?: "npm" | "pnpm" | "yarn"; preload?: string | string[]; nodeOptions?: string; execArgv?: string[]; permissions?: { fs?: { read?: string[]; write?: string[]; }; }; telemetry?: { /** * An array of instrumentations loaded if telemetry is enabled */ instrumentations?: ( | string | { package: string; exportName?: string; options?: { [k: string]: unknown; }; [k: string]: unknown; } )[]; [k: string]: unknown; }; compileCache?: | boolean | { /** * Enable Node.js module compile cache for faster startup */ enabled?: boolean; /** * Directory to store compile cache. Defaults to .plt/compile-cache in app root */ directory?: string; }; }; }; } export interface Info { title: string; summary?: string; description?: string; termsOfService?: string; contact?: Contact; license?: License; version: string; /** * This interface was referenced by `Info`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface Contact { name?: string; url?: string; email?: string; /** * This interface was referenced by `Contact`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface License { name: string; identifier?: string; url?: string; /** * This interface was referenced by `License`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface Server { url: string; description?: string; variables?: { [k: string]: ServerVariable; }; /** * This interface was referenced by `Server`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface ServerVariable { /** * @minItems 1 */ enum?: [string, ...string[]]; default: string; description?: string; /** * This interface was referenced by `ServerVariable`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface Paths { [k: string]: PathItem; } /** * This interface was referenced by `Paths`'s JSON-Schema definition * via the `patternProperty` "^/". */ export interface PathItem { summary?: string; description?: string; servers?: Server[]; parameters?: ParameterOrReference[]; get?: Operation; put?: Operation1; post?: Operation1; delete?: Operation1; options?: Operation1; head?: Operation1; patch?: Operation1; trace?: Operation1; /** * This interface was referenced by `PathItem`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface ParameterOrReference { [k: string]: unknown; } export interface Operation { tags?: string[]; summary?: string; description?: string; externalDocs?: ExternalDocumentation; operationId?: string; parameters?: ParameterOrReference[]; requestBody?: RequestBodyOrReference; responses?: Responses; callbacks?: { [k: string]: CallbacksOrReference; }; security?: SecurityRequirement[]; servers?: Server[]; /** * This interface was referenced by `Operation`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface ExternalDocumentation { description?: string; url: string; /** * This interface was referenced by `ExternalDocumentation`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface RequestBodyOrReference { [k: string]: unknown; } export interface Responses { [k: string]: ResponseOrReference; } export interface ResponseOrReference { [k: string]: unknown; } export interface CallbacksOrReference { [k: string]: unknown; } export interface SecurityRequirement { [k: string]: string[]; } export interface Operation1 { tags?: string[]; summary?: string; description?: string; externalDocs?: ExternalDocumentation; operationId?: string; parameters?: ParameterOrReference[]; requestBody?: RequestBodyOrReference; responses?: Responses; callbacks?: { [k: string]: CallbacksOrReference; }; security?: SecurityRequirement[]; servers?: Server[]; /** * This interface was referenced by `Operation1`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface PathItemOrReference { [k: string]: unknown; } export interface Components { schemas?: { [k: string]: unknown; }; responses?: { [k: string]: ResponseOrReference; }; parameters?: { [k: string]: ParameterOrReference; }; examples?: { [k: string]: ExampleOrReference; }; requestBodies?: { [k: string]: RequestBodyOrReference; }; headers?: { [k: string]: HeaderOrReference; }; securitySchemes?: { [k: string]: SecuritySchemeOrReference; }; links?: { [k: string]: LinkOrReference; }; callbacks?: { [k: string]: CallbacksOrReference; }; pathItems?: { [k: string]: PathItemOrReference; }; /** * This interface was referenced by `Components`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; } export interface ExampleOrReference { [k: string]: unknown; } export interface HeaderOrReference { [k: string]: unknown; } export interface SecuritySchemeOrReference { [k: string]: unknown; } export interface LinkOrReference { [k: string]: unknown; } export interface Tag { name: string; description?: string; externalDocs?: ExternalDocumentation; /** * This interface was referenced by `Tag`'s JSON-Schema definition * via the `patternProperty` "^x-". */ [k: string]: unknown; }