@powerhousedao/reactor-workflow 6.2.3-dev.77 → 6.2.3-dev.79

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/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G as PieceWorkerPool, K as PieceWorker, M as StaticConnectionResolver, R as InMemorySecretProvider, a as PieceRegistry, d as runWorkflow, gt as fetchPieceBundle, ht as ensurePieceBundle, it as extractDedupeKey, lt as sourcedResolver, n as WorkflowTelemetry, ut as buildDescriptor, v as ActivepiecesBlockExecutor, y as CompositeBlockExecutor } from "./telemetry-CohENxMR.js";
1
+ import { G as PieceWorkerPool, K as PieceWorker, M as StaticConnectionResolver, R as InMemorySecretProvider, a as PieceRegistry, d as runWorkflow, gt as fetchPieceBundle, ht as ensurePieceBundle, it as extractDedupeKey, lt as sourcedResolver, n as WorkflowTelemetry, ut as buildDescriptor, v as ActivepiecesBlockExecutor, y as CompositeBlockExecutor } from "./telemetry-CJd29LsN.js";
2
2
  import { createRequire } from "node:module";
3
3
  import { readFileSync, realpathSync } from "node:fs";
4
4
  import path from "node:path";
@@ -6779,6 +6779,29 @@ var RequestGuard = class {
6779
6779
  };
6780
6780
  }
6781
6781
  };
6782
+ const SERVED_DRIVES = {
6783
+ getNode: true,
6784
+ listNodes: true,
6785
+ addFile: true,
6786
+ addFolder: true
6787
+ };
6788
+ const REFUSED_DRIVES = {
6789
+ create: true,
6790
+ removeNode: true,
6791
+ renameNode: true,
6792
+ moveNode: true,
6793
+ copyNode: true,
6794
+ setPreferredEditorOnNode: true
6795
+ };
6796
+ function sessionDrives(proxy, guard) {
6797
+ const remote = proxy.drives;
6798
+ const drives = Object.create(null);
6799
+ for (const name of Object.keys(SERVED_DRIVES)) drives[name] = (...args) => guard.call(() => remote[name](...args));
6800
+ for (const name of Object.keys(REFUSED_DRIVES)) drives[name] = () => {
6801
+ throw named(ReactorAccessDeniedError, `drives.${name} is not available to workflow pieces`);
6802
+ };
6803
+ return drives;
6804
+ }
6782
6805
  function sessionClient(rt, proxy, guard) {
6783
6806
  const local = {
6784
6807
  getDocumentModelModule: (documentType) => guard.call(async () => {
@@ -6802,9 +6825,10 @@ function sessionClient(rt, proxy, guard) {
6802
6825
  throw named(ReactorAccessDeniedError, "Reactor method \"subscribe\" is not offered to pieces");
6803
6826
  }
6804
6827
  };
6828
+ const drives = sessionDrives(proxy, guard);
6805
6829
  return new Proxy({}, { get: (_target, prop) => {
6806
6830
  if (typeof prop !== "string" || prop === "then") return void 0;
6807
- if (prop === "drives") return void 0;
6831
+ if (prop === "drives") return drives;
6808
6832
  if (prop in local) return local[prop];
6809
6833
  return (...args) => guard.call(() => proxy[prop](...args));
6810
6834
  } });