@intentius/behold 0.29.56 → 0.30.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/AGENTS.md +323 -26
- package/THIRD_PARTY.md +21 -0
- package/demos.json +1 -1
- package/dist/cli.js +12393 -8612
- package/example-choudoufu-estate/chant.workspace.json +1 -1
- package/example-terraform-estate/README.md +10 -10
- package/example-terraform-estate/chant.workspace.json +1 -1
- package/example-three-cloud/README.md +17 -9
- package/example-three-cloud/aws/chant.config.ts +1 -1
- package/example-three-cloud/aws/site.component.ts +13 -0
- package/example-three-cloud/azure/chant.config.ts +1 -1
- package/example-three-cloud/azure/src/site.component.ts +13 -0
- package/example-three-cloud/azure/src/site.ts +12 -46
- package/example-three-cloud/dns/chant.config.ts +1 -1
- package/example-three-cloud/dns/src/records.component.ts +14 -0
- package/example-three-cloud/dns/src/route53.ts +8 -39
- package/example-three-cloud/gcp/chant.config.ts +1 -1
- package/example-three-cloud/gcp/src/site.component.ts +13 -0
- package/example-three-cloud/gcp/src/site.ts +12 -92
- package/example-three-cloud/package-lock.json +19 -19
- package/example-three-cloud/package.json +4 -4
- package/example-three-cloud/scripts/front-door.ts +89 -15
- package/licenses/aws-architecture-icons-TERMS.md +19 -0
- package/licenses/azure-architecture-icons-Microsoft_Terms_of_Use.pdf +0 -0
- package/licenses/azure-architecture-icons-TERMS.md +20 -0
- package/licenses/google-cloud-icons-TERMS.md +15 -0
- package/package.json +8 -9
- package/web/agent-move.js +60 -0
- package/web/agent-move.test.js +55 -0
- package/web/app.js +1084 -66
- package/web/dots-lod.js +1 -1
- package/web/edge-weight.d.ts +5 -0
- package/web/edge-weight.js +71 -0
- package/web/edge-weight.test.js +49 -0
- package/web/embed.d.ts +3 -0
- package/web/embed.js +5 -3
- package/web/embed.test.js +8 -0
- package/web/icons/aws/alb.svg +1 -0
- package/web/icons/aws/api-gateway.svg +1 -0
- package/web/icons/aws/app-runner.svg +1 -0
- package/web/icons/aws/appsync.svg +1 -0
- package/web/icons/aws/athena.svg +1 -0
- package/web/icons/aws/auto-scaling.svg +1 -0
- package/web/icons/aws/backup.svg +1 -0
- package/web/icons/aws/batch.svg +1 -0
- package/web/icons/aws/bedrock-agentcore.svg +1 -0
- package/web/icons/aws/bedrock.svg +1 -0
- package/web/icons/aws/certificate-manager.svg +1 -0
- package/web/icons/aws/cloud-map.svg +1 -0
- package/web/icons/aws/cloud.svg +1 -0
- package/web/icons/aws/cloudformation.svg +1 -0
- package/web/icons/aws/cloudfront.svg +1 -0
- package/web/icons/aws/cloudtrail.svg +1 -0
- package/web/icons/aws/cloudwatch-alarm.svg +1 -0
- package/web/icons/aws/cloudwatch-logs.svg +1 -0
- package/web/icons/aws/cloudwatch.svg +1 -0
- package/web/icons/aws/codebuild.svg +1 -0
- package/web/icons/aws/codecommit.svg +1 -0
- package/web/icons/aws/codedeploy.svg +1 -0
- package/web/icons/aws/codepipeline.svg +1 -0
- package/web/icons/aws/cognito.svg +1 -0
- package/web/icons/aws/config.svg +1 -0
- package/web/icons/aws/documentdb.svg +1 -0
- package/web/icons/aws/dynamodb-table.svg +1 -0
- package/web/icons/aws/dynamodb.svg +1 -0
- package/web/icons/aws/ebs-volume.svg +1 -0
- package/web/icons/aws/ec2-instance.svg +1 -0
- package/web/icons/aws/ec2.svg +1 -0
- package/web/icons/aws/ecr-registry.svg +1 -0
- package/web/icons/aws/ecr.svg +1 -0
- package/web/icons/aws/ecs-service.svg +1 -0
- package/web/icons/aws/ecs-task.svg +1 -0
- package/web/icons/aws/ecs.svg +1 -0
- package/web/icons/aws/efs.svg +1 -0
- package/web/icons/aws/eks.svg +1 -0
- package/web/icons/aws/elastic-beanstalk.svg +1 -0
- package/web/icons/aws/elastic-ip.svg +1 -0
- package/web/icons/aws/elasticache.svg +1 -0
- package/web/icons/aws/elb.svg +1 -0
- package/web/icons/aws/emr.svg +1 -0
- package/web/icons/aws/eventbridge.svg +1 -0
- package/web/icons/aws/firehose.svg +1 -0
- package/web/icons/aws/global-accelerator.svg +1 -0
- package/web/icons/aws/glue.svg +1 -0
- package/web/icons/aws/guardduty.svg +1 -0
- package/web/icons/aws/iam.svg +1 -0
- package/web/icons/aws/internet-gateway.svg +1 -0
- package/web/icons/aws/keyspaces.svg +1 -0
- package/web/icons/aws/kinesis.svg +1 -0
- package/web/icons/aws/kms.svg +1 -0
- package/web/icons/aws/lambda-function.svg +1 -0
- package/web/icons/aws/lambda.svg +1 -0
- package/web/icons/aws/mq.svg +1 -0
- package/web/icons/aws/msk.svg +1 -0
- package/web/icons/aws/nat-gateway.svg +1 -0
- package/web/icons/aws/neptune.svg +1 -0
- package/web/icons/aws/network-acl.svg +1 -0
- package/web/icons/aws/network-firewall.svg +1 -0
- package/web/icons/aws/opensearch.svg +1 -0
- package/web/icons/aws/organizations.svg +1 -0
- package/web/icons/aws/rds-instance.svg +1 -0
- package/web/icons/aws/rds.svg +1 -0
- package/web/icons/aws/redshift.svg +1 -0
- package/web/icons/aws/route-53-hosted-zone.svg +1 -0
- package/web/icons/aws/route-53.svg +1 -0
- package/web/icons/aws/router.svg +1 -0
- package/web/icons/aws/s3-bucket.svg +1 -0
- package/web/icons/aws/s3.svg +1 -0
- package/web/icons/aws/sagemaker.svg +1 -0
- package/web/icons/aws/secrets-manager.svg +1 -0
- package/web/icons/aws/ses.svg +1 -0
- package/web/icons/aws/shield.svg +1 -0
- package/web/icons/aws/sns-topic.svg +1 -0
- package/web/icons/aws/sns.svg +1 -0
- package/web/icons/aws/sqs-queue.svg +1 -0
- package/web/icons/aws/sqs.svg +1 -0
- package/web/icons/aws/step-functions.svg +1 -0
- package/web/icons/aws/systems-manager.svg +1 -0
- package/web/icons/aws/transfer-family.svg +1 -0
- package/web/icons/aws/transit-gateway.svg +1 -0
- package/web/icons/aws/vpc-endpoints.svg +1 -0
- package/web/icons/aws/vpc-lattice.svg +1 -0
- package/web/icons/aws/vpc.svg +1 -0
- package/web/icons/aws/vpn-gateway.svg +1 -0
- package/web/icons/aws/waf.svg +1 -0
- package/web/icons/azure/app-service-plan.svg +1 -0
- package/web/icons/azure/app-services.svg +1 -0
- package/web/icons/azure/application-gateway.svg +1 -0
- package/web/icons/azure/container-app.svg +1 -0
- package/web/icons/azure/container-apps-environment.svg +1 -0
- package/web/icons/azure/container-instances.svg +1 -0
- package/web/icons/azure/container-registry.svg +1 -0
- package/web/icons/azure/cosmos-db.svg +1 -0
- package/web/icons/azure/dns-zone.svg +1 -0
- package/web/icons/azure/front-door.svg +1 -0
- package/web/icons/azure/function-app.svg +1 -0
- package/web/icons/azure/kubernetes-service.svg +1 -0
- package/web/icons/azure/load-balancer.svg +1 -0
- package/web/icons/azure/log-analytics.svg +1 -0
- package/web/icons/azure/managed-identity.svg +1 -0
- package/web/icons/azure/mysql.svg +1 -0
- package/web/icons/azure/nat.svg +1 -0
- package/web/icons/azure/network-security-group.svg +1 -0
- package/web/icons/azure/postgresql.svg +1 -0
- package/web/icons/azure/public-ip.svg +1 -0
- package/web/icons/azure/redis.svg +1 -0
- package/web/icons/azure/resource-group.svg +1 -0
- package/web/icons/azure/route-table.svg +1 -0
- package/web/icons/azure/sql-database.svg +1 -0
- package/web/icons/azure/sql-server.svg +1 -0
- package/web/icons/azure/subnet.svg +1 -0
- package/web/icons/azure/subscription.svg +1 -0
- package/web/icons/azure/virtual-machine.svg +1 -0
- package/web/icons/azure/virtual-network-gateway.svg +1 -0
- package/web/icons/azure/virtual-network.svg +1 -0
- package/web/icons/gcp/artifact-registry.svg +1 -0
- package/web/icons/gcp/bigquery.svg +1 -0
- package/web/icons/gcp/bigtable.svg +1 -0
- package/web/icons/gcp/certificate-manager.svg +1 -0
- package/web/icons/gcp/cloud-armor.svg +1 -0
- package/web/icons/gcp/cloud-build.svg +1 -0
- package/web/icons/gcp/cloud-composer.svg +1 -0
- package/web/icons/gcp/cloud-dns.svg +1 -0
- package/web/icons/gcp/cloud-functions.svg +1 -0
- package/web/icons/gcp/cloud-load-balancing.svg +1 -0
- package/web/icons/gcp/cloud-logging.svg +1 -0
- package/web/icons/gcp/cloud-monitoring.svg +1 -0
- package/web/icons/gcp/cloud-nat.svg +1 -0
- package/web/icons/gcp/cloud-router.svg +1 -0
- package/web/icons/gcp/cloud-run.svg +1 -0
- package/web/icons/gcp/cloud-scheduler.svg +1 -0
- package/web/icons/gcp/cloud-spanner.svg +1 -0
- package/web/icons/gcp/cloud-sql.svg +1 -0
- package/web/icons/gcp/cloud-storage.svg +1 -0
- package/web/icons/gcp/cloud-tasks.svg +1 -0
- package/web/icons/gcp/compute-engine.svg +1 -0
- package/web/icons/gcp/dataflow.svg +1 -0
- package/web/icons/gcp/external-ip.svg +1 -0
- package/web/icons/gcp/firestore.svg +1 -0
- package/web/icons/gcp/firewall-rules.svg +1 -0
- package/web/icons/gcp/gke.svg +1 -0
- package/web/icons/gcp/iam.svg +1 -0
- package/web/icons/gcp/kms.svg +1 -0
- package/web/icons/gcp/memorystore.svg +1 -0
- package/web/icons/gcp/persistent-disk.svg +1 -0
- package/web/icons/gcp/project.svg +1 -0
- package/web/icons/gcp/pubsub.svg +1 -0
- package/web/icons/gcp/secret-manager.svg +1 -0
- package/web/icons/gcp/vpc.svg +1 -0
- package/web/index.html +98 -9
- package/web/net-trace.js +649 -0
- package/web/net-trace.test.js +180 -0
- package/web/panel.js +28 -4
- package/web/release.js +6 -4
- package/web/release.test.js +2 -2
- package/web/search-view.d.ts +27 -0
- package/web/search-view.js +213 -0
- package/web/search-view.test.js +144 -0
- package/web/shot-frame.d.ts +5 -0
- package/web/shot-frame.js +116 -0
- package/web/shot-frame.test.js +90 -0
- package/web/themes.js +1 -1
- package/web/view-url.d.ts +18 -0
- package/web/view-url.js +162 -10
- package/web/view-url.test.js +72 -1
package/web/view-url.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { readViewQuery, writeViewQuery, settleView, settlePlace, refusalLine, isEnvName, withOpening, defaultEnv } from "./view-url.js";
|
|
2
|
+
import { readViewQuery, writeViewQuery, settleView, settlePlace, refusalLine, isEnvName, withOpening, defaultEnv, checkQuery, checkSnapshot, QUERY_MAX, viewFromObject, restoreViewQuery } from "./view-url.js";
|
|
3
3
|
|
|
4
4
|
describe("readViewQuery (#475)", () => {
|
|
5
5
|
it("reads the view keys and nothing else", () => {
|
|
@@ -20,6 +20,11 @@ describe("readViewQuery (#475)", () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
describe("writeViewQuery (#475)", () => {
|
|
23
|
+
it("writes alike only when an estate draws every card, since stacked is the default (#877)", () => {
|
|
24
|
+
expect(writeViewQuery("", { zoom: "resources", alike: true })).toBe("?zoom=resources");
|
|
25
|
+
expect(writeViewQuery("", { zoom: "resources", alike: false })).toBe("?zoom=resources&alike=0");
|
|
26
|
+
expect(writeViewQuery("", { zoom: "logical", alike: undefined })).toBe("?zoom=logical");
|
|
27
|
+
});
|
|
23
28
|
it("keeps parameters that are not the view's, and leaves defaults out", () => {
|
|
24
29
|
const q = writeViewQuery("?embed=1&host=http%3A%2F%2Fa&member=old", { member: "delivery", zoom: "resources", env: null, lens: "drift", radial: false, node: null });
|
|
25
30
|
expect(q).toBe("?embed=1&host=http%3A%2F%2Fa&member=delivery&zoom=resources");
|
|
@@ -157,3 +162,69 @@ describe("an export's opening view (#827)", () => {
|
|
|
157
162
|
expect(writeViewQuery("", { zoom: "composites", env: null }, { env: defaultEnv({ env: "frozen" }, null) })).toBe("?zoom=composites&env=");
|
|
158
163
|
});
|
|
159
164
|
});
|
|
165
|
+
|
|
166
|
+
describe("q and snapshot (#913, #914)", () => {
|
|
167
|
+
it("reads and writes q and snapshot through the URL, + for a space and %2B for a plus", () => {
|
|
168
|
+
const q = "attr:internetFacing=true attr:effectiveIngress=tcp:22:0.0.0.0/0 a+b";
|
|
169
|
+
const search = writeViewQuery("", { zoom: "resources", env: "prod", q, snapshot: "latest" });
|
|
170
|
+
expect(search).toBe("?zoom=resources&env=prod&q=attr%3AinternetFacing%3Dtrue+attr%3AeffectiveIngress%3Dtcp%3A22%3A0.0.0.0%2F0+a%2Bb&snapshot=latest");
|
|
171
|
+
expect(readViewQuery(search)).toEqual({ zoom: "resources", env: "prod", q, snapshot: "latest" });
|
|
172
|
+
expect(readViewQuery("?q=")).toEqual({ q: null });
|
|
173
|
+
});
|
|
174
|
+
it("checkQuery passes chant's grammar through and refuses control characters, length and non-strings", () => {
|
|
175
|
+
expect(checkQuery(' ->kind:Bucket !"x <-a ')).toEqual({ ok: true, value: '->kind:Bucket !"x <-a' });
|
|
176
|
+
expect(checkQuery("")).toEqual({ ok: true, value: null });
|
|
177
|
+
expect(checkQuery(null)).toEqual({ ok: true, value: null });
|
|
178
|
+
expect(checkQuery("a\tb").ok).toBe(false);
|
|
179
|
+
expect(checkQuery("a\u007fb").ok).toBe(false);
|
|
180
|
+
expect(checkQuery("x".repeat(QUERY_MAX)).ok).toBe(true);
|
|
181
|
+
expect(checkQuery("x".repeat(QUERY_MAX + 1)).ok).toBe(false);
|
|
182
|
+
expect(checkQuery(3).ok).toBe(false);
|
|
183
|
+
});
|
|
184
|
+
it("settleView takes q, and a snapshot only on an env", () => {
|
|
185
|
+
expect(settleView({ q: "kind:Bucket" }, {})).toEqual({ apply: { q: "kind:Bucket" }, refused: [] });
|
|
186
|
+
expect(settleView({ q: "a\nb" }, {}).refused[0].key).toBe("q");
|
|
187
|
+
expect(settleView({ snapshot: "latest", env: "prod" }, { envs: ["prod"] }).apply).toEqual({ env: "prod", snapshot: "latest" });
|
|
188
|
+
expect(settleView({ snapshot: "latest" }, { env: "prod" }).apply).toEqual({ snapshot: "latest" });
|
|
189
|
+
expect(settleView({ snapshot: "latest" }, {}).refused[0]).toMatchObject({ key: "snapshot", reason: "a snapshot is of an env; name one with env" });
|
|
190
|
+
expect(settleView({ snapshot: "a b" }, { env: "prod" }).refused[0].key).toBe("snapshot");
|
|
191
|
+
expect(settleView({ snapshot: null }, {}).apply).toEqual({ snapshot: null });
|
|
192
|
+
expect(checkSnapshot("latest")).toEqual({ ok: true, value: "latest" });
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
describe("viewFromObject (#914)", () => {
|
|
197
|
+
it("takes the view keys and names everything else", () => {
|
|
198
|
+
const { want, refused } = viewFromObject({ q: "x", env: "", member: null, radial: true, zoom: "resources", at: "abc", other: 1, focus: 3 });
|
|
199
|
+
expect(want).toEqual({ q: "x", env: null, member: null, radial: true, zoom: "resources" });
|
|
200
|
+
expect(refused.map((r) => r.key)).toEqual(["at", "other", "focus"]);
|
|
201
|
+
expect(refused[0].reason).toMatch(/git revision/);
|
|
202
|
+
});
|
|
203
|
+
it("refuses a view that isn't an object", () => {
|
|
204
|
+
expect(viewFromObject("q=x").refused[0].key).toBe("view");
|
|
205
|
+
expect(viewFromObject(null).want).toEqual({});
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
describe("restoreViewQuery (#914)", () => {
|
|
210
|
+
it("clears what the URL leaves out, so Back undoes a move", () => {
|
|
211
|
+
expect(restoreViewQuery("?zoom=resources", { env: "prod", lens: "cost" })).toEqual({
|
|
212
|
+
zoom: "resources",
|
|
213
|
+
member: null,
|
|
214
|
+
gates: null,
|
|
215
|
+
focus: null,
|
|
216
|
+
run: null,
|
|
217
|
+
pull: null,
|
|
218
|
+
q: null,
|
|
219
|
+
snapshot: null,
|
|
220
|
+
countBy: null, // behold#922: no countBy is no grouping
|
|
221
|
+
radial: false,
|
|
222
|
+
plan: false, // behold#922: no plan is the declared source
|
|
223
|
+
alike: true,
|
|
224
|
+
env: "prod",
|
|
225
|
+
lens: "cost",
|
|
226
|
+
});
|
|
227
|
+
expect(restoreViewQuery("?zoom=logical&env=&q=kind%3AX").env).toBe(null);
|
|
228
|
+
expect(restoreViewQuery("?zoom=logical&env=&q=kind%3AX").q).toBe("kind:X");
|
|
229
|
+
});
|
|
230
|
+
});
|