/** * Azure Resource Manager JSON Schema parser. * * Parses each exploded ARM schema into typed structures suitable for code generation: * resources with properties and attributes, property types from definitions, * and enum types from string enum definitions. * * Key differences from CloudFormation parsing: * - ARM has resource-level fields (name, type, apiVersion, location, sku, kind, * identity, tags, zones, plan) separate from properties.properties * - ARM schemas use oneOf wrappers with expression refs that must be unwrapped * - ARM schemas lack readOnlyProperties — attributes are curated */ import type { DeployScope } 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; apiVersion: string; properties: ParsedProperty[]; attributes: ParsedAttribute[]; resourceLevelFields: string[]; tagging?: { taggable: boolean; tagOnCreate: boolean; tagUpdatable: boolean; }; /** * ARM deployment scopes the schema defines this resource at (#1545). * Absent means the resource came from `resourceDefinitions` only, * i.e. plain resource-group scope. */ deployScopes?: DeployScope[]; } export interface ArmSchemaParseResult { resource: ParsedResource; propertyTypes: ParsedPropertyType[]; enums: ParsedEnum[]; } /** * Property-type definition names that are always emitted as typed interfaces, * regardless of reachability/depth — common nested ARM shapes worth typing for * authoring ergonomics. Kept in sync with the azure `validate` required-names * check (it asserts these survive code generation). (#438) */ export declare const CURATED_PROPERTY_TYPE_DEFS: Set; /** * Parse an ARM schema (exploded per-resource format) into typed structures. */ export declare function parseArmSchema(data: string | Buffer): ArmSchemaParseResult; export declare const constraintsIsEmpty: typeof coreConstraintsIsEmpty; /** * Extract short resource name: * "Microsoft.Storage/storageAccounts" → "storageAccounts" */ export declare function armShortName(typeName: string): string; /** * Extract service name: * "Microsoft.Storage/storageAccounts" → "Storage" */ export declare function armServiceName(typeName: string): string; //# sourceMappingURL=parse.d.ts.map