Constructor
new libdbapi()
In this implementation, the library uses DynamoDB as the database.
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. |
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. |
Returns:
A promise that resolves when the type is successfully deleted.
- Type
- Promise
describe() → {Promise.<Object>}
Returns the description of the table.
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. |
Returns:
A promise that resolves to the retrieved type.
- Type
- Promise.<Type>
getDomains() → {Array}
Retrieves the domains from the database.
Returns:
An array of domains.
- Type
- Array
getGroups() → {Array}
Retrieves the groups from the database.
Returns:
An array of groups.
- Type
- Array
getModules() → {Array}
Retrieves the modules from the database.
Returns:
An array of modules.
- Type
- Array
getPurpose() → {Array}
Retrieves the purposes from the database.
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. |
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. |
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. |
Returns:
A promise that resolves with the query results.
- Type
- Promise