@intentius/chant-lexicon-aws 0.14.0 → 0.15.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.
Files changed (85) hide show
  1. package/dist/components/__tests__/mock-cloud-executor.d.ts +106 -0
  2. package/dist/components/__tests__/mock-cloud-executor.d.ts.map +1 -0
  3. package/dist/components/apply.d.ts +242 -0
  4. package/dist/components/apply.d.ts.map +1 -0
  5. package/dist/components/builders.d.ts +37 -0
  6. package/dist/components/builders.d.ts.map +1 -0
  7. package/dist/components/capability-plugin.d.ts +23 -0
  8. package/dist/components/capability-plugin.d.ts.map +1 -0
  9. package/dist/components/cloud-executor.d.ts +350 -0
  10. package/dist/components/cloud-executor.d.ts.map +1 -0
  11. package/dist/components/config-bom.d.ts +135 -0
  12. package/dist/components/config-bom.d.ts.map +1 -0
  13. package/dist/components/host-delivery.d.ts +110 -0
  14. package/dist/components/host-delivery.d.ts.map +1 -0
  15. package/dist/components/index.d.ts +19 -0
  16. package/dist/components/index.d.ts.map +1 -0
  17. package/dist/components/job-submission.d.ts +89 -0
  18. package/dist/components/job-submission.d.ts.map +1 -0
  19. package/dist/components/publish.d.ts +194 -0
  20. package/dist/components/publish.d.ts.map +1 -0
  21. package/dist/components/safety.d.ts +49 -0
  22. package/dist/components/safety.d.ts.map +1 -0
  23. package/dist/components/wait-aws.d.ts +65 -0
  24. package/dist/components/wait-aws.d.ts.map +1 -0
  25. package/dist/generated/index.d.ts +7 -4
  26. package/dist/generated/index.d.ts.map +1 -1
  27. package/dist/import/live-export.d.ts.map +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/integrity.json +4 -4
  31. package/dist/lint/audit-catalog.d.ts +10 -0
  32. package/dist/lint/audit-catalog.d.ts.map +1 -0
  33. package/dist/manifest.json +1 -1
  34. package/dist/meta.json +141 -30
  35. package/dist/op/activities/floci.d.ts +54 -0
  36. package/dist/op/activities/floci.d.ts.map +1 -0
  37. package/dist/op/activities/index.d.ts +8 -0
  38. package/dist/op/activities/index.d.ts.map +1 -0
  39. package/dist/ownership.d.ts +10 -0
  40. package/dist/ownership.d.ts.map +1 -0
  41. package/dist/plugin.d.ts.map +1 -1
  42. package/dist/serializer.d.ts.map +1 -1
  43. package/dist/types/index.d.ts +145 -38
  44. package/package.json +12 -2
  45. package/src/components/__fixtures__/schemas/cyclonedx-1.5.schema.json +3800 -0
  46. package/src/components/__fixtures__/schemas/cyclonedx-spdx-license.schema.json +621 -0
  47. package/src/components/__fixtures__/schemas/jsf-0.82.schema.json +240 -0
  48. package/src/components/__fixtures__/schemas/spdx-2.3.schema.json +740 -0
  49. package/src/components/__fixtures__/synthesized-template.json +53 -0
  50. package/src/components/__tests__/mock-cloud-executor.ts +425 -0
  51. package/src/components/apply.test.ts +382 -0
  52. package/src/components/apply.ts +499 -0
  53. package/src/components/builders.test.ts +49 -0
  54. package/src/components/builders.ts +59 -0
  55. package/src/components/capability-plugin.ts +73 -0
  56. package/src/components/cloud-executor.test.ts +25 -0
  57. package/src/components/cloud-executor.ts +814 -0
  58. package/src/components/config-bom.test.ts +273 -0
  59. package/src/components/config-bom.ts +310 -0
  60. package/src/components/host-delivery.test.ts +121 -0
  61. package/src/components/host-delivery.ts +193 -0
  62. package/src/components/index.ts +19 -0
  63. package/src/components/job-submission.test.ts +97 -0
  64. package/src/components/job-submission.ts +138 -0
  65. package/src/components/pilots-e2e.test.ts +460 -0
  66. package/src/components/presets-e2e.test.ts +166 -0
  67. package/src/components/publish.test.ts +318 -0
  68. package/src/components/publish.ts +356 -0
  69. package/src/components/safety.test.ts +47 -0
  70. package/src/components/safety.ts +78 -0
  71. package/src/components/wait-aws.test.ts +79 -0
  72. package/src/components/wait-aws.ts +132 -0
  73. package/src/generated/index.d.ts +145 -38
  74. package/src/generated/index.ts +12 -9
  75. package/src/generated/lexicon-aws.json +141 -30
  76. package/src/import/live-export.ts +2 -1
  77. package/src/index.ts +5 -0
  78. package/src/lint/audit-catalog.ts +45 -0
  79. package/src/op/activities/floci.test.ts +67 -0
  80. package/src/op/activities/floci.ts +149 -0
  81. package/src/op/activities/index.ts +16 -0
  82. package/src/ownership.test.ts +18 -0
  83. package/src/ownership.ts +15 -0
  84. package/src/plugin.ts +3 -0
  85. package/src/serializer.ts +2 -1
@@ -0,0 +1,73 @@
1
+ /**
2
+ * `awsCapabilityPlugin` — the aws lexicon's capability plugin. It contributes
3
+ * every AWS operational leaf (apply, job-submission, host-delivery, safety, the
4
+ * cloud-specific waits, and publish) through core's `CapabilityPlugin` contract
5
+ * (`@intentius/chant/components/capability-plugin`), so a project declaring
6
+ * `lexicons: ["aws"]` gets these verbs registered automatically when it runs
7
+ * components — the seam docs/components/cloud-boundary describes. Core's starter
8
+ * set carries only the agnostic verbs; the cloud leaves live here.
9
+ */
10
+
11
+ import type { Capability } from "@intentius/chant/components/capability";
12
+ import type { CapabilityPlugin } from "@intentius/chant/components/capability-plugin";
13
+
14
+ import { publishImageCapability, loadImageOnHostCapability, publishArtifactCapability } from "./publish";
15
+ import { extractConfigBomCapability } from "./config-bom";
16
+ import {
17
+ cfnDeployCapability,
18
+ ecsUpdateServiceCapability,
19
+ lambdaDeployCapability,
20
+ s3SyncCapability,
21
+ cdnInvalidateCapability,
22
+ runMigrationCapability,
23
+ } from "./apply";
24
+ import { emrStartJobRunCapability, emrSubmitStepCapability } from "./job-submission";
25
+ import { codeDeployCapability, copyToHostCapability, remoteExecCapability } from "./host-delivery";
26
+ import { waitForStackCapability, waitSteadyStateCapability, waitJobCapability } from "./wait-aws";
27
+ import { snapshotBeforeCapability, rollbackPreviousCapability } from "./safety";
28
+
29
+ /** The AWS verb families this plugin contributes, grouped for `families()` — mirrors core's `STARTER_VERB_FAMILIES` shape. */
30
+ export const AWS_VERB_FAMILIES = {
31
+ // `extract-config-bom` parses a synthesized CloudFormation template (#684).
32
+ sbom: ["extract-config-bom"],
33
+ publish: ["publish-image", "load-image-on-host", "publish-artifact"],
34
+ apply: ["cfn-deploy", "ecs-update-service", "lambda-deploy", "s3-sync", "cdn-invalidate", "run-migration"],
35
+ jobSubmission: ["emr-start-job-run", "emr-submit-step"],
36
+ hostDelivery: ["code-deploy", "copy-to-host", "remote-exec"],
37
+ waitVerify: ["wait-for-stack", "wait-steady-state", "wait-job"],
38
+ safety: ["snapshot-before", "rollback-previous"],
39
+ } as const;
40
+
41
+ /** Every AWS-leaf capability, listed individually so each keeps its own `In`/`Out` generics (same reason core's starter plugin lists them one by one). */
42
+ function awsCapabilities(): Array<Capability<never, unknown>> {
43
+ return [
44
+ extractConfigBomCapability,
45
+ publishImageCapability,
46
+ loadImageOnHostCapability,
47
+ publishArtifactCapability,
48
+ cfnDeployCapability,
49
+ ecsUpdateServiceCapability,
50
+ lambdaDeployCapability,
51
+ s3SyncCapability,
52
+ cdnInvalidateCapability,
53
+ runMigrationCapability,
54
+ emrStartJobRunCapability,
55
+ emrSubmitStepCapability,
56
+ codeDeployCapability,
57
+ copyToHostCapability,
58
+ remoteExecCapability,
59
+ waitForStackCapability,
60
+ waitSteadyStateCapability,
61
+ waitJobCapability,
62
+ snapshotBeforeCapability,
63
+ rollbackPreviousCapability,
64
+ ] as unknown as Array<Capability<never, unknown>>;
65
+ }
66
+
67
+ /** The aws lexicon's capability plugin — loaded by core when a project's `chant.config.ts` lists `lexicons: ["aws"]`. */
68
+ export const awsCapabilityPlugin: CapabilityPlugin = {
69
+ name: "aws",
70
+ version: "1.0.0",
71
+ capabilities: awsCapabilities,
72
+ families: () => AWS_VERB_FAMILIES,
73
+ };
@@ -0,0 +1,25 @@
1
+ import { describe, test, expect } from "vitest";
2
+ import { applyAwsEndpoint } from "./cloud-executor";
3
+
4
+ describe("applyAwsEndpoint", () => {
5
+ const url = "http://localhost:4566";
6
+
7
+ test("injects --endpoint-url into an aws command when set", () => {
8
+ expect(applyAwsEndpoint("aws cloudformation describe-stacks --stack-name x", url)).toBe(
9
+ "aws --endpoint-url 'http://localhost:4566' cloudformation describe-stacks --stack-name x",
10
+ );
11
+ });
12
+
13
+ test("passes the command through unchanged when no endpoint is set", () => {
14
+ expect(applyAwsEndpoint("aws s3 ls", undefined)).toBe("aws s3 ls");
15
+ expect(applyAwsEndpoint("aws s3 ls", "")).toBe("aws s3 ls");
16
+ });
17
+
18
+ test("leaves non-aws commands (docker, piped aws) untouched at the front", () => {
19
+ expect(applyAwsEndpoint("docker build -t x .", url)).toBe("docker build -t x .");
20
+ // only the leading `aws` is rewritten; a piped aws inside is left as-is
21
+ expect(applyAwsEndpoint("aws ecr get-login-password | docker login", url)).toBe(
22
+ "aws --endpoint-url 'http://localhost:4566' ecr get-login-password | docker login",
23
+ );
24
+ });
25
+ });