@aws/nx-plugin 0.109.1 → 0.110.0
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/package.json +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +11 -1
- package/src/preset/generator.js +12 -3
- package/src/preset/generator.js.map +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +17 -17
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +8 -8
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/react-website/agui/generator.js +7 -0
- package/src/ts/react-website/agui/generator.js.map +1 -1
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +2 -2
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +3 -3
- package/src/utils/api-constructs/files/terraform/core/api/http/http-api/http-api.tf.template +2 -2
- package/src/utils/files/terraform/src/core/asset-bucket/asset-bucket.tf.template +2 -2
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__functionNameKebabCase__/__functionNameKebabCase__.tf.template +1 -1
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +6 -6
- package/src/utils/pnpm-workspace.d.ts +22 -0
- package/src/utils/pnpm-workspace.js +58 -0
- package/src/utils/pnpm-workspace.js.map +1 -0
package/package.json
CHANGED
|
@@ -219,7 +219,17 @@ exports[`preset generator > should run successfully > packages/.gitkeep 1`] = `"
|
|
|
219
219
|
|
|
220
220
|
exports[`preset generator > should run successfully > pnpm-workspace.yaml 1`] = `
|
|
221
221
|
"packages:
|
|
222
|
-
-
|
|
222
|
+
- packages/*
|
|
223
|
+
allowBuilds:
|
|
224
|
+
'@swc/core': true
|
|
225
|
+
esbuild: true
|
|
226
|
+
nx: true
|
|
227
|
+
sharp: true
|
|
228
|
+
onlyBuiltDependencies:
|
|
229
|
+
- '@swc/core'
|
|
230
|
+
- esbuild
|
|
231
|
+
- nx
|
|
232
|
+
- sharp
|
|
223
233
|
"
|
|
224
234
|
`;
|
|
225
235
|
|
package/src/preset/generator.js
CHANGED
|
@@ -20,14 +20,23 @@ const child_process_1 = require("child_process");
|
|
|
20
20
|
const enquirer = tslib_1.__importStar(require("enquirer"));
|
|
21
21
|
const utils_1 = require("../utils/config/utils");
|
|
22
22
|
const generator_1 = require("../ts/sync/generator");
|
|
23
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
23
24
|
const WORKSPACES = ['packages/*'];
|
|
24
25
|
const NX_TYPESCRIPT_SYNC_GENERATOR = '@nx/js:typescript-sync';
|
|
26
|
+
// Built dependencies whose install scripts the generated workspace trusts.
|
|
27
|
+
// `onlyBuiltDependencies` is the pnpm 10 key (silently ignored by pnpm 11);
|
|
28
|
+
// pnpm 11 reads `allowBuilds` instead. Any dep NOT in this allowlist will
|
|
29
|
+
// have its install scripts skipped with a warning — matching pnpm 10's
|
|
30
|
+
// default behaviour. The user can opt-in later via `pnpm approve-builds`.
|
|
31
|
+
const PNPM_BUILT_DEPENDENCIES = ['@swc/core', 'esbuild', 'nx', 'sharp'];
|
|
25
32
|
exports.PRESET_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
26
33
|
const setUpWorkspaces = (tree) => {
|
|
27
34
|
if ((0, devkit_1.detectPackageManager)() === 'pnpm') {
|
|
28
|
-
tree.write('pnpm-workspace.yaml',
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
tree.write('pnpm-workspace.yaml', js_yaml_1.default.dump({
|
|
36
|
+
packages: WORKSPACES,
|
|
37
|
+
allowBuilds: Object.fromEntries(PNPM_BUILT_DEPENDENCIES.map((dep) => [dep, true])),
|
|
38
|
+
onlyBuiltDependencies: PNPM_BUILT_DEPENDENCIES,
|
|
39
|
+
}, { quotingType: "'" }));
|
|
31
40
|
}
|
|
32
41
|
else {
|
|
33
42
|
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/preset/generator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/preset/generator.ts"],"names":[],"mappings":";;;AA8FA,kCA4BC;;AA1HD;;;GAGG;AACH,uCAYoB;AACpB,oCAAgE;AAEhE,4CAAuD;AACvD,sDAAwE;AACxE,gDAAiD;AACjD,+BAAuC;AACvC,4DAAkE;AAClE,kDAAiD;AACjD,oFAAmD;AAEnD,iDAAyC;AACzC,2DAAqC;AACrC,iDAG+B;AAC/B,oDAAqF;AACrF,8DAA2B;AAE3B,MAAM,UAAU,GAAG,CAAC,YAAY,CAAC,CAAC;AAClC,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAE9D,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAE3D,QAAA,qBAAqB,GAChC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAE/B,MAAM,eAAe,GAAG,CAAC,IAAU,EAAE,EAAE;IACrC,IAAI,IAAA,6BAAoB,GAAE,KAAK,MAAM,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CACR,qBAAqB,EACrB,iBAAI,CAAC,IAAI,CACP;YACE,QAAQ,EAAE,UAAU;YACpB,WAAW,EAAE,MAAM,CAAC,WAAW,CAC7B,uBAAuB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAClD;YACD,qBAAqB,EAAE,uB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AC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAC7D,GAAG,CAAC,GAAG,EAAE;YACP,MAAM,IAAI,GAAG,IAAA,8CAAgC,GAAE,CAAC;YAChD,OAAO;gBACL,SAAS,EAAE,IAAI,CAAC,IAAI;gBACpB,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ;gBAC7B,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO;aAC5B,CAAC;QACJ,CAAC,CAAC,EAAE;KACL,EACD;QACE,iBAAiB,EAAE,0BAAiB,CAAC,SAAS;KAC/C,CACF,CAAC;IAEF,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAjHW,QAAA,eAAe,mBAiH1B;AAEF,kBAAe,uBAAe,CAAC"}
|
|
@@ -2030,7 +2030,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
2030
2030
|
Sid = "Allow CloudWatch Logs"
|
|
2031
2031
|
Effect = "Allow"
|
|
2032
2032
|
Principal = {
|
|
2033
|
-
Service = "logs.\${data.aws_region.current.
|
|
2033
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
2034
2034
|
}
|
|
2035
2035
|
Action = [
|
|
2036
2036
|
"kms:Encrypt",
|
|
@@ -2042,7 +2042,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
2042
2042
|
Resource = "*"
|
|
2043
2043
|
Condition = {
|
|
2044
2044
|
ArnEquals = {
|
|
2045
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.
|
|
2045
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/\${var.api_name}"
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
2048
|
}
|
|
@@ -2318,7 +2318,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
2318
2318
|
role = aws_iam_role.lambda_execution_role.arn
|
|
2319
2319
|
handler = "run.sh"
|
|
2320
2320
|
runtime = "python3.14"
|
|
2321
|
-
layers = ["arn:aws:lambda:\${data.aws_region.current.
|
|
2321
|
+
layers = ["arn:aws:lambda:\${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
2322
2322
|
timeout = 30
|
|
2323
2323
|
memory_size = 128
|
|
2324
2324
|
publish = true
|
|
@@ -2417,7 +2417,7 @@ resource "aws_apigatewayv2_authorizer" "cognito_authorizer" {
|
|
|
2417
2417
|
|
|
2418
2418
|
jwt_configuration {
|
|
2419
2419
|
audience = var.user_pool_client_ids
|
|
2420
|
-
issuer = "https://cognito-idp.\${data.aws_region.current.
|
|
2420
|
+
issuer = "https://cognito-idp.\${data.aws_region.current.region}.amazonaws.com/\${var.user_pool_id}"
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
2423
|
|
|
@@ -2701,7 +2701,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
2701
2701
|
Sid = "Allow CloudWatch Logs"
|
|
2702
2702
|
Effect = "Allow"
|
|
2703
2703
|
Principal = {
|
|
2704
|
-
Service = "logs.\${data.aws_region.current.
|
|
2704
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
2705
2705
|
}
|
|
2706
2706
|
Action = [
|
|
2707
2707
|
"kms:Encrypt",
|
|
@@ -2713,7 +2713,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
2713
2713
|
Resource = "*"
|
|
2714
2714
|
Condition = {
|
|
2715
2715
|
ArnEquals = {
|
|
2716
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.
|
|
2716
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/\${var.api_name}"
|
|
2717
2717
|
}
|
|
2718
2718
|
}
|
|
2719
2719
|
}
|
|
@@ -2979,7 +2979,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
2979
2979
|
role = aws_iam_role.lambda_execution_role.arn
|
|
2980
2980
|
handler = "run.sh"
|
|
2981
2981
|
runtime = "python3.14"
|
|
2982
|
-
layers = ["arn:aws:lambda:\${data.aws_region.current.
|
|
2982
|
+
layers = ["arn:aws:lambda:\${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
2983
2983
|
timeout = 30
|
|
2984
2984
|
memory_size = 128
|
|
2985
2985
|
publish = true
|
|
@@ -3349,7 +3349,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
3349
3349
|
Sid = "Allow CloudWatch Logs"
|
|
3350
3350
|
Effect = "Allow"
|
|
3351
3351
|
Principal = {
|
|
3352
|
-
Service = "logs.\${data.aws_region.current.
|
|
3352
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
3353
3353
|
}
|
|
3354
3354
|
Action = [
|
|
3355
3355
|
"kms:Encrypt",
|
|
@@ -3361,7 +3361,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
3361
3361
|
Resource = "*"
|
|
3362
3362
|
Condition = {
|
|
3363
3363
|
ArnEquals = {
|
|
3364
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.
|
|
3364
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/\${var.api_name}"
|
|
3365
3365
|
}
|
|
3366
3366
|
}
|
|
3367
3367
|
}
|
|
@@ -3627,7 +3627,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
3627
3627
|
role = aws_iam_role.lambda_execution_role.arn
|
|
3628
3628
|
handler = "run.sh"
|
|
3629
3629
|
runtime = "python3.14"
|
|
3630
|
-
layers = ["arn:aws:lambda:\${data.aws_region.current.
|
|
3630
|
+
layers = ["arn:aws:lambda:\${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
3631
3631
|
timeout = 30
|
|
3632
3632
|
memory_size = 128
|
|
3633
3633
|
publish = true
|
|
@@ -4299,7 +4299,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
4299
4299
|
role = aws_iam_role.lambda_execution_role.arn
|
|
4300
4300
|
handler = "run.sh"
|
|
4301
4301
|
runtime = "python3.14"
|
|
4302
|
-
layers = ["arn:aws:lambda:\${data.aws_region.current.
|
|
4302
|
+
layers = ["arn:aws:lambda:\${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
4303
4303
|
timeout = 30
|
|
4304
4304
|
memory_size = 128
|
|
4305
4305
|
publish = true
|
|
@@ -4394,7 +4394,7 @@ resource "aws_api_gateway_authorizer" "cognito_authorizer" {
|
|
|
4394
4394
|
name = "TestApiAuthorizer-\${random_string.suffix.result}"
|
|
4395
4395
|
rest_api_id = module.rest_api.api_id
|
|
4396
4396
|
type = "COGNITO_USER_POOLS"
|
|
4397
|
-
provider_arns = ["arn:aws:cognito-idp:\${data.aws_region.current.
|
|
4397
|
+
provider_arns = ["arn:aws:cognito-idp:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:userpool/\${var.user_pool_id}"]
|
|
4398
4398
|
identity_source = "method.request.header.Authorization"
|
|
4399
4399
|
}
|
|
4400
4400
|
|
|
@@ -4414,7 +4414,7 @@ resource "aws_api_gateway_integration" "lambda_integration" {
|
|
|
4414
4414
|
integration_http_method = "POST"
|
|
4415
4415
|
type = "AWS_PROXY"
|
|
4416
4416
|
# Use the response streaming invocation path with the alias ARN for SnapStart
|
|
4417
|
-
uri = "arn:aws:apigateway:\${data.aws_region.current.
|
|
4417
|
+
uri = "arn:aws:apigateway:\${data.aws_region.current.region}:lambda:path/2021-11-15/functions/\${aws_lambda_alias.live.arn}/response-streaming-invocations"
|
|
4418
4418
|
response_transfer_mode = "STREAM"
|
|
4419
4419
|
|
|
4420
4420
|
depends_on = [aws_lambda_alias.live]
|
|
@@ -5115,7 +5115,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
5115
5115
|
role = aws_iam_role.lambda_execution_role.arn
|
|
5116
5116
|
handler = "run.sh"
|
|
5117
5117
|
runtime = "python3.14"
|
|
5118
|
-
layers = ["arn:aws:lambda:\${data.aws_region.current.
|
|
5118
|
+
layers = ["arn:aws:lambda:\${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
5119
5119
|
timeout = 30
|
|
5120
5120
|
memory_size = 128
|
|
5121
5121
|
publish = true
|
|
@@ -5222,7 +5222,7 @@ resource "aws_api_gateway_integration" "lambda_integration" {
|
|
|
5222
5222
|
integration_http_method = "POST"
|
|
5223
5223
|
type = "AWS_PROXY"
|
|
5224
5224
|
# Use the response streaming invocation path with the alias ARN for SnapStart
|
|
5225
|
-
uri = "arn:aws:apigateway:\${data.aws_region.current.
|
|
5225
|
+
uri = "arn:aws:apigateway:\${data.aws_region.current.region}:lambda:path/2021-11-15/functions/\${aws_lambda_alias.live.arn}/response-streaming-invocations"
|
|
5226
5226
|
response_transfer_mode = "STREAM"
|
|
5227
5227
|
|
|
5228
5228
|
depends_on = [aws_lambda_alias.live]
|
|
@@ -5933,7 +5933,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
5933
5933
|
role = aws_iam_role.lambda_execution_role.arn
|
|
5934
5934
|
handler = "run.sh"
|
|
5935
5935
|
runtime = "python3.14"
|
|
5936
|
-
layers = ["arn:aws:lambda:\${data.aws_region.current.
|
|
5936
|
+
layers = ["arn:aws:lambda:\${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
5937
5937
|
timeout = 30
|
|
5938
5938
|
memory_size = 128
|
|
5939
5939
|
publish = true
|
|
@@ -6040,7 +6040,7 @@ resource "aws_api_gateway_integration" "lambda_integration" {
|
|
|
6040
6040
|
integration_http_method = "POST"
|
|
6041
6041
|
type = "AWS_PROXY"
|
|
6042
6042
|
# Use the response streaming invocation path with the alias ARN for SnapStart
|
|
6043
|
-
uri = "arn:aws:apigateway:\${data.aws_region.current.
|
|
6043
|
+
uri = "arn:aws:apigateway:\${data.aws_region.current.region}:lambda:path/2021-11-15/functions/\${aws_lambda_alias.live.arn}/response-streaming-invocations"
|
|
6044
6044
|
response_transfer_mode = "STREAM"
|
|
6045
6045
|
|
|
6046
6046
|
depends_on = [aws_lambda_alias.live]
|
|
@@ -111,7 +111,7 @@ data "aws_region" "current" {}
|
|
|
111
111
|
|
|
112
112
|
locals {
|
|
113
113
|
aws_account_id = data.aws_caller_identity.current.account_id
|
|
114
|
-
aws_region = data.aws_region.current.
|
|
114
|
+
aws_region = data.aws_region.current.region
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
resource "random_string" "suffix" {
|
|
@@ -292,7 +292,7 @@ data "aws_region" "current" {}
|
|
|
292
292
|
|
|
293
293
|
locals {
|
|
294
294
|
aws_account_id = data.aws_caller_identity.current.account_id
|
|
295
|
-
aws_region = data.aws_region.current.
|
|
295
|
+
aws_region = data.aws_region.current.region
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
resource "random_string" "suffix" {
|
|
@@ -2098,7 +2098,7 @@ resource "aws_api_gateway_authorizer" "cognito_authorizer" {
|
|
|
2098
2098
|
name = "TestApiAuthorizer-\${random_string.suffix.result}"
|
|
2099
2099
|
rest_api_id = module.rest_api.api_id
|
|
2100
2100
|
type = "COGNITO_USER_POOLS"
|
|
2101
|
-
provider_arns = ["arn:aws:cognito-idp:\${data.aws_region.current.
|
|
2101
|
+
provider_arns = ["arn:aws:cognito-idp:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:userpool/\${var.user_pool_id}"]
|
|
2102
2102
|
identity_source = "method.request.header.Authorization"
|
|
2103
2103
|
}
|
|
2104
2104
|
|
|
@@ -3034,7 +3034,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
3034
3034
|
Sid = "Allow CloudWatch Logs"
|
|
3035
3035
|
Effect = "Allow"
|
|
3036
3036
|
Principal = {
|
|
3037
|
-
Service = "logs.\${data.aws_region.current.
|
|
3037
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
3038
3038
|
}
|
|
3039
3039
|
Action = [
|
|
3040
3040
|
"kms:Encrypt",
|
|
@@ -3046,7 +3046,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
3046
3046
|
Resource = "*"
|
|
3047
3047
|
Condition = {
|
|
3048
3048
|
ArnEquals = {
|
|
3049
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.
|
|
3049
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/\${var.api_name}"
|
|
3050
3050
|
}
|
|
3051
3051
|
}
|
|
3052
3052
|
}
|
|
@@ -3404,7 +3404,7 @@ resource "aws_apigatewayv2_authorizer" "cognito_authorizer" {
|
|
|
3404
3404
|
|
|
3405
3405
|
jwt_configuration {
|
|
3406
3406
|
audience = var.user_pool_client_ids
|
|
3407
|
-
issuer = "https://cognito-idp.\${data.aws_region.current.
|
|
3407
|
+
issuer = "https://cognito-idp.\${data.aws_region.current.region}.amazonaws.com/\${var.user_pool_id}"
|
|
3408
3408
|
}
|
|
3409
3409
|
}
|
|
3410
3410
|
|
|
@@ -3687,7 +3687,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
3687
3687
|
Sid = "Allow CloudWatch Logs"
|
|
3688
3688
|
Effect = "Allow"
|
|
3689
3689
|
Principal = {
|
|
3690
|
-
Service = "logs.\${data.aws_region.current.
|
|
3690
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
3691
3691
|
}
|
|
3692
3692
|
Action = [
|
|
3693
3693
|
"kms:Encrypt",
|
|
@@ -3699,7 +3699,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
3699
3699
|
Resource = "*"
|
|
3700
3700
|
Condition = {
|
|
3701
3701
|
ArnEquals = {
|
|
3702
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.
|
|
3702
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/\${var.api_name}"
|
|
3703
3703
|
}
|
|
3704
3704
|
}
|
|
3705
3705
|
}
|
|
@@ -4317,7 +4317,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
4317
4317
|
Sid = "Allow CloudWatch Logs"
|
|
4318
4318
|
Effect = "Allow"
|
|
4319
4319
|
Principal = {
|
|
4320
|
-
Service = "logs.\${data.aws_region.current.
|
|
4320
|
+
Service = "logs.\${data.aws_region.current.region}.amazonaws.com"
|
|
4321
4321
|
}
|
|
4322
4322
|
Action = [
|
|
4323
4323
|
"kms:Encrypt",
|
|
@@ -4329,7 +4329,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
4329
4329
|
Resource = "*"
|
|
4330
4330
|
Condition = {
|
|
4331
4331
|
ArnEquals = {
|
|
4332
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.
|
|
4332
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/\${var.api_name}"
|
|
4333
4333
|
}
|
|
4334
4334
|
}
|
|
4335
4335
|
}
|
|
@@ -5327,7 +5327,7 @@ resource "aws_api_gateway_authorizer" "cognito_authorizer" {
|
|
|
5327
5327
|
name = "TestApiAuthorizer-\${random_string.suffix.result}"
|
|
5328
5328
|
rest_api_id = module.rest_api.api_id
|
|
5329
5329
|
type = "COGNITO_USER_POOLS"
|
|
5330
|
-
provider_arns = ["arn:aws:cognito-idp:\${data.aws_region.current.
|
|
5330
|
+
provider_arns = ["arn:aws:cognito-idp:\${data.aws_region.current.region}:\${data.aws_caller_identity.current.account_id}:userpool/\${var.user_pool_id}"]
|
|
5331
5331
|
identity_source = "method.request.header.Authorization"
|
|
5332
5332
|
}
|
|
5333
5333
|
|
|
@@ -180,7 +180,7 @@ data "aws_region" "current" {}
|
|
|
180
180
|
|
|
181
181
|
locals {
|
|
182
182
|
aws_account_id = data.aws_caller_identity.current.account_id
|
|
183
|
-
aws_region = data.aws_region.current.
|
|
183
|
+
aws_region = data.aws_region.current.region
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
resource "random_string" "suffix" {
|
|
@@ -361,7 +361,7 @@ data "aws_region" "current" {}
|
|
|
361
361
|
|
|
362
362
|
locals {
|
|
363
363
|
aws_account_id = data.aws_caller_identity.current.account_id
|
|
364
|
-
aws_region = data.aws_region.current.
|
|
364
|
+
aws_region = data.aws_region.current.region
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
resource "random_string" "suffix" {
|
|
@@ -13,6 +13,7 @@ const agent_runtime_config_1 = require("../../../connection/agent-runtime-config
|
|
|
13
13
|
const names_1 = require("../../../utils/names");
|
|
14
14
|
const shared_shadcn_1 = require("../../../utils/shared-shadcn");
|
|
15
15
|
const npm_scope_1 = require("../../../utils/npm-scope");
|
|
16
|
+
const pnpm_workspace_1 = require("../../../utils/pnpm-workspace");
|
|
16
17
|
/**
|
|
17
18
|
* Wires a React website up to an AG-UI agent using CopilotKit and
|
|
18
19
|
* @ag-ui/client's HttpAgent. Agent-server-language agnostic.
|
|
@@ -50,6 +51,12 @@ const addAgUiReactConnection = async (tree, options) => {
|
|
|
50
51
|
const mainTsxPath = (0, devkit_1.joinPathFragments)(frontendProjectConfig.sourceRoot, 'main.tsx');
|
|
51
52
|
await (0, ast_1.addSingleImport)(tree, mainTsxPath, 'AguiProvider', './components/AguiProvider');
|
|
52
53
|
await (0, ast_1.applyGritQL)(tree, mainTsxPath, `\`<App />\` => \`<AguiProvider><App /></AguiProvider>\` where { $program <: not contains \`<AguiProvider>$_</AguiProvider>\` }`);
|
|
54
|
+
// @copilotkit/react-core transitively pulls in @scarf/scarf (telemetry),
|
|
55
|
+
// which has a postinstall script. Under pnpm 11's default
|
|
56
|
+
// `strictDepBuilds=true` that script is treated as an unreviewed build and
|
|
57
|
+
// fails the install. Register it as an explicitly-rejected build so pnpm
|
|
58
|
+
// knows we've seen it and will skip it instead of erroring.
|
|
59
|
+
(0, pnpm_workspace_1.registerPnpmBuiltDependencies)(tree, { '@scarf/scarf': false });
|
|
53
60
|
(0, devkit_1.addDependenciesToPackageJson)(tree, (0, versions_1.withVersions)([
|
|
54
61
|
'@copilotkit/react-core',
|
|
55
62
|
'@ag-ui/client',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/agui/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,2DAAqE;AACrE,sDAAuD;AACvD,4CAI4B;AAC5B,mFAAgG;AAChG,gDAAiD;AACjD,gEAAqE;AACrE,wDAA2E;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/react-website/agui/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAOoB;AACpB,2DAAqE;AACrE,sDAAuD;AACvD,4CAI4B;AAC5B,mFAAgG;AAChG,gDAAiD;AACjD,gEAAqE;AACrE,wDAA2E;AAC3E,kEAA8E;AAiB9E;;;;;;;;;;;GAWG;AACI,MAAM,sBAAsB,GAAG,KAAK,EACzC,IAAU,EACV,OAAmC,EACnC,EAAE;IACF,MAAM,EAAE,qBAAqB,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAClE,OAAO,CAAC;IAEV,MAAM,KAAK,GAA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AyE;QACvE,8BAA8B,OAAO,KAAK;QAC1C,yCAAyC,OAAO,QAAQ;QACxD,yDAAyD,OAAO,SAAS;QACzE,uCAAuC,OAAO,OAAO;QACrD,iDAAiD,OAAO,QAAQ;QAChE,IAAI,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -155,7 +155,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
155
155
|
<%_ } else if (backend.type === 'fastapi') { _%>
|
|
156
156
|
handler = "run.sh"
|
|
157
157
|
runtime = "python3.14"
|
|
158
|
-
layers = ["arn:aws:lambda:${data.aws_region.current.
|
|
158
|
+
layers = ["arn:aws:lambda:${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
159
159
|
<%_ } _%>
|
|
160
160
|
timeout = 30
|
|
161
161
|
memory_size = 128
|
|
@@ -264,7 +264,7 @@ resource "aws_apigatewayv2_authorizer" "cognito_authorizer" {
|
|
|
264
264
|
|
|
265
265
|
jwt_configuration {
|
|
266
266
|
audience = var.user_pool_client_ids
|
|
267
|
-
issuer = "https://cognito-idp.${data.aws_region.current.
|
|
267
|
+
issuer = "https://cognito-idp.${data.aws_region.current.region}.amazonaws.com/${var.user_pool_id}"
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
<%_ } _%>
|
|
@@ -152,7 +152,7 @@ resource "aws_lambda_function" "api_lambda" {
|
|
|
152
152
|
<%_ } else if (backend.type === 'fastapi') { _%>
|
|
153
153
|
handler = "run.sh"
|
|
154
154
|
runtime = "python3.14"
|
|
155
|
-
layers = ["arn:aws:lambda:${data.aws_region.current.
|
|
155
|
+
layers = ["arn:aws:lambda:${data.aws_region.current.region}:753240598075:layer:LambdaAdapterLayerX86:24"]
|
|
156
156
|
<%_ } _%>
|
|
157
157
|
timeout = 30
|
|
158
158
|
memory_size = 128
|
|
@@ -257,7 +257,7 @@ resource "aws_api_gateway_authorizer" "cognito_authorizer" {
|
|
|
257
257
|
name = "<%- apiNameClassName %>Authorizer-${random_string.suffix.result}"
|
|
258
258
|
rest_api_id = module.rest_api.api_id
|
|
259
259
|
type = "COGNITO_USER_POOLS"
|
|
260
|
-
provider_arns = ["arn:aws:cognito-idp:${data.aws_region.current.
|
|
260
|
+
provider_arns = ["arn:aws:cognito-idp:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:userpool/${var.user_pool_id}"]
|
|
261
261
|
identity_source = "method.request.header.Authorization"
|
|
262
262
|
}
|
|
263
263
|
<%_ } _%>
|
|
@@ -279,7 +279,7 @@ resource "aws_api_gateway_integration" "lambda_integration" {
|
|
|
279
279
|
type = "AWS_PROXY"
|
|
280
280
|
<%_ if (backend.type === 'fastapi') { _%>
|
|
281
281
|
# Use the response streaming invocation path with the alias ARN for SnapStart
|
|
282
|
-
uri = "arn:aws:apigateway:${data.aws_region.current.
|
|
282
|
+
uri = "arn:aws:apigateway:${data.aws_region.current.region}:lambda:path/2021-11-15/functions/${aws_lambda_alias.live.arn}/response-streaming-invocations"
|
|
283
283
|
response_transfer_mode = "STREAM"
|
|
284
284
|
<%_ } else if (backend.type === 'trpc') { _%>
|
|
285
285
|
uri = aws_lambda_function.api_lambda.response_streaming_invoke_arn
|
package/src/utils/api-constructs/files/terraform/core/api/http/http-api/http-api.tf.template
CHANGED
|
@@ -111,7 +111,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
111
111
|
Sid = "Allow CloudWatch Logs"
|
|
112
112
|
Effect = "Allow"
|
|
113
113
|
Principal = {
|
|
114
|
-
Service = "logs.${data.aws_region.current.
|
|
114
|
+
Service = "logs.${data.aws_region.current.region}.amazonaws.com"
|
|
115
115
|
}
|
|
116
116
|
Action = [
|
|
117
117
|
"kms:Encrypt",
|
|
@@ -123,7 +123,7 @@ resource "aws_kms_key" "logs_key" {
|
|
|
123
123
|
Resource = "*"
|
|
124
124
|
Condition = {
|
|
125
125
|
ArnEquals = {
|
|
126
|
-
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:${data.aws_region.current.
|
|
126
|
+
"kms:EncryptionContext:aws:logs:arn" = "arn:aws:logs:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:log-group:/aws/apigateway/${var.api_name}"
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -41,7 +41,7 @@ resource "aws_s3_bucket" "access_logs" {
|
|
|
41
41
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for access log bucket
|
|
42
42
|
#checkov:skip=CKV_AWS_18:Access logging the access log bucket would create a cycle
|
|
43
43
|
#checkov:skip=CKV_AWS_145:AES256 (S3-managed) encryption is sufficient for access logs
|
|
44
|
-
bucket = "${var.bucket_name_prefix}-logs-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.
|
|
44
|
+
bucket = "${var.bucket_name_prefix}-logs-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.region}-${random_string.suffix.result}"
|
|
45
45
|
force_destroy = true
|
|
46
46
|
|
|
47
47
|
tags = var.tags
|
|
@@ -118,7 +118,7 @@ resource "aws_s3_bucket" "assets" {
|
|
|
118
118
|
#checkov:skip=CKV_AWS_144:Cross-region replication not required for asset bucket
|
|
119
119
|
#checkov:skip=CKV2_AWS_62:Event notifications not required for asset bucket
|
|
120
120
|
#checkov:skip=CKV_AWS_145:AES256 (S3-managed) encryption is sufficient for build artefacts
|
|
121
|
-
bucket = "${var.bucket_name_prefix}-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.
|
|
121
|
+
bucket = "${var.bucket_name_prefix}-${data.aws_caller_identity.current.account_id}-${data.aws_region.current.region}-${random_string.suffix.result}"
|
|
122
122
|
force_destroy = true
|
|
123
123
|
|
|
124
124
|
tags = var.tags
|
|
@@ -65,7 +65,7 @@ resource "aws_iam_role" "cognito_sms_role" {
|
|
|
65
65
|
"aws:SourceAccount" = data.aws_caller_identity.current.account_id
|
|
66
66
|
}
|
|
67
67
|
ArnLike = {
|
|
68
|
-
"aws:SourceArn" = "arn:aws:cognito-idp:${data.aws_region.current.
|
|
68
|
+
"aws:SourceArn" = "arn:aws:cognito-idp:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:userpool/*"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -124,7 +124,7 @@ resource "aws_cognito_user_pool" "user_pool" {
|
|
|
124
124
|
sms_configuration {
|
|
125
125
|
external_id = random_uuid.sms_external_id.result
|
|
126
126
|
sns_caller_arn = aws_iam_role.cognito_sms_role.arn
|
|
127
|
-
sns_region = data.aws_region.current.
|
|
127
|
+
sns_region = data.aws_region.current.region
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
depends_on = [aws_iam_role_policy.cognito_sms_policy]
|
|
@@ -250,13 +250,13 @@ resource "aws_cognito_user_pool_client" "web_client" {
|
|
|
250
250
|
callback_urls = concat([
|
|
251
251
|
"http://localhost:4200",
|
|
252
252
|
"http://localhost:4300",
|
|
253
|
-
"https://${data.aws_region.current.
|
|
253
|
+
"https://${data.aws_region.current.region}.console.aws.amazon.com"
|
|
254
254
|
], var.callback_urls)
|
|
255
255
|
|
|
256
256
|
logout_urls = concat([
|
|
257
257
|
"http://localhost:4200",
|
|
258
258
|
"http://localhost:4300",
|
|
259
|
-
"https://${data.aws_region.current.
|
|
259
|
+
"https://${data.aws_region.current.region}.console.aws.amazon.com"
|
|
260
260
|
], var.logout_urls)
|
|
261
261
|
|
|
262
262
|
# Security settings
|
|
@@ -379,7 +379,7 @@ module "add_cognito_to_runtime_config" {
|
|
|
379
379
|
namespace = "connection"
|
|
380
380
|
key = "cognitoProps"
|
|
381
381
|
value = {
|
|
382
|
-
region = data.aws_region.current.
|
|
382
|
+
region = data.aws_region.current.region
|
|
383
383
|
identityPoolId = aws_cognito_identity_pool.identity_pool.id
|
|
384
384
|
userPoolId = aws_cognito_user_pool.user_pool.id
|
|
385
385
|
userPoolWebClientId = aws_cognito_user_pool_client.web_client.id
|
|
@@ -389,7 +389,7 @@ module "add_cognito_to_runtime_config" {
|
|
|
389
389
|
# Outputs
|
|
390
390
|
output "region" {
|
|
391
391
|
description = "AWS region"
|
|
392
|
-
value = data.aws_region.current.
|
|
392
|
+
value = data.aws_region.current.region
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
output "user_pool_id" {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
/**
|
|
7
|
+
* Merge `allowBuilds` (pnpm 11) / `onlyBuiltDependencies` (pnpm 10) entries
|
|
8
|
+
* into the generated workspace's `pnpm-workspace.yaml`. No-op for non-pnpm
|
|
9
|
+
* workspaces.
|
|
10
|
+
*
|
|
11
|
+
* Generators call this when they introduce a dependency whose install
|
|
12
|
+
* script pnpm would otherwise reject under pnpm 11's default
|
|
13
|
+
* `strictDepBuilds=true`. Keeping the allowlist explicit — rather than
|
|
14
|
+
* globally disabling strictness — preserves the supply-chain audit pnpm 11
|
|
15
|
+
* intends: each build-script dep is reviewed by the generator author and
|
|
16
|
+
* entered as either `true` (run the script) or `false` (known dep we
|
|
17
|
+
* don't want to run but have seen).
|
|
18
|
+
*
|
|
19
|
+
* Only `true` entries are also added to `onlyBuiltDependencies` (pnpm 10's
|
|
20
|
+
* allowlist has no equivalent of the `false` decision).
|
|
21
|
+
*/
|
|
22
|
+
export declare const registerPnpmBuiltDependencies: (tree: Tree, entries: Record<string, boolean>) => void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerPnpmBuiltDependencies = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
const devkit_1 = require("@nx/devkit");
|
|
10
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
11
|
+
const WORKSPACE_FILE = 'pnpm-workspace.yaml';
|
|
12
|
+
/**
|
|
13
|
+
* Merge `allowBuilds` (pnpm 11) / `onlyBuiltDependencies` (pnpm 10) entries
|
|
14
|
+
* into the generated workspace's `pnpm-workspace.yaml`. No-op for non-pnpm
|
|
15
|
+
* workspaces.
|
|
16
|
+
*
|
|
17
|
+
* Generators call this when they introduce a dependency whose install
|
|
18
|
+
* script pnpm would otherwise reject under pnpm 11's default
|
|
19
|
+
* `strictDepBuilds=true`. Keeping the allowlist explicit — rather than
|
|
20
|
+
* globally disabling strictness — preserves the supply-chain audit pnpm 11
|
|
21
|
+
* intends: each build-script dep is reviewed by the generator author and
|
|
22
|
+
* entered as either `true` (run the script) or `false` (known dep we
|
|
23
|
+
* don't want to run but have seen).
|
|
24
|
+
*
|
|
25
|
+
* Only `true` entries are also added to `onlyBuiltDependencies` (pnpm 10's
|
|
26
|
+
* allowlist has no equivalent of the `false` decision).
|
|
27
|
+
*/
|
|
28
|
+
const registerPnpmBuiltDependencies = (tree, entries) => {
|
|
29
|
+
if ((0, devkit_1.detectPackageManager)(tree.root) !== 'pnpm') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!tree.exists(WORKSPACE_FILE)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const original = tree.read(WORKSPACE_FILE, 'utf-8') ?? '';
|
|
36
|
+
const parsed = js_yaml_1.default.load(original) ?? {};
|
|
37
|
+
const allowBuilds = { ...(parsed.allowBuilds ?? {}) };
|
|
38
|
+
const onlyBuiltDependencies = new Set(parsed.onlyBuiltDependencies ?? []);
|
|
39
|
+
let changed = false;
|
|
40
|
+
for (const [pkg, decision] of Object.entries(entries)) {
|
|
41
|
+
if (allowBuilds[pkg] !== decision) {
|
|
42
|
+
allowBuilds[pkg] = decision;
|
|
43
|
+
changed = true;
|
|
44
|
+
}
|
|
45
|
+
if (decision === true && !onlyBuiltDependencies.has(pkg)) {
|
|
46
|
+
onlyBuiltDependencies.add(pkg);
|
|
47
|
+
changed = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!changed) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
parsed.allowBuilds = allowBuilds;
|
|
54
|
+
parsed.onlyBuiltDependencies = [...onlyBuiltDependencies];
|
|
55
|
+
tree.write(WORKSPACE_FILE, js_yaml_1.default.dump(parsed, { quotingType: "'" }));
|
|
56
|
+
};
|
|
57
|
+
exports.registerPnpmBuiltDependencies = registerPnpmBuiltDependencies;
|
|
58
|
+
//# sourceMappingURL=pnpm-workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpm-workspace.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/utils/pnpm-workspace.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAAwD;AACxD,8DAA2B;AAE3B,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAQ7C;;;;;;;;;;;;;;;GAeG;AACI,MAAM,6BAA6B,GAAG,CAC3C,IAAU,EACV,OAAgC,EAC1B,EAAE;IACR,IAAI,IAAA,6BAAoB,EAAC,IAAI,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1D,MAAM,MAAM,GAAI,iBAAI,CAAC,IAAI,CAAC,QAAQ,CAA8B,IAAI,EAAE,CAAC;IAEvE,MAAM,WAAW,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC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