Class: libdbapi

libdbapi()

Represents a library for interacting with a database. It contains methods for adding, getting, deleting, and querying types from the database. It also contains methods for getting domains, groups, modules, and purposes from the database.

Constructor

new libdbapi()

In this implementation, the library uses DynamoDB as the database.
Source:

Methods

add(path, typename, description, documentation, purpose, version, previous_type, topic, domain, group, contact) → {Promise}

Adds a type to the database.
Parameters:
Name Type Description
path string The path of the type.
typename string The name of the type.
description string The description of the type.
documentation string The documentation of the type.
purpose string The purpose of the type.
version string The version of the type.
previous_type string The previous type of the type.
topic string The topic of the type.
domain string The domain of the type.
group string The group of the type.
contact string The contact of the type.
Source:
Returns:
A promise that resolves when the type is added to the database.
Type
Promise

delete(typeid) → {Promise}

Deletes a type from the database.
Parameters:
Name Type Description
typeid string The ID of the type to delete.
Source:
Returns:
A promise that resolves when the type is successfully deleted.
Type
Promise

describe() → {Promise.<Object>}

Returns the description of the table.
Source:
Returns:
A promise that resolves to the description of the table.
Type
Promise.<Object>

get(typeid) → {Promise.<Type>}

Retrieves a type from the database based on the given typeid.
Parameters:
Name Type Description
typeid string The identifier of the type to retrieve.
Source:
Returns:
A promise that resolves to the retrieved type.
Type
Promise.<Type>

getDomains() → {Array}

Retrieves the domains from the database.
Source:
Returns:
An array of domains.
Type
Array

getGroups() → {Array}

Retrieves the groups from the database.
Source:
Returns:
An array of groups.
Type
Array

getModules() → {Array}

Retrieves the modules from the database.
Source:
Returns:
An array of modules.
Type
Array

getPurpose() → {Array}

Retrieves the purposes from the database.
Source:
Returns:
An array of purposes.
Type
Array

previous(typeid) → {Object}

Retrieves the previous type from the database based on the given typeid.
Parameters:
Name Type Description
typeid string The ID of the type.
Source:
Returns:
- The previous type object.
Type
Object

query(domain, group, modules, topic, type, contains, begin, end) → {Promise.<any>}

Queries the database for types based on the specified parameters.
Parameters:
Name Type Description
domain string The domain of the types.
group string The group of the types.
modules Array.<string> The modules of the types.
topic string The topic of the types.
type string The type of the types.
contains string The string that the types should contain.
begin Date The start date for the types.
end Date The end date for the types.
Source:
Returns:
A promise that resolves with the query results.
Type
Promise.<any>

queryWithLastIndex(domain, group, modules, topic, type, contains, last_typeid, limit) → {Promise}

Queries the database with the last index.
Parameters:
Name Type Description
domain string The domain to query.
group string The group to query.
modules Array.<string> The modules to query.
topic string The topic to query.
type string The type to query.
contains string The string to search for.
last_typeid string The last type ID.
limit number The maximum number of results to return.
Source:
Returns:
A promise that resolves with the query results.
Type
Promise