@magicapply/retool-typebox-client
v2.0.27
Published
Minimal TypeBox client for Retool Workflows with compile-time autocompletion
Downloads
108
Maintainers
Readme
@magicapply/retool-typebox-client
A minimal TypeBox client for Retool Workflows with compile-time autocompletion.
This package implements the two-block workflow described in the docs. Block 1 fetches remote TypeMap syntax and compiles it into JSON Schema; Block 2 consumes the plain payload object to provide fully typed validation helpers.
Installation
npm install @magicapply/retool-typebox-clientBlock 1: fetchAndBuild
const { fetchAndBuildPayload } = require('@magicapply/retool-typebox-client');
// Replace with your schema registry URL
const SCHEMA_REGISTRY_URL = 'https://example.com/api/schemas';
return await fetchAndBuildPayload(SCHEMA_REGISTRY_URL);Block 2: runValidation
// @ts-check
const { createClient } = require('@magicapply/retool-typebox-client');
const payload = /** @type {const} */ (fetchAndBuild.data);
const client = createClient(payload);
// Example
client.assert('example.onboard.user', { id: '1', name: 'Jane', email: '[email protected]' });See AGENTS.md for an overview of the project and AI-CONTEXT.md for more
details on the two-block workflow.
