@intentius/chant-lexicon-aws 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/dynamodb.d.ts +11 -0
- package/dist/actions/dynamodb.d.ts.map +1 -0
- package/dist/actions/ecr.d.ts +5 -0
- package/dist/actions/ecr.d.ts.map +1 -0
- package/dist/actions/ecs.d.ts +6 -0
- package/dist/actions/ecs.d.ts.map +1 -0
- package/dist/actions/iam.d.ts +4 -0
- package/dist/actions/iam.d.ts.map +1 -0
- package/dist/actions/index.d.ts +10 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/lambda.d.ts +6 -0
- package/dist/actions/lambda.d.ts.map +1 -0
- package/dist/actions/logs.d.ts +5 -0
- package/dist/actions/logs.d.ts.map +1 -0
- package/dist/actions/s3.d.ts +11 -0
- package/dist/actions/s3.d.ts.map +1 -0
- package/dist/actions/sns.d.ts +6 -0
- package/dist/actions/sns.d.ts.map +1 -0
- package/dist/actions/sqs.d.ts +6 -0
- package/dist/actions/sqs.d.ts.map +1 -0
- package/dist/codegen/docs-cli.d.ts +2 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +15 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/extensions.d.ts +25 -0
- package/dist/codegen/extensions.d.ts.map +1 -0
- package/dist/codegen/fallback.d.ts +8 -0
- package/dist/codegen/fallback.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +3 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate-lexicon.d.ts +38 -0
- package/dist/codegen/generate-lexicon.d.ts.map +1 -0
- package/dist/codegen/generate-typescript.d.ts +16 -0
- package/dist/codegen/generate-typescript.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +15 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/naming.d.ts +16 -0
- package/dist/codegen/naming.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +11 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/codegen/patches.d.ts +37 -0
- package/dist/codegen/patches.d.ts.map +1 -0
- package/dist/codegen/sam.d.ts +9 -0
- package/dist/codegen/sam.d.ts.map +1 -0
- package/dist/codegen/typecheck.d.ts +5 -0
- package/dist/codegen/typecheck.d.ts.map +1 -0
- package/dist/codegen/versions.d.ts +20 -0
- package/dist/codegen/versions.d.ts.map +1 -0
- package/dist/composites/alb-shared.d.ts +16 -0
- package/dist/composites/alb-shared.d.ts.map +1 -0
- package/dist/composites/ec2-instance-role.d.ts +11 -0
- package/dist/composites/ec2-instance-role.d.ts.map +1 -0
- package/dist/composites/ecs-trust-policy.d.ts +11 -0
- package/dist/composites/ecs-trust-policy.d.ts.map +1 -0
- package/dist/composites/efs-with-access-point.d.ts +18 -0
- package/dist/composites/efs-with-access-point.d.ts.map +1 -0
- package/dist/composites/fargate-alb.d.ts +43 -0
- package/dist/composites/fargate-alb.d.ts.map +1 -0
- package/dist/composites/fargate-service.d.ts +51 -0
- package/dist/composites/fargate-service.d.ts.map +1 -0
- package/dist/composites/index.d.ts +35 -0
- package/dist/composites/index.d.ts.map +1 -0
- package/dist/composites/lambda-api.d.ts +13 -0
- package/dist/composites/lambda-api.d.ts.map +1 -0
- package/dist/composites/lambda-dynamodb.d.ts +20 -0
- package/dist/composites/lambda-dynamodb.d.ts.map +1 -0
- package/dist/composites/lambda-eventbridge.d.ts +14 -0
- package/dist/composites/lambda-eventbridge.d.ts.map +1 -0
- package/dist/composites/lambda-function.d.ts +90 -0
- package/dist/composites/lambda-function.d.ts.map +1 -0
- package/dist/composites/lambda-s3.d.ts +23 -0
- package/dist/composites/lambda-s3.d.ts.map +1 -0
- package/dist/composites/lambda-sns.d.ts +12 -0
- package/dist/composites/lambda-sns.d.ts.map +1 -0
- package/dist/composites/lambda-sqs.d.ts +13 -0
- package/dist/composites/lambda-sqs.d.ts.map +1 -0
- package/dist/composites/minimal-vpc.d.ts +12 -0
- package/dist/composites/minimal-vpc.d.ts.map +1 -0
- package/dist/composites/rds-instance.d.ts +40 -0
- package/dist/composites/rds-instance.d.ts.map +1 -0
- package/dist/composites/scheduled-lambda.d.ts +15 -0
- package/dist/composites/scheduled-lambda.d.ts.map +1 -0
- package/dist/composites/solr-fargate-service.d.ts +15 -0
- package/dist/composites/solr-fargate-service.d.ts.map +1 -0
- package/dist/composites/vpc-default.d.ts +49 -0
- package/dist/composites/vpc-default.d.ts.map +1 -0
- package/dist/coverage.d.ts +5 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/default-tags.d.ts +57 -0
- package/dist/default-tags.d.ts.map +1 -0
- package/dist/detect.d.ts +3 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/generated/index.d.ts +10456 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/runtime.d.ts +5 -0
- package/dist/generated/runtime.d.ts.map +1 -0
- package/dist/import/generator.d.ts +72 -0
- package/dist/import/generator.d.ts.map +1 -0
- package/dist/import/live-export.d.ts +12 -0
- package/dist/import/live-export.d.ts.map +1 -0
- package/dist/import/parser.d.ts +30 -0
- package/dist/import/parser.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +4 -4
- package/dist/intrinsics.d.ts +158 -0
- package/dist/intrinsics.d.ts.map +1 -0
- package/dist/lint/post-synth/cf-refs.d.ts +54 -0
- package/dist/lint/post-synth/cf-refs.d.ts.map +1 -0
- package/dist/lint/post-synth/cor020.d.ts +10 -0
- package/dist/lint/post-synth/cor020.d.ts.map +1 -0
- package/dist/lint/post-synth/ext001.d.ts +25 -0
- package/dist/lint/post-synth/ext001.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/post-synth/waw010.d.ts +10 -0
- package/dist/lint/post-synth/waw010.d.ts.map +1 -0
- package/dist/lint/post-synth/waw011.d.ts +9 -0
- package/dist/lint/post-synth/waw011.d.ts.map +1 -0
- package/dist/lint/post-synth/waw013.d.ts +10 -0
- package/dist/lint/post-synth/waw013.d.ts.map +1 -0
- package/dist/lint/post-synth/waw014.d.ts +9 -0
- package/dist/lint/post-synth/waw014.d.ts.map +1 -0
- package/dist/lint/post-synth/waw015.d.ts +13 -0
- package/dist/lint/post-synth/waw015.d.ts.map +1 -0
- package/dist/lint/post-synth/waw016.d.ts +13 -0
- package/dist/lint/post-synth/waw016.d.ts.map +1 -0
- package/dist/lint/post-synth/waw017.d.ts +13 -0
- package/dist/lint/post-synth/waw017.d.ts.map +1 -0
- package/dist/lint/post-synth/waw018.d.ts +9 -0
- package/dist/lint/post-synth/waw018.d.ts.map +1 -0
- package/dist/lint/post-synth/waw019.d.ts +10 -0
- package/dist/lint/post-synth/waw019.d.ts.map +1 -0
- package/dist/lint/post-synth/waw020.d.ts +10 -0
- package/dist/lint/post-synth/waw020.d.ts.map +1 -0
- package/dist/lint/post-synth/waw021.d.ts +9 -0
- package/dist/lint/post-synth/waw021.d.ts.map +1 -0
- package/dist/lint/post-synth/waw022.d.ts +9 -0
- package/dist/lint/post-synth/waw022.d.ts.map +1 -0
- package/dist/lint/post-synth/waw023.d.ts +9 -0
- package/dist/lint/post-synth/waw023.d.ts.map +1 -0
- package/dist/lint/post-synth/waw024.d.ts +9 -0
- package/dist/lint/post-synth/waw024.d.ts.map +1 -0
- package/dist/lint/post-synth/waw025.d.ts +9 -0
- package/dist/lint/post-synth/waw025.d.ts.map +1 -0
- package/dist/lint/post-synth/waw026.d.ts +9 -0
- package/dist/lint/post-synth/waw026.d.ts.map +1 -0
- package/dist/lint/post-synth/waw027.d.ts +9 -0
- package/dist/lint/post-synth/waw027.d.ts.map +1 -0
- package/dist/lint/post-synth/waw028.d.ts +9 -0
- package/dist/lint/post-synth/waw028.d.ts.map +1 -0
- package/dist/lint/post-synth/waw029.d.ts +11 -0
- package/dist/lint/post-synth/waw029.d.ts.map +1 -0
- package/dist/lint/post-synth/waw030.d.ts +19 -0
- package/dist/lint/post-synth/waw030.d.ts.map +1 -0
- package/dist/lint/post-synth/waw031.d.ts +17 -0
- package/dist/lint/post-synth/waw031.d.ts.map +1 -0
- package/dist/lint/post-synth/waw032.d.ts +11 -0
- package/dist/lint/post-synth/waw032.d.ts.map +1 -0
- package/dist/lint/post-synth/waw033.d.ts +12 -0
- package/dist/lint/post-synth/waw033.d.ts.map +1 -0
- package/dist/lint/post-synth/waw034.d.ts +11 -0
- package/dist/lint/post-synth/waw034.d.ts.map +1 -0
- package/dist/lint/post-synth/waw035.d.ts +12 -0
- package/dist/lint/post-synth/waw035.d.ts.map +1 -0
- package/dist/lint/post-synth/waw036.d.ts +21 -0
- package/dist/lint/post-synth/waw036.d.ts.map +1 -0
- package/dist/lint/post-synth/waw037.d.ts +21 -0
- package/dist/lint/post-synth/waw037.d.ts.map +1 -0
- package/dist/lint/rules/hardcoded-region.d.ts +9 -0
- package/dist/lint/rules/hardcoded-region.d.ts.map +1 -0
- package/dist/lint/rules/iam-wildcard.d.ts +9 -0
- package/dist/lint/rules/iam-wildcard.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +7 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/s3-encryption.d.ts +9 -0
- package/dist/lint/rules/s3-encryption.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +6 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +6 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +47226 -71473
- package/dist/nested-stack.d.ts +75 -0
- package/dist/nested-stack.d.ts.map +1 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/parameter.d.ts +14 -0
- package/dist/parameter.d.ts.map +1 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/pseudo.d.ts +17 -0
- package/dist/pseudo.d.ts.map +1 -0
- package/dist/serializer.d.ts +6 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/spec/fetch.d.ts +74 -0
- package/dist/spec/fetch.d.ts.map +1 -0
- package/dist/spec/parse.d.ts +65 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/taggable.d.ts +11 -0
- package/dist/taggable.d.ts.map +1 -0
- package/dist/types/index.d.ts +36468 -78177
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate.d.ts +17 -0
- package/dist/validate.d.ts.map +1 -0
- package/package.json +24 -5
- package/src/codegen/__snapshots__/snapshot.test.ts.snap +0 -1
- package/src/codegen/fallback.ts +2 -0
- package/src/codegen/package.ts +1 -1
- package/src/codegen/sam.ts +18 -0
- package/src/composites/efs-with-access-point.ts +1 -1
- package/src/composites/fargate-service.ts +1 -1
- package/src/composites/lambda-api.ts +6 -2
- package/src/composites/lambda-function.ts +6 -1
- package/src/composites/lambda-s3.ts +7 -2
- package/src/composites/vpc-default.ts +25 -1
- package/src/detect.ts +19 -0
- package/src/generated/index.d.ts +36468 -78177
- package/src/generated/index.ts +110 -4962
- package/src/generated/lexicon-aws.json +47226 -71473
- package/src/lint/post-synth/index.ts +63 -0
- package/src/plugin.ts +7 -26
- package/src/spec/parse.ts +21 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Code generated by chant generate. DO NOT EDIT.
|
|
2
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
3
|
+
import { cor020 } from "./cor020";
|
|
4
|
+
import { ext001 } from "./ext001";
|
|
5
|
+
import { waw010 } from "./waw010";
|
|
6
|
+
import { waw011 } from "./waw011";
|
|
7
|
+
import { waw013 } from "./waw013";
|
|
8
|
+
import { waw014 } from "./waw014";
|
|
9
|
+
import { waw015 } from "./waw015";
|
|
10
|
+
import { waw016 } from "./waw016";
|
|
11
|
+
import { waw017 } from "./waw017";
|
|
12
|
+
import { waw018 } from "./waw018";
|
|
13
|
+
import { waw019 } from "./waw019";
|
|
14
|
+
import { waw020 } from "./waw020";
|
|
15
|
+
import { waw021 } from "./waw021";
|
|
16
|
+
import { waw022 } from "./waw022";
|
|
17
|
+
import { waw023 } from "./waw023";
|
|
18
|
+
import { waw024 } from "./waw024";
|
|
19
|
+
import { waw025 } from "./waw025";
|
|
20
|
+
import { waw026 } from "./waw026";
|
|
21
|
+
import { waw027 } from "./waw027";
|
|
22
|
+
import { waw028 } from "./waw028";
|
|
23
|
+
import { waw029 } from "./waw029";
|
|
24
|
+
import { waw030 } from "./waw030";
|
|
25
|
+
import { waw031 } from "./waw031";
|
|
26
|
+
import { waw032 } from "./waw032";
|
|
27
|
+
import { waw033 } from "./waw033";
|
|
28
|
+
import { waw034 } from "./waw034";
|
|
29
|
+
import { waw035 } from "./waw035";
|
|
30
|
+
import { waw036 } from "./waw036";
|
|
31
|
+
import { waw037 } from "./waw037";
|
|
32
|
+
|
|
33
|
+
export const postSynthChecks: PostSynthCheck[] = [
|
|
34
|
+
cor020,
|
|
35
|
+
ext001,
|
|
36
|
+
waw010,
|
|
37
|
+
waw011,
|
|
38
|
+
waw013,
|
|
39
|
+
waw014,
|
|
40
|
+
waw015,
|
|
41
|
+
waw016,
|
|
42
|
+
waw017,
|
|
43
|
+
waw018,
|
|
44
|
+
waw019,
|
|
45
|
+
waw020,
|
|
46
|
+
waw021,
|
|
47
|
+
waw022,
|
|
48
|
+
waw023,
|
|
49
|
+
waw024,
|
|
50
|
+
waw025,
|
|
51
|
+
waw026,
|
|
52
|
+
waw027,
|
|
53
|
+
waw028,
|
|
54
|
+
waw029,
|
|
55
|
+
waw030,
|
|
56
|
+
waw031,
|
|
57
|
+
waw032,
|
|
58
|
+
waw033,
|
|
59
|
+
waw034,
|
|
60
|
+
waw035,
|
|
61
|
+
waw036,
|
|
62
|
+
waw037,
|
|
63
|
+
];
|
package/src/plugin.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createRequire } from "module";
|
|
2
|
-
import
|
|
2
|
+
import { detectTemplate } from "./detect";
|
|
3
|
+
import type { LexiconPlugin, IntrinsicDef, ResourceMetadata, ExportedTemplate, ResourceSelector, InitTemplateSet } from "@intentius/chant/lexicon";
|
|
3
4
|
const require = createRequire(import.meta.url);
|
|
4
5
|
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
5
6
|
import type { TemplateParser } from "@intentius/chant/import/parser";
|
|
6
7
|
import type { TypeScriptGenerator } from "@intentius/chant/import/generator";
|
|
7
8
|
import type { CompletionContext, CompletionItem, HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
|
|
8
|
-
import { discoverLintRules
|
|
9
|
+
import { discoverLintRules } from "@intentius/chant/lint/discover";
|
|
10
|
+
import { postSynthChecks as postSynthCheckList } from "./lint/post-synth";
|
|
9
11
|
import { createSkillsLoader, createDiffTool, createCatalogResource } from "@intentius/chant/lexicon-plugin-helpers";
|
|
10
12
|
import { readFileSync } from "fs";
|
|
11
13
|
import { join, dirname } from "path";
|
|
@@ -59,7 +61,7 @@ export const awsPlugin: LexiconPlugin = {
|
|
|
59
61
|
];
|
|
60
62
|
},
|
|
61
63
|
|
|
62
|
-
initTemplates(template?: string) {
|
|
64
|
+
initTemplates(template?: string): InitTemplateSet {
|
|
63
65
|
if (template === "eks") {
|
|
64
66
|
return { src: {
|
|
65
67
|
"infra/cluster.ts": `/**
|
|
@@ -234,27 +236,7 @@ export const logsBucket = new Bucket({
|
|
|
234
236
|
} };
|
|
235
237
|
},
|
|
236
238
|
|
|
237
|
-
detectTemplate
|
|
238
|
-
if (typeof data !== "object" || data === null) return false;
|
|
239
|
-
const obj = data as Record<string, unknown>;
|
|
240
|
-
|
|
241
|
-
// CloudFormation has AWSTemplateFormatVersion
|
|
242
|
-
if (obj.AWSTemplateFormatVersion !== undefined) return true;
|
|
243
|
-
|
|
244
|
-
// Or Resources with AWS::* types
|
|
245
|
-
if (typeof obj.Resources === "object" && obj.Resources !== null) {
|
|
246
|
-
for (const resource of Object.values(obj.Resources as Record<string, unknown>)) {
|
|
247
|
-
if (typeof resource === "object" && resource !== null) {
|
|
248
|
-
const type = (resource as Record<string, unknown>).Type;
|
|
249
|
-
if (typeof type === "string" && type.startsWith("AWS::")) {
|
|
250
|
-
return true;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return false;
|
|
257
|
-
},
|
|
239
|
+
detectTemplate,
|
|
258
240
|
|
|
259
241
|
templateParser(): TemplateParser {
|
|
260
242
|
return new CFParser();
|
|
@@ -265,8 +247,7 @@ export const logsBucket = new Bucket({
|
|
|
265
247
|
},
|
|
266
248
|
|
|
267
249
|
postSynthChecks() {
|
|
268
|
-
|
|
269
|
-
return discoverPostSynthChecks(postSynthDir, import.meta.url);
|
|
250
|
+
return postSynthCheckList;
|
|
270
251
|
},
|
|
271
252
|
|
|
272
253
|
async generate(options?: { verbose?: boolean }): Promise<void> {
|
package/src/spec/parse.ts
CHANGED
|
@@ -17,9 +17,19 @@ import {
|
|
|
17
17
|
type JsonSchemaProperty,
|
|
18
18
|
type JsonSchemaDefinition,
|
|
19
19
|
} from "@intentius/chant/codegen/json-schema";
|
|
20
|
+
import { boundPropertyTypes } from "@intentius/chant/codegen/bound-property-types";
|
|
20
21
|
|
|
21
22
|
export type { PropertyConstraints } from "@intentius/chant/codegen/json-schema";
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Maximum nesting depth of generated property-type interfaces. Bounds the
|
|
26
|
+
* shipped `.d.ts` size: property types reachable from a resource's top-level
|
|
27
|
+
* properties within this depth stay typed; deeper ones are loosened to
|
|
28
|
+
* `Record<string, unknown>`. Set high enough that the shapes composites consume
|
|
29
|
+
* (which reach a few levels into CFN config) remain typed. (#440)
|
|
30
|
+
*/
|
|
31
|
+
const MAX_PROPERTY_TYPE_DEPTH = 3;
|
|
32
|
+
|
|
23
33
|
export interface ParsedProperty {
|
|
24
34
|
name: string;
|
|
25
35
|
tsType: string;
|
|
@@ -182,6 +192,16 @@ export function parseCFNSchema(data: string | Buffer): SchemaParseResult {
|
|
|
182
192
|
replacementStrategy = schema.replacementStrategy;
|
|
183
193
|
}
|
|
184
194
|
|
|
195
|
+
// Bound the emitted property types to keep the shipped declaration small while
|
|
196
|
+
// preserving the shapes composites and shallow authoring rely on (#440).
|
|
197
|
+
const boundedPropertyTypes = boundPropertyTypes(
|
|
198
|
+
shortName,
|
|
199
|
+
props,
|
|
200
|
+
propertyTypes,
|
|
201
|
+
new Set(enums.map((e) => e.name)),
|
|
202
|
+
{ maxDepth: MAX_PROPERTY_TYPE_DEPTH },
|
|
203
|
+
);
|
|
204
|
+
|
|
185
205
|
return {
|
|
186
206
|
resource: {
|
|
187
207
|
typeName: schema.typeName,
|
|
@@ -195,7 +215,7 @@ export function parseCFNSchema(data: string | Buffer): SchemaParseResult {
|
|
|
195
215
|
...(replacementStrategy && { replacementStrategy }),
|
|
196
216
|
...(tagging && { tagging }),
|
|
197
217
|
},
|
|
198
|
-
propertyTypes,
|
|
218
|
+
propertyTypes: boundedPropertyTypes,
|
|
199
219
|
enums,
|
|
200
220
|
};
|
|
201
221
|
}
|