Namespace

Commands

Commands

Defines the strategies for the KeySSI's for each DSU Type

View Source commands/index.js, line 1

Classes

AddFileCommand

Copies a File from disk or from a source DSU when provided

supports sourceDSU, defaults to fs

Can run iteratively

Analog to OpenDSU's Archive addFile method

Command syntax:

    addfile origin_path destination_path

Source object:

  • a DSU;
.
AddFolderCommand

This command copies an entire folder from the filesystem onto the destination DSU (as a single brick for efficiency if I'm not mistaken)

Does not Support sourceDSU (yet)

Can run iteratively

Analog to OpenDSU's Archive addFolder method

Command syntax:

    addfolder origin_path [destination_path]

Source object:

  • a DSU;
.
Command
Base class for the Commands.
CreateDSUCommand

creates a new DSU of the provided type and with the provided key gen arguments

Analog to OpenDSU's Resolver createDSU method

Command syntax:

    createdsu type domain args

args:

  • type: 'array' | 'seed'
  • domain: the anchoring domain
  • args: string|string[] stringified
  • Source object:
  • any;
.
CreateFileCommand

Creates a file with the provided content on the destination DSU (similar to a touch command with added content)

Analog to OpenDSU's Archive writeFile method

fs compatible

Command syntax:

    createfile path content

args:

  • content: string
  • Source object:
  • a DSU;
.
DefineCommand

Defines a variable that can later be used in the script

Command syntax:

    defined var_name [value|command|

args:

  • var_name: string : this variable with be replaced in every subsequent command
  • value|command: string: a value, or a command that will be executed and its result stored as the variable
  • Source object:
  • any;
.
DeleteCommand

Deletes everything in the specified path of the DSU

Analog to OpenDSU's Archive delete method

Command syntax:

    delete path

Source object:

  • a DSU;
.
DeriveCommand

Derives the provided keySSI

Analog to OpenDSU's KeySSI derive method

Command syntax:

    derive [true|false]

Source object:

  • a KeySSI;
.
EndWithCommand

Allows for more complex logic by allowing you to control the output/input for commands while keeping the commands readable

basically sets whatever the result of the with operation into the source Object until it finds the endwith command

Source object:

  • any;
.
GenDBCommand

Generates a DB and returns it's SSI after initialization

Source object:

  • a DSU;
.
GenKeyCommand

Generates a KeySSI

Source object:

  • any;
.
GetIdentifierCommand

Returns the identifier for the current source object

Source object:

  • a DSU|KeySSI;
.
MountCommand

Mounts a DSU onto the provided path

Source object:

  • a DSU;
.
ObjToArrayCommand

Util Command to convert objects to and array with their values

Source object:

  • any
.
ReadFileCommand

Reads The contents of a file from disk or from a sourceDSU

supports sourceDSU

Source object:

  • a DSU|fs;
.
VarStore
A simple variable store.
WithCommand

Namespaces

Registry

Stores references to the available commands and exposes them by command name Commands must be added here to be available

.
utils

Methods

# static createParticipantConstSSI(domain:) → {SeedSSI}

Creates a seedSSI meant to contain participant 'participantConst' data.

Creates a seedSSI meant to contain participant 'participantConst' data. could be used as an identity

Parameters:
Name Type Description
participant. Participant

Must have a valid id property.

domain: string

anchoring domain

View Source commands/setParticipantConstSSI.js, line 9

(template)

SeedSSI

# static createParticipantSSI(participant, domain:) → {SeedSSI}

Creates a seedSSI meant to contain participant 'participant' data.

Creates a seedSSI meant to contain participant 'participant' data. could be used as an identity

Parameters:
Name Type Description
participant Participant
domain: string

anchoring domain

View Source commands/setParticipantSSI.js, line 9

(template)

SeedSSI