1.1.0-beta.9 • Published 1 day ago

antbox-sdk v1.1.0-beta.9

Weekly downloads
-
License
ISC
Repository
-
Last release
1 day ago

Antbox SDK

Antbox SDK provides a Node client for the Antbox ECM, offering a clear and consistent API to interact with the system. With this SDK, developers can seamlessly integrate Antbox's functionalities into their applications.

Table of Contents

Installation

To get started, you can install the package using npm:

npm install antbox-sdk

Usage

Importing the Clients

To use a client, you first need to import it:

import {
  ActionServiceClient,
  AspectServiceClient,
  LoginClient,
  NodeServiceClient,
  WebContentService,
} from "antbox-sdk";

Clients and Methods

Below are the provided clients with their associated methods:

1. ActionServiceClient

MethodDescription
get(uuid)Retrieves an action by its UUID.
run(uuid, uuids, params?)Executes a specific action on multiple nodes.
list()Lists all available actions.

Example:

const actionService = new ActionServiceClient(serverOpts);
actionService.get("sample-uuid").then((action) => {
  console.log(action);
});

2. AspectServiceClient

MethodDescription
get(uuid)Retrieves an aspect by its UUID.
list()Lists all available aspects.

Example:

const aspectService = new AspectServiceClient(serverOpts);
aspectService.get("sample-uuid").then((aspect) => {
  console.log(aspect);
});

3. LoginClient

MethodDescription
loginRoot(pwd)Logs in as the root user using a password.

Example:

const loginClient = new LoginClient(serverOpts);
loginClient.loginRoot("your-password").then((response) => {
  console.log(response);
});

4. NodeServiceClient

MethodDescription
getNodeUrl(uuid)Retrieves the URL for a specific node by its UUID.
copy(uuid, to)Copies a node to a specified location.
duplicate(uuid)Duplicates a node.
createFolder(metadata)Creates a new folder node with the given metadata.
createFile(file, metadata)Creates a new file node with the provided file and metadata.
createMetanode(metadata)Creates a new meta node with the specified metadata.
updateFile(uuid, file)Updates an existing file node with a new file.
delete(uuid)Deletes a node by its UUID.
get(uuid)Retrieves a node by its UUID.
list(parent?)Lists all nodes, optionally filtered by their parent.
query(filters, pageSize?, pageToken?)Queries nodes based on given filters and pagination options.
update(uuid, node)Updates a node's metadata.
evaluate(uuid)Evaluates a smart folder node.
export(uuid)Exports a node's content.

Example:

const nodeService = new NodeServiceClient(serverOpts);
nodeService.get("sample-uuid").then((node) => {
  console.log(node);
});

5. WebContentService

This section is left blank because the provided code does not have any methods or descriptions for the WebContentService client.

ServerOpts

For all the examples above, the serverOpts should be an object that provides necessary configurations for the client to communicate with the server. Typically, it would include the URL of the server.

Example:

const serverOpts = {
  url: "https://your-antbox-server-url.com",
};

Conclusion

The Antbox SDK offers a comprehensive interface to work with the Antbox ECM, ensuring that developers can easily integrate and leverage its capabilities. Make sure to consult the official Antbox documentation for more details on the available features and functionalities.

1.1.0-beta.9

1 day ago

1.1.0-beta.8

5 months ago

1.1.0-beta.7

5 months ago

1.1.0-beta.6

6 months ago

1.1.0-beta.5

6 months ago

1.1.0-beta.4

6 months ago

1.1.0-beta.3

6 months ago

1.1.0-beta.2

6 months ago

1.1.0-beta.1

7 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago