/** * CloudFormation Registry JSON Schema parser. * * Parses each CFNSchema into typed structures suitable for code generation: * resources with properties and attributes, property types from definitions, * and enum types from string enum definitions. */ import type { CFNSchema } from "./fetch.js"; import { constraintsIsEmpty as coreConstraintsIsEmpty, type PropertyConstraints } from "@intentius/chant/codegen/json-schema"; export type { PropertyConstraints } from "@intentius/chant/codegen/json-schema"; export interface ParsedProperty { name: string; tsType: string; required: boolean; description?: string; enum?: string[]; constraints: PropertyConstraints; } export interface ParsedAttribute { name: string; tsType: string; } export interface ParsedPropertyType { name: string; specType: string; properties: ParsedProperty[]; } export interface ParsedEnum { name: string; values: string[]; } export interface ParsedResource { typeName: string; properties: ParsedProperty[]; attributes: ParsedAttribute[]; createOnly: string[]; writeOnly: string[]; primaryIdentifier: string[]; deprecatedProperties: string[]; /** * The subset of `deprecatedProperties` that no upstream declaration backs. * These names come from {@link DEPRECATION_RE} matching the property * description, so they are an inference rather than a reading. Kept apart so * a consumer can tell the two apart and calibrate what it says (#1701). */ inferredDeprecations: string[]; conditionalCreateOnly: string[]; replacementStrategy?: "delete_then_create" | "create_then_delete"; tagging?: { taggable: boolean; tagOnCreate: boolean; tagUpdatable: boolean; }; } export interface SchemaParseResult { resource: ParsedResource; propertyTypes: ParsedPropertyType[]; enums: ParsedEnum[]; } /** * Parse a CloudFormation Registry JSON Schema into typed structures. */ export declare function parseCFNSchema(data: string | Buffer): SchemaParseResult; export declare const constraintsIsEmpty: typeof coreConstraintsIsEmpty; /** * Extract short resource name: "AWS::S3::Bucket" → "Bucket" */ export declare function cfnShortName(typeName: string): string; /** * Extract service name: "AWS::S3::Bucket" → "S3" */ export declare function cfnServiceName(typeName: string): string; /** * Flatten a CloudFormation Registry JSON pointer to the property path a * template expresses, `/`-joined. * * Three shapes occur upstream. `/properties/BucketName` is the plain one. * A pointer can re-enter the `properties` keyword mid-path * (`/properties/DistributionConfig/properties/S3Origin`), which a template * never writes. And a pointer can be scoped to a shared definition * (`/definitions/ContinuousDeploymentPolicyConfig/properties/Type`), which a * template expresses only through whichever property carries that definition. * * Array positions stay as `*`. `readOnlyProperties` attribute names are * generated from this output, so dropping the wildcard would rename them. */ export declare function stripPointerPath(path: string, schema?: CFNSchema): string; //# sourceMappingURL=parse.d.ts.map