Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

542 B
Raw Blame
import { FastifyRequest } from 'fastify'

let hooks: FlagsServiceHooks = {
    async modify(params) {
        return params.flags
    },
}

export const flagHooks = {
    set(newHooks: FlagsServiceHooks): void {
        hooks = newHooks
    },

    get(): FlagsServiceHooks {
        return hooks
    },
}

type CreateParams = {
    flags: Record<string, string | boolean | number | Record<string, unknown>>
    request: FastifyRequest
}

export type FlagsServiceHooks = {
    modify(params: CreateParams): Promise<Record<string, unknown>>
}