← All procedures

procedure.load

Define the stored programs again (procedure.define), after a restart

CLI
Package
@procedures/store · README
Path
["procedure","load"]
CLI
mark procedure load
As data
{"$proc":["procedure","load"],"input":{}}
Tags
procedure, registry, storage

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/store"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["procedure","load"], {});
console.log(JSON.stringify(result));

From the command line

$ mark procedure load

As data, in a program

{ "$proc": ["procedure", "load"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
pathstring[] | stringnoThe path of the procedure: a list of segments, or a dotted key such as "reports.weekly"
prefixstring[] | stringnoLoad the programs of this path and under it
allbooleannoLoad every stored program

Output

FieldTypeRequiredDefaultDescription
loadednumberyesThe number of programs that the load defined
pathsstring[][]yesThe paths of the stored programs that matched
conflictsobject[]yesThe programs that could not be defined, with the reason
messagestringyes
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "path": {
        "anyOf": [
          {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "type": "string",
            "minLength": 1
          }
        ],
        "description": "The path of the procedure: a list of segments, or a dotted key such as \"reports.weekly\""
      },
      "prefix": {
        "description": "Load the programs of this path and under it",
        "anyOf": [
          {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "type": "string",
            "minLength": 1
          }
        ]
      },
      "all": {
        "description": "Load every stored program",
        "type": "boolean"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "loaded": {
        "type": "number",
        "description": "The number of programs that the load defined"
      },
      "paths": {
        "type": "array",
        "items": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": "The paths of the stored programs that matched"
      },
      "conflicts": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "path": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "reason": {
              "type": "string"
            }
          },
          "required": [
            "path",
            "reason"
          ],
          "additionalProperties": false
        },
        "description": "The programs that could not be defined, with the reason"
      },
      "message": {
        "type": "string"
      }
    },
    "required": [
      "loaded",
      "paths",
      "conflicts",
      "message"
    ],
    "additionalProperties": false
  }
}