@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.
Files changed (205) hide show
  1. package/AGENTS.md +323 -26
  2. package/THIRD_PARTY.md +21 -0
  3. package/demos.json +1 -1
  4. package/dist/cli.js +12393 -8612
  5. package/example-choudoufu-estate/chant.workspace.json +1 -1
  6. package/example-terraform-estate/README.md +10 -10
  7. package/example-terraform-estate/chant.workspace.json +1 -1
  8. package/example-three-cloud/README.md +17 -9
  9. package/example-three-cloud/aws/chant.config.ts +1 -1
  10. package/example-three-cloud/aws/site.component.ts +13 -0
  11. package/example-three-cloud/azure/chant.config.ts +1 -1
  12. package/example-three-cloud/azure/src/site.component.ts +13 -0
  13. package/example-three-cloud/azure/src/site.ts +12 -46
  14. package/example-three-cloud/dns/chant.config.ts +1 -1
  15. package/example-three-cloud/dns/src/records.component.ts +14 -0
  16. package/example-three-cloud/dns/src/route53.ts +8 -39
  17. package/example-three-cloud/gcp/chant.config.ts +1 -1
  18. package/example-three-cloud/gcp/src/site.component.ts +13 -0
  19. package/example-three-cloud/gcp/src/site.ts +12 -92
  20. package/example-three-cloud/package-lock.json +19 -19
  21. package/example-three-cloud/package.json +4 -4
  22. package/example-three-cloud/scripts/front-door.ts +89 -15
  23. package/licenses/aws-architecture-icons-TERMS.md +19 -0
  24. package/licenses/azure-architecture-icons-Microsoft_Terms_of_Use.pdf +0 -0
  25. package/licenses/azure-architecture-icons-TERMS.md +20 -0
  26. package/licenses/google-cloud-icons-TERMS.md +15 -0
  27. package/package.json +8 -9
  28. package/web/agent-move.js +60 -0
  29. package/web/agent-move.test.js +55 -0
  30. package/web/app.js +1084 -66
  31. package/web/dots-lod.js +1 -1
  32. package/web/edge-weight.d.ts +5 -0
  33. package/web/edge-weight.js +71 -0
  34. package/web/edge-weight.test.js +49 -0
  35. package/web/embed.d.ts +3 -0
  36. package/web/embed.js +5 -3
  37. package/web/embed.test.js +8 -0
  38. package/web/icons/aws/alb.svg +1 -0
  39. package/web/icons/aws/api-gateway.svg +1 -0
  40. package/web/icons/aws/app-runner.svg +1 -0
  41. package/web/icons/aws/appsync.svg +1 -0
  42. package/web/icons/aws/athena.svg +1 -0
  43. package/web/icons/aws/auto-scaling.svg +1 -0
  44. package/web/icons/aws/backup.svg +1 -0
  45. package/web/icons/aws/batch.svg +1 -0
  46. package/web/icons/aws/bedrock-agentcore.svg +1 -0
  47. package/web/icons/aws/bedrock.svg +1 -0
  48. package/web/icons/aws/certificate-manager.svg +1 -0
  49. package/web/icons/aws/cloud-map.svg +1 -0
  50. package/web/icons/aws/cloud.svg +1 -0
  51. package/web/icons/aws/cloudformation.svg +1 -0
  52. package/web/icons/aws/cloudfront.svg +1 -0
  53. package/web/icons/aws/cloudtrail.svg +1 -0
  54. package/web/icons/aws/cloudwatch-alarm.svg +1 -0
  55. package/web/icons/aws/cloudwatch-logs.svg +1 -0
  56. package/web/icons/aws/cloudwatch.svg +1 -0
  57. package/web/icons/aws/codebuild.svg +1 -0
  58. package/web/icons/aws/codecommit.svg +1 -0
  59. package/web/icons/aws/codedeploy.svg +1 -0
  60. package/web/icons/aws/codepipeline.svg +1 -0
  61. package/web/icons/aws/cognito.svg +1 -0
  62. package/web/icons/aws/config.svg +1 -0
  63. package/web/icons/aws/documentdb.svg +1 -0
  64. package/web/icons/aws/dynamodb-table.svg +1 -0
  65. package/web/icons/aws/dynamodb.svg +1 -0
  66. package/web/icons/aws/ebs-volume.svg +1 -0
  67. package/web/icons/aws/ec2-instance.svg +1 -0
  68. package/web/icons/aws/ec2.svg +1 -0
  69. package/web/icons/aws/ecr-registry.svg +1 -0
  70. package/web/icons/aws/ecr.svg +1 -0
  71. package/web/icons/aws/ecs-service.svg +1 -0
  72. package/web/icons/aws/ecs-task.svg +1 -0
  73. package/web/icons/aws/ecs.svg +1 -0
  74. package/web/icons/aws/efs.svg +1 -0
  75. package/web/icons/aws/eks.svg +1 -0
  76. package/web/icons/aws/elastic-beanstalk.svg +1 -0
  77. package/web/icons/aws/elastic-ip.svg +1 -0
  78. package/web/icons/aws/elasticache.svg +1 -0
  79. package/web/icons/aws/elb.svg +1 -0
  80. package/web/icons/aws/emr.svg +1 -0
  81. package/web/icons/aws/eventbridge.svg +1 -0
  82. package/web/icons/aws/firehose.svg +1 -0
  83. package/web/icons/aws/global-accelerator.svg +1 -0
  84. package/web/icons/aws/glue.svg +1 -0
  85. package/web/icons/aws/guardduty.svg +1 -0
  86. package/web/icons/aws/iam.svg +1 -0
  87. package/web/icons/aws/internet-gateway.svg +1 -0
  88. package/web/icons/aws/keyspaces.svg +1 -0
  89. package/web/icons/aws/kinesis.svg +1 -0
  90. package/web/icons/aws/kms.svg +1 -0
  91. package/web/icons/aws/lambda-function.svg +1 -0
  92. package/web/icons/aws/lambda.svg +1 -0
  93. package/web/icons/aws/mq.svg +1 -0
  94. package/web/icons/aws/msk.svg +1 -0
  95. package/web/icons/aws/nat-gateway.svg +1 -0
  96. package/web/icons/aws/neptune.svg +1 -0
  97. package/web/icons/aws/network-acl.svg +1 -0
  98. package/web/icons/aws/network-firewall.svg +1 -0
  99. package/web/icons/aws/opensearch.svg +1 -0
  100. package/web/icons/aws/organizations.svg +1 -0
  101. package/web/icons/aws/rds-instance.svg +1 -0
  102. package/web/icons/aws/rds.svg +1 -0
  103. package/web/icons/aws/redshift.svg +1 -0
  104. package/web/icons/aws/route-53-hosted-zone.svg +1 -0
  105. package/web/icons/aws/route-53.svg +1 -0
  106. package/web/icons/aws/router.svg +1 -0
  107. package/web/icons/aws/s3-bucket.svg +1 -0
  108. package/web/icons/aws/s3.svg +1 -0
  109. package/web/icons/aws/sagemaker.svg +1 -0
  110. package/web/icons/aws/secrets-manager.svg +1 -0
  111. package/web/icons/aws/ses.svg +1 -0
  112. package/web/icons/aws/shield.svg +1 -0
  113. package/web/icons/aws/sns-topic.svg +1 -0
  114. package/web/icons/aws/sns.svg +1 -0
  115. package/web/icons/aws/sqs-queue.svg +1 -0
  116. package/web/icons/aws/sqs.svg +1 -0
  117. package/web/icons/aws/step-functions.svg +1 -0
  118. package/web/icons/aws/systems-manager.svg +1 -0
  119. package/web/icons/aws/transfer-family.svg +1 -0
  120. package/web/icons/aws/transit-gateway.svg +1 -0
  121. package/web/icons/aws/vpc-endpoints.svg +1 -0
  122. package/web/icons/aws/vpc-lattice.svg +1 -0
  123. package/web/icons/aws/vpc.svg +1 -0
  124. package/web/icons/aws/vpn-gateway.svg +1 -0
  125. package/web/icons/aws/waf.svg +1 -0
  126. package/web/icons/azure/app-service-plan.svg +1 -0
  127. package/web/icons/azure/app-services.svg +1 -0
  128. package/web/icons/azure/application-gateway.svg +1 -0
  129. package/web/icons/azure/container-app.svg +1 -0
  130. package/web/icons/azure/container-apps-environment.svg +1 -0
  131. package/web/icons/azure/container-instances.svg +1 -0
  132. package/web/icons/azure/container-registry.svg +1 -0
  133. package/web/icons/azure/cosmos-db.svg +1 -0
  134. package/web/icons/azure/dns-zone.svg +1 -0
  135. package/web/icons/azure/front-door.svg +1 -0
  136. package/web/icons/azure/function-app.svg +1 -0
  137. package/web/icons/azure/kubernetes-service.svg +1 -0
  138. package/web/icons/azure/load-balancer.svg +1 -0
  139. package/web/icons/azure/log-analytics.svg +1 -0
  140. package/web/icons/azure/managed-identity.svg +1 -0
  141. package/web/icons/azure/mysql.svg +1 -0
  142. package/web/icons/azure/nat.svg +1 -0
  143. package/web/icons/azure/network-security-group.svg +1 -0
  144. package/web/icons/azure/postgresql.svg +1 -0
  145. package/web/icons/azure/public-ip.svg +1 -0
  146. package/web/icons/azure/redis.svg +1 -0
  147. package/web/icons/azure/resource-group.svg +1 -0
  148. package/web/icons/azure/route-table.svg +1 -0
  149. package/web/icons/azure/sql-database.svg +1 -0
  150. package/web/icons/azure/sql-server.svg +1 -0
  151. package/web/icons/azure/subnet.svg +1 -0
  152. package/web/icons/azure/subscription.svg +1 -0
  153. package/web/icons/azure/virtual-machine.svg +1 -0
  154. package/web/icons/azure/virtual-network-gateway.svg +1 -0
  155. package/web/icons/azure/virtual-network.svg +1 -0
  156. package/web/icons/gcp/artifact-registry.svg +1 -0
  157. package/web/icons/gcp/bigquery.svg +1 -0
  158. package/web/icons/gcp/bigtable.svg +1 -0
  159. package/web/icons/gcp/certificate-manager.svg +1 -0
  160. package/web/icons/gcp/cloud-armor.svg +1 -0
  161. package/web/icons/gcp/cloud-build.svg +1 -0
  162. package/web/icons/gcp/cloud-composer.svg +1 -0
  163. package/web/icons/gcp/cloud-dns.svg +1 -0
  164. package/web/icons/gcp/cloud-functions.svg +1 -0
  165. package/web/icons/gcp/cloud-load-balancing.svg +1 -0
  166. package/web/icons/gcp/cloud-logging.svg +1 -0
  167. package/web/icons/gcp/cloud-monitoring.svg +1 -0
  168. package/web/icons/gcp/cloud-nat.svg +1 -0
  169. package/web/icons/gcp/cloud-router.svg +1 -0
  170. package/web/icons/gcp/cloud-run.svg +1 -0
  171. package/web/icons/gcp/cloud-scheduler.svg +1 -0
  172. package/web/icons/gcp/cloud-spanner.svg +1 -0
  173. package/web/icons/gcp/cloud-sql.svg +1 -0
  174. package/web/icons/gcp/cloud-storage.svg +1 -0
  175. package/web/icons/gcp/cloud-tasks.svg +1 -0
  176. package/web/icons/gcp/compute-engine.svg +1 -0
  177. package/web/icons/gcp/dataflow.svg +1 -0
  178. package/web/icons/gcp/external-ip.svg +1 -0
  179. package/web/icons/gcp/firestore.svg +1 -0
  180. package/web/icons/gcp/firewall-rules.svg +1 -0
  181. package/web/icons/gcp/gke.svg +1 -0
  182. package/web/icons/gcp/iam.svg +1 -0
  183. package/web/icons/gcp/kms.svg +1 -0
  184. package/web/icons/gcp/memorystore.svg +1 -0
  185. package/web/icons/gcp/persistent-disk.svg +1 -0
  186. package/web/icons/gcp/project.svg +1 -0
  187. package/web/icons/gcp/pubsub.svg +1 -0
  188. package/web/icons/gcp/secret-manager.svg +1 -0
  189. package/web/icons/gcp/vpc.svg +1 -0
  190. package/web/index.html +98 -9
  191. package/web/net-trace.js +649 -0
  192. package/web/net-trace.test.js +180 -0
  193. package/web/panel.js +28 -4
  194. package/web/release.js +6 -4
  195. package/web/release.test.js +2 -2
  196. package/web/search-view.d.ts +27 -0
  197. package/web/search-view.js +213 -0
  198. package/web/search-view.test.js +144 -0
  199. package/web/shot-frame.d.ts +5 -0
  200. package/web/shot-frame.js +116 -0
  201. package/web/shot-frame.test.js +90 -0
  202. package/web/themes.js +1 -1
  203. package/web/view-url.d.ts +18 -0
  204. package/web/view-url.js +162 -10
  205. package/web/view-url.test.js +72 -1
@@ -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
+ });