← All procedures
client.import
Parse procedure aggregation from JSON string
browsernot registered- Package
- @procedures/client · README
- Path
["client","import"]- CLI
- Not a
mark command: it is not in the default registry. - As data
{"$proc":["client","import"],"input":{}}- Tags
- core, meta
Try it in the Composer →
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";
for (const procedure of allCoreProcedures) {
if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","import"], {});
console.log(JSON.stringify(result));As data, in a program
{ "$proc": ["client", "import"], "input": {} }Input
| Field | Type | Required |
|---|
json | string | no |
path | string | no |
Output
| Field | Type | Required | Default | Description |
|---|
procedure | any | no | | The parsed procedure reference |
success | boolean | yes | | True when the text is a valid procedure reference |
error | string | no | | The error message when the parse failed |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"json": {
"description": "JSON string containing procedure ref",
"type": "string"
},
"path": {
"description": "File path to load procedure ref from (requires fs.read procedure)",
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"procedure": {
"description": "The parsed procedure reference"
},
"success": {
"type": "boolean",
"description": "True when the text is a valid procedure reference"
},
"error": {
"description": "The error message when the parse failed",
"type": "string"
}
},
"required": [
"success"
],
"additionalProperties": {}
}
}