Member Junction
    Preparing search index...

    Base class for executing actions. This class can be sub-classed if desired if you would like to modify the logic across ALL actions. To do so, sub-class this class and use the

    decorator from the @memberjunction/global package to register your sub-class with the ClassFactory. This will cause your sub-class to be used instead of this base class when the Metadata object insantiates the ActionEngine.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get DefaultActionTimeoutMS(): number

      Engine-default wall-clock timeout applied to any action whose MaxExecutionTimeMS is NULL. Intentionally generous (2 hours) because some integration actions do legitimately long sync work; per-action overrides should be used to tighten this for anything agent-facing. Sub-classes can override to globally change the default.

      Returns number

    Methods

    • The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.

      Returns GlobalObjectStore

    • Wraps InternalRunAction() with a universal wall-clock timeout (Action.MaxExecutionTimeMS, falling back to DefaultActionTimeoutMS) and an AbortSignal passed to the action via params.AbortSignal.

      Enforcement is cooperative: when the timeout fires we set an abort on the signal so in-flight fetch/setTimeout/custom polling logic can short-circuit, and we race the action against a rejection that surfaces a TIMEOUT result. If the caller already supplied an AbortSignal (e.g. when being run from a Runtime-action bridge that has its own abort), we chain to it so either source can trigger cancellation.

      Parameters

      Returns Promise<ActionResult>

    • Runs an Action.Type='Runtime' action by delegating to the sandboxed RuntimeActionExecutor. Approval / Status / Code-presence checks are enforced inside the executor; here we parse the RuntimeActionConfiguration, build the permissioned bridge-handler map, and hand it off.

      The bridge handlers run in-process on the host (not inside the sandbox) so they have full access to Metadata, RunView, ActionEngine, etc. Permission enforcement against RuntimeActionConfiguration.permissions happens inside each handler — see RuntimeActionBridge.ts.

      If the configuration is missing or malformed, we still let the action run in pure-compute mode (no bridge). The action's Code can then only use input + libs; any attempt to call utilities.* at runtime rejects with a "handler not registered" error from the worker pool.

      Parameters

      Returns Promise<ActionResultSimple>

    • Returns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.

      Type Parameters

      Parameters

      • this: new () => T
      • OptionalclassName: string

      Returns T