homebridge-prometheus-exporter/src/generated/config_boundary.ts
Lars Strojny 52efa69bf0
Automate code generation for config schema (#16)
Use a fork of https://github.com/lstrojny/json-schema-to-zod to generate
the boundary check for the config automatically.
2022-11-10 13:06:16 +01:00

21 lines
909 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Auto-generated by "code-generation/config-scheme-gen.js", dont manually edit
import { z } from 'zod'
export const ConfigBoundary = z.object({
pin: z.string().regex(new RegExp('^\\d{3}-\\d{2}-\\d{3}$')).describe('Homebridge PIN for service authentication'),
debug: z.boolean().default(false),
prefix: z.string().default('homebridge'),
port: z.number().int().describe('TCP port for the prometheus probe server to listen to').default(36123),
refresh_interval: z.number().int().describe('Discover new services every <interval> seconds').default(60),
request_timeout: z
.number()
.int()
.describe('Request timeout when interacting with homebridge instances')
.default(10),
discovery_timeout: z
.number()
.int()
.describe('Discovery timeout after which the current discovery is considered failed')
.default(20),
})