Class MethodScriptStore
- Namespace
- Kuestenlogik.Bowire.Scripting
- Assembly
- Kuestenlogik.Bowire.dll
#1059 — the pre-request and post-response scripts of a workspace's methods,
on disk: scripts.json in the workspace's folder (or a git-native
workspace's own directory), keyed service::method. The workbench
reads and writes it through /api/scripts; bowire call and the
MCP tool bowire.invoke read it, so a method runs with its scripts
wherever it is called from.
public static class MethodScriptStore
- Inheritance
-
MethodScriptStore
- Inherited Members
Remarks
They lived in the browser's storage before, which kept them from every
call not made in that browser. The shape follows FlowStore: the
browser copy is the in-flight cache, the file is the source of truth.
Methods
Find(string?, string?, string, string)
The scripts of service / method in
the workspace; empty strings for none.
public static (string PreScript, string PostScript) Find(string? workspaceId, string? storageRoot, string service, string method)
Parameters
Returns
FindInFile(string?, string, string)
The scripts of service / method in
the scripts.json at path; empty strings for
none, a missing file or one that does not parse.
public static (string PreScript, string PostScript) FindInFile(string? path, string service, string method)
Parameters
Returns
KeyOf(string, string)
The key a method's scripts are stored under, as the workbench writes it.
public static string KeyOf(string service, string method)
Parameters
Returns
Load(string?, string?)
The workspace's document, {"scripts":{…}}; the empty envelope when none was saved or the file is unreadable.
public static string Load(string? workspaceId, string? storageRoot = null)
Parameters
Returns
Save(string, string?, string?)
Persist the workspace's document verbatim. Throws JsonException
for JSON that does not parse and ArgumentException for one
without a scripts object, writing nothing.
public static void Save(string json, string? workspaceId, string? storageRoot = null)