@intentius/chant-lexicon-gcp 0.6.0 → 0.8.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/dist/actions/index.d.ts +46 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/codegen/docs-cli.d.ts +3 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +12 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +6 -0
- package/dist/codegen/generate-cli.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 +15 -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/composites/cloud-function.d.ts +38 -0
- package/dist/composites/cloud-function.d.ts.map +1 -0
- package/dist/composites/cloud-run-service.d.ts +56 -0
- package/dist/composites/cloud-run-service.d.ts.map +1 -0
- package/dist/composites/cloud-sql-instance.d.ts +52 -0
- package/dist/composites/cloud-sql-instance.d.ts.map +1 -0
- package/dist/composites/gcs-bucket.d.ts +47 -0
- package/dist/composites/gcs-bucket.d.ts.map +1 -0
- package/dist/composites/gke-cluster.d.ts +80 -0
- package/dist/composites/gke-cluster.d.ts.map +1 -0
- package/dist/composites/gke-crdb-region.d.ts +81 -0
- package/dist/composites/gke-crdb-region.d.ts.map +1 -0
- package/dist/composites/index.d.ts +27 -0
- package/dist/composites/index.d.ts.map +1 -0
- package/dist/composites/managed-certificate.d.ts +26 -0
- package/dist/composites/managed-certificate.d.ts.map +1 -0
- package/dist/composites/memorystore-redis.d.ts +52 -0
- package/dist/composites/memorystore-redis.d.ts.map +1 -0
- package/dist/composites/multi-region-vpc.d.ts +55 -0
- package/dist/composites/multi-region-vpc.d.ts.map +1 -0
- package/dist/composites/private-service.d.ts +34 -0
- package/dist/composites/private-service.d.ts.map +1 -0
- package/dist/composites/pubsub-pipeline.d.ts +31 -0
- package/dist/composites/pubsub-pipeline.d.ts.map +1 -0
- package/dist/composites/secure-project.d.ts +35 -0
- package/dist/composites/secure-project.d.ts.map +1 -0
- package/dist/composites/vpc-network.d.ts +66 -0
- package/dist/composites/vpc-network.d.ts.map +1 -0
- package/dist/coverage.d.ts +9 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/default-labels.d.ts +56 -0
- package/dist/default-labels.d.ts.map +1 -0
- package/dist/describe-resources.d.ts +34 -0
- package/dist/describe-resources.d.ts.map +1 -0
- package/dist/detect.d.ts +3 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/export-resources.d.ts +8 -0
- package/dist/export-resources.d.ts.map +1 -0
- package/dist/generated/index.d.ts +1718 -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 +11 -0
- package/dist/import/generator.d.ts.map +1 -0
- package/dist/import/live-export.d.ts +19 -0
- package/dist/import/live-export.d.ts.map +1 -0
- package/dist/import/parser.d.ts +16 -0
- package/dist/import/parser.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +3 -3
- package/dist/lint/post-synth/gcp-helpers.d.ts +54 -0
- package/dist/lint/post-synth/gcp-helpers.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/schema-registry.d.ts +30 -0
- package/dist/lint/post-synth/schema-registry.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc101.d.ts +6 -0
- package/dist/lint/post-synth/wgc101.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc102.d.ts +6 -0
- package/dist/lint/post-synth/wgc102.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc103.d.ts +6 -0
- package/dist/lint/post-synth/wgc103.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc104.d.ts +6 -0
- package/dist/lint/post-synth/wgc104.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc105.d.ts +6 -0
- package/dist/lint/post-synth/wgc105.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc106.d.ts +6 -0
- package/dist/lint/post-synth/wgc106.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc107.d.ts +6 -0
- package/dist/lint/post-synth/wgc107.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc108.d.ts +6 -0
- package/dist/lint/post-synth/wgc108.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc109.d.ts +6 -0
- package/dist/lint/post-synth/wgc109.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc110.d.ts +6 -0
- package/dist/lint/post-synth/wgc110.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc111.d.ts +9 -0
- package/dist/lint/post-synth/wgc111.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc112.d.ts +9 -0
- package/dist/lint/post-synth/wgc112.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc113.d.ts +9 -0
- package/dist/lint/post-synth/wgc113.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc201.d.ts +6 -0
- package/dist/lint/post-synth/wgc201.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc202.d.ts +6 -0
- package/dist/lint/post-synth/wgc202.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc203.d.ts +6 -0
- package/dist/lint/post-synth/wgc203.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc204.d.ts +6 -0
- package/dist/lint/post-synth/wgc204.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc301.d.ts +6 -0
- package/dist/lint/post-synth/wgc301.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc302.d.ts +6 -0
- package/dist/lint/post-synth/wgc302.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc303.d.ts +6 -0
- package/dist/lint/post-synth/wgc303.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc401.d.ts +9 -0
- package/dist/lint/post-synth/wgc401.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc402.d.ts +9 -0
- package/dist/lint/post-synth/wgc402.d.ts.map +1 -0
- package/dist/lint/post-synth/wgc403.d.ts +10 -0
- package/dist/lint/post-synth/wgc403.d.ts.map +1 -0
- package/dist/lint/rules/hardcoded-project.d.ts +9 -0
- package/dist/lint/rules/hardcoded-project.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/index.d.ts +4 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/public-iam.d.ts +9 -0
- package/dist/lint/rules/public-iam.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +3 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +3 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.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 +12 -0
- package/dist/pseudo.d.ts.map +1 -0
- package/dist/rules/schema-registry.ts +4 -1
- package/dist/serializer.d.ts +12 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/spec/fetch.d.ts +19 -0
- package/dist/spec/fetch.d.ts.map +1 -0
- package/dist/spec/parse.d.ts +77 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate.d.ts +9 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/variables.d.ts +16 -0
- package/dist/variables.d.ts.map +1 -0
- package/package.json +24 -5
- package/src/detect.ts +15 -0
- package/src/lint/post-synth/index.ts +51 -20
- package/src/lint/post-synth/schema-registry.ts +4 -1
- package/src/plugin.ts +4 -19
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgc303.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/wgc303.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,MAAM,EAAE,cA6BpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WGC401: Unknown spec field
|
|
3
|
+
*
|
|
4
|
+
* Flags fields in a Config Connector resource spec that are not defined
|
|
5
|
+
* in the CRD schema. Includes "did you mean?" suggestion via Levenshtein.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const wgc401: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=wgc401.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgc401.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/wgc401.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAI9G,eAAO,MAAM,MAAM,EAAE,cA+CpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WGC402: Missing required spec field
|
|
3
|
+
*
|
|
4
|
+
* Flags Config Connector resources that are missing required fields
|
|
5
|
+
* according to their CRD schema.
|
|
6
|
+
*/
|
|
7
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
8
|
+
export declare const wgc402: PostSynthCheck;
|
|
9
|
+
//# sourceMappingURL=wgc402.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgc402.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/wgc402.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAI9G,eAAO,MAAM,MAAM,EAAE,cA0CpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WGC403: Type/structure mismatch in spec field
|
|
3
|
+
*
|
|
4
|
+
* Flags spec fields where the value type doesn't match the CRD schema:
|
|
5
|
+
* - String where number expected (e.g. availableMemoryMb: "512")
|
|
6
|
+
* - Scalar string where resourceRef object expected (e.g. topicRef: "name")
|
|
7
|
+
*/
|
|
8
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
9
|
+
export declare const wgc403: PostSynthCheck;
|
|
10
|
+
//# sourceMappingURL=wgc403.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgc403.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/wgc403.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAI9G,eAAO,MAAM,MAAM,EAAE,cAuEpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
2
|
+
/**
|
|
3
|
+
* WGC001: Hardcoded GCP Project ID
|
|
4
|
+
*
|
|
5
|
+
* Detects hardcoded GCP project IDs in code.
|
|
6
|
+
* Project IDs should use GCP.ProjectId pseudo-parameter instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hardcodedProjectRule: LintRule;
|
|
9
|
+
//# sourceMappingURL=hardcoded-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardcoded-project.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/hardcoded-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAGxF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAgDlC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
2
|
+
/**
|
|
3
|
+
* WGC002: Hardcoded GCP Region/Zone
|
|
4
|
+
*
|
|
5
|
+
* Detects hardcoded GCP region and zone strings in code.
|
|
6
|
+
* Regions/zones should use GCP.Region or GCP.Zone pseudo-parameters instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hardcodedRegionRule: LintRule;
|
|
9
|
+
//# sourceMappingURL=hardcoded-region.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardcoded-region.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/hardcoded-region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAGxF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,QA8CjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
2
|
+
/**
|
|
3
|
+
* WGC003: Public IAM Binding
|
|
4
|
+
*
|
|
5
|
+
* Warns on allUsers or allAuthenticatedUsers IAM bindings,
|
|
6
|
+
* which grant public access to GCP resources.
|
|
7
|
+
*/
|
|
8
|
+
export declare const publicIamRule: LintRule;
|
|
9
|
+
//# sourceMappingURL=public-iam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-iam.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/public-iam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAGxF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,QAiC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/lsp/completions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAapF,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,GAAG,cAAc,EAAE,CAEvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAqB1E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAEjE"}
|
package/dist/manifest.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-cli.d.ts","sourceRoot":"","sources":["../src/package-cli.ts"],"names":[],"mappings":""}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP Config Connector lexicon plugin.
|
|
3
|
+
*
|
|
4
|
+
* Provides serializer, lint rules, template detection,
|
|
5
|
+
* import parsing, and code generation for GCP Config Connector resources.
|
|
6
|
+
*/
|
|
7
|
+
import type { LexiconPlugin } from "@intentius/chant/lexicon";
|
|
8
|
+
export declare const gcpPlugin: LexiconPlugin;
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAqC,MAAM,0BAA0B,CAAC;AAmBjG,eAAO,MAAM,SAAS,EAAE,aA+VvB,CAAC"}
|
package/dist/pseudo.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PseudoParameter } from "@intentius/chant/pseudo-parameter";
|
|
2
|
+
export { PseudoParameter };
|
|
3
|
+
export declare const ProjectId: PseudoParameter, Region: PseudoParameter, Zone: PseudoParameter;
|
|
4
|
+
/**
|
|
5
|
+
* GCP namespace containing all pseudo-parameters.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GCP: {
|
|
8
|
+
readonly ProjectId: PseudoParameter;
|
|
9
|
+
readonly Region: PseudoParameter;
|
|
10
|
+
readonly Zone: PseudoParameter;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=pseudo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pseudo.d.ts","sourceRoot":"","sources":["../src/pseudo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA0B,MAAM,mCAAmC,CAAC;AAE5F,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAQ,SAAS,mBAAE,MAAM,mBAAE,IAAI,iBAKlC,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,GAAG;;;;CAIN,CAAC"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { createRequire } from "module";
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
9
|
|
|
11
10
|
export interface FieldSchema {
|
|
12
11
|
type: string;
|
|
@@ -36,6 +35,10 @@ export function getSchemaRegistry(): Map<string, ResourceSchema> {
|
|
|
36
35
|
|
|
37
36
|
cachedRegistry = new Map();
|
|
38
37
|
try {
|
|
38
|
+
// Built lazily (not at module load) so importing this module stays edge-safe:
|
|
39
|
+
// `createRequire(import.meta.url)` throws where import.meta.url is undefined
|
|
40
|
+
// (bundled Workers); there it's caught here and the registry is just empty.
|
|
41
|
+
const require = createRequire(import.meta.url);
|
|
39
42
|
const lexicon = require("../../generated/lexicon-gcp.json") as Record<string, LexiconEntry>;
|
|
40
43
|
for (const entry of Object.values(lexicon)) {
|
|
41
44
|
if (entry.kind === "resource" && entry.gvkKind && entry.schema) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GCP Config Connector YAML serializer.
|
|
3
|
+
*
|
|
4
|
+
* Converts Chant declarables to multi-document K8s YAML output
|
|
5
|
+
* for Config Connector resources with apiVersion, kind, metadata, and spec.
|
|
6
|
+
*/
|
|
7
|
+
import type { Serializer } from "@intentius/chant/serializer";
|
|
8
|
+
/**
|
|
9
|
+
* GCP Config Connector YAML serializer implementation.
|
|
10
|
+
*/
|
|
11
|
+
export declare const gcpSerializer: Serializer;
|
|
12
|
+
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAsC,MAAM,6BAA6B,CAAC;AAsGlG;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,UA2F3B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema fetching — downloads Config Connector CRD bundle from GitHub releases.
|
|
3
|
+
*
|
|
4
|
+
* Uses the release bundle tar.gz, filtering for CRD YAML files.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Pinned Config Connector version for reproducible codegen.
|
|
8
|
+
*/
|
|
9
|
+
export declare const KCC_VERSION = "v1.145.0";
|
|
10
|
+
/**
|
|
11
|
+
* Fetch the Config Connector CRD bundle and extract CRD YAML files.
|
|
12
|
+
*
|
|
13
|
+
* Returns a Map keyed by CRD filename (e.g., "computeinstance.yaml") with
|
|
14
|
+
* the raw YAML content as a Buffer.
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchCRDBundle(force?: boolean, version?: string): Promise<Map<string, Buffer>>;
|
|
17
|
+
export declare function getCachePath(version?: string): string;
|
|
18
|
+
export declare function clearCache(version?: string): void;
|
|
19
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/spec/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AActC;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,KAAK,UAAQ,EACb,OAAO,GAAE,MAAoB,GAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAM9B;AAwED,wBAAgB,YAAY,CAAC,OAAO,GAAE,MAAoB,GAAG,MAAM,CAElE;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,MAAoB,GAAG,IAAI,CAE9D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRD parser for GCP Config Connector resources.
|
|
3
|
+
*
|
|
4
|
+
* Adapts the K8s CRD parser pattern for GCP-specific concerns:
|
|
5
|
+
* - Type naming: GCP::{Service}::{Kind}
|
|
6
|
+
* - resourceRef detection
|
|
7
|
+
* - Status field skipping
|
|
8
|
+
*/
|
|
9
|
+
import type { PropertyConstraints } from "@intentius/chant/codegen/json-schema";
|
|
10
|
+
export interface ParsedProperty {
|
|
11
|
+
name: string;
|
|
12
|
+
tsType: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
description?: string;
|
|
15
|
+
enum?: string[];
|
|
16
|
+
constraints: PropertyConstraints;
|
|
17
|
+
isResourceRef?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ParsedAttribute {
|
|
20
|
+
name: string;
|
|
21
|
+
tsType: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ParsedPropertyType {
|
|
24
|
+
name: string;
|
|
25
|
+
/** Original definition name in the spec (e.g., "networkRef"). */
|
|
26
|
+
specType: string;
|
|
27
|
+
properties: ParsedProperty[];
|
|
28
|
+
}
|
|
29
|
+
export interface ParsedEnum {
|
|
30
|
+
name: string;
|
|
31
|
+
values: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface ParsedResource {
|
|
34
|
+
typeName: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
properties: ParsedProperty[];
|
|
37
|
+
attributes: ParsedAttribute[];
|
|
38
|
+
deprecatedProperties: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface GcpParseResult {
|
|
41
|
+
resource: ParsedResource;
|
|
42
|
+
propertyTypes: ParsedPropertyType[];
|
|
43
|
+
enums: ParsedEnum[];
|
|
44
|
+
gvk: GroupVersionKind;
|
|
45
|
+
}
|
|
46
|
+
export interface GroupVersionKind {
|
|
47
|
+
group: string;
|
|
48
|
+
version: string;
|
|
49
|
+
kind: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Extract GCP service name from a CNRM group.
|
|
53
|
+
* "compute.cnrm.cloud.google.com" → "Compute"
|
|
54
|
+
*/
|
|
55
|
+
export declare function gcpServiceName(group: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Strip the service prefix from a CRD kind.
|
|
58
|
+
* "ComputeInstance", "Compute" → "Instance"
|
|
59
|
+
* "IAMPolicyMember", "Iam" → "PolicyMember"
|
|
60
|
+
*/
|
|
61
|
+
export declare function stripServicePrefix(kind: string, service: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Build full GCP type name.
|
|
64
|
+
* "compute.cnrm.cloud.google.com", "ComputeInstance" → "GCP::Compute::Instance"
|
|
65
|
+
*/
|
|
66
|
+
export declare function gcpTypeName(group: string, kind: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Extract short name from a GCP type.
|
|
69
|
+
* "GCP::Compute::Instance" → "Instance"
|
|
70
|
+
*/
|
|
71
|
+
export declare function gcpShortName(typeName: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Parse a CRD YAML document string into GcpParseResult entries.
|
|
74
|
+
* Supports multi-document YAML for CRD bundles.
|
|
75
|
+
*/
|
|
76
|
+
export declare function parseGcpCRD(content: string | Buffer): GcpParseResult[];
|
|
77
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/spec/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAIhF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,GAAG,EAAE,gBAAgB,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAoCD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBxE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,EAAE,CAwBtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-cli.d.ts","sourceRoot":"","sources":["../src/validate-cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate generated lexicon-gcp artifacts.
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidateResult } from "@intentius/chant/codegen/validate";
|
|
5
|
+
export type { ValidateCheck, ValidateResult } from "@intentius/chant/codegen/validate";
|
|
6
|
+
export declare function validate(opts?: {
|
|
7
|
+
basePath?: string;
|
|
8
|
+
}): Promise<ValidateResult>;
|
|
9
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAElG,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAQvF,wBAAsB,QAAQ,CAAC,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAapF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Well-known Config Connector annotation keys.
|
|
3
|
+
*/
|
|
4
|
+
export declare const GcpAnnotations: {
|
|
5
|
+
/** Bind a resource to a specific GCP project. */
|
|
6
|
+
readonly ProjectId: "cnrm.cloud.google.com/project-id";
|
|
7
|
+
/** Control what happens when a resource is deleted from K8s. */
|
|
8
|
+
readonly DeletionPolicy: "cnrm.cloud.google.com/deletion-policy";
|
|
9
|
+
/** Whether to merge observed spec back into the resource. */
|
|
10
|
+
readonly StateIntoSpec: "cnrm.cloud.google.com/state-into-spec";
|
|
11
|
+
/** Strategy when another controller manages the same resource. */
|
|
12
|
+
readonly ManagementConflictPolicy: "cnrm.cloud.google.com/management-conflict-prevention-policy";
|
|
13
|
+
/** Disable dependent resource reconciliation. */
|
|
14
|
+
readonly SkipDependentResources: "cnrm.cloud.google.com/skip-dependent-resources";
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../src/variables.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB,iDAAiD;;IAEjD,gEAAgE;;IAEhE,6DAA6D;;IAE7D,kEAAkE;;IAElE,iDAAiD;;CAEzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-gcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Google Cloud lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -29,8 +29,26 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
|
-
".":
|
|
33
|
-
|
|
32
|
+
".": {
|
|
33
|
+
"development": "./src/index.ts",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"default": "./src/index.ts"
|
|
36
|
+
},
|
|
37
|
+
"./*": {
|
|
38
|
+
"development": "./src/*.ts",
|
|
39
|
+
"types": "./dist/*.d.ts",
|
|
40
|
+
"default": "./src/*.ts"
|
|
41
|
+
},
|
|
42
|
+
"./detect": {
|
|
43
|
+
"development": "./src/detect.ts",
|
|
44
|
+
"types": "./dist/detect.d.ts",
|
|
45
|
+
"default": "./src/detect.ts"
|
|
46
|
+
},
|
|
47
|
+
"./lint/post-synth": {
|
|
48
|
+
"development": "./src/lint/post-synth/index.ts",
|
|
49
|
+
"types": "./dist/lint/post-synth/index.d.ts",
|
|
50
|
+
"default": "./src/lint/post-synth/index.ts"
|
|
51
|
+
},
|
|
34
52
|
"./manifest": "./dist/manifest.json",
|
|
35
53
|
"./meta": "./dist/meta.json",
|
|
36
54
|
"./types": "./dist/types/index.d.ts"
|
|
@@ -40,7 +58,8 @@
|
|
|
40
58
|
"bundle": "tsx src/package-cli.ts",
|
|
41
59
|
"validate": "tsx src/validate-cli.ts",
|
|
42
60
|
"docs": "tsx src/codegen/docs-cli.ts",
|
|
43
|
-
"prepack": "npm run generate && npm run bundle && npm run validate"
|
|
61
|
+
"prepack": "npm run generate && npm run bundle && npm run validate && npm run build",
|
|
62
|
+
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && find dist -type f \\( -name \"*.js\" -o -name \"*.js.map\" \\) -delete"
|
|
44
63
|
},
|
|
45
64
|
"dependencies": {
|
|
46
65
|
"fflate": "^0.8.2",
|
|
@@ -52,6 +71,6 @@
|
|
|
52
71
|
"typescript": "^5.9.3"
|
|
53
72
|
},
|
|
54
73
|
"peerDependencies": {
|
|
55
|
-
"@intentius/chant": "^0.
|
|
74
|
+
"@intentius/chant": "^0.8.0"
|
|
56
75
|
}
|
|
57
76
|
}
|
package/src/detect.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Edge-safe template detection for gcp (Config Connector) — see #426. */
|
|
2
|
+
export function detectTemplate(data: unknown): boolean {
|
|
3
|
+
// Handle raw string input (unparsed YAML)
|
|
4
|
+
if (typeof data === "string") {
|
|
5
|
+
return data.includes("cnrm.cloud.google.com");
|
|
6
|
+
}
|
|
7
|
+
// Handle parsed YAML objects
|
|
8
|
+
if (typeof data !== "object" || data === null) return false;
|
|
9
|
+
const obj = data as Record<string, unknown>;
|
|
10
|
+
const apiVersion = obj.apiVersion;
|
|
11
|
+
if (typeof apiVersion === "string" && apiVersion.includes("cnrm.cloud.google.com")) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
@@ -1,20 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
// Code generated by chant generate. DO NOT EDIT.
|
|
2
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
3
|
+
import { wgc101 } from "./wgc101";
|
|
4
|
+
import { wgc102 } from "./wgc102";
|
|
5
|
+
import { wgc103 } from "./wgc103";
|
|
6
|
+
import { wgc104 } from "./wgc104";
|
|
7
|
+
import { wgc105 } from "./wgc105";
|
|
8
|
+
import { wgc106 } from "./wgc106";
|
|
9
|
+
import { wgc107 } from "./wgc107";
|
|
10
|
+
import { wgc108 } from "./wgc108";
|
|
11
|
+
import { wgc109 } from "./wgc109";
|
|
12
|
+
import { wgc110 } from "./wgc110";
|
|
13
|
+
import { wgc111 } from "./wgc111";
|
|
14
|
+
import { wgc112 } from "./wgc112";
|
|
15
|
+
import { wgc113 } from "./wgc113";
|
|
16
|
+
import { wgc201 } from "./wgc201";
|
|
17
|
+
import { wgc202 } from "./wgc202";
|
|
18
|
+
import { wgc203 } from "./wgc203";
|
|
19
|
+
import { wgc204 } from "./wgc204";
|
|
20
|
+
import { wgc301 } from "./wgc301";
|
|
21
|
+
import { wgc302 } from "./wgc302";
|
|
22
|
+
import { wgc303 } from "./wgc303";
|
|
23
|
+
import { wgc401 } from "./wgc401";
|
|
24
|
+
import { wgc402 } from "./wgc402";
|
|
25
|
+
import { wgc403 } from "./wgc403";
|
|
26
|
+
|
|
27
|
+
export const postSynthChecks: PostSynthCheck[] = [
|
|
28
|
+
wgc101,
|
|
29
|
+
wgc102,
|
|
30
|
+
wgc103,
|
|
31
|
+
wgc104,
|
|
32
|
+
wgc105,
|
|
33
|
+
wgc106,
|
|
34
|
+
wgc107,
|
|
35
|
+
wgc108,
|
|
36
|
+
wgc109,
|
|
37
|
+
wgc110,
|
|
38
|
+
wgc111,
|
|
39
|
+
wgc112,
|
|
40
|
+
wgc113,
|
|
41
|
+
wgc201,
|
|
42
|
+
wgc202,
|
|
43
|
+
wgc203,
|
|
44
|
+
wgc204,
|
|
45
|
+
wgc301,
|
|
46
|
+
wgc302,
|
|
47
|
+
wgc303,
|
|
48
|
+
wgc401,
|
|
49
|
+
wgc402,
|
|
50
|
+
wgc403,
|
|
51
|
+
];
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { createRequire } from "module";
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
9
|
|
|
11
10
|
export interface FieldSchema {
|
|
12
11
|
type: string;
|
|
@@ -36,6 +35,10 @@ export function getSchemaRegistry(): Map<string, ResourceSchema> {
|
|
|
36
35
|
|
|
37
36
|
cachedRegistry = new Map();
|
|
38
37
|
try {
|
|
38
|
+
// Built lazily (not at module load) so importing this module stays edge-safe:
|
|
39
|
+
// `createRequire(import.meta.url)` throws where import.meta.url is undefined
|
|
40
|
+
// (bundled Workers); there it's caught here and the registry is just empty.
|
|
41
|
+
const require = createRequire(import.meta.url);
|
|
39
42
|
const lexicon = require("../../generated/lexicon-gcp.json") as Record<string, LexiconEntry>;
|
|
40
43
|
for (const entry of Object.values(lexicon)) {
|
|
41
44
|
if (entry.kind === "resource" && entry.gvkKind && entry.schema) {
|
package/src/plugin.ts
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { LexiconPlugin, InitTemplateSet, ResourceMetadata } from "@intentius/chant/lexicon";
|
|
9
|
+
import { detectTemplate } from "./detect";
|
|
9
10
|
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
10
11
|
import type { TemplateParser } from "@intentius/chant/import/parser";
|
|
11
12
|
import type { TypeScriptGenerator } from "@intentius/chant/import/generator";
|
|
12
13
|
import type { CompletionContext, CompletionItem, HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
|
|
13
|
-
import {
|
|
14
|
+
import { postSynthChecks as postSynthCheckList } from "./lint/post-synth";
|
|
14
15
|
import { createSkillsLoader, createDiffTool, createCatalogResource } from "@intentius/chant/lexicon-plugin-helpers";
|
|
15
16
|
import { join, dirname } from "path";
|
|
16
17
|
import { fileURLToPath } from "url";
|
|
@@ -32,8 +33,7 @@ export const gcpPlugin: LexiconPlugin = {
|
|
|
32
33
|
},
|
|
33
34
|
|
|
34
35
|
postSynthChecks() {
|
|
35
|
-
|
|
36
|
-
return discoverPostSynthChecks(postSynthDir, import.meta.url);
|
|
36
|
+
return postSynthCheckList;
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
intrinsics() {
|
|
@@ -173,22 +173,7 @@ export const bucketReader = new IAMPolicyMember({
|
|
|
173
173
|
};
|
|
174
174
|
},
|
|
175
175
|
|
|
176
|
-
detectTemplate
|
|
177
|
-
// Handle raw string input (unparsed YAML)
|
|
178
|
-
if (typeof data === "string") {
|
|
179
|
-
return data.includes("cnrm.cloud.google.com");
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Handle parsed YAML objects
|
|
183
|
-
if (typeof data !== "object" || data === null) return false;
|
|
184
|
-
const obj = data as Record<string, unknown>;
|
|
185
|
-
const apiVersion = obj.apiVersion;
|
|
186
|
-
if (typeof apiVersion === "string" && apiVersion.includes("cnrm.cloud.google.com")) {
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return false;
|
|
191
|
-
},
|
|
176
|
+
detectTemplate,
|
|
192
177
|
|
|
193
178
|
templateParser(): TemplateParser {
|
|
194
179
|
return new GcpParser();
|