@powerhousedao/switchboard 6.2.3-dev.33 → 6.2.3-dev.35

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.
@@ -26,6 +26,7 @@ import { startSwitchboard } from "../src/server.mjs";
26
26
  import {
27
27
  PH_WORKFLOWS_ENABLED,
28
28
  bindPackagePieces,
29
+ canReadAttachmentRef,
29
30
  composeWorkflowRuntime,
30
31
  assertWorkflowPackageLoadable,
31
32
  resolveWorkflowsEnabled,
@@ -245,7 +246,19 @@ describe("composeWorkflowRuntime", () => {
245
246
  expect(deps.webhooks).toEqual({ id: "webhooks" });
246
247
  expect(typeof deps.assertCanRead).toBe("function");
247
248
  expect(typeof deps.assertCanWrite).toBe("function");
248
- expect(typeof deps.canReadAttachmentRef).toBe("function");
249
+ expect(deps.canReadAttachmentRef).toBe(canReadAttachmentRef);
250
+ });
251
+
252
+ it("lets a step read any well-formed attachment ref", async () => {
253
+ const hash = "a".repeat(64);
254
+ // No document references it: runs read attachments as they read documents.
255
+ expect(await canReadAttachmentRef("wf-1", `attachment://v1:${hash}`)).toBe(
256
+ true,
257
+ );
258
+ expect(await canReadAttachmentRef("wf-1", `attachment://v2:${hash}`)).toBe(
259
+ false,
260
+ );
261
+ expect(await canReadAttachmentRef("wf-1", "not-a-ref")).toBe(false);
249
262
  });
250
263
 
251
264
  it("serves a subgraph the GraphQL manager can construct", async () => {
package/tsconfig.json CHANGED
@@ -33,6 +33,9 @@
33
33
  {
34
34
  "path": "../../packages/reactor-group"
35
35
  },
36
+ {
37
+ "path": "../../packages/reactor-privacy"
38
+ },
36
39
  {
37
40
  "path": "../../packages/reactor-workflow"
38
41
  },