@aws/nx-plugin 1.0.0-rc.13 → 1.0.0-rc.14
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/generators.json +28 -1
- package/package.json +1 -1
- package/src/connection/generator.d.ts +1 -1
- package/src/connection/generator.js +58 -42
- package/src/connection/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +7 -7
- package/src/infra/app/generator.js +4 -4
- package/src/infra/app/generator.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +3 -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/ts/dynamodb/__snapshots__/generator.spec.ts.snap +303 -512
- package/src/ts/dynamodb/files/config.json.template +24 -0
- package/src/ts/dynamodb/files/src/client.ts.template +26 -10
- package/src/ts/dynamodb/files/src/index.ts.template +0 -8
- package/src/ts/dynamodb/generator.js +15 -12
- package/src/ts/dynamodb/generator.js.map +1 -1
- package/src/ts/dynamodb/schema.d.ts +1 -0
- package/src/ts/dynamodb/schema.json +20 -2
- package/src/utils/dynamodb-constructs/dynamodb-constructs.d.ts +0 -1
- package/src/utils/dynamodb-constructs/dynamodb-constructs.js.map +1 -1
- package/src/utils/dynamodb-constructs/files/cdk/app/dynamodb/__nameKebabCase__.ts.template +12 -13
- package/src/utils/dynamodb-constructs/files/terraform/app/dynamodb/__nameKebabCase__/__nameKebabCase__.tf.template +3 -3
- package/src/{ts/dynamodb/files/scripts → utils/files/common/scripts/src/dynamodb}/create-local-table.ts.template +63 -36
- package/src/utils/files/common/scripts/src/dynamodb/pull-image.ts.template +13 -0
- package/src/{ts/dynamodb/files/scripts → utils/files/common/scripts/src/dynamodb}/start-container.ts.template +28 -18
- package/src/utils/port.d.ts +6 -5
- package/src/utils/port.js +7 -5
- package/src/utils/port.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-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-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-scripts.d.ts +1 -4
- package/src/utils/shared-scripts.js +2 -23
- package/src/utils/shared-scripts.js.map +1 -1
- package/src/utils/versions.d.ts +1 -0
- package/src/utils/versions.js +1 -0
- package/src/utils/versions.js.map +1 -1
- package/src/ts/dynamodb/files/dynamodb.config.json +0 -14
- package/src/ts/dynamodb/files/scripts/pull-image.ts.template +0 -15
- package/src/ts/dynamodb/files/src/constants.ts.template +0 -9
- /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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pyDynamoDBMcpServerConnectionGenerator = exports.PY_DYNAMODB_MCP_SERVER_CONNECTION_GENERATOR_INFO = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const format_1 = require("../../../utils/format");
|
|
10
|
+
const metrics_1 = require("../../../utils/metrics");
|
|
11
|
+
const nx_1 = require("../../../utils/nx");
|
|
12
|
+
const nxlv_python_1 = require("../../../utils/nxlv-python");
|
|
13
|
+
const py_1 = require("../../../utils/py");
|
|
14
|
+
exports.PY_DYNAMODB_MCP_SERVER_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
15
|
+
const pyDynamoDBMcpServerConnectionGenerator = async (tree, options) => {
|
|
16
|
+
const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
|
|
17
|
+
const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
|
|
18
|
+
(0, py_1.addWorkspaceDependencyToPyProject)(tree, sourceProject.root, targetProject.name);
|
|
19
|
+
const mcpServerName = options.sourceComponent?.name ?? 'mcp-server';
|
|
20
|
+
const serveLocalTarget = `${mcpServerName}-serve-local`;
|
|
21
|
+
if (sourceProject.targets?.[serveLocalTarget]) {
|
|
22
|
+
(0, nx_1.addDependencyToTargetIfNotPresent)(sourceProject, serveLocalTarget, {
|
|
23
|
+
projects: [targetProject.name],
|
|
24
|
+
target: 'serve-local',
|
|
25
|
+
});
|
|
26
|
+
(0, devkit_1.updateProjectConfiguration)(tree, sourceProject.name, sourceProject);
|
|
27
|
+
}
|
|
28
|
+
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
29
|
+
exports.PY_DYNAMODB_MCP_SERVER_CONNECTION_GENERATOR_INFO,
|
|
30
|
+
]);
|
|
31
|
+
await (0, format_1.formatFilesInSubtree)(tree);
|
|
32
|
+
return async () => {
|
|
33
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
34
|
+
await new nxlv_python_1.UVProvider(tree.root, new nxlv_python_1.Logger(), tree).install();
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.pyDynamoDBMcpServerConnectionGenerator = pyDynamoDBMcpServerConnectionGenerator;
|
|
38
|
+
exports.default = exports.pyDynamoDBMcpServerConnectionGenerator;
|
|
39
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/py/dynamodb/mcp-server-connection/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAKoB;AACpB,kDAA6D;AAC7D,oDAAyE;AACzE,0CAK2B;AAC3B,4DAAgE;AAChE,0CAAsE;AAGzD,QAAA,gDAAgD,GAC3D,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,sCAAsC,GAAG,KAAK,EACzD,IAAU,EACV,OAAqD,EACzB,EAAE;IAC9B,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IAEF,IAAA,sCAAiC,EAC/B,IAAI,EACJ,aAAa,CAAC,IAAI,EAClB,aAAa,CAAC,IAAK,CACpB,CAAC;IAEF,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,IAAI,YAAY,CAAC;IACpE,MAAM,gBAAgB,GAAG,GAAG,aAAa,cAAc,CAAC;IAExD,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9C,IAAA,sCAAiC,EAAC,aAAa,EAAE,gBAAgB,EAAE;YACjE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,aAAa;SACtB,CAAC,CAAC;QACH,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,wDAAgD;KACjD,CAAC,CAAC;IACH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,KAAK,IAAI,EAAE;QAChB,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC1B,MAAM,IAAI,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,oBAAM,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,sCAAsC,0CAsCjD;AAEF,kBAAe,8CAAsC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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 PyDynamoDBMcpServerConnectionGeneratorSchema {
|
|
11
|
+
sourceProject: string;
|
|
12
|
+
targetProject: string;
|
|
13
|
+
sourceComponent?: ComponentMetadata;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "py#dynamodb#mcp-server-connection",
|
|
4
|
+
"title": "py#dynamodb#mcp-server-connection",
|
|
5
|
+
"description": "Connect a py#mcp-server to a py#dynamodb 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#dynamodb project to connect to"
|
|
15
|
+
},
|
|
16
|
+
"sourceComponent": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The MCP server component name"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["sourceProject", "targetProject"]
|
|
22
|
+
}
|
|
@@ -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 { IacOption } from '../../utils/iac';
|
|
6
|
+
|
|
7
|
+
export interface PyDynamoDBGeneratorSchema {
|
|
8
|
+
name: string;
|
|
9
|
+
directory?: string;
|
|
10
|
+
subDirectory?: string;
|
|
11
|
+
framework: 'pynamodb';
|
|
12
|
+
tableName?: string;
|
|
13
|
+
infra: 'dynamodb' | 'none';
|
|
14
|
+
iac: IacOption;
|
|
15
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "py#dynamodb",
|
|
4
|
+
"title": "py#dynamodb",
|
|
5
|
+
"description": "Create a Python DynamoDB project",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the DynamoDB 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 DynamoDB project to have? i.e: MyTable"
|
|
17
|
+
},
|
|
18
|
+
"directory": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "The directory to store the project 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
|
+
"x-prompt": "Which sub directory do you want to create the project in? (By default this is the project name)"
|
|
29
|
+
},
|
|
30
|
+
"framework": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"enum": ["pynamodb"],
|
|
33
|
+
"default": "pynamodb",
|
|
34
|
+
"description": "The framework to use for DynamoDB entities.",
|
|
35
|
+
"x-priority": "important",
|
|
36
|
+
"x-prompt": {
|
|
37
|
+
"message": "Which framework would you like to use for DynamoDB entities?",
|
|
38
|
+
"type": "list",
|
|
39
|
+
"items": [
|
|
40
|
+
{
|
|
41
|
+
"value": "pynamodb",
|
|
42
|
+
"label": "PynamoDB"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"default": "pynamodb"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"tableName": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "The DynamoDB table name. Auto-generated if not specified."
|
|
51
|
+
},
|
|
52
|
+
"infra": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["dynamodb", "none"],
|
|
55
|
+
"default": "dynamodb",
|
|
56
|
+
"description": "Infrastructure to provision for the DynamoDB table.",
|
|
57
|
+
"x-priority": "important",
|
|
58
|
+
"x-prompt": "Which infrastructure would you like to provision?"
|
|
59
|
+
},
|
|
60
|
+
"iac": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "The preferred IaC provider. By default this is inherited from your initial selection.",
|
|
63
|
+
"enum": ["inherit", "cdk", "terraform"],
|
|
64
|
+
"x-priority": "important",
|
|
65
|
+
"default": "inherit",
|
|
66
|
+
"x-prompt": "Which provider would you like to manage your infrastructure? (default: Inherit)"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": ["name"]
|
|
70
|
+
}
|