@aws/nx-plugin 1.0.0-rc.33 → 1.0.0-rc.34

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.
Files changed (109) hide show
  1. package/LICENSE-THIRD-PARTY +28 -41
  2. package/generators.json +27 -0
  3. package/package.json +6 -6
  4. package/src/connection/generator.js +12 -1
  5. package/src/connection/generator.js.map +1 -1
  6. package/src/connection/supported-connections.d.ts +10 -1
  7. package/src/connection/supported-connections.js +13 -0
  8. package/src/connection/supported-connections.js.map +1 -1
  9. package/src/infra/app/__snapshots__/generator.spec.ts.snap +6 -6
  10. package/src/open-api/ts-client/__snapshots__/generator.complex-types.spec.ts.snap +12 -12
  11. package/src/open-api/ts-client/__snapshots__/generator.composite-types.spec.ts.snap +74 -10
  12. package/src/open-api/ts-client/__snapshots__/generator.content-type.spec.ts.snap +22 -4
  13. package/src/open-api/ts-client/__snapshots__/generator.duplicate-types.spec.ts.snap +53 -8
  14. package/src/open-api/ts-client/__snapshots__/generator.edge-cases.spec.ts.snap +32 -4
  15. package/src/open-api/ts-client/__snapshots__/generator.fast-api-gaps.spec.ts.snap +736 -0
  16. package/src/open-api/ts-client/__snapshots__/generator.fast-api.spec.ts.snap +86 -11
  17. package/src/open-api/ts-client/__snapshots__/generator.multipart.spec.ts.snap +21 -3
  18. package/src/open-api/ts-client/__snapshots__/generator.primitive-types.spec.ts.snap +2 -2
  19. package/src/open-api/ts-client/__snapshots__/generator.request.spec.ts.snap +6 -6
  20. package/src/open-api/ts-client/__snapshots__/generator.reserved-keywords.spec.ts.snap +2 -2
  21. package/src/open-api/ts-client/__snapshots__/generator.spec-compliance.spec.ts.snap +1883 -0
  22. package/src/open-api/ts-client/__snapshots__/generator.tags.spec.ts.snap +4 -4
  23. package/src/open-api/ts-client/files/client.gen.ts.template +195 -12
  24. package/src/open-api/ts-client/files/types.gen.ts.template +2 -0
  25. package/src/open-api/ts-client/generator.js +22 -1
  26. package/src/open-api/ts-client/generator.js.map +1 -1
  27. package/src/open-api/utils/codegen-data/languages.js +6 -0
  28. package/src/open-api/utils/codegen-data/languages.js.map +1 -1
  29. package/src/open-api/utils/codegen-data/types.d.ts +16 -1
  30. package/src/open-api/utils/codegen-data/types.js.map +1 -1
  31. package/src/open-api/utils/codegen-data.js +71 -0
  32. package/src/open-api/utils/codegen-data.js.map +1 -1
  33. package/src/open-api/utils/normalise.js +53 -8
  34. package/src/open-api/utils/normalise.js.map +1 -1
  35. package/src/open-api/utils/parser.js +48 -15
  36. package/src/open-api/utils/parser.js.map +1 -1
  37. package/src/preset/__snapshots__/generator.spec.ts.snap +4 -2
  38. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +1 -1
  39. package/src/py/rdb/__snapshots__/generator.spec.ts.snap +2038 -0
  40. package/src/py/rdb/agent-connection/__snapshots__/generator.spec.ts.snap +104 -0
  41. package/src/py/rdb/agent-connection/generator.d.ts +10 -0
  42. package/src/py/rdb/agent-connection/generator.js +46 -0
  43. package/src/py/rdb/agent-connection/generator.js.map +1 -0
  44. package/src/py/rdb/agent-connection/schema.d.js +8 -0
  45. package/src/py/rdb/agent-connection/schema.d.js.map +1 -0
  46. package/src/py/rdb/agent-connection/schema.d.ts +15 -0
  47. package/src/py/rdb/agent-connection/schema.json +27 -0
  48. package/src/py/rdb/fast-api-connection/__snapshots__/generator.spec.ts.snap +44 -0
  49. package/src/py/rdb/fast-api-connection/files/__apiModuleName__/dependencies/__rdbNameSnake__.py.template +14 -0
  50. package/src/py/rdb/fast-api-connection/generator.d.ts +10 -0
  51. package/src/py/rdb/fast-api-connection/generator.js +54 -0
  52. package/src/py/rdb/fast-api-connection/generator.js.map +1 -0
  53. package/src/py/rdb/fast-api-connection/schema.d.js +8 -0
  54. package/src/py/rdb/fast-api-connection/schema.d.js.map +1 -0
  55. package/src/py/rdb/fast-api-connection/schema.d.ts +13 -0
  56. package/src/py/rdb/fast-api-connection/schema.json +23 -0
  57. package/src/py/rdb/files/Dockerfile.create-db-user.template +10 -0
  58. package/src/py/rdb/files/Dockerfile.migration.template +10 -0
  59. package/src/py/rdb/files/__name__/__init__.py.template +3 -0
  60. package/src/py/rdb/files/__name__/connection.py.template +55 -0
  61. package/src/py/rdb/files/__name__/create_db_user_handler.py.template +97 -0
  62. package/src/py/rdb/files/__name__/migration_handler.py.template +36 -0
  63. package/src/py/rdb/files/__name__/models/__init__.py.template +3 -0
  64. package/src/py/rdb/files/__name__/models/example.py.template +8 -0
  65. package/src/py/rdb/files/__name__/utils.py.template +104 -0
  66. package/src/py/rdb/files/alembic.ini.template +38 -0
  67. package/src/py/rdb/files/config.json.template +14 -0
  68. package/src/py/rdb/files/migrations/env.py.template +80 -0
  69. package/src/py/rdb/files/migrations/script.py.mako.template +28 -0
  70. package/src/py/rdb/generator.d.ts +6 -0
  71. package/src/py/rdb/generator.js +263 -0
  72. package/src/py/rdb/generator.js.map +1 -0
  73. package/src/py/rdb/mcp-server-connection/__snapshots__/generator.spec.ts.snap +101 -0
  74. package/src/py/rdb/mcp-server-connection/generator.d.ts +10 -0
  75. package/src/py/rdb/mcp-server-connection/generator.js +46 -0
  76. package/src/py/rdb/mcp-server-connection/generator.js.map +1 -0
  77. package/src/py/rdb/mcp-server-connection/schema.d.js +8 -0
  78. package/src/py/rdb/mcp-server-connection/schema.d.js.map +1 -0
  79. package/src/py/rdb/mcp-server-connection/schema.d.ts +15 -0
  80. package/src/py/rdb/mcp-server-connection/schema.json +27 -0
  81. package/src/py/rdb/schema.d.js +6 -0
  82. package/src/py/rdb/schema.d.js.map +1 -0
  83. package/src/py/rdb/schema.d.ts +16 -0
  84. package/src/py/rdb/schema.json +77 -0
  85. package/src/py/rdb/utils.d.ts +6 -0
  86. package/src/py/rdb/utils.js +16 -0
  87. package/src/py/rdb/utils.js.map +1 -0
  88. package/src/sdk/py.d.ts +2 -0
  89. package/src/sdk/py.js +1 -0
  90. package/src/sdk/py.js.map +1 -1
  91. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +145 -173
  92. package/src/ts/rdb/generator.js +4 -3
  93. package/src/ts/rdb/generator.js.map +1 -1
  94. package/src/ts/rdb/schema.json +1 -1
  95. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +16 -16
  96. package/src/utils/rdb-constructs/files/cdk/app/dbs/__nameKebabCase__.ts.template +58 -14
  97. package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +68 -78
  98. package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +88 -8
  99. package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +5 -32
  100. package/src/utils/rdb-constructs/rdb-constructs.d.ts +11 -1
  101. package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
  102. package/src/utils/shared-constructs.js +9 -21
  103. package/src/utils/shared-constructs.js.map +1 -1
  104. package/src/utils/shared-rdb-scripts.js +5 -1
  105. package/src/utils/shared-rdb-scripts.js.map +1 -1
  106. package/src/utils/versions.d.ts +34 -30
  107. package/src/utils/versions.js +34 -30
  108. package/src/utils/versions.js.map +1 -1
  109. package/src/utils/files/terraform/scripts/reset-runtime-config.ts.template +0 -25
@@ -0,0 +1,101 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`py#rdb mcp-server-connection generator > should add RDS CA bundle to Dockerfile 1`] = `
4
+ "FROM public.ecr.aws/docker/library/python:3.14-slim
5
+
6
+ WORKDIR /app
7
+
8
+ COPY . /app
9
+
10
+ ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/rds-global-bundle.crt
11
+ RUN update-ca-certificates
12
+
13
+ EXPOSE 8000
14
+
15
+ ENV PYTHONPATH=/app
16
+
17
+ CMD ["python", "-m", "uvicorn", "proj_my_mcp_server.mcp_server.http:app", "--host", "0.0.0.0", "--port", "8000"]
18
+ "
19
+ `;
20
+
21
+ exports[`py#rdb mcp-server-connection generator > should add RDS CA bundle to sourceComponent Dockerfile 1`] = `
22
+ "FROM public.ecr.aws/docker/library/python:3.14-slim
23
+
24
+ WORKDIR /app
25
+
26
+ COPY . /app
27
+
28
+ ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/rds-global-bundle.crt
29
+ RUN update-ca-certificates
30
+
31
+ EXPOSE 8000
32
+
33
+ ENV PYTHONPATH=/app
34
+
35
+ CMD ["python", "-m", "uvicorn", "proj_my_mcp_server.custom_mcp_server.http:app", "--host", "0.0.0.0", "--port", "8000"]
36
+ "
37
+ `;
38
+
39
+ exports[`py#rdb mcp-server-connection generator > should add rdb dev dependency to mcp-server dev 1`] = `
40
+ {
41
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
42
+ "name": "my-mcp-server",
43
+ "root": "packages/my-mcp-server",
44
+ "sourceRoot": "packages/my-mcp-server/src/proj_my_mcp_server",
45
+ "targets": {
46
+ "mcp-server-dev": {
47
+ "continuous": true,
48
+ "dependsOn": [
49
+ {
50
+ "projects": [
51
+ "db",
52
+ ],
53
+ "target": "dev",
54
+ },
55
+ ],
56
+ "executor": "nx:run-commands",
57
+ },
58
+ },
59
+ }
60
+ `;
61
+
62
+ exports[`py#rdb mcp-server-connection generator > should be idempotent for Dockerfile 1`] = `
63
+ "FROM public.ecr.aws/docker/library/python:3.14-slim
64
+
65
+ WORKDIR /app
66
+
67
+ COPY . /app
68
+
69
+ ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/rds-global-bundle.crt
70
+ RUN update-ca-certificates
71
+
72
+ EXPOSE 8000
73
+
74
+ ENV PYTHONPATH=/app
75
+
76
+ CMD ["python", "-m", "uvicorn", "proj_my_mcp_server.mcp_server.http:app", "--host", "0.0.0.0", "--port", "8000"]
77
+ "
78
+ `;
79
+
80
+ exports[`py#rdb mcp-server-connection generator > should use sourceComponent name when provided 1`] = `
81
+ {
82
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
83
+ "name": "my-mcp-server",
84
+ "root": "packages/my-mcp-server",
85
+ "sourceRoot": "packages/my-mcp-server/src/proj_my_mcp_server",
86
+ "targets": {
87
+ "custom-mcp-server-dev": {
88
+ "continuous": true,
89
+ "dependsOn": [
90
+ {
91
+ "projects": [
92
+ "db",
93
+ ],
94
+ "target": "dev",
95
+ },
96
+ ],
97
+ "executor": "nx:run-commands",
98
+ },
99
+ },
100
+ }
101
+ `;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
6
+ import { type NxGeneratorInfo } from '../../../utils/nx';
7
+ import type { PyRdbMcpServerConnectionGeneratorSchema } from './schema';
8
+ export declare const PY_RDB_MCP_SERVER_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
9
+ export declare const pyRdbMcpServerConnectionGenerator: (tree: Tree, options: PyRdbMcpServerConnectionGeneratorSchema) => Promise<GeneratorCallback>;
10
+ export default pyRdbMcpServerConnectionGenerator;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { joinPathFragments, updateProjectConfiguration } from "@nx/devkit";
5
+ import { formatFilesInSubtree } from "../../../utils/format.js";
6
+ import { installDependencies } from "../../../utils/install.js";
7
+ import { addGeneratorMetricsIfApplicable } from "../../../utils/metrics.js";
8
+ import { toSnakeCase } from "../../../utils/names.js";
9
+ import { addDependencyToTargetIfNotPresent, getGeneratorInfo, readProjectConfigurationUnqualified } from "../../../utils/nx.js";
10
+ import { addWorkspaceDependencyToPyProject } from "../../../utils/py.js";
11
+ import { injectRdsCaBundleIntoDockerfile } from "../utils.js";
12
+ export const PY_RDB_MCP_SERVER_CONNECTION_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
13
+ export const pyRdbMcpServerConnectionGenerator = async (tree, options)=>{
14
+ const sourceProject = readProjectConfigurationUnqualified(tree, options.sourceProject);
15
+ const targetProject = readProjectConfigurationUnqualified(tree, options.targetProject);
16
+ addWorkspaceDependencyToPyProject(tree, sourceProject, targetProject);
17
+ const mcpServerName = options.sourceComponent?.name ?? 'mcp-server';
18
+ const devTarget = `${mcpServerName}-dev`;
19
+ const mcpServerSourceDir = options.sourceComponent?.path ? joinPathFragments(sourceProject.root, options.sourceComponent.path) : sourceProject.sourceRoot ? joinPathFragments(sourceProject.sourceRoot, toSnakeCase(mcpServerName)) : undefined;
20
+ const dockerfilePath = mcpServerSourceDir ? joinPathFragments(mcpServerSourceDir, 'Dockerfile') : undefined;
21
+ if (dockerfilePath) {
22
+ injectRdsCaBundleIntoDockerfile(tree, dockerfilePath);
23
+ }
24
+ if (sourceProject.targets?.[devTarget]) {
25
+ addDependencyToTargetIfNotPresent(sourceProject, devTarget, {
26
+ projects: [
27
+ targetProject.name
28
+ ],
29
+ target: 'dev'
30
+ });
31
+ updateProjectConfiguration(tree, sourceProject.name, sourceProject);
32
+ }
33
+ await addGeneratorMetricsIfApplicable(tree, [
34
+ PY_RDB_MCP_SERVER_CONNECTION_GENERATOR_INFO
35
+ ]);
36
+ await formatFilesInSubtree(tree);
37
+ return ()=>installDependencies(tree, options.preferInstallDependencies, {
38
+ languages: [
39
+ 'typescript',
40
+ 'python'
41
+ ]
42
+ });
43
+ };
44
+ export default pyRdbMcpServerConnectionGenerator;
45
+
46
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/py/rdb/mcp-server-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 joinPathFragments,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../../utils/format';\nimport { installDependencies } from '../../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../../utils/metrics';\nimport { toSnakeCase } from '../../../utils/names';\nimport {\n addDependencyToTargetIfNotPresent,\n getGeneratorInfo,\n type NxGeneratorInfo,\n readProjectConfigurationUnqualified,\n} from '../../../utils/nx';\nimport { addWorkspaceDependencyToPyProject } from '../../../utils/py';\nimport { injectRdsCaBundleIntoDockerfile } from '../utils';\nimport type { PyRdbMcpServerConnectionGeneratorSchema } from './schema';\n\nexport const PY_RDB_MCP_SERVER_CONNECTION_GENERATOR_INFO: NxGeneratorInfo =\n getGeneratorInfo(import.meta.filename);\n\nexport const pyRdbMcpServerConnectionGenerator = async (\n tree: Tree,\n options: PyRdbMcpServerConnectionGeneratorSchema,\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 addWorkspaceDependencyToPyProject(tree, sourceProject, targetProject);\n\n const mcpServerName = options.sourceComponent?.name ?? 'mcp-server';\n const devTarget = `${mcpServerName}-dev`;\n const mcpServerSourceDir = options.sourceComponent?.path\n ? joinPathFragments(sourceProject.root, options.sourceComponent.path)\n : sourceProject.sourceRoot\n ? joinPathFragments(sourceProject.sourceRoot, toSnakeCase(mcpServerName))\n : undefined;\n const dockerfilePath = mcpServerSourceDir\n ? joinPathFragments(mcpServerSourceDir, 'Dockerfile')\n : undefined;\n\n if (dockerfilePath) {\n injectRdsCaBundleIntoDockerfile(tree, dockerfilePath);\n }\n\n if (sourceProject.targets?.[devTarget]) {\n addDependencyToTargetIfNotPresent(sourceProject, devTarget, {\n projects: [targetProject.name],\n target: 'dev',\n });\n updateProjectConfiguration(tree, sourceProject.name, sourceProject);\n }\n\n await addGeneratorMetricsIfApplicable(tree, [\n PY_RDB_MCP_SERVER_CONNECTION_GENERATOR_INFO,\n ]);\n await formatFilesInSubtree(tree);\n return () =>\n installDependencies(tree, options.preferInstallDependencies, {\n languages: ['typescript', 'python'],\n });\n};\n\nexport default pyRdbMcpServerConnectionGenerator;\n"],"names":["joinPathFragments","updateProjectConfiguration","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","toSnakeCase","addDependencyToTargetIfNotPresent","getGeneratorInfo","readProjectConfigurationUnqualified","addWorkspaceDependencyToPyProject","injectRdsCaBundleIntoDockerfile","PY_RDB_MCP_SERVER_CONNECTION_GENERATOR_INFO","filename","pyRdbMcpServerConnectionGenerator","tree","options","sourceProject","targetProject","mcpServerName","sourceComponent","name","devTarget","mcpServerSourceDir","path","root","sourceRoot","undefined","dockerfilePath","targets","projects","target","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,iBAAiB,EAEjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,mBAAmB,QAAQ,4BAAyB;AAC7D,SAASC,+BAA+B,QAAQ,4BAAyB;AACzE,SAASC,WAAW,QAAQ,0BAAuB;AACnD,SACEC,iCAAiC,EACjCC,gBAAgB,EAEhBC,mCAAmC,QAC9B,uBAAoB;AAC3B,SAASC,iCAAiC,QAAQ,uBAAoB;AACtE,SAASC,+BAA+B,QAAQ,cAAW;AAG3D,OAAO,MAAMC,8CACXJ,iBAAiB,YAAYK,QAAQ,EAAE;AAEzC,OAAO,MAAMC,oCAAoC,OAC/CC,MACAC;IAEA,MAAMC,gBAAgBR,oCACpBM,MACAC,QAAQC,aAAa;IAEvB,MAAMC,gBAAgBT,oCACpBM,MACAC,QAAQE,aAAa;IAGvBR,kCAAkCK,MAAME,eAAeC;IAEvD,MAAMC,gBAAgBH,QAAQI,eAAe,EAAEC,QAAQ;IACvD,MAAMC,YAAY,GAAGH,cAAc,IAAI,CAAC;IACxC,MAAMI,qBAAqBP,QAAQI,eAAe,EAAEI,OAChDvB,kBAAkBgB,cAAcQ,IAAI,EAAET,QAAQI,eAAe,CAACI,IAAI,IAClEP,cAAcS,UAAU,GACtBzB,kBAAkBgB,cAAcS,UAAU,EAAEpB,YAAYa,kBACxDQ;IACN,MAAMC,iBAAiBL,qBACnBtB,kBAAkBsB,oBAAoB,gBACtCI;IAEJ,IAAIC,gBAAgB;QAClBjB,gCAAgCI,MAAMa;IACxC;IAEA,IAAIX,cAAcY,OAAO,EAAE,CAACP,UAAU,EAAE;QACtCf,kCAAkCU,eAAeK,WAAW;YAC1DQ,UAAU;gBAACZ,cAAcG,IAAI;aAAC;YAC9BU,QAAQ;QACV;QACA7B,2BAA2Ba,MAAME,cAAcI,IAAI,EAAEJ;IACvD;IAEA,MAAMZ,gCAAgCU,MAAM;QAC1CH;KACD;IACD,MAAMT,qBAAqBY;IAC3B,OAAO,IACLX,oBAAoBW,MAAMC,QAAQgB,yBAAyB,EAAE;YAC3DC,WAAW;gBAAC;gBAAc;aAAS;QACrC;AACJ,EAAE;AAEF,eAAenB,kCAAkC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ /**
5
+ * TypeScript types for options defined in schema.json
6
+ */ export { };
7
+
8
+ //# sourceMappingURL=schema.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/py/rdb/mcp-server-connection/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ComponentMetadata } from '../../../utils/nx';\n\n/**\n * TypeScript types for options defined in schema.json\n */\nexport interface PyRdbMcpServerConnectionGeneratorSchema {\n sourceProject: string;\n targetProject: string;\n sourceComponent?: ComponentMetadata;\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAGD;;CAEC,GACD,WAKC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { ComponentMetadata } from '../../../utils/nx';
6
+
7
+ /**
8
+ * TypeScript types for options defined in schema.json
9
+ */
10
+ export interface PyRdbMcpServerConnectionGeneratorSchema {
11
+ sourceProject: string;
12
+ targetProject: string;
13
+ sourceComponent?: ComponentMetadata;
14
+ preferInstallDependencies?: boolean;
15
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "py#rdb#mcp-server-connection",
4
+ "title": "py#rdb#mcp-server-connection",
5
+ "description": "Connect a py#mcp-server to a py#rdb project",
6
+ "type": "object",
7
+ "properties": {
8
+ "sourceProject": {
9
+ "type": "string",
10
+ "description": "The project containing the py#mcp-server to connect from"
11
+ },
12
+ "targetProject": {
13
+ "type": "string",
14
+ "description": "The py#rdb project to connect to"
15
+ },
16
+ "sourceComponent": {
17
+ "type": "string",
18
+ "description": "The MCP server component name"
19
+ },
20
+ "preferInstallDependencies": {
21
+ "type": "boolean",
22
+ "description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
23
+ "default": true
24
+ }
25
+ },
26
+ "required": ["sourceProject", "targetProject"]
27
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ export { };
5
+
6
+ //# sourceMappingURL=schema.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/py/rdb/schema.d.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nexport interface PyRdbGeneratorSchema {\n name: string;\n directory?: string;\n subDirectory?: string;\n infra: 'aurora' | 'none';\n engine: 'postgres' | 'mysql';\n databaseUser?: string;\n databaseName?: string;\n framework: 'sqlmodel';\n iac?: 'inherit' | 'cdk' | 'terraform';\n preferInstallDependencies?: boolean;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GACD,WAWC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ export interface PyRdbGeneratorSchema {
6
+ name: string;
7
+ directory?: string;
8
+ subDirectory?: string;
9
+ infra: 'aurora' | 'none';
10
+ engine: 'postgres' | 'mysql';
11
+ databaseUser?: string;
12
+ databaseName?: string;
13
+ framework: 'sqlmodel';
14
+ iac?: 'inherit' | 'cdk' | 'terraform';
15
+ preferInstallDependencies?: boolean;
16
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "py#rdb",
4
+ "title": "py#rdb",
5
+ "description": "Create a Python relational database project",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "Name of the database project to generate",
11
+ "$default": {
12
+ "$source": "argv",
13
+ "index": 0
14
+ },
15
+ "x-priority": "important",
16
+ "x-prompt": "What name would you like your database project to have? i.e: MyDb"
17
+ },
18
+ "directory": {
19
+ "type": "string",
20
+ "description": "The directory to store the application in.",
21
+ "default": "packages",
22
+ "x-priority": "important",
23
+ "x-prompt": "Which directory do you want to create the project in?"
24
+ },
25
+ "subDirectory": {
26
+ "type": "string",
27
+ "description": "The sub directory the project is placed in. By default this is the project name."
28
+ },
29
+ "infra": {
30
+ "type": "string",
31
+ "enum": ["aurora", "none"],
32
+ "default": "aurora",
33
+ "description": "Relational database service to provision.",
34
+ "x-priority": "important",
35
+ "x-prompt": "Which database service would you like to use?"
36
+ },
37
+ "engine": {
38
+ "type": "string",
39
+ "enum": ["postgres", "mysql"],
40
+ "default": "postgres",
41
+ "description": "Database engine to use with the selected service.",
42
+ "x-priority": "important",
43
+ "x-prompt": "Which database engine would you like to use?"
44
+ },
45
+ "databaseUser": {
46
+ "type": "string",
47
+ "description": "Database admin username. Defaults to 'dbadmin'.",
48
+ "default": "dbadmin"
49
+ },
50
+ "databaseName": {
51
+ "type": "string",
52
+ "description": "Initial database name. Defaults to the project name."
53
+ },
54
+ "framework": {
55
+ "type": "string",
56
+ "enum": ["sqlmodel"],
57
+ "default": "sqlmodel",
58
+ "description": "ORM framework to use for the generated project.",
59
+ "x-priority": "important",
60
+ "x-prompt": "Which ORM framework would you like to use?"
61
+ },
62
+ "iac": {
63
+ "type": "string",
64
+ "description": "The preferred IaC provider. By default this is inherited from your initial selection.",
65
+ "enum": ["inherit", "cdk", "terraform"],
66
+ "x-priority": "important",
67
+ "default": "inherit",
68
+ "x-prompt": "Which provider would you like to manage your infrastructure? (default: inherit)"
69
+ },
70
+ "preferInstallDependencies": {
71
+ "type": "boolean",
72
+ "description": "Whether to prefer installing dependencies after the generator runs. Set to false to defer installing when batching multiple generators (an install still runs if needed so subsequent generators can compute the Nx project graph); install once at the end.",
73
+ "default": true
74
+ }
75
+ },
76
+ "required": ["name"]
77
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import type { Tree } from '@nx/devkit';
6
+ export declare const injectRdsCaBundleIntoDockerfile: (tree: Tree, dockerfilePath: string) => void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ const RDS_CA_RUN = [
5
+ 'ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/rds-global-bundle.crt',
6
+ 'RUN update-ca-certificates'
7
+ ].join('\n');
8
+ export const injectRdsCaBundleIntoDockerfile = (tree, dockerfilePath)=>{
9
+ if (!tree.exists(dockerfilePath)) return;
10
+ const content = tree.read(dockerfilePath, 'utf-8');
11
+ if (!content) return;
12
+ if (content.includes('global-bundle.pem')) return;
13
+ tree.write(dockerfilePath, content.replace(/^(EXPOSE \d+)/m, `${RDS_CA_RUN}\n\n$1`));
14
+ };
15
+
16
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/py/rdb/utils.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Tree } from '@nx/devkit';\n\nconst RDS_CA_RUN = [\n 'ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/rds-global-bundle.crt',\n 'RUN update-ca-certificates',\n].join('\\n');\n\nexport const injectRdsCaBundleIntoDockerfile = (\n tree: Tree,\n dockerfilePath: string,\n): void => {\n if (!tree.exists(dockerfilePath)) return;\n const content = tree.read(dockerfilePath, 'utf-8');\n if (!content) return;\n if (content.includes('global-bundle.pem')) return;\n tree.write(\n dockerfilePath,\n content.replace(/^(EXPOSE \\d+)/m, `${RDS_CA_RUN}\\n\\n$1`),\n );\n};\n"],"names":["RDS_CA_RUN","join","injectRdsCaBundleIntoDockerfile","tree","dockerfilePath","exists","content","read","includes","write","replace"],"mappings":"AAAA;;;CAGC,GAGD,MAAMA,aAAa;IACjB;IACA;CACD,CAACC,IAAI,CAAC;AAEP,OAAO,MAAMC,kCAAkC,CAC7CC,MACAC;IAEA,IAAI,CAACD,KAAKE,MAAM,CAACD,iBAAiB;IAClC,MAAME,UAAUH,KAAKI,IAAI,CAACH,gBAAgB;IAC1C,IAAI,CAACE,SAAS;IACd,IAAIA,QAAQE,QAAQ,CAAC,sBAAsB;IAC3CL,KAAKM,KAAK,CACRL,gBACAE,QAAQI,OAAO,CAAC,kBAAkB,GAAGV,WAAW,MAAM,CAAC;AAE3D,EAAE"}
package/src/sdk/py.d.ts CHANGED
@@ -12,3 +12,5 @@ export { pyMcpServerGenerator } from '../py/mcp-server/generator';
12
12
  export type { PyMcpServerGeneratorSchema } from '../py/mcp-server/schema';
13
13
  export { pyProjectGenerator } from '../py/project/generator';
14
14
  export type { PyProjectGeneratorSchema } from '../py/project/schema';
15
+ export { pyRdbGenerator } from '../py/rdb/generator';
16
+ export type { PyRdbGeneratorSchema } from '../py/rdb/schema';
package/src/sdk/py.js CHANGED
@@ -6,5 +6,6 @@ export { pyApiGenerator } from "../py/api/generator.js";
6
6
  export { pyLambdaFunctionGenerator } from "../py/lambda-function/generator.js";
7
7
  export { pyMcpServerGenerator } from "../py/mcp-server/generator.js";
8
8
  export { pyProjectGenerator } from "../py/project/generator.js";
9
+ export { pyRdbGenerator } from "../py/rdb/generator.js";
9
10
 
10
11
  //# sourceMappingURL=py.js.map
package/src/sdk/py.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/sdk/py.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { pyAgentGenerator } from '../py/agent/generator';\nexport type { PyAgentGeneratorSchema } from '../py/agent/schema';\n\nexport { pyApiGenerator } from '../py/api/generator';\nexport type { PyApiGeneratorSchema } from '../py/api/schema';\n\nexport { pyLambdaFunctionGenerator } from '../py/lambda-function/generator';\nexport type { PyLambdaFunctionGeneratorSchema } from '../py/lambda-function/schema';\n\nexport { pyMcpServerGenerator } from '../py/mcp-server/generator';\nexport type { PyMcpServerGeneratorSchema } from '../py/mcp-server/schema';\nexport { pyProjectGenerator } from '../py/project/generator';\nexport type { PyProjectGeneratorSchema } from '../py/project/schema';\n"],"names":["pyAgentGenerator","pyApiGenerator","pyLambdaFunctionGenerator","pyMcpServerGenerator","pyProjectGenerator"],"mappings":"AAAA;;;CAGC,GAED,SAASA,gBAAgB,QAAQ,2BAAwB;AAGzD,SAASC,cAAc,QAAQ,yBAAsB;AAGrD,SAASC,yBAAyB,QAAQ,qCAAkC;AAG5E,SAASC,oBAAoB,QAAQ,gCAA6B;AAElE,SAASC,kBAAkB,QAAQ,6BAA0B"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/sdk/py.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { pyAgentGenerator } from '../py/agent/generator';\nexport type { PyAgentGeneratorSchema } from '../py/agent/schema';\n\nexport { pyApiGenerator } from '../py/api/generator';\nexport type { PyApiGeneratorSchema } from '../py/api/schema';\n\nexport { pyLambdaFunctionGenerator } from '../py/lambda-function/generator';\nexport type { PyLambdaFunctionGeneratorSchema } from '../py/lambda-function/schema';\n\nexport { pyMcpServerGenerator } from '../py/mcp-server/generator';\nexport type { PyMcpServerGeneratorSchema } from '../py/mcp-server/schema';\nexport { pyProjectGenerator } from '../py/project/generator';\nexport type { PyProjectGeneratorSchema } from '../py/project/schema';\n\nexport { pyRdbGenerator } from '../py/rdb/generator';\nexport type { PyRdbGeneratorSchema } from '../py/rdb/schema';\n"],"names":["pyAgentGenerator","pyApiGenerator","pyLambdaFunctionGenerator","pyMcpServerGenerator","pyProjectGenerator","pyRdbGenerator"],"mappings":"AAAA;;;CAGC,GAED,SAASA,gBAAgB,QAAQ,2BAAwB;AAGzD,SAASC,cAAc,QAAQ,yBAAsB;AAGrD,SAASC,yBAAyB,QAAQ,qCAAkC;AAG5E,SAASC,oBAAoB,QAAQ,gCAA6B;AAElE,SAASC,kBAAkB,QAAQ,6BAA0B;AAG7D,SAASC,cAAc,QAAQ,yBAAsB"}