1.0.29 • Published 3 years ago

multix-client v1.0.29

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

The Multix client lets you invoke Multix commands same as the IDE and get results back as JS data. If terminals are specified, they will still work the same way. Be sure to set the API credentials and home project/module first. Also make sure appropriate worker(s) are running

First require the client:

    let MultixClient = require("multix-client");

Now set API credentials as shown below

This example runs a query (in this case, the 'help' command which returns an array):

    let multixClient = new MultixClient();  // returns type MultixClientT if using Typescript

    // set API key/secret
    multixClient.setCredentials(" -- myAPIkey -- "," -- my secret -- ");

    // be aware this has auto-reconnect
    await multixClient.login("wss://api.multix.catatonic.ai");


    // now send the 'help' command to Multix

    // make sure you have the module spelling correct and the
    // appropriate worker already running
    let result = await multixClient.runCommand({
        command: `help`,
        env: {
            homeProjectName: "myProject",
            homeModuleName: "myOpenAPIModule",
            loggerTerminalName: "myLogger",      // optional
            outputTerminalName: "myOutput"       // optional
        },
        prior: null     // use this to send prior
    });

    console.log(result);

    // this uses the multix logger which does buffering etc.
    multixClient.logger.debug("Help result", result);

The result for this example should be a JS array of objects like this:

 {
    Keyword: 'module',
    Option: 'get',
    Description: 'Get module content',
    Context: 'system'
  },
  {
    Keyword: 'module',
    Option: 'ls',
    Description: 'List modules in a project',
    Context: 'system'
  }
  ...

Use the prior to send any prior data. For example if you wanted to run {x:5} >> foo then set command to 'foo' and prior to {x:5}

The full interface is documented in node_modules/multix-client/types/MultixClientT.ts.

The difference between runCommand() and execCommand() is that the latter does not attempt to retrieve results. Most of the other stuff is for IDE support. For example you can call saveModule() to upsert or bulk load code


The signup portal is below\ https://portal.multix.catatonic.ai

One account can manage many API keys (logins). If you have a team, they can collab under the same account

Demo videos etc. are here\ https://www.youtube.com/channel/UCDtG3T7He_Vcw_C_wDytqSA

VSCode extension is available in the marketplace; this has more features than just the web 'catbox'\ https://marketplace.visualstudio.com/items?itemName=catatonic-ai.multix-vscode-extension

Samples are here https://gitlab.com/rein.dapp/multix-samples

@ 2022 catatonic.ai Estonia

1.0.22

3 years ago

1.0.21

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.20

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago