← All procedures

procedure.sync

Synchronize the runtime-defined procedures of the registry with the program store

CLI
Package
@procedures/store · README
Path
["procedure","sync"]
CLI
mark procedure sync
As data
{"$proc":["procedure","sync"],"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","sync"], {});
console.log(JSON.stringify(result));

From the command line

$ mark procedure sync

As data, in a program

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

Input

FieldTypeRequiredDefaultDescription
direction"push" | "pull" | "both"nopush: write the programs of the registry to the store. pull: define the stored programs. both (the default): push, then pull the stored programs that the registry does not have

Output

FieldTypeRequiredDefaultDescription
pushednumberyesThe number of programs written to the store
pullednumberyesThe number of stored programs defined in the registry
conflictsobject[]yesThe programs that could not be defined, with the reason
messagestringyes
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "direction": {
        "description": "push: write the programs of the registry to the store. pull: define the stored programs. both (the default): push, then pull the stored programs that the registry does not have",
        "type": "string",
        "enum": [
          "push",
          "pull",
          "both"
        ]
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "pushed": {
        "type": "number",
        "description": "The number of programs written to the store"
      },
      "pulled": {
        "type": "number",
        "description": "The number of stored programs defined in the registry"
      },
      "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": [
      "pushed",
      "pulled",
      "conflicts",
      "message"
    ],
    "additionalProperties": false
  }
}