@intentius/chant-lexicon-gcp 0.49.0 → 0.50.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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { gcpApply, gcpDelete, flociGcpUp, flociGcpDown } from "./op/builders.js";
1
2
  export { gcpSerializer } from "./serializer.js";
2
3
  export { gcpPlugin } from "./plugin.js";
3
4
  export { defaultLabels, defaultAnnotations, isDefaultLabels, isDefaultAnnotations } from "./default-labels.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAGrF,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGxD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EACL,UAAU,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAC7E,cAAc,EAAE,wBAAwB,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAC3F,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAC5D,oBAAoB,EAAE,mBAAmB,EAAE,uBAAuB,GACnE,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,eAAe,EAAE,SAAS,EAC1B,mBAAmB,EACnB,6BAA6B,EAC7B,mBA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,EAAE,sBAAsB,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG9H,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGxH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC1G,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrI,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "227727b18bfb8d0875e8ea92b6c572ec1294fadfb0edb8ce0a641f1674c90b1f",
4
+ "manifest.json": "ed246ac3b74e491648ab0fe551472acafbae7f5ec4dcd09f4cfca817effe4eea",
5
5
  "meta.json": "475f10909854d059a2e2d4fb541c058803422e38b9c64bd4d6858c0623eedb8c",
6
6
  "types/index.d.ts": "5433b54c04b57d6fda8f3d81ef92ed0aca87f7e8e5dd3ea92d8de6e62a3ccfab",
7
7
  "rules/hardcoded-project.ts": "228631d3159e1ffcce2359c66073d4ae59bb0285f378e46e446f416aec50481c",
@@ -40,5 +40,5 @@
40
40
  "skills/chant-gcp-patterns.md": "4c6809fc7c37fa1879379ad4c0e2d114dec9497bc6eb9d1bca4e79fddea4f509",
41
41
  "skills/chant-gcp-gke.md": "be277019da9a722c851e47cd2dfb9c9536668948c3535fb20db7697e934c4e2b"
42
42
  },
43
- "composite": "2592321e250e7dbd8adcad67b82a9232652af393445d16192e44bf7a5e1ebda9"
43
+ "composite": "d82d01c89efe07eb6159d280987dae5435443c5f5696f5d1044d8812f87a0f31"
44
44
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcp",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "GCP",
6
6
  "intrinsics": [],
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Typed step-builder wrappers for this lexicon's activities (chant #1288
3
+ * Stage 2). See `lexicons/k8s/src/op/builders.ts`'s module doc for why these
4
+ * live beside their `*Args` interfaces rather than in core or the temporal
5
+ * barrel. `opts`'s type in each wrapper below IS the activity's own `*Args`
6
+ * interface (via `Omit`/`WithStepRefs`) — never restated. `core`'s own
7
+ * `gcpApply`/`gcpDelete`/`flociGcpUp`/`flociGcpDown` are unchanged and
8
+ * produce byte-identical `ActivityStep` output; these are purely additive.
9
+ */
10
+ import { type ActivityStep, type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
11
+ import type { GcpApplyArgs } from "./activities/gcp-apply.js";
12
+ import type { FlociGcpUpArgs, FlociGcpDownArgs } from "./activities/floci-gcp.js";
13
+ /** Extra opts every wrapper below accepts alongside its activity's own fields. */
14
+ type StepOpts = {
15
+ profile?: ActivityStep["profile"];
16
+ id?: string;
17
+ };
18
+ /**
19
+ * Apply built GCP (CNRM) resources directly to their GCP REST APIs — the
20
+ * fully typed twin of core's `gcpApply`. `opts` is {@link GcpApplyArgs}
21
+ * itself, minus the positional `manifestPath`. Defaults to the `longInfra`
22
+ * profile.
23
+ */
24
+ export declare const gcpApply: (manifestPath: string, opts?: WithStepRefs<Omit<GcpApplyArgs, "manifestPath">> & StepOpts) => NamedActivityStep;
25
+ /**
26
+ * Delete the GCP (CNRM) resources in a built manifest — the inverse of
27
+ * {@link gcpApply}, fully typed twin of core's `gcpDelete`. `opts` is
28
+ * {@link GcpApplyArgs} itself (the activity reuses it), minus the positional
29
+ * `manifestPath`. Defaults to the `longInfra` profile.
30
+ */
31
+ export declare const gcpDelete: (manifestPath: string, opts?: WithStepRefs<Omit<GcpApplyArgs, "manifestPath">> & StepOpts) => NamedActivityStep;
32
+ /**
33
+ * Boot a local floci-gcp (GCP emulator) — the fully typed twin of core's
34
+ * `flociGcpUp`. `opts` is {@link FlociGcpUpArgs} itself. Defaults to the
35
+ * `longInfra` profile.
36
+ */
37
+ export declare const flociGcpUp: (opts?: WithStepRefs<FlociGcpUpArgs> & StepOpts) => NamedActivityStep;
38
+ /**
39
+ * Stop and remove the local floci-gcp container — the fully typed twin of
40
+ * core's `flociGcpDown`. `opts` is {@link FlociGcpDownArgs} itself. Defaults
41
+ * to the `fastIdempotent` profile.
42
+ */
43
+ export declare const flociGcpDown: (opts?: WithStepRefs<FlociGcpDownArgs> & StepOpts) => NamedActivityStep;
44
+ export {};
45
+ //# sourceMappingURL=builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,kFAAkF;AAClF,KAAK,QAAQ,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GACnB,cAAc,MAAM,EACpB,OAAO,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,GAAG,QAAQ,KACjE,iBAGF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,cAAc,MAAM,EACpB,OAAO,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,GAAG,QAAQ,KACjE,iBAGF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,YAAY,CAAC,cAAc,CAAC,GAAG,QAAQ,KAAG,iBAG3E,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,YAAY,CAAC,gBAAgB,CAAC,GAAG,QAAQ,KAAG,iBAG/E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-gcp",
3
- "version": "0.49.0",
3
+ "version": "0.50.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",
@@ -76,7 +76,7 @@
76
76
  "typescript": "^5.9.3"
77
77
  },
78
78
  "peerDependencies": {
79
- "@intentius/chant": "^0.49.0",
79
+ "@intentius/chant": "^0.50.0",
80
80
  "typescript": "^5.9.3"
81
81
  }
82
82
  }
package/src/index.ts CHANGED
@@ -1,3 +1,11 @@
1
+ // Typed Op step-builder wrappers (chant #1288 Stage 2) — gcpApply/gcpDelete/
2
+ // flociGcpUp/flociGcpDown with authoring-time types derived from this
3
+ // lexicon's own *Args interfaces (see ./op/builders.ts's module doc for why
4
+ // these live here rather than in core or the temporal barrel). Opt-in:
5
+ // `@intentius/chant-lexicon-temporal`'s same-named exports are core's
6
+ // original untyped builders, unchanged.
7
+ export { gcpApply, gcpDelete, flociGcpUp, flociGcpDown } from "./op/builders";
8
+
1
9
  // Serializer
2
10
  export { gcpSerializer } from "./serializer";
3
11
 
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Typed step-builder wrappers (chant #1288 Stage 2) — see
3
+ * `lexicons/k8s/src/op/builders.test.ts`'s module doc for what's asserted
4
+ * and why.
5
+ */
6
+
7
+ import { describe, test, expect } from "vitest";
8
+ import {
9
+ gcpApply as gcpApplyOld,
10
+ gcpDelete as gcpDeleteOld,
11
+ flociGcpUp as flociGcpUpOld,
12
+ flociGcpDown as flociGcpDownOld,
13
+ stepOutput,
14
+ type StepOutputRef,
15
+ } from "@intentius/chant/op";
16
+ import { gcpApply, gcpDelete, flociGcpUp, flociGcpDown } from "./builders";
17
+
18
+ describe("gcp typed step builders (#1288 Stage 2)", () => {
19
+ test("gcpApply: identical ActivityStep to core's original for a minimal call", () => {
20
+ expect(gcpApply("dist/manifest.yaml")).toEqual(gcpApplyOld("dist/manifest.yaml"));
21
+ });
22
+
23
+ test("gcpApply: identical ActivityStep with opts", () => {
24
+ const opts = { project: "my-project", prune: true };
25
+ expect(gcpApply("dist/manifest.yaml", opts)).toEqual(gcpApplyOld("dist/manifest.yaml", opts));
26
+ });
27
+
28
+ test("gcpDelete: identical ActivityStep to core's original", () => {
29
+ expect(gcpDelete("dist/manifest.yaml")).toEqual(gcpDeleteOld("dist/manifest.yaml"));
30
+ });
31
+
32
+ test("flociGcpUp/flociGcpDown: identical ActivityStep to core's original", () => {
33
+ expect(flociGcpUp()).toEqual(flociGcpUpOld());
34
+ expect(flociGcpDown()).toEqual(flociGcpDownOld());
35
+ });
36
+
37
+ test("gcpApply: accepts a StepOutputRef in a typed slot", () => {
38
+ const ref = stepOutput("resolve-project", "project");
39
+ const step = gcpApply("dist/manifest.yaml", { project: ref });
40
+ expect(step.args?.project).toBe(ref);
41
+ });
42
+
43
+ test("gcpApply: .out is reachable when an id is given", () => {
44
+ const step = gcpApply("dist/manifest.yaml", { id: "apply" });
45
+ const ref: StepOutputRef = step.out.applied;
46
+ expect(ref.step).toBe("apply");
47
+ });
48
+ });
49
+
50
+ // ── Compile-time-only: authoring-time type errors (never executed) ──────────
51
+ function _typeChecksOnly(): void {
52
+ // @ts-expect-error — "projectId" is not a key of GcpApplyArgs (the field is `project`).
53
+ gcpApply("dist/manifest.yaml", { projectId: "my-project" });
54
+
55
+ // @ts-expect-error — prune must be a boolean.
56
+ gcpApply("dist/manifest.yaml", { prune: "true" });
57
+ }
58
+ void _typeChecksOnly;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Typed step-builder wrappers for this lexicon's activities (chant #1288
3
+ * Stage 2). See `lexicons/k8s/src/op/builders.ts`'s module doc for why these
4
+ * live beside their `*Args` interfaces rather than in core or the temporal
5
+ * barrel. `opts`'s type in each wrapper below IS the activity's own `*Args`
6
+ * interface (via `Omit`/`WithStepRefs`) — never restated. `core`'s own
7
+ * `gcpApply`/`gcpDelete`/`flociGcpUp`/`flociGcpDown` are unchanged and
8
+ * produce byte-identical `ActivityStep` output; these are purely additive.
9
+ */
10
+
11
+ import {
12
+ activity,
13
+ takeProfileAndId,
14
+ type ActivityStep,
15
+ type NamedActivityStep,
16
+ type WithStepRefs,
17
+ } from "@intentius/chant/op";
18
+ import type { GcpApplyArgs } from "./activities/gcp-apply";
19
+ import type { FlociGcpUpArgs, FlociGcpDownArgs } from "./activities/floci-gcp";
20
+
21
+ /** Extra opts every wrapper below accepts alongside its activity's own fields. */
22
+ type StepOpts = { profile?: ActivityStep["profile"]; id?: string };
23
+
24
+ /**
25
+ * Apply built GCP (CNRM) resources directly to their GCP REST APIs — the
26
+ * fully typed twin of core's `gcpApply`. `opts` is {@link GcpApplyArgs}
27
+ * itself, minus the positional `manifestPath`. Defaults to the `longInfra`
28
+ * profile.
29
+ */
30
+ export const gcpApply = (
31
+ manifestPath: string,
32
+ opts?: WithStepRefs<Omit<GcpApplyArgs, "manifestPath">> & StepOpts,
33
+ ): NamedActivityStep => {
34
+ const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown> | undefined);
35
+ return activity("gcpApply", { manifestPath, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
36
+ };
37
+
38
+ /**
39
+ * Delete the GCP (CNRM) resources in a built manifest — the inverse of
40
+ * {@link gcpApply}, fully typed twin of core's `gcpDelete`. `opts` is
41
+ * {@link GcpApplyArgs} itself (the activity reuses it), minus the positional
42
+ * `manifestPath`. Defaults to the `longInfra` profile.
43
+ */
44
+ export const gcpDelete = (
45
+ manifestPath: string,
46
+ opts?: WithStepRefs<Omit<GcpApplyArgs, "manifestPath">> & StepOpts,
47
+ ): NamedActivityStep => {
48
+ const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown> | undefined);
49
+ return activity("gcpDelete", { manifestPath, ...args }, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
50
+ };
51
+
52
+ /**
53
+ * Boot a local floci-gcp (GCP emulator) — the fully typed twin of core's
54
+ * `flociGcpUp`. `opts` is {@link FlociGcpUpArgs} itself. Defaults to the
55
+ * `longInfra` profile.
56
+ */
57
+ export const flociGcpUp = (opts?: WithStepRefs<FlociGcpUpArgs> & StepOpts): NamedActivityStep => {
58
+ const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown> | undefined);
59
+ return activity("flociGcpUp", args, { profile: profile ?? "longInfra", ...(id ? { id } : {}) });
60
+ };
61
+
62
+ /**
63
+ * Stop and remove the local floci-gcp container — the fully typed twin of
64
+ * core's `flociGcpDown`. `opts` is {@link FlociGcpDownArgs} itself. Defaults
65
+ * to the `fastIdempotent` profile.
66
+ */
67
+ export const flociGcpDown = (opts?: WithStepRefs<FlociGcpDownArgs> & StepOpts): NamedActivityStep => {
68
+ const { args, profile, id } = takeProfileAndId(opts as Record<string, unknown> | undefined);
69
+ return activity("flociGcpDown", args, { profile: profile ?? "fastIdempotent", ...(id ? { id } : {}) });
70
+ };