Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/archive/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["archive","create"], { output: "<output>" });
console.log(JSON.stringify(result));From the command line
$ mark archive create --output <string>
As data, in a program
{ "$proc": ["archive", "create"], "input": { "output": "<output>" } }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"output": {
"type": "string",
"minLength": 1,
"maxLength": 4096,
"description": "The archive to make"
},
"source": {
"type": "string",
"minLength": 1,
"maxLength": 4096,
"description": "A folder: the archive gets its content"
},
"files": {
"description": "Files and folders, relative to cwd. A folder goes in with its content",
"minItems": 1,
"maxItems": 10000,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 4096
}
},
"cwd": {
"type": "string",
"minLength": 1,
"maxLength": 4096,
"description": "The base folder of files (default: the working folder, or the root of the module)"
},
"format": {
"description": "The format (default: from the name of output: .tar.gz, .tgz, .tar or .zip)",
"type": "string",
"enum": [
"tar.gz",
"tar",
"zip"
]
},
"overwrite": {
"description": "True: replace an existing archive (default false)",
"type": "boolean"
}
},
"required": [
"output"
]
},
"output": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The absolute path of the archive"
},
"format": {
"type": "string",
"enum": [
"tar.gz",
"tar",
"zip"
]
},
"entries": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "The number of entries: files, folders and links"
},
"bytes": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "The size of the archive, in bytes"
}
},
"required": [
"path",
"format",
"entries",
"bytes"
],
"additionalProperties": false
}
}