@aws/nx-plugin 1.0.0-rc.2 → 1.0.0-rc.21
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 +3552 -4179
- package/README.md +8 -8
- package/executors.json +9 -0
- package/generators.json +100 -1
- package/package.json +16 -12
- package/sdk/agentcore-gateway.d.ts +6 -0
- package/sdk/agentcore-gateway.js +11 -0
- package/sdk/agentcore-gateway.js.map +1 -0
- package/sdk/license.d.ts +8 -0
- package/sdk/license.js +14 -0
- package/sdk/license.js.map +1 -0
- package/sdk/py.d.ts +6 -6
- package/sdk/py.js +7 -7
- package/sdk/py.js.map +1 -1
- package/sdk/ts.d.ts +18 -14
- package/sdk/ts.js +38 -32
- package/sdk/ts.js.map +1 -1
- package/src/agentcore-gateway/attach-upstream.d.ts +33 -0
- package/src/agentcore-gateway/attach-upstream.js +41 -0
- package/src/agentcore-gateway/attach-upstream.js.map +1 -0
- package/src/agentcore-gateway/files/cedar/policies/README.md +52 -0
- package/src/agentcore-gateway/files/cedar/policies/permit-all.cedar +11 -0
- package/src/agentcore-gateway/files/project/serve-local.ts.template +134 -0
- package/src/agentcore-gateway/gateway-connection/generator.d.ts +21 -0
- package/src/agentcore-gateway/gateway-connection/generator.js +102 -0
- package/src/agentcore-gateway/gateway-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/gateway-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/gateway-connection/schema.json +26 -0
- package/src/agentcore-gateway/generator.d.ts +25 -0
- package/src/agentcore-gateway/generator.js +129 -0
- package/src/agentcore-gateway/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/generator.d.ts +19 -0
- package/src/agentcore-gateway/mcp-connection/generator.js +63 -0
- package/src/agentcore-gateway/mcp-connection/generator.js.map +1 -0
- package/src/agentcore-gateway/mcp-connection/schema.d.ts +12 -0
- package/src/agentcore-gateway/mcp-connection/schema.json +26 -0
- package/src/agentcore-gateway/schema.d.ts +16 -0
- package/src/agentcore-gateway/schema.json +65 -0
- package/src/connection/agent-runtime-config.d.ts +1 -1
- package/src/connection/agent-runtime-config.js.map +1 -1
- package/src/connection/agent-serve-local.d.ts +2 -2
- package/src/connection/agent-serve-local.js +1 -1
- package/src/connection/agent-serve-local.js.map +1 -1
- package/src/connection/generator.d.ts +5 -5
- package/src/connection/generator.js +93 -37
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.d.ts +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +47 -58
- package/src/infra/app/generator.d.ts +3 -3
- package/src/infra/app/generator.js +19 -17
- package/src/infra/app/generator.js.map +1 -1
- package/src/license/__snapshots__/config.spec.ts.snap +23 -0
- package/src/license/config-types.d.ts +18 -1
- package/src/license/config-types.js +4 -0
- package/src/license/config-types.js.map +1 -1
- package/src/license/config.d.ts +65 -7
- package/src/license/config.js +315 -7
- package/src/license/config.js.map +1 -1
- package/src/license/dependency-check/check.d.ts +16 -0
- package/src/license/dependency-check/check.js +111 -0
- package/src/license/dependency-check/check.js.map +1 -0
- package/src/license/dependency-check/collectors/collector.d.ts +21 -0
- package/src/license/dependency-check/collectors/collector.js +76 -0
- package/src/license/dependency-check/collectors/collector.js.map +1 -0
- package/src/license/dependency-check/collectors/npm-collector.d.ts +10 -0
- package/src/license/dependency-check/collectors/npm-collector.js +75 -0
- package/src/license/dependency-check/collectors/npm-collector.js.map +1 -0
- package/src/license/dependency-check/collectors/python-collector.d.ts +23 -0
- package/src/license/dependency-check/collectors/python-collector.js +121 -0
- package/src/license/dependency-check/collectors/python-collector.js.map +1 -0
- package/src/license/dependency-check/evaluator.d.ts +9 -0
- package/src/license/dependency-check/evaluator.js +122 -0
- package/src/license/dependency-check/evaluator.js.map +1 -0
- package/src/license/dependency-check/executor-schema.json +6 -0
- package/src/license/dependency-check/executor.d.ts +9 -0
- package/src/license/dependency-check/executor.js +43 -0
- package/src/license/dependency-check/executor.js.map +1 -0
- package/src/license/dependency-check/pre-approved.d.ts +6 -0
- package/src/license/dependency-check/pre-approved.js +1280 -0
- package/src/license/dependency-check/pre-approved.js.map +1 -0
- package/src/license/dependency-check/types.d.ts +45 -0
- package/src/license/dependency-check/types.js +7 -0
- package/src/license/dependency-check/types.js.map +1 -0
- package/src/license/generator.d.ts +3 -3
- package/src/license/generator.js +102 -14
- package/src/license/generator.js.map +1 -1
- package/src/license/index.d.ts +8 -0
- package/src/license/index.js +13 -0
- package/src/license/index.js.map +1 -0
- package/src/license/known-exceptions.d.ts +6 -0
- package/src/license/known-exceptions.js +26 -0
- package/src/license/known-exceptions.js.map +1 -0
- package/src/license/schema.d.ts +5 -0
- package/src/license/schema.json +6 -0
- package/src/license/sync/generator.d.ts +2 -2
- package/src/license/sync/generator.js +15 -15
- package/src/license/sync/generator.js.map +1 -1
- package/src/license/sync/project-file-sync.d.ts +3 -3
- package/src/license/sync/project-file-sync.js.map +1 -1
- package/src/mcp-server/generator-info.d.ts +5 -1
- package/src/mcp-server/generator-info.js +7 -7
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +1 -1
- package/src/mcp-server/guide-pipeline.js +2 -2
- package/src/mcp-server/guide-pipeline.js.map +1 -1
- package/src/mcp-server/mdx-ast.js +4 -0
- package/src/mcp-server/mdx-ast.js.map +1 -1
- package/src/mcp-server/schema-registry.d.ts +9 -3
- package/src/mcp-server/schema-registry.js +22 -6
- package/src/mcp-server/schema-registry.js.map +1 -1
- package/src/mcp-server/server.js +3 -3
- package/src/mcp-server/server.js.map +1 -1
- package/src/mcp-server/tools/create-workspace-command.d.ts +1 -1
- package/src/mcp-server/tools/create-workspace-command.js +4 -4
- package/src/mcp-server/tools/create-workspace-command.js.map +1 -1
- package/src/mcp-server/tools/general-guidance.d.ts +2 -2
- package/src/mcp-server/tools/general-guidance.js +2 -2
- package/src/mcp-server/tools/general-guidance.js.map +1 -1
- package/src/mcp-server/tools/generator-guide.d.ts +2 -2
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +2 -2
- package/src/mcp-server/tools/list-generators.js +1 -1
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +1 -1
- package/src/open-api/ts-client/generator.d.ts +3 -3
- package/src/open-api/ts-client/generator.js +2 -2
- package/src/open-api/ts-client/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.d.ts +3 -3
- package/src/open-api/ts-hooks/generator.js +2 -2
- package/src/open-api/ts-hooks/generator.js.map +1 -1
- package/src/open-api/ts-hooks/generator.spec.tsx +14 -14
- package/src/open-api/ts-metadata/generator.d.ts +3 -3
- package/src/open-api/ts-metadata/generator.js +1 -1
- package/src/open-api/ts-metadata/generator.js.map +1 -1
- package/src/open-api/utils/codegen-data/languages.d.ts +5 -1
- package/src/open-api/utils/codegen-data/languages.js +4 -4
- package/src/open-api/utils/codegen-data/languages.js.map +1 -1
- package/src/open-api/utils/codegen-data.d.ts +6 -2
- package/src/open-api/utils/codegen-data.js +6 -6
- package/src/open-api/utils/codegen-data.js.map +1 -1
- package/src/open-api/utils/normalise.d.ts +5 -1
- package/src/open-api/utils/normalise.js +5 -5
- package/src/open-api/utils/normalise.js.map +1 -1
- package/src/open-api/utils/parse.d.ts +2 -2
- package/src/open-api/utils/parse.js +4 -0
- package/src/open-api/utils/parse.js.map +1 -1
- package/src/open-api/utils/refs.d.ts +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +131 -13
- package/src/preset/generator.d.ts +4 -4
- package/src/preset/generator.js +21 -14
- package/src/preset/generator.js.map +1 -1
- package/src/preset/schema.d.ts +3 -1
- package/src/preset/schema.json +5 -0
- package/src/py/agent/__snapshots__/generator.spec.ts.snap +659 -21
- package/src/py/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +201 -0
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/a2a-connection/generator.d.ts +3 -3
- package/src/py/agent/a2a-connection/generator.js +11 -10
- package/src/py/agent/a2a-connection/generator.js.map +1 -1
- package/src/py/agent/files/common/agent.py.template +2 -0
- package/src/py/agent/files/http/init.py.template +7 -25
- package/src/py/agent/files/http/main.py.template +2 -3
- package/src/py/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +197 -0
- package/src/py/agent/gateway-connection/files/agent-connection/app/__gatewaySnakeCase___client_strands.py.template +35 -0
- package/src/py/agent/gateway-connection/generator.d.ts +10 -0
- package/src/py/agent/gateway-connection/generator.js +106 -0
- package/src/py/agent/gateway-connection/generator.js.map +1 -0
- package/src/py/agent/gateway-connection/schema.d.ts +12 -0
- package/src/py/agent/gateway-connection/schema.json +26 -0
- package/src/py/agent/generator.d.ts +3 -3
- package/src/py/agent/generator.js +47 -38
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +167 -81
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client_strands.py.template +30 -0
- package/src/py/agent/mcp-connection/generator.d.ts +3 -3
- package/src/py/agent/mcp-connection/generator.js +11 -81
- package/src/py/agent/mcp-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/__snapshots__/generator.spec.ts.snap +8 -17
- package/src/py/agent/react-connection/generator.d.ts +3 -3
- package/src/py/agent/react-connection/generator.js +4 -4
- package/src/py/agent/react-connection/generator.js.map +1 -1
- package/src/py/agent/react-connection/serve-local.d.ts +2 -2
- package/src/py/agent/react-connection/serve-local.js.map +1 -1
- package/src/py/api/generator.d.ts +3 -3
- package/src/py/api/generator.js.map +1 -1
- package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +1486 -0
- package/src/py/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/agent-connection/generator.js +39 -0
- package/src/py/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/py/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/py/dynamodb/agent-connection/schema.json +22 -0
- package/src/py/dynamodb/fast-api-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/py/dynamodb/fast-api-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/fast-api-connection/generator.js +37 -0
- package/src/py/dynamodb/fast-api-connection/generator.js.map +1 -0
- package/src/py/dynamodb/fast-api-connection/schema.d.ts +12 -0
- package/src/py/dynamodb/fast-api-connection/schema.json +18 -0
- package/src/py/dynamodb/files/__name__/__init__.py.template +6 -0
- package/src/py/dynamodb/files/__name__/client.py.template +39 -0
- package/src/py/dynamodb/files/__name__/entities/__init__.py.template +4 -0
- package/src/py/dynamodb/files/__name__/entities/base.py.template +63 -0
- package/src/py/dynamodb/files/__name__/entities/example.py.template +64 -0
- package/src/py/dynamodb/files/config.json.template +24 -0
- package/src/py/dynamodb/generator.d.ts +10 -0
- package/src/py/dynamodb/generator.js +106 -0
- package/src/py/dynamodb/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/py/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js +39 -0
- package/src/py/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/py/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/py/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/py/dynamodb/schema.d.ts +15 -0
- package/src/py/dynamodb/schema.json +70 -0
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +167 -39
- package/src/py/fast-api/files/app/__name__/init.py.template +5 -22
- package/src/py/fast-api/files/app/__name__/main.py.template +4 -1
- package/src/py/fast-api/generator.d.ts +3 -3
- package/src/py/fast-api/generator.js +23 -17
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/react/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/fast-api/react/generator.d.ts +3 -3
- package/src/py/fast-api/react/generator.js +2 -2
- package/src/py/fast-api/react/generator.js.map +1 -1
- package/src/py/fast-api/react/open-api.d.ts +1 -1
- package/src/py/fast-api/react/open-api.js +5 -2
- package/src/py/fast-api/react/open-api.js.map +1 -1
- package/src/py/lambda-function/generator.d.ts +3 -3
- package/src/py/lambda-function/generator.js +11 -11
- package/src/py/lambda-function/generator.js.map +1 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +83 -13
- package/src/py/mcp-server/generator.d.ts +3 -3
- package/src/py/mcp-server/generator.js +33 -26
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/project/generator.d.ts +3 -3
- package/src/py/project/generator.js +96 -70
- package/src/py/project/generator.js.map +1 -1
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +19 -16
- package/src/smithy/project/files/build.Dockerfile.template +1 -0
- package/src/smithy/project/files/src/operations/echo.smithy.template +1 -0
- package/src/smithy/project/generator.d.ts +3 -3
- package/src/smithy/project/generator.js +30 -28
- package/src/smithy/project/generator.js.map +1 -1
- package/src/smithy/react-connection/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/smithy/react-connection/generator.d.ts +3 -3
- package/src/smithy/react-connection/generator.js +3 -3
- package/src/smithy/react-connection/generator.js.map +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +14 -34
- package/src/smithy/ts/api/generator.d.ts +3 -3
- package/src/smithy/ts/api/generator.js +18 -12
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/terraform/project/files/application/src/main.tf.template +6 -1
- package/src/terraform/project/generator.d.ts +3 -3
- package/src/terraform/project/generator.js +13 -8
- package/src/terraform/project/generator.js.map +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +163 -18
- package/src/trpc/backend/files/src/procedures/echo.ts.template +1 -1
- package/src/trpc/backend/files/src/schema/echo.ts.template +2 -2
- package/src/trpc/backend/generator.d.ts +3 -3
- package/src/trpc/backend/generator.js +11 -10
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +2 -2
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +3 -3
- package/src/trpc/react/generator.d.ts +3 -3
- package/src/trpc/react/generator.js +5 -5
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +652 -14
- package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +256 -0
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client-strands.ts.template +23 -0
- package/src/ts/agent/a2a-connection/generator.d.ts +3 -3
- package/src/ts/agent/a2a-connection/generator.js +8 -8
- package/src/ts/agent/a2a-connection/generator.js.map +1 -1
- package/src/ts/agent/files/common/agent.ts.template +6 -2
- package/src/ts/agent/files/http/router.ts.template +1 -1
- package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +220 -0
- package/src/ts/agent/gateway-connection/files/agent-connection/app/__gatewayKebabCase__-client-strands.ts.template +30 -0
- package/src/ts/agent/gateway-connection/generator.d.ts +10 -0
- package/src/ts/agent/gateway-connection/generator.js +106 -0
- package/src/ts/agent/gateway-connection/generator.js.map +1 -0
- package/src/ts/agent/gateway-connection/schema.d.ts +12 -0
- package/src/ts/agent/gateway-connection/schema.json +26 -0
- package/src/ts/agent/generator.d.ts +3 -3
- package/src/ts/agent/generator.js +44 -32
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +191 -110
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client-strands.ts.template +22 -0
- package/src/ts/agent/mcp-connection/generator.d.ts +3 -3
- package/src/ts/agent/mcp-connection/generator.js +9 -21
- package/src/ts/agent/mcp-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/generator.d.ts +3 -3
- package/src/ts/agent/react-connection/generator.js +9 -9
- package/src/ts/agent/react-connection/generator.js.map +1 -1
- package/src/ts/agent/react-connection/serve-local.d.ts +2 -2
- package/src/ts/api/generator.d.ts +3 -3
- package/src/ts/api/generator.js +4 -4
- package/src/ts/api/generator.js.map +1 -1
- package/src/ts/api/schema.d.ts +2 -1
- package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +7 -8
- package/src/ts/astro-docs/generator.d.ts +3 -3
- package/src/ts/astro-docs/generator.js +14 -11
- package/src/ts/astro-docs/generator.js.map +1 -1
- package/src/ts/docs/generator.d.ts +3 -3
- package/src/ts/docs/generator.js.map +1 -1
- package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +1352 -0
- package/src/ts/dynamodb/agent-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/agent-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/agent-connection/generator.js +32 -0
- package/src/ts/dynamodb/agent-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/agent-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/agent-connection/schema.json +22 -0
- package/src/ts/dynamodb/files/config.json.template +24 -0
- package/src/ts/dynamodb/files/src/client.ts.template +61 -0
- package/src/ts/dynamodb/files/src/entities/example.ts.template +47 -0
- package/src/ts/dynamodb/files/src/entities/index.ts.template +1 -0
- package/src/ts/dynamodb/files/src/index.ts.template +2 -0
- package/src/ts/dynamodb/generator.d.ts +10 -0
- package/src/ts/dynamodb/generator.js +111 -0
- package/src/ts/dynamodb/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +45 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js +32 -0
- package/src/ts/dynamodb/mcp-server-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.d.ts +14 -0
- package/src/ts/dynamodb/mcp-server-connection/schema.json +22 -0
- package/src/ts/dynamodb/schema.d.ts +15 -0
- package/src/ts/dynamodb/schema.json +70 -0
- package/src/ts/dynamodb/smithy-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/smithy-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/smithy-connection/generator.js +30 -0
- package/src/ts/dynamodb/smithy-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/smithy-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/smithy-connection/schema.json +18 -0
- package/src/ts/dynamodb/trpc-connection/__snapshots__/generator.spec.ts.snap +23 -0
- package/src/ts/dynamodb/trpc-connection/generator.d.ts +10 -0
- package/src/ts/dynamodb/trpc-connection/generator.js +30 -0
- package/src/ts/dynamodb/trpc-connection/generator.js.map +1 -0
- package/src/ts/dynamodb/trpc-connection/schema.d.ts +12 -0
- package/src/ts/dynamodb/trpc-connection/schema.json +18 -0
- package/src/ts/lambda-function/generator.d.ts +3 -3
- package/src/ts/lambda-function/generator.js +8 -8
- package/src/ts/lambda-function/generator.js.map +1 -1
- package/src/ts/lib/__snapshots__/generator.spec.ts.snap +32 -65
- package/src/ts/lib/__snapshots__/vitest.spec.ts.snap +24 -0
- package/src/ts/lib/biome.d.ts +7 -0
- package/src/ts/lib/biome.js +58 -0
- package/src/ts/lib/biome.js.map +1 -0
- package/src/ts/lib/generator.d.ts +3 -3
- package/src/ts/lib/generator.js +27 -29
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/grit/vitest-pass-with-no-tests.grit +1 -4
- package/src/ts/lib/ts-project-utils.d.ts +12 -2
- package/src/ts/lib/ts-project-utils.js +30 -10
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.d.ts +2 -2
- package/src/ts/lib/vitest.js +1 -1
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +82 -12
- package/src/ts/mcp-server/generator.d.ts +3 -3
- package/src/ts/mcp-server/generator.js +34 -12
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +19 -14
- package/src/ts/nx-generator/generator.d.ts +2 -2
- package/src/ts/nx-generator/generator.js +52 -19
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/generator.d.ts +3 -3
- package/src/ts/nx-plugin/generator.js +10 -9
- package/src/ts/nx-plugin/generator.js.map +1 -1
- package/src/ts/nx-plugin/utils.d.ts +1 -1
- package/src/ts/nx-plugin/utils.js +10 -4
- package/src/ts/nx-plugin/utils.js.map +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +252 -388
- package/src/ts/rdb/agent-connection/generator.d.ts +3 -3
- package/src/ts/rdb/agent-connection/generator.js +4 -4
- package/src/ts/rdb/agent-connection/generator.js.map +1 -1
- package/src/ts/rdb/files/config.json.template +14 -0
- package/src/ts/rdb/files/prisma.config.ts.template +5 -4
- package/src/ts/rdb/files/src/index.ts.template +0 -1
- package/src/ts/rdb/files/src/prisma.ts.template +26 -21
- package/src/ts/rdb/generator.d.ts +3 -7
- package/src/ts/rdb/generator.js +52 -41
- package/src/ts/rdb/generator.js.map +1 -1
- package/src/ts/rdb/mcp-server-connection/generator.d.ts +3 -3
- package/src/ts/rdb/mcp-server-connection/generator.js +4 -4
- package/src/ts/rdb/mcp-server-connection/generator.js.map +1 -1
- package/src/ts/rdb/smithy-connection/generator.d.ts +3 -3
- package/src/ts/rdb/smithy-connection/generator.js +4 -4
- package/src/ts/rdb/smithy-connection/generator.js.map +1 -1
- package/src/ts/rdb/trpc-connection/generator.d.ts +3 -3
- package/src/ts/rdb/trpc-connection/generator.js +3 -3
- package/src/ts/rdb/trpc-connection/generator.js.map +1 -1
- package/src/ts/rdb/utils.d.ts +1 -1
- package/src/ts/react-website/agui/files/common/src/hooks/useAgui__agentNameClassName__.tsx.template +1 -16
- package/src/ts/react-website/agui/generator.d.ts +1 -1
- package/src/ts/react-website/agui/generator.js +4 -5
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +530 -367
- package/src/ts/react-website/app/generator.d.ts +3 -3
- package/src/ts/react-website/app/generator.js +21 -17
- package/src/ts/react-website/app/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +1 -7
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +9 -3
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.ux-provider.spec.ts.snap +0 -20
- package/src/ts/react-website/cognito-auth/generator.d.ts +3 -3
- package/src/ts/react-website/cognito-auth/generator.js +10 -13
- package/src/ts/react-website/cognito-auth/generator.js.map +1 -1
- package/src/ts/react-website/cognito-auth/grit/cloudscape-auth-menu.grit +8 -6
- package/src/ts/react-website/cognito-auth/grit/cognito-auth-wrapper.grit +1 -1
- package/src/ts/react-website/cognito-auth/grit/none-auth-menu.grit +1 -0
- package/src/ts/react-website/cognito-auth/grit/shadcn-auth-menu.grit +3 -1
- package/src/ts/react-website/cognito-auth/grit/shadcn-state-declarations.grit +3 -1
- package/src/ts/react-website/cognito-auth/utils.d.ts +1 -1
- package/src/ts/react-website/cognito-auth/utils.js +1 -1
- package/src/ts/react-website/cognito-auth/utils.js.map +1 -1
- package/src/ts/react-website/runtime-config/generator.d.ts +3 -3
- package/src/ts/react-website/runtime-config/generator.js +4 -4
- package/src/ts/react-website/runtime-config/generator.js.map +1 -1
- package/src/ts/sync/generator.d.ts +3 -3
- package/src/ts/sync/generator.js +2 -2
- package/src/ts/sync/generator.js.map +1 -1
- package/src/ts/website/app/generator.d.ts +3 -3
- package/src/ts/website/app/generator.js +1 -1
- package/src/ts/website/app/generator.js.map +1 -1
- package/src/ts/website/auth/generator.d.ts +3 -3
- package/src/ts/website/auth/generator.js +1 -1
- package/src/ts/website/auth/generator.js.map +1 -1
- package/src/utils/agent-chat/agent-chat.d.ts +31 -0
- package/src/utils/agent-chat/agent-chat.js +30 -0
- package/src/utils/agent-chat/agent-chat.js.map +1 -0
- package/src/utils/agent-chat/files/a2a/chat.ts.template +33 -0
- package/src/utils/agent-chat/files/ag-ui/chat.ts.template +17 -0
- package/src/utils/agent-chat/files/common/agentcore.ts.template +81 -0
- package/src/utils/agent-chat/files/http-py/chat.ts.template +43 -0
- package/src/utils/agent-chat/files/http-ts/chat.ts.template +54 -0
- package/src/utils/agent-connection/agent-connection.d.ts +67 -24
- package/src/utils/agent-connection/agent-connection.js +236 -44
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client-config.ts.template +93 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-endpoints.ts.template +37 -0
- package/src/utils/agent-connection/files/core-auth/agentcore-fetch.ts.template +54 -0
- package/src/utils/agent-connection/files/core-gateway/agentcore-gateway-mcp-transport.ts.template +41 -0
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-transport.ts.template +70 -0
- package/src/utils/agent-connection/files/core-runtime-config/runtime-config.ts.template +22 -32
- package/src/utils/agent-connection/files/core-shared/agentcore-transport.ts.template +39 -0
- package/src/utils/agent-connection/files/core-strands/a2a/agentcore-a2a-client-strands.ts.template +61 -0
- package/src/utils/agent-connection/files/core-strands/base/model-errors-strands.ts.template +36 -0
- package/src/utils/agent-connection/files/core-strands/gateway/agentcore-gateway-mcp-client-strands.ts.template +26 -0
- package/src/utils/agent-connection/files/core-strands/mcp/agentcore-mcp-client-strands.ts.template +27 -0
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client_config.py.template +43 -0
- package/src/utils/agent-connection/files/py-core-auth/agentcore_endpoints.py.template +47 -0
- package/src/utils/agent-connection/files/py-core-auth/auth/session.py.template +51 -0
- package/src/utils/agent-connection/files/py-core-gateway/agentcore_gateway_mcp_transport.py.template +28 -0
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_transport.py.template +34 -0
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +5 -18
- package/src/utils/agent-connection/files/py-core-shared/agentcore_transport.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/a2a/agentcore_a2a_client_strands.py.template +66 -0
- package/src/utils/agent-connection/files/py-core-strands/base/model_errors_strands.py.template +40 -0
- package/src/utils/agent-connection/files/py-core-strands/gateway/agentcore_gateway_mcp_client_strands.py.template +22 -0
- package/src/utils/agent-connection/files/py-core-strands/mcp/agentcore_mcp_client_strands.py.template +30 -0
- package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +11 -3
- package/src/utils/agent-core-constructs/agent-core-constructs.js +57 -12
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +4 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.ts.template +40 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/agentcore-gateway.ts.template +375 -0
- package/src/utils/agent-core-constructs/files/cdk/core/agentcore-gateway/readiness-probe/index.js.template +55 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +335 -0
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/render-cedar.cjs.template +13 -0
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +77 -9
- package/src/utils/agent-core-constructs/files/terraform/core/agentcore-gateway/gateway.tf.template +14 -0
- package/src/utils/api-constructs/api-constructs.d.ts +2 -2
- package/src/utils/api-constructs/api-constructs.js +1 -1
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +3 -0
- package/src/utils/api-constructs/files/cdk/core/api/http/http-api.ts.template +9 -0
- package/src/utils/api-constructs/files/cdk/core/api/rest/rest-api.ts.template +23 -1
- package/src/utils/api-constructs/files/cdk/core/api/utils/utils.ts.template +61 -7
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +3 -0
- package/src/utils/api-constructs/open-api-metadata.d.ts +2 -2
- package/src/utils/api-constructs/open-api-metadata.js.map +1 -1
- package/src/utils/ast/website.d.ts +5 -1
- package/src/utils/ast/website.js +3 -3
- package/src/utils/ast/website.js.map +1 -1
- package/src/utils/ast.d.ts +33 -1
- package/src/utils/ast.js +89 -4
- package/src/utils/ast.js.map +1 -1
- package/src/utils/bundle/bundle.d.ts +1 -1
- package/src/utils/bundle/bundle.js +2 -2
- package/src/utils/bundle/bundle.js.map +1 -1
- package/src/utils/config/index.d.ts +5 -5
- package/src/utils/config/utils.d.ts +13 -3
- package/src/utils/config/utils.js +37 -5
- package/src/utils/config/utils.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +1 -1
- package/src/utils/connection/open-api/react.d.ts +1 -1
- package/src/utils/connection/open-api/react.js +4 -4
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/containers.d.ts +1 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +18 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js +49 -0
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -0
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +43 -0
- package/src/utils/dynamodb-constructs/files/cdk/core/dynamodb.ts.template +105 -0
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +62 -0
- package/src/utils/dynamodb-constructs/files/terraform/core/dynamodb/dynamodb.tf.template +155 -0
- package/src/utils/files/common/scripts/src/dynamodb/create-local-table.ts.template +195 -0
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +13 -0
- package/src/utils/files/common/scripts/src/dynamodb/start-container.ts.template +91 -0
- package/src/utils/files/common/scripts/src/rdb/pull-image.ts.template +16 -0
- package/src/utils/files/common/scripts/src/rdb/start-container.ts.template +102 -0
- package/src/utils/files/common/scripts/src/rdb/wait-for-db.ts.template +59 -0
- package/src/utils/files/terraform/src/core/runtime-config/appconfig-deployment/appconfig-deployment.tf.template +9 -3
- package/src/utils/files/terraform/src/core/runtime-config/read/read.tf.template +7 -2
- package/src/utils/format.d.ts +45 -2
- package/src/utils/format.js +167 -46
- package/src/utils/format.js.map +1 -1
- package/src/utils/fs.d.ts +1 -1
- package/src/utils/fs.js.map +1 -1
- package/src/utils/function-constructs/function-constructs.d.ts +2 -2
- package/src/utils/function-constructs/function-constructs.js +1 -1
- package/src/utils/function-constructs/function-constructs.js.map +1 -1
- package/src/utils/generators.d.ts +4 -0
- package/src/utils/generators.js +4 -4
- package/src/utils/generators.js.map +1 -1
- package/src/utils/git.d.ts +1 -1
- package/src/utils/git.js.map +1 -1
- package/src/utils/iac.d.ts +1 -1
- package/src/utils/iac.js.map +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +1 -5
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +9 -3
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +2 -4
- package/src/utils/identity-constructs/identity-constructs.d.ts +2 -2
- package/src/utils/identity-constructs/identity-constructs.js +1 -1
- package/src/utils/identity-constructs/identity-constructs.js.map +1 -1
- package/src/utils/js.d.ts +4 -0
- package/src/utils/js.js +4 -4
- package/src/utils/js.js.map +1 -1
- package/src/utils/mcp.d.ts +25 -0
- package/src/utils/mcp.js +81 -0
- package/src/utils/mcp.js.map +1 -0
- package/src/utils/metrics.d.ts +9 -3
- package/src/utils/metrics.js +58 -28
- package/src/utils/metrics.js.map +1 -1
- package/src/utils/npm-scope.d.ts +1 -1
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/nx.d.ts +7 -2
- package/src/utils/nx.js +46 -14
- package/src/utils/nx.js.map +1 -1
- package/src/utils/nxlv-python.d.ts +1 -1
- package/src/utils/paths.d.ts +1 -1
- package/src/utils/pnpm-workspace.d.ts +1 -1
- package/src/utils/pnpm-workspace.js.map +1 -1
- package/src/utils/port.d.ts +31 -3
- package/src/utils/port.js +74 -4
- package/src/utils/port.js.map +1 -1
- package/src/utils/py.d.ts +2 -2
- package/src/utils/py.js +13 -6
- package/src/utils/py.js.map +1 -1
- package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +12 -2
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +30 -1
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +38 -16
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +28 -13
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +5 -4
- package/src/utils/rdb-constructs/rdb-constructs.js +3 -11
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/shared-constructs-constants.d.ts +1 -0
- package/src/utils/shared-constructs-constants.js +2 -1
- package/src/utils/shared-constructs-constants.js.map +1 -1
- package/src/utils/shared-constructs.d.ts +2 -2
- package/src/utils/shared-constructs.js +7 -7
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/shared-dynamodb-scripts.d.ts +11 -0
- package/src/utils/shared-dynamodb-scripts.js +23 -0
- package/src/utils/shared-dynamodb-scripts.js.map +1 -0
- package/src/utils/shared-infra-config.d.ts +1 -1
- package/src/utils/shared-infra-config.js +1 -1
- package/src/utils/shared-infra-config.js.map +1 -1
- package/src/utils/shared-infra-scripts.d.ts +11 -0
- package/src/utils/shared-infra-scripts.js +35 -0
- package/src/utils/shared-infra-scripts.js.map +1 -0
- package/src/utils/shared-rdb-scripts.d.ts +11 -0
- package/src/utils/shared-rdb-scripts.js +20 -0
- package/src/utils/shared-rdb-scripts.js.map +1 -0
- package/src/utils/shared-scripts.d.ts +2 -5
- package/src/utils/shared-scripts.js +2 -23
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/shared-shadcn.d.ts +1 -1
- package/src/utils/shared-shadcn.js +1 -13
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/test.d.ts +5 -1
- package/src/utils/test.js +9 -5
- package/src/utils/test.js.map +1 -1
- package/src/utils/toml.d.ts +1 -1
- package/src/utils/toml.js +4 -0
- package/src/utils/toml.js.map +1 -1
- package/src/utils/versions.d.ts +82 -83
- package/src/utils/versions.js +81 -82
- package/src/utils/versions.js.map +1 -1
- package/src/utils/website-constructs/files/cdk/core/static-website.ts.template +72 -5
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +63 -15
- package/src/utils/website-constructs/website-constructs.d.ts +2 -2
- package/src/utils/website-constructs/website-constructs.js +1 -1
- package/src/utils/website-constructs/website-constructs.js.map +1 -1
- package/src/py/agent/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -22
- package/src/py/agent/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -22
- package/src/py/agent/scripts/http/chat.ts.template +0 -38
- package/src/ts/agent/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -19
- package/src/ts/agent/scripts/http/chat.ts.template +0 -35
- package/src/ts/lib/eslint.d.ts +0 -14
- package/src/ts/lib/eslint.js +0 -90
- package/src/ts/lib/eslint.js.map +0 -1
- package/src/ts/lib/grit/eslint-dependency-checks-warn.grit +0 -1
- package/src/ts/rdb/files/scripts/docker-pull.ts.template +0 -15
- package/src/ts/rdb/files/scripts/docker-start.ts.template +0 -84
- package/src/ts/rdb/files/scripts/wait-for-db.ts.template +0 -55
- package/src/ts/rdb/files/src/constants.ts.template +0 -8
- package/src/utils/agent-connection/files/core-a2a/agentcore-a2a-client.ts.template +0 -123
- package/src/utils/agent-connection/files/core-mcp/agentcore-mcp-client.ts.template +0 -128
- package/src/utils/agent-connection/files/py-core-a2a/agentcore_a2a_client.py.template +0 -120
- package/src/utils/agent-connection/files/py-core-mcp/agentcore_mcp_client.py.template +0 -89
- /package/src/utils/agent-connection/files/{core-runtime-config/with-session-id.ts.template → core-strands/base/with-session-id-strands.ts.template} +0 -0
- /package/src/utils/agent-connection/files/{py-core-runtime-config/with_session_id.py.template → py-core-strands/base/with_session_id_strands.py.template} +0 -0
- /package/src/utils/files/common/scripts/src/{index.ts.template → infra/index.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-deploy.ts.template → infra/infra-deploy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{infra-destroy.ts.template → infra/infra-destroy.ts.template} +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/cdk-command.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/credentials.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/run.ts.template +0 -0
- /package/src/utils/files/common/scripts/src/{stage-credentials → infra/stage-credentials}/stage-parser.ts.template +0 -0
|
@@ -7,22 +7,21 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const generator_1 = tslib_1.__importStar(require("../../../ts/lib/generator"));
|
|
11
|
+
const api_constructs_1 = require("../../../utils/api-constructs/api-constructs");
|
|
12
|
+
const open_api_metadata_1 = require("../../../utils/api-constructs/open-api-metadata");
|
|
13
|
+
const bundle_1 = require("../../../utils/bundle/bundle");
|
|
12
14
|
const format_1 = require("../../../utils/format");
|
|
15
|
+
const fs_1 = require("../../../utils/fs");
|
|
16
|
+
const git_1 = require("../../../utils/git");
|
|
13
17
|
const iac_1 = require("../../../utils/iac");
|
|
14
|
-
const
|
|
18
|
+
const metrics_1 = require("../../../utils/metrics");
|
|
15
19
|
const names_1 = require("../../../utils/names");
|
|
16
|
-
const
|
|
20
|
+
const nx_1 = require("../../../utils/nx");
|
|
17
21
|
const port_1 = require("../../../utils/port");
|
|
22
|
+
const shared_constructs_1 = require("../../../utils/shared-constructs");
|
|
18
23
|
const versions_1 = require("../../../utils/versions");
|
|
19
24
|
const generator_2 = tslib_1.__importDefault(require("../../project/generator"));
|
|
20
|
-
const bundle_1 = require("../../../utils/bundle/bundle");
|
|
21
|
-
const git_1 = require("../../../utils/git");
|
|
22
|
-
const eslint_1 = require("../../../ts/lib/eslint");
|
|
23
|
-
const fs_1 = require("../../../utils/fs");
|
|
24
|
-
const api_constructs_1 = require("../../../utils/api-constructs/api-constructs");
|
|
25
|
-
const open_api_metadata_1 = require("../../../utils/api-constructs/open-api-metadata");
|
|
26
25
|
exports.TS_SMITHY_API_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
27
26
|
const tsSmithyApiGenerator = async (tree, options) => {
|
|
28
27
|
if (options.infra !== 'rest-lambda' &&
|
|
@@ -169,8 +168,12 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
169
168
|
continuous: true,
|
|
170
169
|
dependsOn: ['copy-ssdk', 'watch-copy-ssdk'],
|
|
171
170
|
};
|
|
171
|
+
const existingServeLocalDependsOn = backendProjectConfig.targets['serve-local']?.dependsOn ?? [];
|
|
172
172
|
backendProjectConfig.targets['serve-local'] = {
|
|
173
173
|
...backendProjectConfig.targets.serve,
|
|
174
|
+
// Own copy of dependsOn so adding serve-local dependencies below doesn't
|
|
175
|
+
// mutate the shared array referenced by the serve target.
|
|
176
|
+
dependsOn: [...(backendProjectConfig.targets.serve.dependsOn ?? [])],
|
|
174
177
|
options: {
|
|
175
178
|
...backendProjectConfig.targets.serve.options,
|
|
176
179
|
env: {
|
|
@@ -178,12 +181,15 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
178
181
|
},
|
|
179
182
|
},
|
|
180
183
|
};
|
|
184
|
+
// Preserve any dependencies added to serve-local by connection generators
|
|
185
|
+
for (const dependency of existingServeLocalDependsOn) {
|
|
186
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(backendProjectConfig, 'serve-local', dependency);
|
|
187
|
+
}
|
|
181
188
|
// Ignore generated code
|
|
182
189
|
(0, git_1.updateGitIgnore)(tree, backendProjectConfig.root, (patterns) => [
|
|
183
190
|
...patterns,
|
|
184
191
|
'src/generated',
|
|
185
192
|
]);
|
|
186
|
-
await (0, eslint_1.addIgnoresToEslintConfig)(tree, (0, devkit_1.joinPathFragments)(backendProjectConfig.root, 'eslint.config.mjs'), ['**/generated']);
|
|
187
193
|
(0, devkit_1.updateProjectConfiguration)(tree, backendFullyQualifiedName, backendProjectConfig);
|
|
188
194
|
(0, devkit_1.addDependenciesToPackageJson)(tree, (0, versions_1.withVersions)([
|
|
189
195
|
'@aws-smithy/server-apigateway',
|
|
@@ -197,7 +203,7 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
197
203
|
...(options.auth === 'custom'
|
|
198
204
|
? ['@aws-lambda-powertools/parser']
|
|
199
205
|
: []),
|
|
200
|
-
]), (0, versions_1.withVersions)(['@types/aws-lambda']));
|
|
206
|
+
]), (0, versions_1.withVersions)(['@types/aws-lambda', 'tsx']));
|
|
201
207
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.TS_SMITHY_API_GENERATOR_INFO]);
|
|
202
208
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
203
209
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/smithy/ts/api/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/smithy/ts/api/generator.ts"],"names":[],"mappings":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IAED,wBAAwB;IACxB,IAAA,qBAAe,EAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC7D,GAAG,QAAQ;QACX,eAAe;KAChB,CAAC,CAAC;IAEH,IAAA,mCAA0B,EACxB,IAAI,EACJ,yBAAyB,EACzB,oBAAoB,CACrB,CAAC;IAEF,IAAA,qCAA4B,EAC1B,IAAI,EACJ,IAAA,uBAAY,EAAC;QACX,+BAA+B;QAC/B,yBAAyB;QACzB,aAAa;QACb,+BAA+B;QAC/B,mCAAmC;QACnC,+BAA+B;QAC/B,gCAAgC;QAChC,+BAA+B;QAC/B,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;YAC3B,CAAC,CAAE,CAAC,+BAA+B,CAAW;YAC9C,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,EACF,IAAA,uBAAY,EAAC,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC,CAC3C,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,oCAA4B,CAAC,CAAC,CAAC;IAE5E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AA9RW,QAAA,oBAAoB,wBA8R/B;AAEF,MAAM,qBAAqB,GAAG,CAC5B,OAAmC,EACZ,EAAE,CAAC,OAAO,CAAC,kBAAkB,IAAI,UAAU,CAAC;AAErE,kBAAe,4BAAoB,CAAC"}
|
|
@@ -14,6 +14,11 @@ resource "null_resource" "print_info" {
|
|
|
14
14
|
# }
|
|
15
15
|
|
|
16
16
|
provisioner "local-exec" {
|
|
17
|
-
command = "echo
|
|
17
|
+
command = "echo \"AWS Region: $AWS_REGION, AWS Account: $ACCOUNT_ID, Environment: $ENVIRONMENT\""
|
|
18
|
+
environment = {
|
|
19
|
+
AWS_REGION = local.aws_region
|
|
20
|
+
ACCOUNT_ID = local.account_id
|
|
21
|
+
ENVIRONMENT = var.environment
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
24
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { TerraformProjectGeneratorSchema } from './schema';
|
|
8
8
|
export declare const TERRAFORM_PROJECT_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare function terraformProjectGenerator(tree: Tree, schema: TerraformProjectGeneratorSchema): Promise<GeneratorCallback>;
|
|
10
10
|
export default terraformProjectGenerator;
|
|
@@ -7,17 +7,17 @@ exports.terraformProjectGenerator = terraformProjectGenerator;
|
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
*/
|
|
9
9
|
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
const generator_1 = require("../../ts/lib/generator");
|
|
11
10
|
const path_1 = require("path");
|
|
12
|
-
const
|
|
13
|
-
const nx_1 = require("../../utils/nx");
|
|
11
|
+
const generator_1 = require("../../ts/lib/generator");
|
|
14
12
|
const git_1 = require("../../utils/git");
|
|
15
|
-
const versions_1 = require("../../utils/versions");
|
|
16
13
|
const metrics_1 = require("../../utils/metrics");
|
|
17
|
-
const
|
|
14
|
+
const names_1 = require("../../utils/names");
|
|
15
|
+
const nx_1 = require("../../utils/nx");
|
|
16
|
+
const object_1 = require("../../utils/object");
|
|
18
17
|
const py_1 = require("../../utils/py");
|
|
18
|
+
const shared_constructs_1 = require("../../utils/shared-constructs");
|
|
19
19
|
const shared_constructs_constants_1 = require("../../utils/shared-constructs-constants");
|
|
20
|
-
const
|
|
20
|
+
const versions_1 = require("../../utils/versions");
|
|
21
21
|
const NX_EXTEND_PLUGIN = '@nx-extend/terraform';
|
|
22
22
|
exports.TERRAFORM_PROJECT_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
23
23
|
async function terraformProjectGenerator(tree, schema) {
|
|
@@ -178,7 +178,7 @@ async function terraformProjectGenerator(tree, schema) {
|
|
|
178
178
|
dependsOn: ['init'],
|
|
179
179
|
},
|
|
180
180
|
};
|
|
181
|
-
|
|
181
|
+
const projectConfiguration = {
|
|
182
182
|
root: lib.dir,
|
|
183
183
|
projectType: schema.type,
|
|
184
184
|
sourceRoot: (0, devkit_1.joinPathFragments)(lib.dir, 'src'),
|
|
@@ -186,7 +186,12 @@ async function terraformProjectGenerator(tree, schema) {
|
|
|
186
186
|
...libTargets,
|
|
187
187
|
...(schema.type === 'application' ? applicationTargets : {}),
|
|
188
188
|
}),
|
|
189
|
-
}
|
|
189
|
+
};
|
|
190
|
+
// Only create the project configuration on first run; skip it on re-run so
|
|
191
|
+
// existing project.json customisations are preserved.
|
|
192
|
+
if (!(0, nx_1.projectExists)(tree, lib.fullyQualifiedName)) {
|
|
193
|
+
(0, devkit_1.addProjectConfiguration)(tree, lib.fullyQualifiedName, projectConfiguration);
|
|
194
|
+
}
|
|
190
195
|
(0, nx_1.addGeneratorMetadata)(tree, lib.fullyQualifiedName, exports.TERRAFORM_PROJECT_GENERATOR_INFO);
|
|
191
196
|
(0, devkit_1.generateFiles)(tree, // the virtual file system
|
|
192
197
|
(0, devkit_1.joinPathFragments)(__dirname, `./files/${schema.type}`), // path to the file templates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/terraform/project/generator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/terraform/project/generator.ts"],"names":[],"mapp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,CAAC;IAEH,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF,IAAA,uBAAY,EAAC;QACX,sBAAsB;QACtB,cAAc;QACd,KAAK;QACL,oBAAoB;QACpB,qBAAqB;QACrB,+BAA+B;QAC/B,yBAAyB;QACzB,8BAA8B;KAC/B,CAAC,CACH,CAAC;IAEF,gFAAgF;IAChF,sDAAsD;IACtD,8EAA8E;IAC9E,IAAI,IAAA,6BAAoB,GAAE,KAAK,KAAK,EAAE,CAAC;QACrC,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,WAAW,EAAE,EAAE;YAC/C,WAAW,CAAC,SAAS,GAAG;gBACtB,GAAG,WAAW,CAAC,SAAS;gBACxB,GAAG,IAAA,uBAAY,EAAC,CAAC,YAAY,CAAC,CAAC;aAChC,CAAC;YACF,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AACD,kBAAe,yBAAyB,CAAC"}
|
|
@@ -281,7 +281,7 @@ import { EchoInputSchema, EchoOutputSchema } from '../schema/index.js';
|
|
|
281
281
|
export const echo = publicProcedure
|
|
282
282
|
.input(EchoInputSchema)
|
|
283
283
|
.output(EchoOutputSchema)
|
|
284
|
-
.query((opts) => ({
|
|
284
|
+
.query((opts) => ({ message: opts.input.message }));
|
|
285
285
|
"
|
|
286
286
|
`;
|
|
287
287
|
|
|
@@ -303,13 +303,13 @@ exports[`trpc backend generator > should generate the project > apps/test-api/sr
|
|
|
303
303
|
"import { z } from 'zod';
|
|
304
304
|
|
|
305
305
|
export const EchoInputSchema = z.object({
|
|
306
|
-
message: z.string(),
|
|
306
|
+
message: z.string().max(1024),
|
|
307
307
|
});
|
|
308
308
|
|
|
309
309
|
export type IEchoInput = z.TypeOf<typeof EchoInputSchema>;
|
|
310
310
|
|
|
311
311
|
export const EchoOutputSchema = z.object({
|
|
312
|
-
|
|
312
|
+
message: z.string().max(1024),
|
|
313
313
|
});
|
|
314
314
|
|
|
315
315
|
export type IEchoOutput = z.TypeOf<typeof EchoOutputSchema>;
|
|
@@ -478,6 +478,9 @@ export class TestApi<
|
|
|
478
478
|
authorizer: new CognitoUserPoolsAuthorizer(scope, 'TestApiAuthorizer', {
|
|
479
479
|
cognitoUserPools: [props.identity.userPool],
|
|
480
480
|
}),
|
|
481
|
+
// Accept access tokens from both sign-in flows: 'openid' (Cognito hosted UI)
|
|
482
|
+
// and 'aws.cognito.signin.user.admin' (Cognito admin/SRP auth APIs).
|
|
483
|
+
authorizationScopes: ['openid', 'aws.cognito.signin.user.admin'],
|
|
481
484
|
},
|
|
482
485
|
deployOptions: {
|
|
483
486
|
tracingEnabled: true,
|
|
@@ -1206,6 +1209,7 @@ import {
|
|
|
1206
1209
|
HttpMethod,
|
|
1207
1210
|
HttpStage,
|
|
1208
1211
|
LogGroupLogDestination,
|
|
1212
|
+
ThrottleSettings,
|
|
1209
1213
|
} from 'aws-cdk-lib/aws-apigatewayv2';
|
|
1210
1214
|
import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
|
1211
1215
|
import { suppressRules } from '../checkov.js';
|
|
@@ -1232,6 +1236,12 @@ export interface HttpApiProps<
|
|
|
1232
1236
|
* Map of operation names to their API Gateway integrations
|
|
1233
1237
|
*/
|
|
1234
1238
|
readonly integrations: TIntegrations;
|
|
1239
|
+
/**
|
|
1240
|
+
* Default throttling limits applied to the API's default stage.
|
|
1241
|
+
*
|
|
1242
|
+
* @default { rateLimit: 10000, burstLimit: 5000 }
|
|
1243
|
+
*/
|
|
1244
|
+
readonly throttle?: ThrottleSettings;
|
|
1235
1245
|
}
|
|
1236
1246
|
|
|
1237
1247
|
/**
|
|
@@ -1265,6 +1275,7 @@ export class HttpApi<
|
|
|
1265
1275
|
apiName,
|
|
1266
1276
|
operations,
|
|
1267
1277
|
integrations,
|
|
1278
|
+
throttle = { rateLimit: 10000, burstLimit: 5000 },
|
|
1268
1279
|
...props
|
|
1269
1280
|
}: HttpApiProps<TIntegrations, TOperation>,
|
|
1270
1281
|
) {
|
|
@@ -1292,6 +1303,7 @@ export class HttpApi<
|
|
|
1292
1303
|
this.defaultStage = new HttpStage(this, 'DefaultStage', {
|
|
1293
1304
|
httpApi: this.api,
|
|
1294
1305
|
autoDeploy: true,
|
|
1306
|
+
throttle,
|
|
1295
1307
|
accessLogSettings: {
|
|
1296
1308
|
destination: new LogGroupLogDestination(accessLogGroup),
|
|
1297
1309
|
},
|
|
@@ -1751,6 +1763,8 @@ export type ApiIntegrations<TOperation extends string, TBaseIntegration> =
|
|
|
1751
1763
|
* @template TDefaultIntegrationProps - Type for default integration properties
|
|
1752
1764
|
* @template TDefaultIntegration - Type for default integration implementation
|
|
1753
1765
|
* @template TPattern - The integration pattern ('shared' or 'isolated')
|
|
1766
|
+
* @template TOverridden - Union of operation names that have been overridden
|
|
1767
|
+
* @template TOperationOptioned - Union of operation names with per-operation options
|
|
1754
1768
|
*/
|
|
1755
1769
|
export class IntegrationBuilder<
|
|
1756
1770
|
TOperation extends string,
|
|
@@ -1759,6 +1773,8 @@ export class IntegrationBuilder<
|
|
|
1759
1773
|
TDefaultIntegrationProps extends object,
|
|
1760
1774
|
TDefaultIntegration extends TBaseIntegration,
|
|
1761
1775
|
TPattern extends 'shared' | 'isolated',
|
|
1776
|
+
TOverridden extends string = never,
|
|
1777
|
+
TOperationOptioned extends string = never,
|
|
1762
1778
|
> {
|
|
1763
1779
|
/** Options for the integration builder */
|
|
1764
1780
|
private options: IntegrationBuilderProps<
|
|
@@ -1771,6 +1787,11 @@ export class IntegrationBuilder<
|
|
|
1771
1787
|
/** Map of operation names to their custom integrations */
|
|
1772
1788
|
private integrations: Partial<TIntegrations> = {};
|
|
1773
1789
|
|
|
1790
|
+
/** Map of default integration keys to per-operation default option overrides */
|
|
1791
|
+
private perOperationOptions: Partial<
|
|
1792
|
+
Record<string, Partial<TDefaultIntegrationProps>>
|
|
1793
|
+
> = {};
|
|
1794
|
+
|
|
1774
1795
|
/**
|
|
1775
1796
|
* Create an Integration Builder for an HTTP API with a shared pattern
|
|
1776
1797
|
*/
|
|
@@ -1925,11 +1946,16 @@ export class IntegrationBuilder<
|
|
|
1925
1946
|
/**
|
|
1926
1947
|
* Overrides default integrations with custom implementations for specific operations.
|
|
1927
1948
|
*
|
|
1949
|
+
* Operations which have per-operation options set via withOperationOptions cannot be
|
|
1950
|
+
* overridden, since these still use the default integration.
|
|
1951
|
+
*
|
|
1928
1952
|
* @param overrides - Map of operation names to their custom integration implementations
|
|
1929
1953
|
* @returns The builder instance with updated type information reflecting the overrides
|
|
1930
1954
|
*/
|
|
1931
1955
|
public withOverrides<
|
|
1932
|
-
TOverrideIntegrations extends Partial<
|
|
1956
|
+
TOverrideIntegrations extends Partial<
|
|
1957
|
+
Record<Exclude<TOperation, TOperationOptioned>, TBaseIntegration>
|
|
1958
|
+
>,
|
|
1933
1959
|
>(overrides: TOverrideIntegrations) {
|
|
1934
1960
|
this.integrations = { ...this.integrations, ...overrides };
|
|
1935
1961
|
// Re-type to include the overridden integration types.
|
|
@@ -1945,7 +1971,9 @@ export class IntegrationBuilder<
|
|
|
1945
1971
|
MergedIntegrations,
|
|
1946
1972
|
TDefaultIntegrationProps,
|
|
1947
1973
|
TDefaultIntegration,
|
|
1948
|
-
TPattern
|
|
1974
|
+
TPattern,
|
|
1975
|
+
TOverridden | Extract<keyof TOverrideIntegrations, string>,
|
|
1976
|
+
TOperationOptioned
|
|
1949
1977
|
>;
|
|
1950
1978
|
}
|
|
1951
1979
|
|
|
@@ -1964,6 +1992,43 @@ export class IntegrationBuilder<
|
|
|
1964
1992
|
return this;
|
|
1965
1993
|
}
|
|
1966
1994
|
|
|
1995
|
+
/**
|
|
1996
|
+
* Updates the default integration options for specific operations, without
|
|
1997
|
+
* affecting the others. The given options are merged with the defaults (and
|
|
1998
|
+
* any options set via withDefaultOptions) when building each default integration.
|
|
1999
|
+
*
|
|
2000
|
+
* Operations which have been replaced via withOverrides cannot be targeted, since
|
|
2001
|
+
* they no longer use the default integration.
|
|
2002
|
+
*
|
|
2003
|
+
* @param options - Map of operation names to partial default integration options
|
|
2004
|
+
* @returns The builder instance
|
|
2005
|
+
*/
|
|
2006
|
+
public withOperationOptions<
|
|
2007
|
+
TOptions extends Partial<
|
|
2008
|
+
Record<
|
|
2009
|
+
Exclude<DefaultIntegrationKeys<TPattern, TOperation>, TOverridden>,
|
|
2010
|
+
Partial<TDefaultIntegrationProps>
|
|
2011
|
+
>
|
|
2012
|
+
>,
|
|
2013
|
+
>(options: TOptions) {
|
|
2014
|
+
Object.entries(options).forEach(([op, opOptions]) => {
|
|
2015
|
+
this.perOperationOptions[op] = {
|
|
2016
|
+
...this.perOperationOptions[op],
|
|
2017
|
+
...(opOptions as Partial<TDefaultIntegrationProps>),
|
|
2018
|
+
};
|
|
2019
|
+
});
|
|
2020
|
+
return this as unknown as IntegrationBuilder<
|
|
2021
|
+
TOperation,
|
|
2022
|
+
TBaseIntegration,
|
|
2023
|
+
TIntegrations,
|
|
2024
|
+
TDefaultIntegrationProps,
|
|
2025
|
+
TDefaultIntegration,
|
|
2026
|
+
TPattern,
|
|
2027
|
+
TOverridden,
|
|
2028
|
+
TOperationOptioned | Extract<keyof TOptions, string>
|
|
2029
|
+
>;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
1967
2032
|
/**
|
|
1968
2033
|
* Builds and returns the complete set of integrations.
|
|
1969
2034
|
*
|
|
@@ -1978,6 +2043,10 @@ export class IntegrationBuilder<
|
|
|
1978
2043
|
*/
|
|
1979
2044
|
public build(): TIntegrations {
|
|
1980
2045
|
const options = this.options;
|
|
2046
|
+
const buildOptionsFor = (op: string): TDefaultIntegrationProps => ({
|
|
2047
|
+
...options.defaultIntegrationOptions,
|
|
2048
|
+
...this.perOperationOptions[op],
|
|
2049
|
+
});
|
|
1981
2050
|
return {
|
|
1982
2051
|
...Object.fromEntries(
|
|
1983
2052
|
options.pattern === 'shared'
|
|
@@ -1986,7 +2055,7 @@ export class IntegrationBuilder<
|
|
|
1986
2055
|
'$router',
|
|
1987
2056
|
options.buildDefaultIntegration(
|
|
1988
2057
|
'$router',
|
|
1989
|
-
|
|
2058
|
+
buildOptionsFor('$router'),
|
|
1990
2059
|
),
|
|
1991
2060
|
],
|
|
1992
2061
|
]
|
|
@@ -1997,10 +2066,7 @@ export class IntegrationBuilder<
|
|
|
1997
2066
|
)
|
|
1998
2067
|
.map((op) => [
|
|
1999
2068
|
op,
|
|
2000
|
-
options.buildDefaultIntegration(
|
|
2001
|
-
op,
|
|
2002
|
-
options.defaultIntegrationOptions,
|
|
2003
|
-
),
|
|
2069
|
+
options.buildDefaultIntegration(op, buildOptionsFor(op)),
|
|
2004
2070
|
]),
|
|
2005
2071
|
),
|
|
2006
2072
|
...this.integrations,
|
|
@@ -2019,6 +2085,7 @@ import {
|
|
|
2019
2085
|
RestApiProps as _RestApiProps,
|
|
2020
2086
|
IResource,
|
|
2021
2087
|
Stage,
|
|
2088
|
+
ThrottleSettings,
|
|
2022
2089
|
} from 'aws-cdk-lib/aws-apigateway';
|
|
2023
2090
|
import { IAspect, RemovalPolicy } from 'aws-cdk-lib';
|
|
2024
2091
|
import {
|
|
@@ -2065,6 +2132,12 @@ export interface RestApiProps<
|
|
|
2065
2132
|
* @default true
|
|
2066
2133
|
*/
|
|
2067
2134
|
readonly enableWaf?: boolean;
|
|
2135
|
+
/**
|
|
2136
|
+
* Default throttling limits applied to all methods on the API's default stage.
|
|
2137
|
+
*
|
|
2138
|
+
* @default { rateLimit: 10000, burstLimit: 5000 }
|
|
2139
|
+
*/
|
|
2140
|
+
readonly throttle?: ThrottleSettings;
|
|
2068
2141
|
}
|
|
2069
2142
|
|
|
2070
2143
|
/**
|
|
@@ -2099,6 +2172,7 @@ export class RestApi<
|
|
|
2099
2172
|
operations,
|
|
2100
2173
|
integrations,
|
|
2101
2174
|
enableWaf = true,
|
|
2175
|
+
throttle = { rateLimit: 10000, burstLimit: 5000 },
|
|
2102
2176
|
...props
|
|
2103
2177
|
}: RestApiProps<TIntegrations, TOperation>,
|
|
2104
2178
|
) {
|
|
@@ -2106,7 +2180,21 @@ export class RestApi<
|
|
|
2106
2180
|
this.integrations = integrations;
|
|
2107
2181
|
|
|
2108
2182
|
// Create the API Gateway REST API
|
|
2109
|
-
this.api = new _RestApi(this, 'Api',
|
|
2183
|
+
this.api = new _RestApi(this, 'Api', {
|
|
2184
|
+
...props,
|
|
2185
|
+
deployOptions: {
|
|
2186
|
+
...props.deployOptions,
|
|
2187
|
+
methodOptions: {
|
|
2188
|
+
...props.deployOptions?.methodOptions,
|
|
2189
|
+
// Default throttling applied to all resource paths and methods
|
|
2190
|
+
'/*/*': {
|
|
2191
|
+
throttlingRateLimit: throttle.rateLimit,
|
|
2192
|
+
throttlingBurstLimit: throttle.burstLimit,
|
|
2193
|
+
...props.deployOptions?.methodOptions?.['/*/*'],
|
|
2194
|
+
},
|
|
2195
|
+
},
|
|
2196
|
+
},
|
|
2197
|
+
});
|
|
2110
2198
|
|
|
2111
2199
|
if (enableWaf) {
|
|
2112
2200
|
this.webAcl = new CfnWebACL(this, 'WebAcl', {
|
|
@@ -2708,6 +2796,8 @@ export type ApiIntegrations<TOperation extends string, TBaseIntegration> =
|
|
|
2708
2796
|
* @template TDefaultIntegrationProps - Type for default integration properties
|
|
2709
2797
|
* @template TDefaultIntegration - Type for default integration implementation
|
|
2710
2798
|
* @template TPattern - The integration pattern ('shared' or 'isolated')
|
|
2799
|
+
* @template TOverridden - Union of operation names that have been overridden
|
|
2800
|
+
* @template TOperationOptioned - Union of operation names with per-operation options
|
|
2711
2801
|
*/
|
|
2712
2802
|
export class IntegrationBuilder<
|
|
2713
2803
|
TOperation extends string,
|
|
@@ -2716,6 +2806,8 @@ export class IntegrationBuilder<
|
|
|
2716
2806
|
TDefaultIntegrationProps extends object,
|
|
2717
2807
|
TDefaultIntegration extends TBaseIntegration,
|
|
2718
2808
|
TPattern extends 'shared' | 'isolated',
|
|
2809
|
+
TOverridden extends string = never,
|
|
2810
|
+
TOperationOptioned extends string = never,
|
|
2719
2811
|
> {
|
|
2720
2812
|
/** Options for the integration builder */
|
|
2721
2813
|
private options: IntegrationBuilderProps<
|
|
@@ -2728,6 +2820,11 @@ export class IntegrationBuilder<
|
|
|
2728
2820
|
/** Map of operation names to their custom integrations */
|
|
2729
2821
|
private integrations: Partial<TIntegrations> = {};
|
|
2730
2822
|
|
|
2823
|
+
/** Map of default integration keys to per-operation default option overrides */
|
|
2824
|
+
private perOperationOptions: Partial<
|
|
2825
|
+
Record<string, Partial<TDefaultIntegrationProps>>
|
|
2826
|
+
> = {};
|
|
2827
|
+
|
|
2731
2828
|
/**
|
|
2732
2829
|
* Create an Integration Builder for an HTTP API with a shared pattern
|
|
2733
2830
|
*/
|
|
@@ -2882,11 +2979,16 @@ export class IntegrationBuilder<
|
|
|
2882
2979
|
/**
|
|
2883
2980
|
* Overrides default integrations with custom implementations for specific operations.
|
|
2884
2981
|
*
|
|
2982
|
+
* Operations which have per-operation options set via withOperationOptions cannot be
|
|
2983
|
+
* overridden, since these still use the default integration.
|
|
2984
|
+
*
|
|
2885
2985
|
* @param overrides - Map of operation names to their custom integration implementations
|
|
2886
2986
|
* @returns The builder instance with updated type information reflecting the overrides
|
|
2887
2987
|
*/
|
|
2888
2988
|
public withOverrides<
|
|
2889
|
-
TOverrideIntegrations extends Partial<
|
|
2989
|
+
TOverrideIntegrations extends Partial<
|
|
2990
|
+
Record<Exclude<TOperation, TOperationOptioned>, TBaseIntegration>
|
|
2991
|
+
>,
|
|
2890
2992
|
>(overrides: TOverrideIntegrations) {
|
|
2891
2993
|
this.integrations = { ...this.integrations, ...overrides };
|
|
2892
2994
|
// Re-type to include the overridden integration types.
|
|
@@ -2902,7 +3004,9 @@ export class IntegrationBuilder<
|
|
|
2902
3004
|
MergedIntegrations,
|
|
2903
3005
|
TDefaultIntegrationProps,
|
|
2904
3006
|
TDefaultIntegration,
|
|
2905
|
-
TPattern
|
|
3007
|
+
TPattern,
|
|
3008
|
+
TOverridden | Extract<keyof TOverrideIntegrations, string>,
|
|
3009
|
+
TOperationOptioned
|
|
2906
3010
|
>;
|
|
2907
3011
|
}
|
|
2908
3012
|
|
|
@@ -2921,6 +3025,43 @@ export class IntegrationBuilder<
|
|
|
2921
3025
|
return this;
|
|
2922
3026
|
}
|
|
2923
3027
|
|
|
3028
|
+
/**
|
|
3029
|
+
* Updates the default integration options for specific operations, without
|
|
3030
|
+
* affecting the others. The given options are merged with the defaults (and
|
|
3031
|
+
* any options set via withDefaultOptions) when building each default integration.
|
|
3032
|
+
*
|
|
3033
|
+
* Operations which have been replaced via withOverrides cannot be targeted, since
|
|
3034
|
+
* they no longer use the default integration.
|
|
3035
|
+
*
|
|
3036
|
+
* @param options - Map of operation names to partial default integration options
|
|
3037
|
+
* @returns The builder instance
|
|
3038
|
+
*/
|
|
3039
|
+
public withOperationOptions<
|
|
3040
|
+
TOptions extends Partial<
|
|
3041
|
+
Record<
|
|
3042
|
+
Exclude<DefaultIntegrationKeys<TPattern, TOperation>, TOverridden>,
|
|
3043
|
+
Partial<TDefaultIntegrationProps>
|
|
3044
|
+
>
|
|
3045
|
+
>,
|
|
3046
|
+
>(options: TOptions) {
|
|
3047
|
+
Object.entries(options).forEach(([op, opOptions]) => {
|
|
3048
|
+
this.perOperationOptions[op] = {
|
|
3049
|
+
...this.perOperationOptions[op],
|
|
3050
|
+
...(opOptions as Partial<TDefaultIntegrationProps>),
|
|
3051
|
+
};
|
|
3052
|
+
});
|
|
3053
|
+
return this as unknown as IntegrationBuilder<
|
|
3054
|
+
TOperation,
|
|
3055
|
+
TBaseIntegration,
|
|
3056
|
+
TIntegrations,
|
|
3057
|
+
TDefaultIntegrationProps,
|
|
3058
|
+
TDefaultIntegration,
|
|
3059
|
+
TPattern,
|
|
3060
|
+
TOverridden,
|
|
3061
|
+
TOperationOptioned | Extract<keyof TOptions, string>
|
|
3062
|
+
>;
|
|
3063
|
+
}
|
|
3064
|
+
|
|
2924
3065
|
/**
|
|
2925
3066
|
* Builds and returns the complete set of integrations.
|
|
2926
3067
|
*
|
|
@@ -2935,6 +3076,10 @@ export class IntegrationBuilder<
|
|
|
2935
3076
|
*/
|
|
2936
3077
|
public build(): TIntegrations {
|
|
2937
3078
|
const options = this.options;
|
|
3079
|
+
const buildOptionsFor = (op: string): TDefaultIntegrationProps => ({
|
|
3080
|
+
...options.defaultIntegrationOptions,
|
|
3081
|
+
...this.perOperationOptions[op],
|
|
3082
|
+
});
|
|
2938
3083
|
return {
|
|
2939
3084
|
...Object.fromEntries(
|
|
2940
3085
|
options.pattern === 'shared'
|
|
@@ -2943,7 +3088,7 @@ export class IntegrationBuilder<
|
|
|
2943
3088
|
'$router',
|
|
2944
3089
|
options.buildDefaultIntegration(
|
|
2945
3090
|
'$router',
|
|
2946
|
-
|
|
3091
|
+
buildOptionsFor('$router'),
|
|
2947
3092
|
),
|
|
2948
3093
|
],
|
|
2949
3094
|
]
|
|
@@ -2954,10 +3099,7 @@ export class IntegrationBuilder<
|
|
|
2954
3099
|
)
|
|
2955
3100
|
.map((op) => [
|
|
2956
3101
|
op,
|
|
2957
|
-
options.buildDefaultIntegration(
|
|
2958
|
-
op,
|
|
2959
|
-
options.defaultIntegrationOptions,
|
|
2960
|
-
),
|
|
3102
|
+
options.buildDefaultIntegration(op, buildOptionsFor(op)),
|
|
2961
3103
|
]),
|
|
2962
3104
|
),
|
|
2963
3105
|
...this.integrations,
|
|
@@ -5502,6 +5644,9 @@ resource "aws_api_gateway_method" "proxy_method" {
|
|
|
5502
5644
|
|
|
5503
5645
|
authorization = "COGNITO_USER_POOLS"
|
|
5504
5646
|
authorizer_id = aws_api_gateway_authorizer.cognito_authorizer.id
|
|
5647
|
+
# Accept access tokens from both sign-in flows: 'openid' (Cognito hosted UI)
|
|
5648
|
+
# and 'aws.cognito.signin.user.admin' (Cognito admin/SRP auth APIs).
|
|
5649
|
+
authorization_scopes = ["openid", "aws.cognito.signin.user.admin"]
|
|
5505
5650
|
|
|
5506
5651
|
request_parameters = {
|
|
5507
5652
|
"method.request.path.proxy" = true
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const EchoInputSchema = z.object({
|
|
4
|
-
message: z.string(),
|
|
4
|
+
message: z.string().max(1024),
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
export type IEchoInput = z.TypeOf<typeof EchoInputSchema>;
|
|
8
8
|
|
|
9
9
|
export const EchoOutputSchema = z.object({
|
|
10
|
-
|
|
10
|
+
message: z.string().max(1024),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export type IEchoOutput = z.TypeOf<typeof EchoOutputSchema>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
|
+
import { type NxGeneratorInfo } from '../../utils/nx';
|
|
7
|
+
import type { TsTrpcApiGeneratorSchema } from './schema';
|
|
8
8
|
export declare const TRPC_BACKEND_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
9
|
export declare function tsTrpcApiGenerator(tree: Tree, options: TsTrpcApiGeneratorSchema): Promise<() => void>;
|
|
10
10
|
export default tsTrpcApiGenerator;
|