@aws/nx-plugin 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-THIRD-PARTY +11686 -23398
- package/README.md +18 -0
- package/generators.json +7 -0
- package/migrations.json +34 -1
- package/package.json +6 -6
- package/src/agentcore-gateway/schema.json +1 -0
- package/src/agentcore-harness/generator.d.ts +1 -1
- package/src/connection/scaffold-catalog.d.ts +4 -0
- package/src/connection/scaffold-catalog.js +3 -6
- package/src/connection/scaffold-catalog.js.map +1 -1
- package/src/infra/app/generator.d.ts +1 -1
- package/src/init/generator.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +2 -1
- package/src/mcp-server/guide-pipeline.js +6 -0
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.d.ts +7 -0
- package/src/mcp-server/mdx-ast.js +15 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/schema-registry.d.ts +2 -2
- package/src/mcp-server/schema-registry.js +2 -2
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/open-api/py-client/__snapshots__/generator.additional-properties.spec.ts.snap +34 -0
- package/src/open-api/py-client/__snapshots__/generator.arrays.spec.ts.snap +1750 -0
- package/src/open-api/py-client/__snapshots__/generator.complex-types.spec.ts.snap +82 -0
- package/src/open-api/py-client/__snapshots__/generator.composite-types.spec.ts.snap +447 -0
- package/src/open-api/py-client/__snapshots__/generator.duplicate-types.spec.ts.snap +404 -0
- package/src/open-api/py-client/__snapshots__/generator.errors.spec.ts.snap +430 -0
- package/src/open-api/py-client/__snapshots__/generator.fast-api.spec.ts.snap +447 -0
- package/src/open-api/py-client/__snapshots__/generator.petstore.spec.ts.snap +3488 -0
- package/src/open-api/py-client/__snapshots__/generator.primitive-types.spec.ts.snap +1444 -0
- package/src/open-api/py-client/__snapshots__/generator.request.spec.ts.snap +390 -0
- package/src/open-api/py-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +364 -0
- package/src/open-api/py-client/__snapshots__/generator.response.spec.ts.snap +739 -0
- package/src/open-api/py-client/__snapshots__/generator.streaming.spec.ts.snap +384 -0
- package/src/open-api/py-client/__snapshots__/generator.tags.spec.ts.snap +414 -0
- package/src/open-api/py-client/files/client/__clientModuleName__.py.template +1076 -0
- package/src/open-api/py-client/files/shared/__init__.py.template +28 -0
- package/src/open-api/py-client/files/shared/errors.py.template +37 -0
- package/src/open-api/py-client/files/shared/types.py.template +319 -0
- package/src/open-api/py-client/generator.d.ts +53 -0
- package/src/open-api/py-client/generator.js +119 -0
- package/src/open-api/py-client/generator.js.map +1 -0
- package/src/open-api/py-client/schema.d.js +6 -0
- package/src/open-api/py-client/schema.d.js.map +1 -0
- package/src/open-api/py-client/schema.d.ts +12 -0
- package/src/open-api/py-client/schema.json +28 -0
- package/src/open-api/py-client/vessel-registry-spec.json +2716 -0
- package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +274 -0
- package/src/open-api/ts-client/petstore-spec.d.ts +6 -0
- package/src/open-api/ts-client/petstore-spec.js +1275 -0
- package/src/open-api/ts-client/petstore-spec.js.map +1 -0
- package/src/open-api/ts-hooks/generator.spec.tsx +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +68 -2
- package/src/open-api/utils/codegen-data/languages.js +433 -21
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data/types.d.ts +187 -0
- package/src/open-api/utils/codegen-data/types.js +10 -1
- package/src/open-api/utils/codegen-data/types.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +40 -1
- package/src/open-api/utils/codegen-data.js +622 -17
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.js +175 -41
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parser.js +1 -1
- package/src/open-api/utils/parser.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/preset/generator.d.ts +1 -1
- package/src/py/agent/gateway-connection/generator.js +0 -3
- package/src/py/agent/gateway-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/generator.d.ts +1 -1
- package/src/py/agent/schema.json +2 -0
- package/src/py/fast-api/react/generator.d.ts +1 -1
- package/src/py/mcp-server/schema.json +1 -0
- package/src/sdk/open-api.d.ts +2 -0
- package/src/sdk/open-api.js +1 -0
- package/src/sdk/open-api.js.map +1 -1
- package/src/smithy/project/generator.d.ts +1 -1
- package/src/smithy/react-connection/generator.d.ts +1 -1
- package/src/terraform/project/generator.d.ts +1 -1
- package/src/trpc/react/generator.d.ts +1 -1
- package/src/ts/agent/a2a-connection/generator.d.ts +1 -1
- package/src/ts/agent/gateway-connection/generator.d.ts +1 -1
- package/src/ts/agent/gateway-connection/generator.js +0 -3
- package/src/ts/agent/gateway-connection/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/generator.d.ts +1 -1
- package/src/ts/agent/react-connection/generator.d.ts +1 -1
- package/src/ts/agent/schema.json +1 -0
- package/src/ts/api/schema.json +2 -0
- package/src/ts/astro-docs/generator.d.ts +1 -1
- package/src/ts/dcr-proxy/generator.d.ts +1 -1
- package/src/ts/dynamodb/generator.d.ts +1 -1
- package/src/ts/lambda-function/generator.d.ts +1 -1
- package/src/ts/lib/generator.d.ts +1 -1
- package/src/ts/mcp-server/schema.json +1 -0
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/nx-generator/files/nx-plugin-for-aws/generator/generator.spec.ts.template +1 -1
- package/src/ts/nx-generator/generator.d.ts +1 -1
- package/src/ts/nx-migration/generator.d.ts +1 -1
- package/src/ts/nx-plugin/generator.d.ts +1 -1
- package/src/ts/rdb/generator.d.ts +1 -1
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +10 -10
- package/src/ts/react-website/app/schema.json +1 -0
- package/src/ts/website/app/schema.json +1 -0
- package/src/utils/metrics-assertions.d.ts +18 -0
- package/src/utils/metrics-assertions.js +42 -0
- package/src/utils/metrics-assertions.js.map +1 -0
- package/src/utils/test/python-dependencies.d.ts +8 -0
- package/src/utils/test/python-dependencies.js +14 -0
- package/src/utils/test/python-dependencies.js.map +1 -0
- package/src/utils/test/python-worker/worker.py +703 -0
- package/src/utils/test/warm-python-cache.d.ts +18 -0
- package/src/utils/test/warm-python-cache.js +46 -0
- package/src/utils/test/warm-python-cache.js.map +1 -0
- package/src/utils/versions.d.ts +10 -9
- package/src/utils/versions.js +9 -8
- package/src/utils/versions.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/open-api/utils/parser.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport camelCase from 'lodash.camelcase';\nimport trim from 'lodash.trim';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport {\n type ClientData,\n COLLECTION_TYPES,\n COMPOSED_SCHEMA_TYPES,\n createModel,\n DEFAULT_SERVICE_NAME,\n type Discriminator,\n type DiscriminatorMapping,\n type EnumMember,\n indexModelsByName,\n type Model,\n type ModelExport,\n type ModelIn,\n type ModelsByName,\n type Operation,\n PRIMITIVE_TYPES,\n type Service,\n} from './codegen-data/types.js';\nimport { isRef, resolveIfRef, splitRef } from './refs.js';\nimport type {\n OpenApiSchemaOrRef,\n OpenApiSchema as Schema,\n Spec,\n} from './types.js';\n\n/**\n * OpenAPI primitive `type` values mapped to the internal model `type`.\n */\nconst PRIMITIVE_TYPE_MAP: { [openApiType: string]: string } = {\n string: 'string',\n number: 'number',\n integer: 'number',\n boolean: 'boolean',\n null: 'null',\n};\n\nconst HTTP_METHODS = [\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n] as const;\n\ntype HttpMethod = (typeof HTTP_METHODS)[number];\n\ntype SchemaOrRef = Schema | OpenAPIV3.ReferenceObject;\n\ntype ParameterOrRef = OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject;\n\nconst schemaType = (schema: Schema): string | string[] | undefined =>\n (schema as { type?: string | string[] }).type;\n\nconst isNullable = (schema: Schema): boolean => {\n const type = schemaType(schema);\n return (\n schema.nullable === true ||\n type === 'null' ||\n (Array.isArray(type) && type.includes('null'))\n );\n};\n\n/**\n * The \"primary\" type of a schema, ignoring 'null' in a 3.1 type array.\n */\nconst primaryType = (schema: Schema): string | undefined => {\n const type = schemaType(schema);\n return Array.isArray(type) ? type.find((t) => t !== 'null') : type;\n};\n\nconst isEnumSchema = (schema: Schema): boolean =>\n Array.isArray(schema.enum) && schema.enum.length > 0;\n\nconst compositeExport = (schema: Schema): ModelExport | undefined => {\n if (schema.allOf) return 'all-of';\n if (schema.anyOf) return 'any-of';\n if (schema.oneOf) return 'one-of';\n return undefined;\n};\n\nconst compositeMembers = (schema: Schema): SchemaOrRef[] =>\n (schema.allOf ?? schema.anyOf ?? schema.oneOf ?? []) as SchemaOrRef[];\n\n/**\n * A schema is a \"dictionary\" (map) when it is an object with no explicit\n * properties (it may have `additionalProperties`, or be a bare `object`).\n */\nconst isDictionarySchema = (schema: Schema): boolean => {\n if (primaryType(schema) !== 'object') return false;\n if (compositeExport(schema) || isEnumSchema(schema)) return false;\n const hasProperties = Object.keys(schema.properties ?? {}).length > 0;\n return !hasProperties && !schema.patternProperties;\n};\n\n/**\n * The internal primitive type name for a primitive schema. A `string` field\n * denotes raw binary content (rendered as a `Blob`) only via `format: binary`.\n * The 3.1 `contentMediaType` idiom is ambiguous in isolation — FastAPI emits it\n * both for multipart file fields (binary) and for `bytes` in a JSON body\n * (base64 string) — so `normalise` rewrites it to `format: binary` for form\n * bodies only, and this stays context-free.\n */\nconst primitiveType = (schema: Schema): string => {\n const type = primaryType(schema);\n if (type === 'string' && schema.format === 'binary') return 'binary';\n return (type && PRIMITIVE_TYPE_MAP[type]) ?? 'unknown';\n};\n\n/**\n * Prefer application/json, falling back to the first declared media type.\n */\nconst preferredMediaType = (content: { [media: string]: unknown }): string =>\n 'application/json' in content ? 'application/json' : Object.keys(content)[0];\n\nconst parseResponseCode = (code: string): number | string =>\n /^\\d+$/.test(code) ? parseInt(code, 10) : code;\n\n/**\n * The unique imports declared across a set of models, in first-seen order.\n */\nconst collectImports = (models: Model[]): string[] => [\n ...new Set(models.flatMap((m) => m.imports)),\n];\n\n/**\n * The structural fields (export/type/link/properties/enum/imports/format) a\n * schema contributes to a model.\n */\nconst schemaStructure = (spec: Spec, schema: Schema): Partial<Model> => {\n // A null member (3.0 nullable enums list null as a value) marks the model\n // nullable rather than becoming a literal. An enum of only null degrades to\n // a plain (nullable) schema.\n const enumMembers = (schema.enum ?? []).filter((value) => value !== null);\n if (isEnumSchema(schema) && enumMembers.length > 0) {\n // A string (or untyped) enum renders as a literal union; a boolean/number\n // enum renders as its bare primitive, so it must carry the declared type.\n const declared = primaryType(schema);\n return {\n export: 'enum',\n type: (declared && PRIMITIVE_TYPE_MAP[declared]) ?? 'string',\n enum: enumMembers.map(\n (value): EnumMember => ({ value: value as EnumMember['value'] }),\n ),\n ...(enumMembers.length < schema.enum!.length ? { isNullable: true } : {}),\n };\n }\n\n const composite = compositeExport(schema);\n if (composite) {\n const properties = compositeMembers(schema).map((member) =>\n buildInlineModel(spec, member),\n );\n return {\n export: composite,\n type: 'unknown',\n properties,\n imports: collectImports(properties),\n };\n }\n\n const type = primaryType(schema);\n\n if (type === 'array') {\n // A fixed-length tuple (3.1 `prefixItems`, as emitted by Pydantic for\n // `tuple[A, B]`) models each element positionally in `properties`. An open\n // tuple (additional `items` beyond the prefix) degrades to a plain array.\n const prefixItems = (schema as { prefixItems?: SchemaOrRef[] }).prefixItems;\n const items = (schema as { items?: SchemaOrRef }).items;\n if (prefixItems && prefixItems.length > 0 && !items) {\n const properties = prefixItems.map((member) =>\n buildInlineModel(spec, member),\n );\n return {\n export: 'tuple',\n type: 'unknown',\n properties,\n imports: collectImports(properties),\n };\n }\n return { export: 'array', ...collectionValue(spec, items) };\n }\n\n // Recorded whether or not this schema declares the properties it names: an\n // `allOf` member may raise a sibling branch's property to mandatory, and a\n // composite has to be able to tell that apart from an empty member.\n const declaredRequired = schema.required ?? [];\n\n if (isDictionarySchema(schema)) {\n return {\n export: 'dictionary',\n declaredRequired,\n ...dictionaryValue(spec, schema),\n };\n }\n\n if (type === 'object' || schema.properties || schema.patternProperties) {\n const properties = buildProperties(spec, schema);\n return {\n export: 'interface',\n type: 'unknown',\n properties,\n declaredRequired,\n imports: collectImports(properties),\n };\n }\n\n // A schema with no type (e.g. `{}`) is an untyped object.\n if (type === undefined) {\n return { export: 'interface', type: 'unknown', declaredRequired };\n }\n\n return {\n export: 'generic',\n type: primitiveType(schema),\n ...(schema.format ? { format: schema.format } : {}),\n };\n};\n\n/**\n * The value type of a collection (array items / dictionary values): a `type`,\n * `link` and `imports`.\n *\n * - ref value → `type` is the referenced model name; `link` is left null and\n * resolved later by `linkModels`.\n * - non-ref value → a `link` model carrying the (innermost) type and imports.\n */\nconst collectionValue = (\n spec: Spec,\n value: SchemaOrRef | undefined,\n): Partial<Model> => {\n if (value && isRef(value)) {\n const type = splitRef(value.$ref)[2];\n return { type, imports: [type], link: null };\n }\n const link = createModel(schemaStructure(spec, (value ?? {}) as Schema));\n return { link, type: link.type, imports: [...link.imports] };\n};\n\n/**\n * The value type of a dictionary (map).\n */\nconst dictionaryValue = (spec: Spec, schema: Schema): Partial<Model> => {\n const additional = schema.additionalProperties;\n if (additional && additional !== true) {\n return collectionValue(spec, additional);\n }\n if (schema.properties && additional !== true) {\n // An object with an (empty) `properties` map but no additionalProperties\n // renders as `{}`.\n return { type: 'unknown', link: null };\n }\n // `additionalProperties: true`, or a bare `{ type: 'object' }` → an \"any\"\n // value type.\n return {\n type: 'unknown',\n link: createModel({ export: 'interface', type: 'unknown' }),\n };\n};\n\n/**\n * A model for an inline sub-schema (property value, array item, dictionary\n * value, composite member, parameter, or response).\n */\nexport const buildInlineModel = (\n spec: Spec,\n schemaOrRef: SchemaOrRef,\n): Model => {\n if (isRef(schemaOrRef)) {\n const name = splitRef(schemaOrRef.$ref)[2];\n // `nullable` beside a `$ref` describes this use of the schema, not the schema\n // itself. OpenAPI 3.0 ignores a `$ref`'s siblings, but normalisation puts it\n // here when it hoists a nullable inline schema — dropping it made a required\n // nullable object property non-nullable.\n return createModel({\n export: 'reference',\n type: name,\n imports: [name],\n ...((schemaOrRef as { nullable?: boolean }).nullable\n ? { isNullable: true }\n : {}),\n });\n }\n return createModel({\n description: schemaOrRef.description ?? null,\n deprecated: !!schemaOrRef.deprecated,\n isNullable: isNullable(schemaOrRef),\n isReadOnly: !!schemaOrRef.readOnly,\n ...schemaStructure(spec, schemaOrRef),\n });\n};\n\n/**\n * A model for a top-level named schema (a definition). Object definitions are\n * typed as their own name (the type the generator emits for them).\n */\nconst buildDefinitionModel = (\n spec: Spec,\n name: string,\n schema: Schema,\n): Model => {\n const structure = schemaStructure(spec, schema);\n const isNamedObject =\n schema.type === 'object' &&\n !!(schema.properties || schema.patternProperties);\n return createModel({\n name,\n description: schema.description ?? null,\n deprecated: !!schema.deprecated,\n isNullable: isNullable(schema),\n ...structure,\n ...(isNamedObject ? { type: name } : {}),\n });\n};\n\n/**\n * The property models for an object schema.\n */\nconst buildProperties = (spec: Spec, schema: Schema): Model[] => {\n const required = new Set(schema.required ?? []);\n return Object.entries(schema.properties ?? {}).map(([name, propSchema]) => ({\n ...buildInlineModel(spec, propSchema),\n name,\n isRequired: required.has(name),\n }));\n};\n\n/**\n * A `{ modelName → { propertyName } }` map of the discriminator properties\n * declared by composite schemas with an explicit `mapping`.\n */\nconst discriminatorTargets = (spec: Spec): Map<string, Set<string>> => {\n const targets = new Map<string, Set<string>>();\n for (const schemaOrRef of Object.values(spec.components?.schemas ?? {})) {\n const { discriminator } = resolveIfRef(spec, schemaOrRef) as Schema;\n if (!discriminator?.propertyName || !discriminator.mapping) continue;\n for (const mappedRef of Object.values(discriminator.mapping)) {\n if (typeof mappedRef !== 'string' || !mappedRef.startsWith('#/'))\n continue;\n const modelName = splitRef(mappedRef)[2];\n const properties = targets.get(modelName) ?? new Set<string>();\n properties.add(discriminator.propertyName);\n targets.set(modelName, properties);\n }\n }\n return targets;\n};\n\n/**\n * For discriminated composites, collapse each mapped schema's discriminator\n * property from its enum reference to the bare primitive type (`export` stays\n * `reference`, `type` becomes the primitive, `imports` are cleared). The\n * referenced enum models are left in place. This drops the literal narrowing\n * but keeps the emitted code valid.\n */\nconst collapseDiscriminators = (spec: Spec, models: Model[]): Model[] => {\n const targets = discriminatorTargets(spec);\n if (targets.size === 0) return models;\n\n const byName = new Map(models.map((m) => [m.name, m]));\n return models.map((model) => {\n const properties = targets.get(model.name);\n if (!properties) return model;\n return {\n ...model,\n properties: model.properties.map((property) => {\n if (!properties.has(property.name) || property.export !== 'reference') {\n return property;\n }\n const referenced = byName.get(property.type);\n return referenced?.export === 'enum'\n ? { ...property, type: referenced.type, imports: [] }\n : property;\n }),\n };\n });\n};\n\nconst buildModels = (spec: Spec): Model[] =>\n collapseDiscriminators(\n spec,\n Object.entries(spec.components?.schemas ?? {}).map(([name, schemaOrRef]) =>\n buildDefinitionModel(spec, name, resolveIfRef(spec, schemaOrRef)),\n ),\n );\n\n/**\n * The synthetic `body` parameter for an operation's request body.\n */\nconst buildRequestBody = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject,\n): Model | null => {\n const requestBody = resolveIfRef<OpenAPIV3.RequestBodyObject | undefined>(\n spec,\n specOp.requestBody,\n );\n // An empty content map declares no acceptable media types, ie no body.\n if (!requestBody?.content || Object.keys(requestBody.content).length === 0)\n return null;\n\n const mediaType = preferredMediaType(requestBody.content);\n const base = buildInlineModel(\n spec,\n (requestBody.content[mediaType]?.schema ?? {}) as Schema,\n );\n // The encoding object's per-part content types (multipart/urlencoded bodies)\n const partContentTypes = Object.fromEntries(\n Object.entries(requestBody.content[mediaType]?.encoding ?? {}).flatMap(\n ([prop, encoding]) =>\n encoding.contentType ? [[prop, encoding.contentType]] : [],\n ),\n );\n return {\n ...base,\n name: 'requestBody',\n prop: 'requestBody',\n in: 'body',\n mediaType,\n ...(Object.keys(partContentTypes).length > 0 ? { partContentTypes } : {}),\n isRequired: !!requestBody.required,\n description: requestBody.description ?? base.description,\n };\n};\n\n/**\n * The parameter models for an operation, including a synthetic body parameter.\n * Ordered required-first with a stable sort (`Array.prototype.sort`), so the\n * original relative order within each group is preserved.\n */\nconst buildParameters = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject,\n pathParameters: ParameterOrRef[] = [],\n): Model[] => {\n const declared: Model[] = mergeParameters(spec, pathParameters, [\n ...(specOp.parameters ?? []),\n ]).flatMap((p) => {\n const param = resolveIfRef<OpenAPIV3.ParameterObject | undefined>(spec, p);\n if (!param) return [];\n // A content-based parameter declares `content` (a single media type)\n // instead of `schema`; its value is serialised to that media type.\n const contentMediaType = param.content\n ? Object.keys(param.content)[0]\n : undefined;\n if (contentMediaType && contentMediaType !== 'application/json') {\n throw new Error(\n `Parameter \"${param.name}\" declares content media type \"${contentMediaType}\", which is not supported (only application/json content-based parameters can be serialised)`,\n );\n }\n const schema = param.schema ?? param.content?.[contentMediaType]?.schema;\n const base = buildInlineModel(spec, (schema ?? {}) as Schema);\n return [\n {\n ...base,\n name: param.name,\n prop: param.name,\n in: param.in as ModelIn,\n mediaType: param.schema ? null : (contentMediaType ?? null),\n isRequired: !!param.required,\n description: param.description ? param.description : base.description,\n },\n ];\n });\n\n const body = buildRequestBody(spec, specOp);\n const params = body ? [...declared, body] : declared;\n\n return [...params].sort((a, b) =>\n a.isRequired === b.isRequired ? 0 : a.isRequired ? -1 : 1,\n );\n};\n\n/**\n * Merge path-level parameters with operation-level parameters. Per the OpenAPI\n * spec, path-level parameters apply to every operation in the path unless an\n * operation-level parameter overrides one with the same `name` + `in`.\n */\nconst mergeParameters = (\n spec: Spec,\n pathParameters: ParameterOrRef[],\n operationParameters: ParameterOrRef[],\n): ParameterOrRef[] => {\n const key = (p: ParameterOrRef) => {\n const param = resolveIfRef<OpenAPIV3.ParameterObject | undefined>(spec, p);\n return param ? specParameterKey(param) : null;\n };\n const overridden = new Set(operationParameters.map(key));\n const inherited = pathParameters.filter((p) => !overridden.has(key(p)));\n return [...inherited, ...operationParameters];\n};\n\n/**\n * The response models for an operation.\n */\nconst buildResponses = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject,\n): Model[] =>\n Object.entries(specOp.responses ?? {}).flatMap(([code, resOrRef]) => {\n const response = resolveIfRef<OpenAPIV3.ResponseObject | undefined>(\n spec,\n resOrRef,\n );\n if (!response) return [];\n\n const content = response.content ?? {};\n const mediaType = Object.keys(content).length\n ? preferredMediaType(content)\n : undefined;\n const responseSchema = mediaType\n ? (content[mediaType]?.schema as SchemaOrRef | undefined)\n : undefined;\n\n return [\n {\n ...(responseSchema\n ? buildInlineModel(spec, responseSchema)\n : createModel({ export: 'generic', type: 'void' })),\n name: '',\n code: parseResponseCode(code),\n in: 'response' as ModelIn,\n description: response.description ?? null,\n },\n ];\n });\n\nconst buildOperation = (\n spec: Spec,\n path: string,\n method: string,\n specOp: OpenAPIV3.OperationObject,\n pathParameters: ParameterOrRef[] = [],\n): Operation => {\n const parameters = buildParameters(spec, specOp, pathParameters);\n const responses = buildResponses(spec, specOp);\n const id = (specOp as { operationId: string }).operationId;\n\n return {\n id,\n name: id,\n method: method.toUpperCase(),\n path,\n description: specOp.description ?? null,\n tags: specOp.tags ?? null,\n deprecated: !!specOp.deprecated,\n parameters,\n parametersBody: parameters.find((p) => p.in === 'body') ?? null,\n responses,\n imports: collectImports([...parameters, ...responses]),\n };\n};\n\nconst buildOperations = (spec: Spec): Operation[] =>\n Object.entries(spec.paths ?? {}).flatMap(([path, pathItemOrRef]) => {\n const pathItem = resolveIfRef<OpenAPIV3.PathItemObject | undefined>(\n spec,\n pathItemOrRef,\n );\n if (!pathItem) return [];\n const pathParameters = pathItem.parameters ?? [];\n return HTTP_METHODS.flatMap((method: HttpMethod) => {\n const specOp = pathItem[method as OpenAPIV3.HttpMethods];\n return specOp\n ? [buildOperation(spec, path, method, specOp, pathParameters)]\n : [];\n });\n });\n\nconst buildDefaultService = (spec: Spec): Service => {\n const operations = buildOperations(spec);\n return {\n name: DEFAULT_SERVICE_NAME,\n operations,\n imports: [...new Set(operations.flatMap((op) => op.imports))],\n };\n};\n\n/**\n * Look up the spec operation object for a parsed operation.\n */\nexport const getSpecOperation = (\n spec: Spec,\n op: Operation,\n): OpenAPIV3.OperationObject | undefined =>\n (spec.paths?.[op.path] as OpenAPIV3.PathItemObject | undefined)?.[\n op.method.toLowerCase() as OpenAPIV3.HttpMethods\n ];\n\n/**\n * The `in`-qualified key for a parameter, distinguishing parameters that share\n * a name across positions (e.g. `id` in both path and query).\n */\nexport const specParameterKey = (parameter: {\n in: string;\n name: string;\n}): string => `${parameter.in}:${parameter.name}`;\n\n/**\n * An operation's resolved parameters indexed by `in:name`, including any\n * path-level parameters inherited from the containing path item\n * (operation-level parameters take precedence when both declare the same\n * `name` + `in`).\n */\nexport const getSpecParametersByKey = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject | undefined,\n pathParameters: ParameterOrRef[] = [],\n): { [key: string]: OpenAPIV3.ParameterObject } =>\n Object.fromEntries(\n [...pathParameters, ...(specOp?.parameters ?? [])].map((p) => {\n const param = resolveIfRef(spec, p);\n return [specParameterKey(param), param];\n }),\n );\n\n/**\n * The path-level parameters declared on the path item containing an operation.\n */\nexport const getSpecPathParameters = (\n spec: Spec,\n op: Operation,\n): ParameterOrRef[] => {\n const pathItem = resolveIfRef<OpenAPIV3.PathItemObject | undefined>(\n spec,\n spec.paths?.[op.path],\n );\n return pathItem?.parameters ?? [];\n};\n\n/**\n * The member sub-schemas of a composite (allOf/anyOf/oneOf) schema, in order.\n */\nexport const compositeMemberSchemas = (\n schema: Schema,\n compositeExport: ModelExport,\n): OpenApiSchemaOrRef[] => {\n const keyword = camelCase(compositeExport) as 'allOf' | 'anyOf' | 'oneOf';\n return (schema[keyword] as OpenApiSchemaOrRef[] | undefined) ?? [];\n};\n\n/**\n * Recursively stitch a model's collection `link` to the named model it\n * references (ref values are left null by the builders, since the target model\n * does not exist until every definition is built).\n */\nexport const linkModel = (\n spec: Spec,\n modelsByName: ModelsByName,\n model: Model,\n schema: Schema,\n visited: Set<Model> = new Set(),\n): void => {\n if (visited.has(model)) return;\n visited.add(model);\n\n if (\n model.export === 'dictionary' &&\n 'additionalProperties' in schema &&\n schema.additionalProperties\n ) {\n if (isRef(schema.additionalProperties)) {\n const name = splitRef(schema.additionalProperties.$ref)[2];\n if (modelsByName[name] && !model.link) {\n model.link = modelsByName[name];\n }\n } else if (model.link && typeof schema.additionalProperties !== 'boolean') {\n linkModel(\n spec,\n modelsByName,\n model.link,\n schema.additionalProperties,\n visited,\n );\n }\n } else if (model.export === 'array' && 'items' in schema && schema.items) {\n if (isRef(schema.items)) {\n const name = splitRef(schema.items.$ref)[2];\n if (modelsByName[name] && !model.link) {\n model.link = modelsByName[name];\n }\n } else if (model.link) {\n linkModel(spec, modelsByName, model.link, schema.items, visited);\n }\n }\n\n if (model.export === 'tuple' && 'prefixItems' in schema) {\n const memberSchemas =\n (schema as { prefixItems?: OpenApiSchemaOrRef[] }).prefixItems ?? [];\n model.properties.forEach((member, i) => {\n const subSchema = resolveIfRef(spec, memberSchemas[i]);\n if (subSchema && !visited.has(member)) {\n linkModel(spec, modelsByName, member, subSchema, visited);\n }\n });\n }\n\n model.properties\n .filter((p) => !visited.has(p) && schema.properties?.[trim(p.name, `\"'`)])\n .forEach((property) => {\n const subSchema = resolveIfRef(\n spec,\n schema.properties![trim(property.name, `\"'`)],\n );\n linkModel(spec, modelsByName, property, subSchema, visited);\n });\n\n if (COMPOSED_SCHEMA_TYPES.has(model.export)) {\n const memberSchemas = compositeMemberSchemas(schema, model.export);\n model.properties.forEach((property, i) => {\n const subSchema = resolveIfRef(spec, memberSchemas[i]);\n if (subSchema) {\n linkModel(spec, modelsByName, property, subSchema, visited);\n }\n });\n }\n};\n\n/**\n * Stitch collection links across every model, operation parameter and response.\n */\nconst linkModels = (spec: Spec, data: ClientData): void => {\n const modelsByName = indexModelsByName(data.models);\n const visited = new Set<Model>();\n\n data.models.forEach((model) => {\n const schema = resolveIfRef<Schema | undefined>(\n spec,\n spec.components?.schemas?.[model.name],\n );\n if (schema) {\n linkModel(spec, modelsByName, model, schema, visited);\n }\n });\n\n data.services.forEach((service) => {\n service.operations.forEach((op) => {\n const specOp = getSpecOperation(spec, op);\n const specParametersByKey = getSpecParametersByKey(\n spec,\n specOp,\n getSpecPathParameters(spec, op),\n );\n\n op.parameters.forEach((parameter) => {\n const specParameter =\n specParametersByKey[\n specParameterKey({ in: parameter.in, name: parameter.prop })\n ];\n const specParameterSchema = resolveIfRef(spec, specParameter?.schema);\n if (specParameterSchema) {\n linkModel(\n spec,\n modelsByName,\n parameter,\n specParameterSchema,\n visited,\n );\n } else if (parameter.in === 'body') {\n const specBody = resolveIfRef(spec, specOp?.requestBody);\n const specBodySchema = resolveIfRef(\n spec,\n specBody?.content?.[parameter.mediaType]?.schema,\n );\n if (specBodySchema) {\n linkModel(spec, modelsByName, parameter, specBodySchema, visited);\n }\n }\n });\n\n op.responses.forEach((response) => {\n const specResponse = resolveIfRef(\n spec,\n specOp?.responses?.[response.code],\n );\n Object.keys(specResponse?.content ?? {}).forEach((mediaType) => {\n const responseSchema = resolveIfRef(\n spec,\n specResponse?.content?.[mediaType]?.schema,\n );\n if (responseSchema) {\n linkModel(spec, modelsByName, response, responseSchema, visited);\n }\n });\n });\n });\n });\n};\n\n/**\n * Populate `composedModels` and `composedPrimitives` on each composite model\n * with the models and primitive types it is composed of.\n */\nconst resolveComposedModel = (\n modelsByName: ModelsByName,\n model: Model,\n visited: Set<Model>,\n): void => {\n if (!COMPOSED_SCHEMA_TYPES.has(model.export) || visited.has(model)) return;\n visited.add(model);\n\n const members = model.properties.filter((p) => !p.name);\n const referenced = members\n .filter((p) => p.export === 'reference')\n .flatMap((r) => (modelsByName[r.type] ? [modelsByName[r.type]] : []));\n\n // Resolve recursively so all-of mixins include nested all-of properties\n referenced.forEach((m) => resolveComposedModel(modelsByName, m, visited));\n\n // Enums serialise as primitives, so group them with the primitives\n const composedModels = referenced.filter((m) => m.export !== 'enum');\n const composedPrimitives = [\n ...members.filter((p) => p.export !== 'reference'),\n ...referenced.filter((m) => m.export === 'enum'),\n ];\n\n // A composite of multiple non-primitive array members can't be told apart at\n // runtime: each arrives as a plain JSON array with no property to switch on.\n // A `discriminator` can't disambiguate here either — it names a property on\n // an object member, not on an array. Model a polymorphic list as an array of\n // a discriminated union instead (`type: array` whose `items` is the oneOf).\n const isPrimitiveArray = (m: Model): boolean =>\n m.link && COLLECTION_TYPES.has(m.export)\n ? isPrimitiveArray(m.link)\n : PRIMITIVE_TYPES.has(m.type) &&\n !['date', 'date-time'].includes(m.format ?? '');\n const arrayComposedModels = composedPrimitives.filter(\n (m) => m.export === 'array' && !isPrimitiveArray(m),\n );\n if (arrayComposedModels.length > 1) {\n throw new Error(\n `Schema \"${model.name}\" defines ${camelCase(model.export)} with multiple array types which cannot be distinguished at runtime. Model a polymorphic list as an array whose items are a discriminated union instead (a \"type: array\" schema with a \"oneOf\" in \"items\").`,\n );\n }\n\n /**\n * Whether a member constrains nothing, describing the empty object.\n * `{description: \"...\"}`, `{example: ...}` and `{title: ...}` are how OpenAPI\n * 3.0 annotates a `$ref`, whose own siblings are ignored there — the commonest\n * `allOf` idiom in published specs, and counting it as a non-object made those\n * documents fail outright.\n *\n * A bare `{description}` parses as an `interface` with no properties; an\n * explicit `{type: object}` with none parses as a `dictionary` carrying no\n * value type.\n *\n * A member declaring `required` is *not* empty even with no properties of its\n * own: it raises a sibling branch's property to mandatory, and nothing here\n * carries that across, so dropping it would quietly make a required field\n * optional. Those keep failing loudly until the constraint can be honoured.\n */\n const isStructurallyEmpty = (m: Model): boolean =>\n (m.properties ?? []).length === 0 &&\n !m.hasAdditionalProperties &&\n !m.hasPatternProperties &&\n (m.declaredRequired ?? []).length === 0 &&\n ((m.export === 'interface' && !m.link) ||\n (m.export === 'dictionary' && m.type === 'unknown'));\n const constrainingPrimitives = composedPrimitives.filter(\n (m) => !isStructurallyEmpty(m),\n );\n\n // A single-member `allOf` composes to exactly that member, so a scalar one is\n // unambiguous rather than a conjunction of incompatible types — it is how a\n // description is attached to a scalar, and specs use it for enums especially.\n const isSingleMemberAllOf =\n model.export === 'all-of' &&\n members.length === 1 &&\n composedModels.length === 0 &&\n constrainingPrimitives.length === 1;\n\n if (\n model.export === 'all-of' &&\n constrainingPrimitives.length > 0 &&\n !isSingleMemberAllOf\n ) {\n // Name what the offending members actually are: the old wording said\n // \"non-object types\" even for a member that is explicitly an object, which\n // sent readers looking for the wrong thing.\n const requiresOnly = constrainingPrimitives.filter(\n (m) => (m.declaredRequired ?? []).length > 0 && !m.properties?.length,\n );\n const detail =\n requiresOnly.length > 0\n ? `an allOf member declares \"required\" (${requiresOnly\n .flatMap((m) => m.declaredRequired ?? [])\n .map((name) => `\"${name}\"`)\n .join(\n ', ',\n )}) for properties it does not itself declare, which this generator cannot carry across branches. Declare the property in the same member, or mark it required where it is declared`\n : `an allOf member is not an object type, and allOf may only compose object types`;\n throw new Error(`Schema \"${model.name}\" cannot be composed: ${detail}.`);\n }\n\n model.composedModels = composedModels;\n model.composedPrimitives =\n model.export === 'all-of' ? constrainingPrimitives : composedPrimitives;\n // Drop the annotation-only members from what templates render, so an `allOf`\n // that only carried a description composes to the member it annotates rather\n // than to an intersection with the empty object.\n if (model.export === 'all-of') {\n model.properties = model.properties.filter(\n (member) => member.name || !isStructurallyEmpty(member),\n );\n }\n};\n\nconst resolveComposedModels = (data: ClientData): void => {\n const modelsByName = indexModelsByName(data.models);\n const visited = new Set<Model>();\n data.models.forEach((model) =>\n resolveComposedModel(modelsByName, model, visited),\n );\n};\n\nconst isHoisted = (spec: Spec, name: string): boolean =>\n !!(\n resolveIfRef<Schema | undefined>(spec, spec.components?.schemas?.[name]) as\n | { 'x-aws-nx-hoisted'?: boolean }\n | undefined\n )?.['x-aws-nx-hoisted'];\n\n/**\n * The on-the-wire name of a schema: its original name before normalisation to\n * a valid identifier (recorded by the normaliser), or its current name. An\n * implicit discriminator matches on this, not the normalised model name.\n */\nconst wireName = (spec: Spec, name: string): string =>\n (\n resolveIfRef<Schema | undefined>(spec, spec.components?.schemas?.[name]) as\n | { 'x-aws-nx-original-name'?: string }\n | undefined\n )?.['x-aws-nx-original-name'] ?? name;\n\n/**\n * The value → model-name mapping for a discriminator, resolved either from an\n * explicit `mapping` (value → schema ref) or implicitly (each candidate model's\n * schema name is its own discriminator value). Only candidates in\n * `candidateNames` are kept, so unknown values fall through to the default\n * marshalling; hoisted synthetic names (which never appear on the wire) are\n * excluded from the implicit form.\n */\nconst buildDiscriminatorMapping = (\n spec: Spec,\n discriminator: OpenAPIV3.DiscriminatorObject,\n candidateNames: Set<string>,\n): DiscriminatorMapping[] => {\n if (discriminator.mapping) {\n const mapping: DiscriminatorMapping[] = [];\n for (const [value, ref] of Object.entries(discriminator.mapping)) {\n if (typeof ref !== 'string' || !ref.startsWith('#/')) continue;\n const modelName = splitRef(ref)[2];\n if (candidateNames.has(modelName)) mapping.push({ value, modelName });\n }\n return mapping;\n }\n return (\n [...candidateNames]\n .filter((name) => !isHoisted(spec, name))\n // The wire value is the schema's original name; the model it selects is the\n // normalised name.\n .map((name) => ({ value: wireName(spec, name), modelName: name }))\n );\n};\n\n/**\n * Build the {@link Discriminator} for a `oneOf`/`anyOf` composite, if declared.\n * The candidates are the models composed by the union.\n */\nconst buildCompositeDiscriminator = (\n spec: Spec,\n model: Model,\n schema: Schema,\n): Discriminator | undefined => {\n const { discriminator } = schema;\n if (!discriminator?.propertyName) return undefined;\n\n const candidateNames = new Set(\n (model.composedModels ?? []).map((m) => m.name),\n );\n const mapping = buildDiscriminatorMapping(\n spec,\n discriminator,\n candidateNames,\n );\n\n return mapping.length > 0\n ? { propertyName: discriminator.propertyName, mapping }\n : undefined;\n};\n\n/**\n * Build the {@link Discriminator} for an inheritance base — an `object` schema\n * carrying a `discriminator` whose subtypes `allOf`-compose it. The candidates\n * are those subtypes (found by scanning every model for one that composes this\n * base). Marked `isBase` so the generator emits a non-dispatching body the\n * subtypes can compose without recursing.\n */\nconst buildBaseDiscriminator = (\n spec: Spec,\n base: Model,\n schema: Schema,\n models: Model[],\n): Discriminator | undefined => {\n const { discriminator } = schema;\n if (!discriminator?.propertyName) return undefined;\n\n const subtypeNames = new Set(\n models\n .filter(\n (m) =>\n m.export === 'all-of' &&\n (m.composedModels ?? []).some((c) => c.name === base.name),\n )\n .map((m) => m.name),\n );\n if (subtypeNames.size === 0) return undefined;\n\n const mapping = buildDiscriminatorMapping(spec, discriminator, subtypeNames);\n\n return mapping.length > 0\n ? { propertyName: discriminator.propertyName, mapping, isBase: true }\n : undefined;\n};\n\n/**\n * Attach discriminator metadata so the generator can marshal directly to the\n * matching branch/subtype. Two shapes carry a discriminator:\n * - a `oneOf`/`anyOf` composite (dispatch to the matching member), and\n * - an inheritance base `object` whose subtypes `allOf`-compose it (dispatch\n * to the matching subtype so subtype-only fields survive marshalling).\n * `allOf` itself is a conjunction (not a choice) so it is never discriminated.\n */\nconst resolveDiscriminators = (spec: Spec, data: ClientData): void => {\n data.models.forEach((model) => {\n const schema = resolveIfRef<Schema | undefined>(\n spec,\n spec.components?.schemas?.[model.name],\n );\n if (!schema) return;\n\n if (model.export === 'one-of' || model.export === 'any-of') {\n const discriminator = buildCompositeDiscriminator(spec, model, schema);\n if (discriminator) model.discriminator = discriminator;\n } else if (model.export === 'interface') {\n const discriminator = buildBaseDiscriminator(\n spec,\n model,\n schema,\n data.models,\n );\n if (discriminator) model.discriminator = discriminator;\n }\n });\n};\n\n/**\n * Type each discriminated subtype's discriminator property as its literal\n * value(s), turning `Cat | Dog` into a true TypeScript tagged union that\n * narrows on the discriminator (e.g. `Cat.petType: 'cat'`).\n *\n * The literal is taken from every discriminator's `mapping` (value → subtype).\n * A subtype selected by several values within one discriminator becomes a union\n * of those literals. A subtype that appears in multiple discriminators with\n * conflicting values can't be pinned to a single literal, so it is left as the\n * plain primitive (`string`) — the marshalling dispatch is unaffected either\n * way, this only affects the emitted type.\n */\nconst resolveDiscriminatorLiterals = (data: ClientData): void => {\n const modelsByName = indexModelsByName(data.models);\n\n // Collect, per (subtype, discriminator property), the set of literal values\n // that select it — across every discriminator in the spec.\n const valuesBySubtypeProp = new Map<string, Set<string>>();\n const conflicting = new Set<string>();\n\n for (const model of data.models) {\n const discriminator = model.discriminator;\n if (!discriminator) continue;\n const byName = new Map<string, string[]>();\n for (const { value, modelName } of discriminator.mapping) {\n byName.set(modelName, [...(byName.get(modelName) ?? []), value]);\n }\n for (const [modelName, values] of byName) {\n const key = `${modelName}\u0000${discriminator.propertyName}`;\n const existing = valuesBySubtypeProp.get(key);\n const incoming = new Set(values);\n if (existing && !setsEqual(existing, incoming)) {\n // Same subtype+property tagged differently by another union.\n conflicting.add(key);\n }\n valuesBySubtypeProp.set(\n key,\n existing ? union(existing, incoming) : incoming,\n );\n }\n }\n\n for (const [key, values] of valuesBySubtypeProp) {\n if (conflicting.has(key)) continue;\n const [modelName, propertyName] = key.split('\u0000');\n const property = modelsByName[modelName]?.properties.find(\n (p) => p.name === propertyName,\n );\n // Only pin a literal when the property is a plain (string/enum) scalar —\n // never an object/array reference.\n if (property && (property.type === 'string' || property.isEnum)) {\n property.discriminatorValue = [...values]\n .map((v) => JSON.stringify(v))\n .join(' | ');\n }\n }\n};\n\nconst setsEqual = (a: Set<string>, b: Set<string>): boolean =>\n a.size === b.size && [...a].every((v) => b.has(v));\n\nconst union = (a: Set<string>, b: Set<string>): Set<string> =>\n new Set([...a, ...b]);\n\n/**\n * Build the client data structure from a (normalised) OpenAPI spec: a fully\n * linked model graph with composite members resolved, ready for augmentation.\n */\nexport const buildClientData = (spec: Spec): ClientData => {\n const data: ClientData = {\n models: buildModels(spec),\n services: [buildDefaultService(spec)],\n };\n linkModels(spec, data);\n resolveComposedModels(data);\n resolveDiscriminators(spec, data);\n resolveDiscriminatorLiterals(data);\n return data;\n};\n"],"names":["camelCase","trim","COLLECTION_TYPES","COMPOSED_SCHEMA_TYPES","createModel","DEFAULT_SERVICE_NAME","indexModelsByName","PRIMITIVE_TYPES","isRef","resolveIfRef","splitRef","PRIMITIVE_TYPE_MAP","string","number","integer","boolean","null","HTTP_METHODS","schemaType","schema","type","isNullable","nullable","Array","isArray","includes","primaryType","find","t","isEnumSchema","enum","length","compositeExport","allOf","anyOf","oneOf","undefined","compositeMembers","isDictionarySchema","hasProperties","Object","keys","properties","patternProperties","primitiveType","format","preferredMediaType","content","parseResponseCode","code","test","parseInt","collectImports","models","Set","flatMap","m","imports","schemaStructure","spec","enumMembers","filter","value","declared","export","map","composite","member","buildInlineModel","prefixItems","items","collectionValue","declaredRequired","required","dictionaryValue","buildProperties","$ref","link","additional","additionalProperties","schemaOrRef","name","description","deprecated","isReadOnly","readOnly","buildDefinitionModel","structure","isNamedObject","entries","propSchema","isRequired","has","discriminatorTargets","targets","Map","values","components","schemas","discriminator","propertyName","mapping","mappedRef","startsWith","modelName","get","add","set","collapseDiscriminators","size","byName","model","property","referenced","buildModels","buildRequestBody","specOp","requestBody","mediaType","base","partContentTypes","fromEntries","encoding","prop","contentType","in","buildParameters","pathParameters","mergeParameters","parameters","p","param","contentMediaType","Error","body","params","sort","a","b","operationParameters","key","specParameterKey","overridden","inherited","buildResponses","responses","resOrRef","response","responseSchema","buildOperation","path","method","id","operationId","toUpperCase","tags","parametersBody","buildOperations","paths","pathItemOrRef","pathItem","buildDefaultService","operations","op","getSpecOperation","toLowerCase","parameter","getSpecParametersByKey","getSpecPathParameters","compositeMemberSchemas","keyword","linkModel","modelsByName","visited","memberSchemas","forEach","i","subSchema","linkModels","data","services","service","specParametersByKey","specParameter","specParameterSchema","specBody","specBodySchema","specResponse","resolveComposedModel","members","r","composedModels","composedPrimitives","isPrimitiveArray","arrayComposedModels","isStructurallyEmpty","hasAdditionalProperties","hasPatternProperties","constrainingPrimitives","isSingleMemberAllOf","requiresOnly","detail","join","resolveComposedModels","isHoisted","wireName","buildDiscriminatorMapping","candidateNames","ref","push","buildCompositeDiscriminator","buildBaseDiscriminator","subtypeNames","some","c","isBase","resolveDiscriminators","resolveDiscriminatorLiterals","valuesBySubtypeProp","conflicting","existing","incoming","setsEqual","union","split","isEnum","discriminatorValue","v","JSON","stringify","every","buildClientData"],"mappings":"AAAA;;;CAGC,GAED,OAAOA,eAAe,mBAAmB;AACzC,OAAOC,UAAU,cAAc;AAE/B,SAEEC,gBAAgB,EAChBC,qBAAqB,EACrBC,WAAW,EACXC,oBAAoB,EAIpBC,iBAAiB,EAMjBC,eAAe,QAEV,0BAA0B;AACjC,SAASC,KAAK,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,YAAY;AAO1D;;CAEC,GACD,MAAMC,qBAAwD;IAC5DC,QAAQ;IACRC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,MAAM;AACR;AAEA,MAAMC,eAAe;IACnB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAQD,MAAMC,aAAa,CAACC,SAClB,AAACA,OAAwCC,IAAI;AAE/C,MAAMC,aAAa,CAACF;IAClB,MAAMC,OAAOF,WAAWC;IACxB,OACEA,OAAOG,QAAQ,KAAK,QACpBF,SAAS,UACRG,MAAMC,OAAO,CAACJ,SAASA,KAAKK,QAAQ,CAAC;AAE1C;AAEA;;CAEC,GACD,MAAMC,cAAc,CAACP;IACnB,MAAMC,OAAOF,WAAWC;IACxB,OAAOI,MAAMC,OAAO,CAACJ,QAAQA,KAAKO,IAAI,CAAC,CAACC,IAAMA,MAAM,UAAUR;AAChE;AAEA,MAAMS,eAAe,CAACV,SACpBI,MAAMC,OAAO,CAACL,OAAOW,IAAI,KAAKX,OAAOW,IAAI,CAACC,MAAM,GAAG;AAErD,MAAMC,kBAAkB,CAACb;IACvB,IAAIA,OAAOc,KAAK,EAAE,OAAO;I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AsB7J,MAAMwH;IAC5BsC,6BAA6BtC;IAC7B,OAAOA;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/open-api/utils/parser.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport camelCase from 'lodash.camelcase';\nimport trim from 'lodash.trim';\nimport type { OpenAPIV3 } from 'openapi-types';\nimport {\n type ClientData,\n COLLECTION_TYPES,\n COMPOSED_SCHEMA_TYPES,\n createModel,\n DEFAULT_SERVICE_NAME,\n type Discriminator,\n type DiscriminatorMapping,\n type EnumMember,\n indexModelsByName,\n type Model,\n type ModelExport,\n type ModelIn,\n type ModelsByName,\n type Operation,\n PRIMITIVE_TYPES,\n type Service,\n} from './codegen-data/types.js';\nimport { isRef, resolveIfRef, splitRef } from './refs.js';\nimport type {\n OpenApiSchemaOrRef,\n OpenApiSchema as Schema,\n Spec,\n} from './types.js';\n\n/**\n * OpenAPI primitive `type` values mapped to the internal model `type`.\n */\nconst PRIMITIVE_TYPE_MAP: { [openApiType: string]: string } = {\n string: 'string',\n number: 'number',\n integer: 'number',\n boolean: 'boolean',\n null: 'null',\n};\n\nconst HTTP_METHODS = [\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n] as const;\n\ntype HttpMethod = (typeof HTTP_METHODS)[number];\n\ntype SchemaOrRef = Schema | OpenAPIV3.ReferenceObject;\n\ntype ParameterOrRef = OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject;\n\nconst schemaType = (schema: Schema): string | string[] | undefined =>\n (schema as { type?: string | string[] }).type;\n\nconst isNullable = (schema: Schema): boolean => {\n const type = schemaType(schema);\n return (\n schema.nullable === true ||\n type === 'null' ||\n (Array.isArray(type) && type.includes('null'))\n );\n};\n\n/**\n * The \"primary\" type of a schema, ignoring 'null' in a 3.1 type array.\n */\nconst primaryType = (schema: Schema): string | undefined => {\n const type = schemaType(schema);\n return Array.isArray(type) ? type.find((t) => t !== 'null') : type;\n};\n\nconst isEnumSchema = (schema: Schema): boolean =>\n Array.isArray(schema.enum) && schema.enum.length > 0;\n\nconst compositeExport = (schema: Schema): ModelExport | undefined => {\n if (schema.allOf) return 'all-of';\n if (schema.anyOf) return 'any-of';\n if (schema.oneOf) return 'one-of';\n return undefined;\n};\n\nconst compositeMembers = (schema: Schema): SchemaOrRef[] =>\n (schema.allOf ?? schema.anyOf ?? schema.oneOf ?? []) as SchemaOrRef[];\n\n/**\n * A schema is a \"dictionary\" (map) when it is an object with no explicit\n * properties (it may have `additionalProperties`, or be a bare `object`).\n */\nconst isDictionarySchema = (schema: Schema): boolean => {\n if (primaryType(schema) !== 'object') return false;\n if (compositeExport(schema) || isEnumSchema(schema)) return false;\n const hasProperties = Object.keys(schema.properties ?? {}).length > 0;\n return !hasProperties && !schema.patternProperties;\n};\n\n/**\n * The internal primitive type name for a primitive schema. A `string` field\n * denotes raw binary content (rendered as a `Blob`) only via `format: binary`.\n * The 3.1 `contentMediaType` idiom is ambiguous in isolation — FastAPI emits it\n * both for multipart file fields (binary) and for `bytes` in a JSON body\n * (base64 string) — so `normalise` rewrites it to `format: binary` for form\n * bodies only, and this stays context-free.\n */\nconst primitiveType = (schema: Schema): string => {\n const type = primaryType(schema);\n if (type === 'string' && schema.format === 'binary') return 'binary';\n return (type && PRIMITIVE_TYPE_MAP[type]) ?? 'unknown';\n};\n\n/**\n * Prefer application/json, falling back to the first declared media type.\n */\nconst preferredMediaType = (content: { [media: string]: unknown }): string =>\n 'application/json' in content ? 'application/json' : Object.keys(content)[0];\n\nconst parseResponseCode = (code: string): number | string =>\n /^\\d+$/.test(code) ? parseInt(code, 10) : code;\n\n/**\n * The unique imports declared across a set of models, in first-seen order.\n */\nconst collectImports = (models: Model[]): string[] => [\n ...new Set(models.flatMap((m) => m.imports)),\n];\n\n/**\n * The structural fields (export/type/link/properties/enum/imports/format) a\n * schema contributes to a model.\n */\nconst schemaStructure = (spec: Spec, schema: Schema): Partial<Model> => {\n // A null member (3.0 nullable enums list null as a value) marks the model\n // nullable rather than becoming a literal. An enum of only null degrades to\n // a plain (nullable) schema.\n const enumMembers = (schema.enum ?? []).filter((value) => value !== null);\n if (isEnumSchema(schema) && enumMembers.length > 0) {\n // A string (or untyped) enum renders as a literal union; a boolean/number\n // enum renders as its bare primitive, so it must carry the declared type.\n const declared = primaryType(schema);\n return {\n export: 'enum',\n type: (declared && PRIMITIVE_TYPE_MAP[declared]) ?? 'string',\n enum: enumMembers.map(\n (value): EnumMember => ({ value: value as EnumMember['value'] }),\n ),\n ...(enumMembers.length < schema.enum!.length ? { isNullable: true } : {}),\n };\n }\n\n const composite = compositeExport(schema);\n if (composite) {\n const properties = compositeMembers(schema).map((member) =>\n buildInlineModel(spec, member),\n );\n return {\n export: composite,\n type: 'unknown',\n properties,\n imports: collectImports(properties),\n };\n }\n\n const type = primaryType(schema);\n\n if (type === 'array') {\n // A fixed-length tuple (3.1 `prefixItems`, as emitted by Pydantic for\n // `tuple[A, B]`) models each element positionally in `properties`. An open\n // tuple (additional `items` beyond the prefix) degrades to a plain array.\n const prefixItems = (schema as { prefixItems?: SchemaOrRef[] }).prefixItems;\n const items = (schema as { items?: SchemaOrRef }).items;\n if (prefixItems && prefixItems.length > 0 && !items) {\n const properties = prefixItems.map((member) =>\n buildInlineModel(spec, member),\n );\n return {\n export: 'tuple',\n type: 'unknown',\n properties,\n imports: collectImports(properties),\n };\n }\n return { export: 'array', ...collectionValue(spec, items) };\n }\n\n // Recorded whether or not this schema declares the properties it names: an\n // `allOf` member may raise a sibling branch's property to mandatory, and a\n // composite has to be able to tell that apart from an empty member.\n const declaredRequired = schema.required ?? [];\n\n if (isDictionarySchema(schema)) {\n return {\n export: 'dictionary',\n declaredRequired,\n ...dictionaryValue(spec, schema),\n };\n }\n\n if (type === 'object' || schema.properties || schema.patternProperties) {\n const properties = buildProperties(spec, schema);\n return {\n export: 'interface',\n type: 'unknown',\n properties,\n declaredRequired,\n imports: collectImports(properties),\n };\n }\n\n // A schema with no type (e.g. `{}`) is an untyped object.\n if (type === undefined) {\n return { export: 'interface', type: 'unknown', declaredRequired };\n }\n\n return {\n export: 'generic',\n type: primitiveType(schema),\n ...(schema.format ? { format: schema.format } : {}),\n };\n};\n\n/**\n * The value type of a collection (array items / dictionary values): a `type`,\n * `link` and `imports`.\n *\n * - ref value → `type` is the referenced model name; `link` is left null and\n * resolved later by `linkModels`.\n * - non-ref value → a `link` model carrying the (innermost) type and imports.\n */\nconst collectionValue = (\n spec: Spec,\n value: SchemaOrRef | undefined,\n): Partial<Model> => {\n if (value && isRef(value)) {\n const type = splitRef(value.$ref)[2];\n return { type, imports: [type], link: null };\n }\n const link = createModel(schemaStructure(spec, (value ?? {}) as Schema));\n return { link, type: link.type, imports: [...link.imports] };\n};\n\n/**\n * The value type of a dictionary (map).\n */\nconst dictionaryValue = (spec: Spec, schema: Schema): Partial<Model> => {\n const additional = schema.additionalProperties;\n if (additional && additional !== true) {\n return collectionValue(spec, additional);\n }\n if (schema.properties && additional !== true) {\n // An object with an (empty) `properties` map but no additionalProperties\n // renders as `{}`.\n return { type: 'unknown', link: null };\n }\n // `additionalProperties: true`, or a bare `{ type: 'object' }` → an \"any\"\n // value type.\n return {\n type: 'unknown',\n link: createModel({ export: 'interface', type: 'unknown' }),\n };\n};\n\n/**\n * A model for an inline sub-schema (property value, array item, dictionary\n * value, composite member, parameter, or response).\n */\nexport const buildInlineModel = (\n spec: Spec,\n schemaOrRef: SchemaOrRef,\n): Model => {\n if (isRef(schemaOrRef)) {\n const name = splitRef(schemaOrRef.$ref)[2];\n // `nullable` beside a `$ref` describes this use of the schema, not the schema\n // itself. OpenAPI 3.0 ignores a `$ref`'s siblings, but normalisation puts it\n // here when it hoists a nullable inline schema — dropping it made a required\n // nullable object property reject the null its own spec permits.\n return createModel({\n export: 'reference',\n type: name,\n imports: [name],\n ...((schemaOrRef as { nullable?: boolean }).nullable\n ? { isNullable: true }\n : {}),\n });\n }\n return createModel({\n description: schemaOrRef.description ?? null,\n deprecated: !!schemaOrRef.deprecated,\n isNullable: isNullable(schemaOrRef),\n isReadOnly: !!schemaOrRef.readOnly,\n ...schemaStructure(spec, schemaOrRef),\n });\n};\n\n/**\n * A model for a top-level named schema (a definition). Object definitions are\n * typed as their own name (the type the generator emits for them).\n */\nconst buildDefinitionModel = (\n spec: Spec,\n name: string,\n schema: Schema,\n): Model => {\n const structure = schemaStructure(spec, schema);\n const isNamedObject =\n schema.type === 'object' &&\n !!(schema.properties || schema.patternProperties);\n return createModel({\n name,\n description: schema.description ?? null,\n deprecated: !!schema.deprecated,\n isNullable: isNullable(schema),\n ...structure,\n ...(isNamedObject ? { type: name } : {}),\n });\n};\n\n/**\n * The property models for an object schema.\n */\nconst buildProperties = (spec: Spec, schema: Schema): Model[] => {\n const required = new Set(schema.required ?? []);\n return Object.entries(schema.properties ?? {}).map(([name, propSchema]) => ({\n ...buildInlineModel(spec, propSchema),\n name,\n isRequired: required.has(name),\n }));\n};\n\n/**\n * A `{ modelName → { propertyName } }` map of the discriminator properties\n * declared by composite schemas with an explicit `mapping`.\n */\nconst discriminatorTargets = (spec: Spec): Map<string, Set<string>> => {\n const targets = new Map<string, Set<string>>();\n for (const schemaOrRef of Object.values(spec.components?.schemas ?? {})) {\n const { discriminator } = resolveIfRef(spec, schemaOrRef) as Schema;\n if (!discriminator?.propertyName || !discriminator.mapping) continue;\n for (const mappedRef of Object.values(discriminator.mapping)) {\n if (typeof mappedRef !== 'string' || !mappedRef.startsWith('#/'))\n continue;\n const modelName = splitRef(mappedRef)[2];\n const properties = targets.get(modelName) ?? new Set<string>();\n properties.add(discriminator.propertyName);\n targets.set(modelName, properties);\n }\n }\n return targets;\n};\n\n/**\n * For discriminated composites, collapse each mapped schema's discriminator\n * property from its enum reference to the bare primitive type (`export` stays\n * `reference`, `type` becomes the primitive, `imports` are cleared). The\n * referenced enum models are left in place. This drops the literal narrowing\n * but keeps the emitted code valid.\n */\nconst collapseDiscriminators = (spec: Spec, models: Model[]): Model[] => {\n const targets = discriminatorTargets(spec);\n if (targets.size === 0) return models;\n\n const byName = new Map(models.map((m) => [m.name, m]));\n return models.map((model) => {\n const properties = targets.get(model.name);\n if (!properties) return model;\n return {\n ...model,\n properties: model.properties.map((property) => {\n if (!properties.has(property.name) || property.export !== 'reference') {\n return property;\n }\n const referenced = byName.get(property.type);\n return referenced?.export === 'enum'\n ? { ...property, type: referenced.type, imports: [] }\n : property;\n }),\n };\n });\n};\n\nconst buildModels = (spec: Spec): Model[] =>\n collapseDiscriminators(\n spec,\n Object.entries(spec.components?.schemas ?? {}).map(([name, schemaOrRef]) =>\n buildDefinitionModel(spec, name, resolveIfRef(spec, schemaOrRef)),\n ),\n );\n\n/**\n * The synthetic `body` parameter for an operation's request body.\n */\nconst buildRequestBody = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject,\n): Model | null => {\n const requestBody = resolveIfRef<OpenAPIV3.RequestBodyObject | undefined>(\n spec,\n specOp.requestBody,\n );\n // An empty content map declares no acceptable media types, ie no body.\n if (!requestBody?.content || Object.keys(requestBody.content).length === 0)\n return null;\n\n const mediaType = preferredMediaType(requestBody.content);\n const base = buildInlineModel(\n spec,\n (requestBody.content[mediaType]?.schema ?? {}) as Schema,\n );\n // The encoding object's per-part content types (multipart/urlencoded bodies)\n const partContentTypes = Object.fromEntries(\n Object.entries(requestBody.content[mediaType]?.encoding ?? {}).flatMap(\n ([prop, encoding]) =>\n encoding.contentType ? [[prop, encoding.contentType]] : [],\n ),\n );\n return {\n ...base,\n name: 'requestBody',\n prop: 'requestBody',\n in: 'body',\n mediaType,\n ...(Object.keys(partContentTypes).length > 0 ? { partContentTypes } : {}),\n isRequired: !!requestBody.required,\n description: requestBody.description ?? base.description,\n };\n};\n\n/**\n * The parameter models for an operation, including a synthetic body parameter.\n * Ordered required-first with a stable sort (`Array.prototype.sort`), so the\n * original relative order within each group is preserved.\n */\nconst buildParameters = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject,\n pathParameters: ParameterOrRef[] = [],\n): Model[] => {\n const declared: Model[] = mergeParameters(spec, pathParameters, [\n ...(specOp.parameters ?? []),\n ]).flatMap((p) => {\n const param = resolveIfRef<OpenAPIV3.ParameterObject | undefined>(spec, p);\n if (!param) return [];\n // A content-based parameter declares `content` (a single media type)\n // instead of `schema`; its value is serialised to that media type.\n const contentMediaType = param.content\n ? Object.keys(param.content)[0]\n : undefined;\n if (contentMediaType && contentMediaType !== 'application/json') {\n throw new Error(\n `Parameter \"${param.name}\" declares content media type \"${contentMediaType}\", which is not supported (only application/json content-based parameters can be serialised)`,\n );\n }\n const schema = param.schema ?? param.content?.[contentMediaType]?.schema;\n const base = buildInlineModel(spec, (schema ?? {}) as Schema);\n return [\n {\n ...base,\n name: param.name,\n prop: param.name,\n in: param.in as ModelIn,\n mediaType: param.schema ? null : (contentMediaType ?? null),\n isRequired: !!param.required,\n description: param.description ? param.description : base.description,\n },\n ];\n });\n\n const body = buildRequestBody(spec, specOp);\n const params = body ? [...declared, body] : declared;\n\n return [...params].sort((a, b) =>\n a.isRequired === b.isRequired ? 0 : a.isRequired ? -1 : 1,\n );\n};\n\n/**\n * Merge path-level parameters with operation-level parameters. Per the OpenAPI\n * spec, path-level parameters apply to every operation in the path unless an\n * operation-level parameter overrides one with the same `name` + `in`.\n */\nconst mergeParameters = (\n spec: Spec,\n pathParameters: ParameterOrRef[],\n operationParameters: ParameterOrRef[],\n): ParameterOrRef[] => {\n const key = (p: ParameterOrRef) => {\n const param = resolveIfRef<OpenAPIV3.ParameterObject | undefined>(spec, p);\n return param ? specParameterKey(param) : null;\n };\n const overridden = new Set(operationParameters.map(key));\n const inherited = pathParameters.filter((p) => !overridden.has(key(p)));\n return [...inherited, ...operationParameters];\n};\n\n/**\n * The response models for an operation.\n */\nconst buildResponses = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject,\n): Model[] =>\n Object.entries(specOp.responses ?? {}).flatMap(([code, resOrRef]) => {\n const response = resolveIfRef<OpenAPIV3.ResponseObject | undefined>(\n spec,\n resOrRef,\n );\n if (!response) return [];\n\n const content = response.content ?? {};\n const mediaType = Object.keys(content).length\n ? preferredMediaType(content)\n : undefined;\n const responseSchema = mediaType\n ? (content[mediaType]?.schema as SchemaOrRef | undefined)\n : undefined;\n\n return [\n {\n ...(responseSchema\n ? buildInlineModel(spec, responseSchema)\n : createModel({ export: 'generic', type: 'void' })),\n name: '',\n code: parseResponseCode(code),\n in: 'response' as ModelIn,\n description: response.description ?? null,\n },\n ];\n });\n\nconst buildOperation = (\n spec: Spec,\n path: string,\n method: string,\n specOp: OpenAPIV3.OperationObject,\n pathParameters: ParameterOrRef[] = [],\n): Operation => {\n const parameters = buildParameters(spec, specOp, pathParameters);\n const responses = buildResponses(spec, specOp);\n const id = (specOp as { operationId: string }).operationId;\n\n return {\n id,\n name: id,\n method: method.toUpperCase(),\n path,\n description: specOp.description ?? null,\n tags: specOp.tags ?? null,\n deprecated: !!specOp.deprecated,\n parameters,\n parametersBody: parameters.find((p) => p.in === 'body') ?? null,\n responses,\n imports: collectImports([...parameters, ...responses]),\n };\n};\n\nconst buildOperations = (spec: Spec): Operation[] =>\n Object.entries(spec.paths ?? {}).flatMap(([path, pathItemOrRef]) => {\n const pathItem = resolveIfRef<OpenAPIV3.PathItemObject | undefined>(\n spec,\n pathItemOrRef,\n );\n if (!pathItem) return [];\n const pathParameters = pathItem.parameters ?? [];\n return HTTP_METHODS.flatMap((method: HttpMethod) => {\n const specOp = pathItem[method as OpenAPIV3.HttpMethods];\n return specOp\n ? [buildOperation(spec, path, method, specOp, pathParameters)]\n : [];\n });\n });\n\nconst buildDefaultService = (spec: Spec): Service => {\n const operations = buildOperations(spec);\n return {\n name: DEFAULT_SERVICE_NAME,\n operations,\n imports: [...new Set(operations.flatMap((op) => op.imports))],\n };\n};\n\n/**\n * Look up the spec operation object for a parsed operation.\n */\nexport const getSpecOperation = (\n spec: Spec,\n op: Operation,\n): OpenAPIV3.OperationObject | undefined =>\n (spec.paths?.[op.path] as OpenAPIV3.PathItemObject | undefined)?.[\n op.method.toLowerCase() as OpenAPIV3.HttpMethods\n ];\n\n/**\n * The `in`-qualified key for a parameter, distinguishing parameters that share\n * a name across positions (e.g. `id` in both path and query).\n */\nexport const specParameterKey = (parameter: {\n in: string;\n name: string;\n}): string => `${parameter.in}:${parameter.name}`;\n\n/**\n * An operation's resolved parameters indexed by `in:name`, including any\n * path-level parameters inherited from the containing path item\n * (operation-level parameters take precedence when both declare the same\n * `name` + `in`).\n */\nexport const getSpecParametersByKey = (\n spec: Spec,\n specOp: OpenAPIV3.OperationObject | undefined,\n pathParameters: ParameterOrRef[] = [],\n): { [key: string]: OpenAPIV3.ParameterObject } =>\n Object.fromEntries(\n [...pathParameters, ...(specOp?.parameters ?? [])].map((p) => {\n const param = resolveIfRef(spec, p);\n return [specParameterKey(param), param];\n }),\n );\n\n/**\n * The path-level parameters declared on the path item containing an operation.\n */\nexport const getSpecPathParameters = (\n spec: Spec,\n op: Operation,\n): ParameterOrRef[] => {\n const pathItem = resolveIfRef<OpenAPIV3.PathItemObject | undefined>(\n spec,\n spec.paths?.[op.path],\n );\n return pathItem?.parameters ?? [];\n};\n\n/**\n * The member sub-schemas of a composite (allOf/anyOf/oneOf) schema, in order.\n */\nexport const compositeMemberSchemas = (\n schema: Schema,\n compositeExport: ModelExport,\n): OpenApiSchemaOrRef[] => {\n const keyword = camelCase(compositeExport) as 'allOf' | 'anyOf' | 'oneOf';\n return (schema[keyword] as OpenApiSchemaOrRef[] | undefined) ?? [];\n};\n\n/**\n * Recursively stitch a model's collection `link` to the named model it\n * references (ref values are left null by the builders, since the target model\n * does not exist until every definition is built).\n */\nexport const linkModel = (\n spec: Spec,\n modelsByName: ModelsByName,\n model: Model,\n schema: Schema,\n visited: Set<Model> = new Set(),\n): void => {\n if (visited.has(model)) return;\n visited.add(model);\n\n if (\n model.export === 'dictionary' &&\n 'additionalProperties' in schema &&\n schema.additionalProperties\n ) {\n if (isRef(schema.additionalProperties)) {\n const name = splitRef(schema.additionalProperties.$ref)[2];\n if (modelsByName[name] && !model.link) {\n model.link = modelsByName[name];\n }\n } else if (model.link && typeof schema.additionalProperties !== 'boolean') {\n linkModel(\n spec,\n modelsByName,\n model.link,\n schema.additionalProperties,\n visited,\n );\n }\n } else if (model.export === 'array' && 'items' in schema && schema.items) {\n if (isRef(schema.items)) {\n const name = splitRef(schema.items.$ref)[2];\n if (modelsByName[name] && !model.link) {\n model.link = modelsByName[name];\n }\n } else if (model.link) {\n linkModel(spec, modelsByName, model.link, schema.items, visited);\n }\n }\n\n if (model.export === 'tuple' && 'prefixItems' in schema) {\n const memberSchemas =\n (schema as { prefixItems?: OpenApiSchemaOrRef[] }).prefixItems ?? [];\n model.properties.forEach((member, i) => {\n const subSchema = resolveIfRef(spec, memberSchemas[i]);\n if (subSchema && !visited.has(member)) {\n linkModel(spec, modelsByName, member, subSchema, visited);\n }\n });\n }\n\n model.properties\n .filter((p) => !visited.has(p) && schema.properties?.[trim(p.name, `\"'`)])\n .forEach((property) => {\n const subSchema = resolveIfRef(\n spec,\n schema.properties![trim(property.name, `\"'`)],\n );\n linkModel(spec, modelsByName, property, subSchema, visited);\n });\n\n if (COMPOSED_SCHEMA_TYPES.has(model.export)) {\n const memberSchemas = compositeMemberSchemas(schema, model.export);\n model.properties.forEach((property, i) => {\n const subSchema = resolveIfRef(spec, memberSchemas[i]);\n if (subSchema) {\n linkModel(spec, modelsByName, property, subSchema, visited);\n }\n });\n }\n};\n\n/**\n * Stitch collection links across every model, operation parameter and response.\n */\nconst linkModels = (spec: Spec, data: ClientData): void => {\n const modelsByName = indexModelsByName(data.models);\n const visited = new Set<Model>();\n\n data.models.forEach((model) => {\n const schema = resolveIfRef<Schema | undefined>(\n spec,\n spec.components?.schemas?.[model.name],\n );\n if (schema) {\n linkModel(spec, modelsByName, model, schema, visited);\n }\n });\n\n data.services.forEach((service) => {\n service.operations.forEach((op) => {\n const specOp = getSpecOperation(spec, op);\n const specParametersByKey = getSpecParametersByKey(\n spec,\n specOp,\n getSpecPathParameters(spec, op),\n );\n\n op.parameters.forEach((parameter) => {\n const specParameter =\n specParametersByKey[\n specParameterKey({ in: parameter.in, name: parameter.prop })\n ];\n const specParameterSchema = resolveIfRef(spec, specParameter?.schema);\n if (specParameterSchema) {\n linkModel(\n spec,\n modelsByName,\n parameter,\n specParameterSchema,\n visited,\n );\n } else if (parameter.in === 'body') {\n const specBody = resolveIfRef(spec, specOp?.requestBody);\n const specBodySchema = resolveIfRef(\n spec,\n specBody?.content?.[parameter.mediaType]?.schema,\n );\n if (specBodySchema) {\n linkModel(spec, modelsByName, parameter, specBodySchema, visited);\n }\n }\n });\n\n op.responses.forEach((response) => {\n const specResponse = resolveIfRef(\n spec,\n specOp?.responses?.[response.code],\n );\n Object.keys(specResponse?.content ?? {}).forEach((mediaType) => {\n const responseSchema = resolveIfRef(\n spec,\n specResponse?.content?.[mediaType]?.schema,\n );\n if (responseSchema) {\n linkModel(spec, modelsByName, response, responseSchema, visited);\n }\n });\n });\n });\n });\n};\n\n/**\n * Populate `composedModels` and `composedPrimitives` on each composite model\n * with the models and primitive types it is composed of.\n */\nconst resolveComposedModel = (\n modelsByName: ModelsByName,\n model: Model,\n visited: Set<Model>,\n): void => {\n if (!COMPOSED_SCHEMA_TYPES.has(model.export) || visited.has(model)) return;\n visited.add(model);\n\n const members = model.properties.filter((p) => !p.name);\n const referenced = members\n .filter((p) => p.export === 'reference')\n .flatMap((r) => (modelsByName[r.type] ? [modelsByName[r.type]] : []));\n\n // Resolve recursively so all-of mixins include nested all-of properties\n referenced.forEach((m) => resolveComposedModel(modelsByName, m, visited));\n\n // Enums serialise as primitives, so group them with the primitives\n const composedModels = referenced.filter((m) => m.export !== 'enum');\n const composedPrimitives = [\n ...members.filter((p) => p.export !== 'reference'),\n ...referenced.filter((m) => m.export === 'enum'),\n ];\n\n // A composite of multiple non-primitive array members can't be told apart at\n // runtime: each arrives as a plain JSON array with no property to switch on.\n // A `discriminator` can't disambiguate here either — it names a property on\n // an object member, not on an array. Model a polymorphic list as an array of\n // a discriminated union instead (`type: array` whose `items` is the oneOf).\n const isPrimitiveArray = (m: Model): boolean =>\n m.link && COLLECTION_TYPES.has(m.export)\n ? isPrimitiveArray(m.link)\n : PRIMITIVE_TYPES.has(m.type) &&\n !['date', 'date-time'].includes(m.format ?? '');\n const arrayComposedModels = composedPrimitives.filter(\n (m) => m.export === 'array' && !isPrimitiveArray(m),\n );\n if (arrayComposedModels.length > 1) {\n throw new Error(\n `Schema \"${model.name}\" defines ${camelCase(model.export)} with multiple array types which cannot be distinguished at runtime. Model a polymorphic list as an array whose items are a discriminated union instead (a \"type: array\" schema with a \"oneOf\" in \"items\").`,\n );\n }\n\n /**\n * Whether a member constrains nothing, describing the empty object.\n * `{description: \"...\"}`, `{example: ...}` and `{title: ...}` are how OpenAPI\n * 3.0 annotates a `$ref`, whose own siblings are ignored there — the commonest\n * `allOf` idiom in published specs, and counting it as a non-object made those\n * documents fail outright.\n *\n * A bare `{description}` parses as an `interface` with no properties; an\n * explicit `{type: object}` with none parses as a `dictionary` carrying no\n * value type.\n *\n * A member declaring `required` is *not* empty even with no properties of its\n * own: it raises a sibling branch's property to mandatory, and nothing here\n * carries that across, so dropping it would quietly make a required field\n * optional. Those keep failing loudly until the constraint can be honoured.\n */\n const isStructurallyEmpty = (m: Model): boolean =>\n (m.properties ?? []).length === 0 &&\n !m.hasAdditionalProperties &&\n !m.hasPatternProperties &&\n (m.declaredRequired ?? []).length === 0 &&\n ((m.export === 'interface' && !m.link) ||\n (m.export === 'dictionary' && m.type === 'unknown'));\n const constrainingPrimitives = composedPrimitives.filter(\n (m) => !isStructurallyEmpty(m),\n );\n\n // A single-member `allOf` composes to exactly that member, so a scalar one is\n // unambiguous rather than a conjunction of incompatible types — it is how a\n // description is attached to a scalar, and specs use it for enums especially.\n const isSingleMemberAllOf =\n model.export === 'all-of' &&\n members.length === 1 &&\n composedModels.length === 0 &&\n constrainingPrimitives.length === 1;\n\n if (\n model.export === 'all-of' &&\n constrainingPrimitives.length > 0 &&\n !isSingleMemberAllOf\n ) {\n // Name what the offending members actually are: the old wording said\n // \"non-object types\" even for a member that is explicitly an object, which\n // sent readers looking for the wrong thing.\n const requiresOnly = constrainingPrimitives.filter(\n (m) => (m.declaredRequired ?? []).length > 0 && !m.properties?.length,\n );\n const detail =\n requiresOnly.length > 0\n ? `an allOf member declares \"required\" (${requiresOnly\n .flatMap((m) => m.declaredRequired ?? [])\n .map((name) => `\"${name}\"`)\n .join(\n ', ',\n )}) for properties it does not itself declare, which this generator cannot carry across branches. Declare the property in the same member, or mark it required where it is declared`\n : `an allOf member is not an object type, and allOf may only compose object types`;\n throw new Error(`Schema \"${model.name}\" cannot be composed: ${detail}.`);\n }\n\n model.composedModels = composedModels;\n model.composedPrimitives =\n model.export === 'all-of' ? constrainingPrimitives : composedPrimitives;\n // Drop the annotation-only members from what templates render, so an `allOf`\n // that only carried a description composes to the member it annotates rather\n // than to an intersection with the empty object.\n if (model.export === 'all-of') {\n model.properties = model.properties.filter(\n (member) => member.name || !isStructurallyEmpty(member),\n );\n }\n};\n\nconst resolveComposedModels = (data: ClientData): void => {\n const modelsByName = indexModelsByName(data.models);\n const visited = new Set<Model>();\n data.models.forEach((model) =>\n resolveComposedModel(modelsByName, model, visited),\n );\n};\n\nconst isHoisted = (spec: Spec, name: string): boolean =>\n !!(\n resolveIfRef<Schema | undefined>(spec, spec.components?.schemas?.[name]) as\n | { 'x-aws-nx-hoisted'?: boolean }\n | undefined\n )?.['x-aws-nx-hoisted'];\n\n/**\n * The on-the-wire name of a schema: its original name before normalisation to\n * a valid identifier (recorded by the normaliser), or its current name. An\n * implicit discriminator matches on this, not the normalised model name.\n */\nconst wireName = (spec: Spec, name: string): string =>\n (\n resolveIfRef<Schema | undefined>(spec, spec.components?.schemas?.[name]) as\n | { 'x-aws-nx-original-name'?: string }\n | undefined\n )?.['x-aws-nx-original-name'] ?? name;\n\n/**\n * The value → model-name mapping for a discriminator, resolved either from an\n * explicit `mapping` (value → schema ref) or implicitly (each candidate model's\n * schema name is its own discriminator value). Only candidates in\n * `candidateNames` are kept, so unknown values fall through to the default\n * marshalling; hoisted synthetic names (which never appear on the wire) are\n * excluded from the implicit form.\n */\nconst buildDiscriminatorMapping = (\n spec: Spec,\n discriminator: OpenAPIV3.DiscriminatorObject,\n candidateNames: Set<string>,\n): DiscriminatorMapping[] => {\n if (discriminator.mapping) {\n const mapping: DiscriminatorMapping[] = [];\n for (const [value, ref] of Object.entries(discriminator.mapping)) {\n if (typeof ref !== 'string' || !ref.startsWith('#/')) continue;\n const modelName = splitRef(ref)[2];\n if (candidateNames.has(modelName)) mapping.push({ value, modelName });\n }\n return mapping;\n }\n return (\n [...candidateNames]\n .filter((name) => !isHoisted(spec, name))\n // The wire value is the schema's original name; the model it selects is the\n // normalised name.\n .map((name) => ({ value: wireName(spec, name), modelName: name }))\n );\n};\n\n/**\n * Build the {@link Discriminator} for a `oneOf`/`anyOf` composite, if declared.\n * The candidates are the models composed by the union.\n */\nconst buildCompositeDiscriminator = (\n spec: Spec,\n model: Model,\n schema: Schema,\n): Discriminator | undefined => {\n const { discriminator } = schema;\n if (!discriminator?.propertyName) return undefined;\n\n const candidateNames = new Set(\n (model.composedModels ?? []).map((m) => m.name),\n );\n const mapping = buildDiscriminatorMapping(\n spec,\n discriminator,\n candidateNames,\n );\n\n return mapping.length > 0\n ? { propertyName: discriminator.propertyName, mapping }\n : undefined;\n};\n\n/**\n * Build the {@link Discriminator} for an inheritance base — an `object` schema\n * carrying a `discriminator` whose subtypes `allOf`-compose it. The candidates\n * are those subtypes (found by scanning every model for one that composes this\n * base). Marked `isBase` so the generator emits a non-dispatching body the\n * subtypes can compose without recursing.\n */\nconst buildBaseDiscriminator = (\n spec: Spec,\n base: Model,\n schema: Schema,\n models: Model[],\n): Discriminator | undefined => {\n const { discriminator } = schema;\n if (!discriminator?.propertyName) return undefined;\n\n const subtypeNames = new Set(\n models\n .filter(\n (m) =>\n m.export === 'all-of' &&\n (m.composedModels ?? []).some((c) => c.name === base.name),\n )\n .map((m) => m.name),\n );\n if (subtypeNames.size === 0) return undefined;\n\n const mapping = buildDiscriminatorMapping(spec, discriminator, subtypeNames);\n\n return mapping.length > 0\n ? { propertyName: discriminator.propertyName, mapping, isBase: true }\n : undefined;\n};\n\n/**\n * Attach discriminator metadata so the generator can marshal directly to the\n * matching branch/subtype. Two shapes carry a discriminator:\n * - a `oneOf`/`anyOf` composite (dispatch to the matching member), and\n * - an inheritance base `object` whose subtypes `allOf`-compose it (dispatch\n * to the matching subtype so subtype-only fields survive marshalling).\n * `allOf` itself is a conjunction (not a choice) so it is never discriminated.\n */\nconst resolveDiscriminators = (spec: Spec, data: ClientData): void => {\n data.models.forEach((model) => {\n const schema = resolveIfRef<Schema | undefined>(\n spec,\n spec.components?.schemas?.[model.name],\n );\n if (!schema) return;\n\n if (model.export === 'one-of' || model.export === 'any-of') {\n const discriminator = buildCompositeDiscriminator(spec, model, schema);\n if (discriminator) model.discriminator = discriminator;\n } else if (model.export === 'interface') {\n const discriminator = buildBaseDiscriminator(\n spec,\n model,\n schema,\n data.models,\n );\n if (discriminator) model.discriminator = discriminator;\n }\n });\n};\n\n/**\n * Type each discriminated subtype's discriminator property as its literal\n * value(s), turning `Cat | Dog` into a true TypeScript tagged union that\n * narrows on the discriminator (e.g. `Cat.petType: 'cat'`).\n *\n * The literal is taken from every discriminator's `mapping` (value → subtype).\n * A subtype selected by several values within one discriminator becomes a union\n * of those literals. A subtype that appears in multiple discriminators with\n * conflicting values can't be pinned to a single literal, so it is left as the\n * plain primitive (`string`) — the marshalling dispatch is unaffected either\n * way, this only affects the emitted type.\n */\nconst resolveDiscriminatorLiterals = (data: ClientData): void => {\n const modelsByName = indexModelsByName(data.models);\n\n // Collect, per (subtype, discriminator property), the set of literal values\n // that select it — across every discriminator in the spec.\n const valuesBySubtypeProp = new Map<string, Set<string>>();\n const conflicting = new Set<string>();\n\n for (const model of data.models) {\n const discriminator = model.discriminator;\n if (!discriminator) continue;\n const byName = new Map<string, string[]>();\n for (const { value, modelName } of discriminator.mapping) {\n byName.set(modelName, [...(byName.get(modelName) ?? []), value]);\n }\n for (const [modelName, values] of byName) {\n const key = `${modelName}\u0000${discriminator.propertyName}`;\n const existing = valuesBySubtypeProp.get(key);\n const incoming = new Set(values);\n if (existing && !setsEqual(existing, incoming)) {\n // Same subtype+property tagged differently by another union.\n conflicting.add(key);\n }\n valuesBySubtypeProp.set(\n key,\n existing ? union(existing, incoming) : incoming,\n );\n }\n }\n\n for (const [key, values] of valuesBySubtypeProp) {\n if (conflicting.has(key)) continue;\n const [modelName, propertyName] = key.split('\u0000');\n const property = modelsByName[modelName]?.properties.find(\n (p) => p.name === propertyName,\n );\n // Only pin a literal when the property is a plain (string/enum) scalar —\n // never an object/array reference.\n if (property && (property.type === 'string' || property.isEnum)) {\n property.discriminatorValue = [...values]\n .map((v) => JSON.stringify(v))\n .join(' | ');\n }\n }\n};\n\nconst setsEqual = (a: Set<string>, b: Set<string>): boolean =>\n a.size === b.size && [...a].every((v) => b.has(v));\n\nconst union = (a: Set<string>, b: Set<string>): Set<string> =>\n new Set([...a, ...b]);\n\n/**\n * Build the client data structure from a (normalised) OpenAPI spec: a fully\n * linked model graph with composite members resolved, ready for augmentation.\n */\nexport const buildClientData = (spec: Spec): ClientData => {\n const data: ClientData = {\n models: buildModels(spec),\n services: [buildDefaultService(spec)],\n };\n linkModels(spec, data);\n resolveComposedModels(data);\n resolveDiscriminators(spec, data);\n resolveDiscriminatorLiterals(data);\n return data;\n};\n"],"names":["camelCase","trim","COLLECTION_TYPES","COMPOSED_SCHEMA_TYPES","createModel","DEFAULT_SERVICE_NAME","indexModelsByName","PRIMITIVE_TYPES","isRef","resolveIfRef","splitRef","PRIMITIVE_TYPE_MAP","string","number","integer","boolean","null","HTTP_METHODS","schemaType","schema","type","isNullable","nullable","Array","isArray","includes","primaryType","find","t","isEnumSchema","enum","length","compositeExport","allOf","anyOf","oneOf","undefined","compositeMembers","isDictionarySchema","hasProperties","Object","keys","properties","patternProperties","primitiveType","format","preferredMediaType","content","parseResponseCode","code","test","parseInt","collectImports","models","Set","flatMap","m","imports","schemaStructure","spec","enumMembers","filter","value","declared","export","map","composite","member","buildInlineModel","prefixItems","items","collectionValue","declaredRequired","required","dictionaryValue","buildProperties","$ref","link","additional","additionalProperties","schemaOrRef","name","description","deprecated","isReadOnly","readOnly","buildDefinitionModel","structure","isNamedObject","entries","propSchema","isRequired","has","discriminatorTargets","targets","Map","values","components","schemas","discriminator","propertyName","mapping","mappedRef","startsWith","modelName","get","add","set","collapseDiscriminators","size","byName","model","property","referenced","buildModels","buildRequestBody","specOp","requestBody","mediaType","base","partContentTypes","fromEntries","encoding","prop","contentType","in","buildParameters","pathParameters","mergeParameters","parameters","p","param","contentMediaType","Error","body","params","sort","a","b","operationParameters","key","specParameterKey","overridden","inherited","buildResponses","responses","resOrRef","response","responseSchema","buildOperation","path","method","id","operationId","toUpperCase","tags","parametersBody","buildOperations","paths","pathItemOrRef","pathItem","buildDefaultService","operations","op","getSpecOperation","toLowerCase","parameter","getSpecParametersByKey","getSpecPathParameters","compositeMemberSchemas","keyword","linkModel","modelsByName","visited","memberSchemas","forEach","i","subSchema","linkModels","data","services","service","specParametersByKey","specParameter","specParameterSchema","specBody","specBodySchema","specResponse","resolveComposedModel","members","r","composedModels","composedPrimitives","isPrimitiveArray","arrayComposedModels","isStructurallyEmpty","hasAdditionalProperties","hasPatternProperties","constrainingPrimitives","isSingleMemberAllOf","requiresOnly","detail","join","resolveComposedModels","isHoisted","wireName","buildDiscriminatorMapping","candidateNames","ref","push","buildCompositeDiscriminator","buildBaseDiscriminator","subtypeNames","some","c","isBase","resolveDiscriminators","resolveDiscriminatorLiterals","valuesBySubtypeProp","conflicting","existing","incoming","setsEqual","union","split","isEnum","discriminatorValue","v","JSON","stringify","every","buildClientData"],"mappings":"AAAA;;;CAGC,GAED,OAAOA,eAAe,mB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AAI0H,oBAAqB;QAC/C,IAAIC,YAAY/H,GAAG,CAACgD,MAAM;QAC1B,MAAM,CAACpC,WAAWJ,aAAa,GAAGwC,IAAIoF,KAAK,CAAC;QAC5C,MAAMhH,WAAW4D,YAAY,CAACpE,UAAU,EAAE9D,WAAWf,KACnD,CAACuG,IAAMA,EAAEjD,IAAI,KAAKmB;QAEpB,yEAAyE;QACzE,mCAAmC;QACnC,IAAIY,YAAaA,CAAAA,SAAS5F,IAAI,KAAK,YAAY4F,SAASiH,MAAM,AAAD,GAAI;YAC/DjH,SAASkH,kBAAkB,GAAG;mBAAIlI;aAAO,CACtC/B,GAAG,CAAC,CAACkK,IAAMC,KAAKC,SAAS,CAACF,IAC1BzB,IAAI,CAAC;QACV;IACF;AACF;AAEA,MAAMoB,YAAY,CAACrF,GAAgBC,IACjCD,EAAE5B,IAAI,KAAK6B,EAAE7B,IAAI,IAAI;WAAI4B;KAAE,CAAC6F,KAAK,CAAC,CAACH,IAAMzF,EAAE9C,GAAG,CAACuI;AAEjD,MAAMJ,QAAQ,CAACtF,GAAgBC,IAC7B,IAAIpF,IAAI;WAAImF;WAAMC;KAAE;AAEtB;;;CAGC,GACD,OAAO,MAAM6F,kBAAkB,CAAC5K;IAC9B,MAAMwH,OAAmB;QACvB9H,QAAQ6D,YAAYvD;QACpByH,UAAU;YAACnB,oBAAoBtG;SAAM;IACvC;IACAuH,WAAWvH,MAAMwH;IACjBwB,sBAAsBxB;IACtBqC,sBAAsB7J,MAAMwH;IAC5BsC,6BAA6BtC;IAC7B,OAAOA;AACT,EAAE"}
|
|
@@ -418,9 +418,9 @@ onlyBuiltDependencies:
|
|
|
418
418
|
- sharp
|
|
419
419
|
catalogMode: strict
|
|
420
420
|
catalog:
|
|
421
|
-
nx: 23.2.
|
|
422
|
-
'@nx/js': 23.2.
|
|
423
|
-
'@nx/workspace': 23.2.
|
|
421
|
+
nx: 23.2.1
|
|
422
|
+
'@nx/js': 23.2.1
|
|
423
|
+
'@nx/workspace': 23.2.1
|
|
424
424
|
typescript: ~6.0.3
|
|
425
425
|
'@biomejs/biome': 2.5.12
|
|
426
426
|
'@aws/nx-plugin': ^0.0.0
|
|
@@ -17,7 +17,7 @@ export declare const DEPENDENCIES: import("../utils/declared-dependencies.js").D
|
|
|
17
17
|
readonly name: "typescript";
|
|
18
18
|
}, {
|
|
19
19
|
readonly name: "@biomejs/biome";
|
|
20
|
-
}], readonly import("../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
20
|
+
}], readonly import("../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
21
21
|
export declare const PRESET_GENERATOR_INFO: NxGeneratorInfo;
|
|
22
22
|
/**
|
|
23
23
|
* Determines if the current user is an Amazon employee based on their git configuration.
|
|
@@ -49,9 +49,6 @@ export const pyAgentGatewayConnectionGenerator = async (tree, options)=>{
|
|
|
49
49
|
if (gateway.auth !== 'iam') {
|
|
50
50
|
throw new Error(`Gateway '${gateway.name}' uses auth='${gateway.auth}'. Agent connections currently require the gateway to use IAM authentication.`);
|
|
51
51
|
}
|
|
52
|
-
if (agentComponent.auth && agentComponent.auth !== 'iam') {
|
|
53
|
-
throw new Error(`Agent '${agentComponent.name}' uses auth='${agentComponent.auth}'. Only IAM-authenticated agents can connect to IAM gateways.`);
|
|
54
|
-
}
|
|
55
52
|
const gatewayClassName = gateway.rc;
|
|
56
53
|
const gatewaySnakeCase = snakeCase(gatewayClassName);
|
|
57
54
|
// A gateway is its own standalone project, so it exposes plain serve / dev.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/py/agent/gateway-connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { readAgentCoreGatewayMetadata } from '../../../agentcore-gateway/generator.js';\nimport { addPyDependencies } from '../../../utils/add-dependencies.js';\nimport {\n AGENT_CONNECTION_PY_DEPENDENCIES,\n type AgentFramework,\n addPythonCoreClient,\n addPythonReExport,\n ensurePythonAgentConnectionProject,\n getPythonAgentConnectionModuleName,\n getPythonAgentConnectionProject,\n getPythonAgentConnectionProjectDir,\n PY_MCP_FAMILY_CONNECTIONS,\n resolveAgentFramework,\n} from '../../../utils/agent-connection/agent-connection.js';\nimport { addPythonDestructuredImport } from '../../../utils/ast.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { installDependencies } from '../../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics.js';\nimport { snakeCase } from '../../../utils/names.js';\nimport {\n addComponentGeneratorMetadata,\n addDependencyToTargetIfNotPresent,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx.js';\nimport { toProjectRelativePath } from '../../../utils/paths.js';\nimport { addWorkspaceDependencyToPyProject } from '../../../utils/py.js';\nimport type { PyAgentGatewayConnectionGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface PyAgentGatewayConnectionMetadata {\n readonly framework: AgentFramework;\n}\n\n// The framework picks the MCP client's extra deps, so it names its branch here.\nexport const DEPENDENCIES =\n declareDependencies<PyAgentGatewayConnectionMetadata>()({\n py: [\n { name: 'boto3' },\n { name: 'httpx' },\n { name: 'mcp' },\n // Backs the LangChain client; it must not pull Strands in.\n {\n name: 'langchain-mcp-adapters',\n when: (m) => m.framework === 'langchain',\n },\n ...ownedElsewhere(AGENT_CONNECTION_PY_DEPENDENCIES),\n ],\n });\n\nexport const PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const pyAgentGatewayConnectionGenerator = async (\n tree: Tree,\n options: PyAgentGatewayConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const agentComponent = options.sourceComponent;\n if (!agentComponent) {\n throw new Error(\n 'sourceComponent must be provided for py#agent -> agentcore-gateway connections',\n );\n }\n const gateway = readAgentCoreGatewayMetadata(targetProject);\n\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Only MCP-protocol gateways are supported.`,\n );\n }\n if (gateway.auth !== 'iam') {\n throw new Error(\n `Gateway '${gateway.name}' uses auth='${gateway.auth}'. Agent connections currently require the gateway to use IAM authentication.`,\n );\n }\n if (agentComponent.auth && agentComponent.auth !== 'iam') {\n throw new Error(\n `Agent '${agentComponent.name}' uses auth='${agentComponent.auth}'. Only IAM-authenticated agents can connect to IAM gateways.`,\n );\n }\n\n const gatewayClassName = gateway.rc;\n const gatewaySnakeCase = snakeCase(gatewayClassName);\n // A gateway is its own standalone project, so it exposes plain serve / dev.\n const gatewayServeTargetName = 'serve';\n const gatewayDevTargetName = 'dev';\n\n // The source agent's framework selects the client shape, dependencies and the\n // agent.py transform — see PY_MCP_FAMILY_CONNECTIONS (keyed by framework, not a\n // boolean, so a third framework is an additive entry there). A Gateway exposes\n // its tools over MCP, so it reuses the same wiring as an MCP server connection.\n const framework = resolveAgentFramework(agentComponent.framework);\n const connection = PY_MCP_FAMILY_CONNECTIONS[framework];\n\n // Recorded below and read by the declaration's predicates, so the packages\n // added here are exactly the ones the version sync will own.\n const metadata: PyAgentGatewayConnectionMetadata = { framework };\n\n await ensurePythonAgentConnectionProject(tree, DEPENDENCIES);\n await addPythonCoreClient(tree, 'gateway', DEPENDENCIES, framework);\n\n const agentConnectionProjectDir = getPythonAgentConnectionProjectDir(tree);\n const agentConnectionModuleName = getPythonAgentConnectionModuleName(tree);\n\n // Shared MCP transport + signed httpx auth deps, plus whatever extra deps the\n // framework's MCP client needs (e.g. langchain-mcp-adapters for LangChain).\n // These belong to the shared agent-connection project, which holds the client.\n addPyDependencies(tree, DEPENDENCIES, {\n metadata,\n projectRoot: agentConnectionProjectDir,\n });\n\n const appDir = joinPathFragments(\n agentConnectionProjectDir,\n agentConnectionModuleName,\n 'app',\n );\n // Local mode points at the gateway project's local gateway port.\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n connection.appTemplateSubdir,\n ),\n appDir,\n {\n gatewaySnakeCase,\n gatewayClassName,\n agentConnectionModuleName,\n gatewayPort: gateway.port,\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n const appInitPath = joinPathFragments(appDir, '__init__.py');\n if (!tree.exists(appInitPath)) {\n tree.write(appInitPath, '');\n }\n\n const moduleInitPath = joinPathFragments(\n agentConnectionProjectDir,\n agentConnectionModuleName,\n '__init__.py',\n );\n await addPythonReExport(\n tree,\n moduleInitPath,\n `.app.${gatewaySnakeCase}_client_${connection.clientModuleSuffix}`,\n `${gatewayClassName}Client${connection.clientClassSuffix}`,\n );\n\n const agentSourceDir = joinPathFragments(\n sourceProject.root,\n agentComponent.path ?? 'src',\n );\n const agentFilePath = joinPathFragments(agentSourceDir, 'agent.py');\n\n if (tree.exists(agentFilePath)) {\n const clientClassName = `${gatewayClassName}Client${connection.clientClassSuffix}`;\n const clientVarName = gatewaySnakeCase;\n\n await addPythonDestructuredImport(\n tree,\n agentFilePath,\n [clientClassName],\n agentConnectionModuleName,\n );\n await connection.wireClientIntoAgent(\n tree,\n agentFilePath,\n clientClassName,\n clientVarName,\n );\n }\n\n addWorkspaceDependencyToPyProject(\n tree,\n sourceProject,\n getPythonAgentConnectionProject(tree),\n );\n\n const agentName = agentComponent.name ?? 'agent';\n const serveTargetName = `${agentName}-serve`;\n const devTargetName = `${agentName}-dev`;\n let projectConfigChanged = false;\n if (sourceProject.targets?.[serveTargetName]) {\n addDependencyToTargetIfNotPresent(sourceProject, serveTargetName, {\n projects: [targetProject.name],\n target: gatewayServeTargetName,\n });\n projectConfigChanged = true;\n }\n if (sourceProject.targets?.[devTargetName]) {\n addDependencyToTargetIfNotPresent(sourceProject, devTargetName, {\n projects: [targetProject.name],\n target: gatewayDevTargetName,\n });\n projectConfigChanged = true;\n }\n if (projectConfigChanged) {\n updateProjectConfiguration(tree, sourceProject.name, sourceProject);\n }\n\n // Recorded so the version sync knows this connection's dependencies are ours.\n addComponentGeneratorMetadata(\n tree,\n sourceProject.name,\n PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO,\n toProjectRelativePath(sourceProject, agentFilePath),\n gatewayClassName,\n // `sourcePath` names the source component this connection is made from, so\n // the pair is identifiable rather than just the two projects.\n { ...metadata, sourcePath: options.sourceComponent?.path },\n );\n\n await addGeneratorMetricsIfApplicable(tree, [\n PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default pyAgentGatewayConnectionGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","readAgentCoreGatewayMetadata","addPyDependencies","AGENT_CONNECTION_PY_DEPENDENCIES","addPythonCoreClient","addPythonReExport","ensurePythonAgentConnectionProject","getPythonAgentConnectionModuleName","getPythonAgentConnectionProject","getPythonAgentConnectionProjectDir","PY_MCP_FAMILY_CONNECTIONS","resolveAgentFramework","addPythonDestructuredImport","declareDependencies","ownedElsewhere","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","snakeCase","addComponentGeneratorMetadata","addDependencyToTargetIfNotPresent","getGeneratorInfo","readProjectConfigurationUnqualified","toProjectRelativePath","addWorkspaceDependencyToPyProject","DEPENDENCIES","py","name","when","m","framework","PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO","filename","pyAgentGatewayConnectionGenerator","tree","options","sourceProject","targetProject","agentComponent","sourceComponent","Error","gateway","protocol","auth","gatewayClassName","rc","gatewaySnakeCase","gatewayServeTargetName","gatewayDevTargetName","connection","metadata","agentConnectionProjectDir","agentConnectionModuleName","projectRoot","appDir","dirname","appTemplateSubdir","gatewayPort","port","overwriteStrategy","KeepExisting","appInitPath","exists","write","moduleInitPath","clientModuleSuffix","clientClassSuffix","agentSourceDir","root","path","agentFilePath","clientClassName","clientVarName","wireClientIntoAgent","agentName","serveTargetName","devTargetName","projectConfigChanged","targets","projects","target","sourcePath","preferInstallDependencies","languages"],"mappings":"AAAA;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AC9BqD,QAAQjC;QACV;QACA8B,uBAAuB;IACzB;IACA,IAAIzC,cAAc0C,OAAO,EAAE,CAACF,cAAc,EAAE;QAC1CxD,kCAAkCgB,eAAewC,eAAe;YAC9DG,UAAU;gBAAC1C,cAAcV,IAAI;aAAC;YAC9BqD,QAAQhC;QACV;QACA6B,uBAAuB;IACzB;IACA,IAAIA,sBAAsB;QACxB7E,2BAA2BkC,MAAME,cAAcT,IAAI,EAAES;IACvD;IAEA,8EAA8E;IAC9EjB,8BACEe,MACAE,cAAcT,IAAI,EAClBI,4CACAR,sBAAsBa,eAAekC,gBACrC1B,kBACA,2EAA2E;IAC3E,8DAA8D;IAC9D;QAAE,GAAGM,QAAQ;QAAE+B,YAAY9C,QAAQI,eAAe,EAAE8B;IAAK;IAG3D,MAAMpD,gCAAgCiB,MAAM;QAC1CH;KACD;IAED,MAAMhB,qBAAqBmB;IAC3B,OAAO,IACLlB,oBAAoBkB,MAAMC,QAAQ+C,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,eAAelD,kCAAkC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/py/agent/gateway-connection/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { readAgentCoreGatewayMetadata } from '../../../agentcore-gateway/generator.js';\nimport { addPyDependencies } from '../../../utils/add-dependencies.js';\nimport {\n AGENT_CONNECTION_PY_DEPENDENCIES,\n type AgentFramework,\n addPythonCoreClient,\n addPythonReExport,\n ensurePythonAgentConnectionProject,\n getPythonAgentConnectionModuleName,\n getPythonAgentConnectionProject,\n getPythonAgentConnectionProjectDir,\n PY_MCP_FAMILY_CONNECTIONS,\n resolveAgentFramework,\n} from '../../../utils/agent-connection/agent-connection.js';\nimport { addPythonDestructuredImport } from '../../../utils/ast.js';\nimport {\n declareDependencies,\n ownedElsewhere,\n} from '../../../utils/declared-dependencies.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { installDependencies } from '../../../utils/install.js';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics.js';\nimport { snakeCase } from '../../../utils/names.js';\nimport {\n addComponentGeneratorMetadata,\n addDependencyToTargetIfNotPresent,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx.js';\nimport { toProjectRelativePath } from '../../../utils/paths.js';\nimport { addWorkspaceDependencyToPyProject } from '../../../utils/py.js';\nimport type { PyAgentGatewayConnectionGeneratorSchema } from './schema';\n\n/** The metadata this generator records, which its predicates read. */\nexport interface PyAgentGatewayConnectionMetadata {\n readonly framework: AgentFramework;\n}\n\n// The framework picks the MCP client's extra deps, so it names its branch here.\nexport const DEPENDENCIES =\n declareDependencies<PyAgentGatewayConnectionMetadata>()({\n py: [\n { name: 'boto3' },\n { name: 'httpx' },\n { name: 'mcp' },\n // Backs the LangChain client; it must not pull Strands in.\n {\n name: 'langchain-mcp-adapters',\n when: (m) => m.framework === 'langchain',\n },\n ...ownedElsewhere(AGENT_CONNECTION_PY_DEPENDENCIES),\n ],\n });\n\nexport const PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const pyAgentGatewayConnectionGenerator = async (\n tree: Tree,\n options: PyAgentGatewayConnectionGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const sourceProject = readProjectConfigurationUnqualified(\n tree,\n options.sourceProject,\n );\n const targetProject = readProjectConfigurationUnqualified(\n tree,\n options.targetProject,\n );\n\n const agentComponent = options.sourceComponent;\n if (!agentComponent) {\n throw new Error(\n 'sourceComponent must be provided for py#agent -> agentcore-gateway connections',\n );\n }\n const gateway = readAgentCoreGatewayMetadata(targetProject);\n\n if (gateway.protocol !== 'mcp') {\n throw new Error(\n `Gateway '${gateway.name}' has protocol='${gateway.protocol}'. Only MCP-protocol gateways are supported.`,\n );\n }\n if (gateway.auth !== 'iam') {\n throw new Error(\n `Gateway '${gateway.name}' uses auth='${gateway.auth}'. Agent connections currently require the gateway to use IAM authentication.`,\n );\n }\n\n const gatewayClassName = gateway.rc;\n const gatewaySnakeCase = snakeCase(gatewayClassName);\n // A gateway is its own standalone project, so it exposes plain serve / dev.\n const gatewayServeTargetName = 'serve';\n const gatewayDevTargetName = 'dev';\n\n // The source agent's framework selects the client shape, dependencies and the\n // agent.py transform — see PY_MCP_FAMILY_CONNECTIONS (keyed by framework, not a\n // boolean, so a third framework is an additive entry there). A Gateway exposes\n // its tools over MCP, so it reuses the same wiring as an MCP server connection.\n const framework = resolveAgentFramework(agentComponent.framework);\n const connection = PY_MCP_FAMILY_CONNECTIONS[framework];\n\n // Recorded below and read by the declaration's predicates, so the packages\n // added here are exactly the ones the version sync will own.\n const metadata: PyAgentGatewayConnectionMetadata = { framework };\n\n await ensurePythonAgentConnectionProject(tree, DEPENDENCIES);\n await addPythonCoreClient(tree, 'gateway', DEPENDENCIES, framework);\n\n const agentConnectionProjectDir = getPythonAgentConnectionProjectDir(tree);\n const agentConnectionModuleName = getPythonAgentConnectionModuleName(tree);\n\n // Shared MCP transport + signed httpx auth deps, plus whatever extra deps the\n // framework's MCP client needs (e.g. langchain-mcp-adapters for LangChain).\n // These belong to the shared agent-connection project, which holds the client.\n addPyDependencies(tree, DEPENDENCIES, {\n metadata,\n projectRoot: agentConnectionProjectDir,\n });\n\n const appDir = joinPathFragments(\n agentConnectionProjectDir,\n agentConnectionModuleName,\n 'app',\n );\n // Local mode points at the gateway project's local gateway port.\n generateFiles(\n tree,\n joinPathFragments(\n import.meta.dirname,\n 'files',\n connection.appTemplateSubdir,\n ),\n appDir,\n {\n gatewaySnakeCase,\n gatewayClassName,\n agentConnectionModuleName,\n gatewayPort: gateway.port,\n },\n { overwriteStrategy: OverwriteStrategy.KeepExisting },\n );\n\n const appInitPath = joinPathFragments(appDir, '__init__.py');\n if (!tree.exists(appInitPath)) {\n tree.write(appInitPath, '');\n }\n\n const moduleInitPath = joinPathFragments(\n agentConnectionProjectDir,\n agentConnectionModuleName,\n '__init__.py',\n );\n await addPythonReExport(\n tree,\n moduleInitPath,\n `.app.${gatewaySnakeCase}_client_${connection.clientModuleSuffix}`,\n `${gatewayClassName}Client${connection.clientClassSuffix}`,\n );\n\n const agentSourceDir = joinPathFragments(\n sourceProject.root,\n agentComponent.path ?? 'src',\n );\n const agentFilePath = joinPathFragments(agentSourceDir, 'agent.py');\n\n if (tree.exists(agentFilePath)) {\n const clientClassName = `${gatewayClassName}Client${connection.clientClassSuffix}`;\n const clientVarName = gatewaySnakeCase;\n\n await addPythonDestructuredImport(\n tree,\n agentFilePath,\n [clientClassName],\n agentConnectionModuleName,\n );\n await connection.wireClientIntoAgent(\n tree,\n agentFilePath,\n clientClassName,\n clientVarName,\n );\n }\n\n addWorkspaceDependencyToPyProject(\n tree,\n sourceProject,\n getPythonAgentConnectionProject(tree),\n );\n\n const agentName = agentComponent.name ?? 'agent';\n const serveTargetName = `${agentName}-serve`;\n const devTargetName = `${agentName}-dev`;\n let projectConfigChanged = false;\n if (sourceProject.targets?.[serveTargetName]) {\n addDependencyToTargetIfNotPresent(sourceProject, serveTargetName, {\n projects: [targetProject.name],\n target: gatewayServeTargetName,\n });\n projectConfigChanged = true;\n }\n if (sourceProject.targets?.[devTargetName]) {\n addDependencyToTargetIfNotPresent(sourceProject, devTargetName, {\n projects: [targetProject.name],\n target: gatewayDevTargetName,\n });\n projectConfigChanged = true;\n }\n if (projectConfigChanged) {\n updateProjectConfiguration(tree, sourceProject.name, sourceProject);\n }\n\n // Recorded so the version sync knows this connection's dependencies are ours.\n addComponentGeneratorMetadata(\n tree,\n sourceProject.name,\n PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO,\n toProjectRelativePath(sourceProject, agentFilePath),\n gatewayClassName,\n // `sourcePath` names the source component this connection is made from, so\n // the pair is identifiable rather than just the two projects.\n { ...metadata, sourcePath: options.sourceComponent?.path },\n );\n\n await addGeneratorMetricsIfApplicable(tree, [\n PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO,\n ]);\n\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\n\nexport default pyAgentGatewayConnectionGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","updateProjectConfiguration","readAgentCoreGatewayMetadata","addPyDependencies","AGENT_CONNECTION_PY_DEPENDENCIES","addPythonCoreClient","addPythonReExport","ensurePythonAgentConnectionProject","getPythonAgentConnectionModuleName","getPythonAgentConnectionProject","getPythonAgentConnectionProjectDir","PY_MCP_FAMILY_CONNECTIONS","resolveAgentFramework","addPythonDestructuredImport","declareDependencies","ownedElsewhere","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","snakeCase","addComponentGeneratorMetadata","addDependencyToTargetIfNotPresent","getGeneratorInfo","readProjectConfigurationUnqualified","toProjectRelativePath","addWorkspaceDependencyToPyProject","DEPENDENCIES","py","name","when","m","framework","PY_AGENT_GATEWAY_CONNECTION_GENERATOR_INFO","filename","pyAgentGatewayConnectionGenerator","tree","options","sourceProject","targetProject","agentComponent","sourceComponent","Error","gateway","protocol","auth","gatewayClassName","rc","gatewaySnakeCase","gatewayServeTargetName","gatewayDevTargetName","connection","metadata","agentConnectionProjectDir","agentConnectionModuleName","projectRoot","appDir","dirname","appTemplateSubdir","gatewayPort","port","overwriteStrategy","KeepExisting","appInitPath","exists","write","moduleInitPath","clientModuleSuffix","clientClassSuffix","agentSourceDir","root","path","agentFilePath","clientClassName","clientVarName","wireClientIntoAgent","agentName","serveTargetName","devTargetName","projectConfigChanged","targets","projects","target","sourcePath","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,E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IACA,IAAIA,sBAAsB;QACxB7E,2BAA2BkC,MAAME,cAAcT,IAAI,EAAES;IACvD;IAEA,8EAA8E;IAC9EjB,8BACEe,MACAE,cAAcT,IAAI,EAClBI,4CACAR,sBAAsBa,eAAekC,gBACrC1B,kBACA,2EAA2E;IAC3E,8DAA8D;IAC9D;QAAE,GAAGM,QAAQ;QAAE+B,YAAY9C,QAAQI,eAAe,EAAE8B;IAAK;IAG3D,MAAMpD,gCAAgCiB,MAAM;QAC1CH;KACD;IAED,MAAMhB,qBAAqBmB;IAC3B,OAAO,IACLlB,oBAAoBkB,MAAMC,QAAQ+C,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AAEF,eAAelD,kCAAkC"}
|
|
@@ -174,7 +174,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies.
|
|
|
174
174
|
versionOnly: true;
|
|
175
175
|
}, "when"> & {
|
|
176
176
|
when: (m: PyAgentReactConnectionMetadata) => boolean;
|
|
177
|
-
}], readonly import("../../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", PyAgentReactConnectionMetadata>[]>;
|
|
177
|
+
}], readonly import("../../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", PyAgentReactConnectionMetadata>[]>;
|
|
178
178
|
export declare const PY_AGENT_REACT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
179
179
|
export declare const pyAgentReactConnectionGenerator: (tree: Tree, options: ResolvedConnectionOptions & {
|
|
180
180
|
gatewayRoute?: AgentGatewayRoute;
|
package/src/py/agent/schema.json
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"auth": {
|
|
33
33
|
"type": "string",
|
|
34
34
|
"description": "The method used to authenticate with your Agent. Only applicable when infra is set (ignored when infra is none).",
|
|
35
|
+
"x-when": { "infra": ["agentcore", "agentcore-ecr"] },
|
|
35
36
|
"default": "iam",
|
|
36
37
|
"enum": ["iam", "cognito"],
|
|
37
38
|
"x-prompt": "How would you like to authenticate with your Agent?",
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"description": "The storage used to persist session for your Agent. LangChain supports 's3' or 'dynamodb-s3'; Strands supports 's3'; 'in-memory' is valid for both.",
|
|
67
68
|
"x-prompt": "How would you like to persist session for your Agent?",
|
|
68
69
|
"enum": ["s3", "dynamodb-s3", "in-memory"],
|
|
70
|
+
"x-value-when": { "dynamodb-s3": { "framework": "langchain" } },
|
|
69
71
|
"default": "s3",
|
|
70
72
|
"x-priority": "important"
|
|
71
73
|
},
|
|
@@ -19,7 +19,7 @@ export declare const DEPENDENCIES: import("../../../utils/declared-dependencies.
|
|
|
19
19
|
readonly name: "@tanstack/react-query-devtools";
|
|
20
20
|
}, {
|
|
21
21
|
readonly name: "@smithy/types";
|
|
22
|
-
}], readonly import("../../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
22
|
+
}], readonly import("../../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
23
23
|
export declare const FAST_API_REACT_GENERATOR_INFO: NxGeneratorInfo;
|
|
24
24
|
export declare const fastApiReactGenerator: (tree: Tree, options: FastApiReactGeneratorSchema) => Promise<() => Promise<void>>;
|
|
25
25
|
export default fastApiReactGenerator;
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"auth": {
|
|
25
25
|
"type": "string",
|
|
26
26
|
"description": "The method used to authenticate with your MCP server. Only applicable when infra is set (ignored when infra is none).",
|
|
27
|
+
"x-when": { "infra": ["agentcore", "agentcore-ecr"] },
|
|
27
28
|
"default": "iam",
|
|
28
29
|
"enum": ["iam", "cognito"],
|
|
29
30
|
"x-prompt": "How would you like to authenticate with your MCP server?",
|
package/src/sdk/open-api.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { openApiJsonMetadataGenerator } from '../open-api/json-metadata/generato
|
|
|
6
6
|
export type { OpenApiJsonMetadataGeneratorSchema } from '../open-api/json-metadata/schema';
|
|
7
7
|
export { buildOpenApiCodeGenerationData, openApiTsClientGenerator, } from '../open-api/ts-client/generator.js';
|
|
8
8
|
export type { OpenApiTsClientGeneratorSchema } from '../open-api/ts-client/schema';
|
|
9
|
+
export { openApiPyClientGenerator } from '../open-api/py-client/generator.js';
|
|
10
|
+
export type { OpenApiPyClientGeneratorSchema } from '../open-api/py-client/schema';
|
|
9
11
|
export { openApiTsHooksGenerator } from '../open-api/ts-hooks/generator.js';
|
|
10
12
|
export type { OpenApiTsHooksGeneratorSchema } from '../open-api/ts-hooks/schema';
|
|
11
13
|
export { openApiTsMetadataGenerator } from '../open-api/ts-metadata/generator.js';
|
package/src/sdk/open-api.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/ export { openApiJsonMetadataGenerator } from "../open-api/json-metadata/generator.js";
|
|
5
5
|
export { buildOpenApiCodeGenerationData, openApiTsClientGenerator } from "../open-api/ts-client/generator.js";
|
|
6
|
+
export { openApiPyClientGenerator } from "../open-api/py-client/generator.js";
|
|
6
7
|
export { openApiTsHooksGenerator } from "../open-api/ts-hooks/generator.js";
|
|
7
8
|
export { openApiTsMetadataGenerator } from "../open-api/ts-metadata/generator.js";
|
|
8
9
|
|
package/src/sdk/open-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/nx-plugin/src/sdk/open-api.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { openApiJsonMetadataGenerator } from '../open-api/json-metadata/generator.js';\nexport type { OpenApiJsonMetadataGeneratorSchema } from '../open-api/json-metadata/schema';\nexport {\n buildOpenApiCodeGenerationData,\n openApiTsClientGenerator,\n} from '../open-api/ts-client/generator.js';\nexport type { OpenApiTsClientGeneratorSchema } from '../open-api/ts-client/schema';\n\nexport { openApiTsHooksGenerator } from '../open-api/ts-hooks/generator.js';\nexport type { OpenApiTsHooksGeneratorSchema } from '../open-api/ts-hooks/schema';\n\nexport { openApiTsMetadataGenerator } from '../open-api/ts-metadata/generator.js';\nexport type { OpenApiTsMetadataGeneratorSchema } from '../open-api/ts-metadata/schema';\n"],"names":["openApiJsonMetadataGenerator","buildOpenApiCodeGenerationData","openApiTsClientGenerator","openApiTsHooksGenerator","openApiTsMetadataGenerator"],"mappings":"AAAA;;;CAGC,GAED,SAASA,4BAA4B,QAAQ,yCAAyC;AAEtF,SACEC,8BAA8B,EAC9BC,wBAAwB,QACnB,qCAAqC;AAG5C,SAASC,uBAAuB,QAAQ,oCAAoC;AAG5E,SAASC,0BAA0B,QAAQ,uCAAuC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx-plugin/src/sdk/open-api.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { openApiJsonMetadataGenerator } from '../open-api/json-metadata/generator.js';\nexport type { OpenApiJsonMetadataGeneratorSchema } from '../open-api/json-metadata/schema';\nexport {\n buildOpenApiCodeGenerationData,\n openApiTsClientGenerator,\n} from '../open-api/ts-client/generator.js';\nexport type { OpenApiTsClientGeneratorSchema } from '../open-api/ts-client/schema';\n\nexport { openApiPyClientGenerator } from '../open-api/py-client/generator.js';\nexport type { OpenApiPyClientGeneratorSchema } from '../open-api/py-client/schema';\n\nexport { openApiTsHooksGenerator } from '../open-api/ts-hooks/generator.js';\nexport type { OpenApiTsHooksGeneratorSchema } from '../open-api/ts-hooks/schema';\n\nexport { openApiTsMetadataGenerator } from '../open-api/ts-metadata/generator.js';\nexport type { OpenApiTsMetadataGeneratorSchema } from '../open-api/ts-metadata/schema';\n"],"names":["openApiJsonMetadataGenerator","buildOpenApiCodeGenerationData","openApiTsClientGenerator","openApiPyClientGenerator","openApiTsHooksGenerator","openApiTsMetadataGenerator"],"mappings":"AAAA;;;CAGC,GAED,SAASA,4BAA4B,QAAQ,yCAAyC;AAEtF,SACEC,8BAA8B,EAC9BC,wBAAwB,QACnB,qCAAqC;AAG5C,SAASC,wBAAwB,QAAQ,qCAAqC;AAG9E,SAASC,uBAAuB,QAAQ,oCAAoC;AAG5E,SAASC,0BAA0B,QAAQ,uCAAuC"}
|
|
@@ -38,7 +38,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
|
|
|
38
38
|
readonly dev: true;
|
|
39
39
|
readonly root: true;
|
|
40
40
|
readonly when: (metadata: SmithyProjectMetadata) => boolean;
|
|
41
|
-
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", SmithyProjectMetadata>[]>;
|
|
41
|
+
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", SmithyProjectMetadata>[]>;
|
|
42
42
|
export declare const SMITHY_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
|
|
43
43
|
/**
|
|
44
44
|
* The commands that build a Smithy project's model, run from the workspace root.
|
|
@@ -19,7 +19,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
|
|
|
19
19
|
readonly name: "@tanstack/react-query-devtools";
|
|
20
20
|
}, {
|
|
21
21
|
readonly name: "@smithy/types";
|
|
22
|
-
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
22
|
+
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
23
23
|
export declare const SMITHY_REACT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
24
24
|
export declare const smithyReactConnectionGenerator: (tree: Tree, options: SmithyReactConnectionGeneratorSchema) => Promise<GeneratorCallback>;
|
|
25
25
|
export default smithyReactConnectionGenerator;
|
|
@@ -54,7 +54,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
|
|
|
54
54
|
readonly name: "@types/node";
|
|
55
55
|
} & {
|
|
56
56
|
versionOnly: true;
|
|
57
|
-
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
57
|
+
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", Record<string, never>>[]>;
|
|
58
58
|
export declare const TERRAFORM_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
|
|
59
59
|
/**
|
|
60
60
|
* Checks formatting, mirroring the TypeScript and Python `format` targets: the
|
|
@@ -41,7 +41,7 @@ export declare const DEPENDENCIES: import("../../utils/declared-dependencies.js"
|
|
|
41
41
|
readonly name: "@types/event-source-polyfill";
|
|
42
42
|
readonly when: (m: TrpcReactMetadata) => boolean;
|
|
43
43
|
readonly dev: true;
|
|
44
|
-
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TrpcReactMetadata>[]>;
|
|
44
|
+
}], readonly import("../../utils/declared-dependencies.js").DeclaredPyDependency<"ruff" | "a2a-sdk" | "ag-ui-langgraph" | "ag-ui-protocol" | "ag-ui-strands" | "aiosqlite" | "aws-lambda-powertools" | "aws-lambda-powertools[tracer]" | "aws-lambda-powertools[parser]" | "aws-opentelemetry-distro" | "bedrock-agentcore" | "boto3" | "checkov" | "fastapi" | "fastapi[standard]" | "httpx" | "langchain" | "langchain-aws" | "langchain-mcp-adapters" | "langgraph" | "langgraph-checkpoint-aws" | "langgraph-checkpoint-sqlite" | "mcp" | "pip-check-updates" | "pip-licenses" | "pydantic" | "strands-agents" | "strands-agents[a2a]" | "strands-agents-tools" | "ty" | "pynamodb" | "uvicorn" | "sqlmodel" | "alembic" | "aiomysql" | "asyncpg" | "greenlet", TrpcReactMetadata>[]>;
|
|
45
45
|
export declare const TRPC_REACT_GENERATOR_INFO: NxGeneratorInfo;
|
|
46
46
|
export declare function reactGenerator(tree: Tree, options: ReactGeneratorSchema): Promise<() => Promise<void>>;
|
|
47
47
|
export default reactGenerator;
|