/** * flaps JSON template parser. * * Turns Fly Machines API ("flaps") JSON into the import IR for conversion to * chant TypeScript. Three input shapes are accepted, all mapped to the authoring * surface (the writable fields a user would have declared): * * 1. The #738 serializer plan — `{ : { endpoint, method, body } }`. * `/v1/apps` bodies become `App`s; `.../machines` bodies become `Machine`s. * 2. A machines listing (an array) or an app-with-machines bundle * (`{ ...appFields, machines: [...] }`) — an `App` plus its `Machine`s. * 3. A single machine (`{ name, region, config }`) or a single app * (`{ app_name }` / the `GET /v1/apps/{app}` shape). * * flaps wire field names are mapped back to the authoring surface: an app's * `app_name` becomes the `App`'s `name`, and server-written read-only machine * fields (id, state, instance_id, ...) are dropped so the IR is the declared * shape. `logicalId` is the app/machine name (the generator camelCases it into a * variable). */ import type { TemplateParser, TemplateIR } from "@intentius/chant/import/parser"; import { BaseValueParser } from "@intentius/chant/import/base-parser"; export declare const APP_TYPE = "Fly::Machines::App"; export declare const MACHINE_TYPE = "Fly::Machines::Machine"; /** Server-written read-only machine fields — never part of the authored shape. */ export declare const MACHINE_SERVER_FIELDS: string[]; /** Server-written read-only app fields — never part of the authored shape. */ export declare const APP_SERVER_FIELDS: string[]; export declare class FlyParser extends BaseValueParser implements TemplateParser { protected dispatchIntrinsic(_key: string, _value: unknown, _obj: Record): unknown | null; parse(input: string): TemplateIR; /** Map one serializer-plan request to a resource by its endpoint. */ private resourceFromRequest; private looksLikeApp; /** An `App` resource. flaps `app_name` (create body) or `name` (GET) → `name`. */ private appResource; /** A `Machine` resource, stripped of server-written read-only fields. */ private machineResource; } //# sourceMappingURL=parser.d.ts.map