Class: PKM

PKM(key, user_name, client, configopt)

Persistent Knowledge Monitor User's session

Constructor

new PKM(key, user_name, client, configopt)

Constructor
Parameters:
Name Type Attributes Description
key string a key
user_name string user's name
client Client connected client instance
config PkmConfig <optional>
a Configuration (optional)
Source:

Methods

(static) access(key, configopt) → {Promise.<PKM>}

Access
Parameters:
Name Type Attributes Description
key string a key (valid or invalid)
config PkmConfig <optional>
a Configuration (optional)
Source:
Returns:
a promise
Type
Promise.<PKM>

(static) finalize(superuser_name, superuser_auth_db, superuser_password, configopt) → {Promise}

Finalize
Parameters:
Name Type Attributes Description
superuser_name string MongoDB "superuser" that can create a "root"
superuser_auth_db string superuser authentication database
superuser_password string superuser password
config PkmConfig <optional>
a Configuration (optional)
Source:
Returns:
a promise
Type
Promise

(static) fix_document(document, collection_name) → {Object}

Fix document
Parameters:
Name Type Description
document Object document
collection_name string collection name
Source:
Returns:
fixed document
Type
Object

(static) from(pkm) → {PKM}

Duplicate PKM user's session
Parameters:
Name Type Description
pkm PKM an instance of class PKM
Source:
Returns:
a new instance of class PKM
Type
PKM

(static) get_collection_info()

Get predefined collection info
Source:
Returns:
Array.

(static) get_collection_names()

Get predefined collection names
Source:
Returns:
Array.

(static) get_document_validator(schema_path) → {function}

Get document validator
Parameters:
Name Type Description
schema_path string path of schema file
Source:
Returns:
a validator
Type
function

(static) get_dummy_document_validator() → {function}

Get dummy document validator
Source:
Returns:
a validator
Type
function

(static) get_file_collection_names()

Get predefined file collection names
Source:
Returns:
Array.

(static) get_role_names()

Get predefined role names
Source:
Returns:
Array.

(static) get_shared_data_path(filename) → {string}

Get Shared data path
Parameters:
Name Type Description
filename string filename
Source:
Returns:
absolute path of shared data
Type
string

(static) get_type_key(collection_name) → {string}

Get type attribute key of a document according to the collection
Parameters:
Name Type Description
collection_name string collection name
Source:
Returns:
a type key value
Type
string

(static) get_type_value(collection_name) → {string}

Get type attribute value of a document according to the collection
Parameters:
Name Type Description
collection_name string collection name
Source:
Returns:
a type attribute value
Type
string

(static) initialize(superuser_name, superuser_auth_db, superuser_password, pkm_admin_user, configopt) → {Promise}

Initialize
Parameters:
Name Type Attributes Description
superuser_name string MongoDB "superuser" that can create a "root"
superuser_auth_db string superuser authentication database
superuser_password string superuser password
pkm_admin_user User PKM administrator user
config PkmConfig <optional>
a Configuration (optional)
Source:
Returns:
a promise
Type
Promise

(static) load_global_config() → {PkmConfig}

Load global PKM configuration. Global PKM configuration can be overriden using File 'pkm_config.json'.
Source:
Returns:
configuration
Type
PkmConfig

(static) login(user_name, user_password, config) → {Promise.<PKM>}

Login
Parameters:
Name Type Description
user_name string User name
user_password string User password
config PkmConfig a Configuration
Source:
Returns:
a promise
Type
Promise.<PKM>

(static) logout(key, configopt) → {Promise}

Logout
Parameters:
Name Type Attributes Description
key string a key (valid or invalid)
config PkmConfig <optional>
a Configuration (optional)
Source:
Returns:
a promise
Type
Promise

acquire()

Acquire a PKM instance
Source:

close()

Close a PKM instance
Source:

count_documents(dbName, collection_name, queryopt, optionsopt) → {Promise}

Count documents in a generic manner of a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

count_documents_spanned(dbName, collection_names, queryopt, optionsopt) → {Promise}

Count documents in a generic manner from several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

create_all_collections(dbName) → {Promise}

Create all collections
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

create_all_roles(dbName) → {Promise}

Create all predefined roles
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

create_collection(dbName, collection_name, collection_infoopt) → {Promise}

Create collection
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
collection_info Object <optional>
collection info
Source:
Returns:
a promise
Type
Promise

create_db(dbName) → {Promise}

Create a database
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

create_project(project) → {Promise}

Create a project
Parameters:
Name Type Description
project PkmProject project
Source:
Returns:
a promise
Type
Promise

create_update_project(project, update) → {Promise}

Create a project
Parameters:
Name Type Description
project PkmProject project
update boolean flag to enable/disable updating an existing project
Source:
Returns:
a promise
Type
Promise

create_update_user(user, update) → {Promise}

Create/Update user
Parameters:
Name Type Description
user User user
update boolean flag to enable/disable updating user's info
Source:
Returns:
a promise
Type
Promise

create_user(user) → {Promise}

Create user
Parameters:
Name Type Description
user User user
Source:
Returns:
a promise
Type
Promise

delete_annotations(dbName, query) → {Promise}

Delete Annotations
Parameters:
Name Type Description
dbName string Database name
query Object query
Source:
Returns:
a promise
Type
Promise

delete_any_files(dbName, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get any files in a generic manner from a database
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

delete_c_annotations(dbName, queryopt) → {Promise}

Delete C Annotations
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_c_comments(dbName, queryopt) → {Promise}

Delete C Comments
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_c_source_codes(dbName, queryopt) → {Promise}

Delete C source codes
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_compile_commands(dbName, queryopt) → {Promise.<Array.<Object>>}

Delete compile commands documents from a database
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

delete_cpp_annotations(dbName, queryopt) → {Promise}

Delete C++ Annotations
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_cpp_comments(dbName, queryopt) → {Promise}

Delete C++ Comments
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_cpp_source_codes(dbName, queryopt) → {Promise}

Delete C++ source codes
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_cves(dbName, queryopt) → {Promise}

Delete CVE Documents
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_doc_files(dbName, queryopt) → {Promise}

Delete Documentation files
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_docs(dbName, queryopt) → {Promise}

Delete Documentation documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_documents(dbName, collection_name, queryopt) → {Promise}

Delete some documents in a generic manner from a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_documents_spanned(dbName, collection_names, queryopt, optionsopt) → {Promise}

Delete some documents in a generic manner from several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

delete_executable_binary_files(dbName, queryopt) → {Promise}

Delete Executable Binary files
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_files(dbName, collection_name, queryopt) → {Promise}

Delete files in a generic manner in a collection of a database, together with documents on other collections which originate from these files
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_files_spanned(dbName, collection_names, queryopt) → {Promise}

Delete files in a generic manner in several collections of a database, together with documents on other collections which originate from these files
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_git_files(dbName, git_working_tree_directory, queryopt) → {Promise.<Array.<File>>}

Delete files from a Git working tree
Parameters:
Name Type Attributes Description
dbName string database name
git_working_tree_directory string Directory of Git working tree
query GetGitFilesQuery <optional>
query
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

delete_git_working_trees(dbName, queryopt) → {Promise}

Delete Git Working Trees together with Git working trees while optionally leaving intact Files in PKM.
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_graphical_docs(dbName, queryopt) → {Promise}

Delete Graphical documentation documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_invocations(dbName, queryopt) → {Promise}

Delete Invocation documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_java_annotations(dbName, queryopt) → {Promise}

Delete Java Annotations
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_java_comments(dbName, queryopt) → {Promise}

Delete Java Comments
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_java_source_codes(dbName, queryopt) → {Promise}

Delete Java source codes
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_logs(dbName, queryopt) → {Promise}

Delete Log Documents
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_methodology_status(dbName, queryopt) → {Promise}

Delete Methodoloy status of a database
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_project(project_name) → {Promise}

Delete a project
Parameters:
Name Type Description
project_name string project name
Source:
Returns:
a promise
Type
Promise

delete_reviews(dbName, queryopt) → {Promise}

Delete reviews of a database
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_source_code_annotations(dbName, queryopt) → {Promise}

Delete Source Code Annotations
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_source_code_comments(dbName, queryopt) → {Promise}

Delete Source Code Comments
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_source_codes(dbName, queryopt) → {Promise}

Delete Source Codes
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_source_files(dbName, queryopt) → {Promise}

Delete source files
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_testar_settings(dbName) → {Promise}

Delete TESTAR settings of a database
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

delete_testar_state_models(dbName, queryopt) → {Promise}

Delete TESTAR State Model JSON Document using unique artefactId
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_testar_test_results(dbName, queryopt) → {Promise}

Delete TESTAR Test Results JSON Document using unique artefactId
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_tools(dbName, queryopt) → {Promise}

Delete Tool documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_traceability_matrix(dbName, queryopt) → {Promise}

Delete Traceability Matrix Document using unique artefactId
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_uml_class_diagrams(dbName, queryopt) → {Promise}

Delete UML Class Diagrams
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_uml_files(dbName, queryopt) → {Promise}

Delete UML files
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

delete_uml_state_machines(dbName, queryopt) → {Promise}

Delete UML State Machines
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
Source:
Returns:
a promise
Type
Promise

dispatch_file(file) → {string}

Dispatch a file based on MIME type, filename suffix and magic number
Parameters:
Name Type Description
file File a file look-alike
Source:
Returns:
collection name
Type
string

drop_all_collections(dbName) → {Promise}

Drop all collections
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

drop_all_roles(dbName) → {Promise}

Drop all roles
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

drop_all_users() → {Promise}

Drop all users
Source:
Returns:
a promise
Type
Promise

drop_collection(dbName, collection_name) → {Promise}

Drop collection
Parameters:
Name Type Description
dbName string database name
collection_name string collection name
Source:
Returns:
a promise
Type
Promise

drop_db(dbName) → {Promise}

Drop database
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise

drop_role(dbName, role_name) → {Promise}

Drop role
Parameters:
Name Type Description
dbName string database name
role_name string role name
Source:
Returns:
a promise
Type
Promise

drop_user(user_name) → {Promise}

Drop user
Parameters:
Name Type Description
user_name string user name
Source:
Returns:
a promise
Type
Promise

Error(err) → {PKM_Error}

Create an instance of PKM_Error from a foreign error or a bare string, and log the error
Parameters:
Name Type Description
err Object | string an error
Source:
Returns:
a PKM_Error instance
Type
PKM_Error

find_in_c_source(dbName, kind, query_valueopt) → {Promise.<Array.<Object>>}

find in source
Parameters:
Name Type Attributes Description
dbName string database name
kind string either 'function', 'variable', 'type', 'filename', 'dir'
query_value string <optional>
query value (optional)
Source:
Returns:
a promise that passes the result (an array) to resolve callback
Type
Promise.<Array.<Object>>

find_in_cpp_class(dbName, className, kind) → {Promise.<Array.<Object>>}

find methods or fields in C++ class
Parameters:
Name Type Description
dbName string database name
className string class name
kind string either 'field' or 'method'
Source:
Returns:
a promise that passes the result (an array) to resolve callback
Type
Promise.<Array.<Object>>

find_in_cpp_source(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

find artefacts in C++ source
Parameters:
Name Type Attributes Description
dbName string database name
query object <optional>
query { kind : ('string'|'/regex/'), path : ('string'|'/regex/'), id : number, name : ('string'|'/regex/') })
options object <optional>
options
Source:
Returns:
a promise that passes the result (an array) to resolve callback
Type
Promise.<Array.<Object>>

find_in_doc(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Find in Documentation
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

find_in_java_class(dbName, className, kind, value) → {Promise.<Array.<Object>>}

find in Java class
Parameters:
Name Type Description
dbName string database name
className string class name
kind string either 'field' or 'method'
value string either a field or method name [optional]
Source:
Returns:
a promise that passes the result (an array) to resolve callback
Type
Promise.<Array.<Object>>

find_in_java_source(dbName, kind) → {Promise.<Array.<Object>>}

find in Java source
Parameters:
Name Type Description
dbName string database name
kind string should be 'class'
Source:
Returns:
a promise that passes the result (an array) to resolve callback
Type
Promise.<Array.<Object>>

find_in_uml_class_diagrams(dbName, className, kind, varName, varType) → {Promise.<Array.<Object>>}

find in UML class diagrams
Parameters:
Name Type Description
dbName string database name
className string class name
kind string it is either 'operations', 'attributes', or null
varName string when kind is null, it is either an operation or attribute name
varType string when kind is null, it is either 'parameters', 'returnType' or 'attributeType'
Source:
Returns:
a promise that passes the result (an array) to resolve callback
Type
Promise.<Array.<Object>>

fix_document(document, collection_name) → {Object}

Fix document
Parameters:
Name Type Description
document Object document
collection_name string collection name
Source:
Returns:
fixed document
Type
Object

fix_file(a) → {File}

Fix some attributes (type and mime_type) of a file
Parameters:
Name Type Description
a File file (an instance of class File)
Source:
Returns:
the fixed file
Type
File

get_annotations(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Annotations
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_any_files(dbName, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get any files in a generic manner from a database
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_c_annotations(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get C Annotations
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_c_comments(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get C Comments
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_c_source_codes(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get C source codes
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_collection(dbName, collection_name, optionsopt) → {Promise.<Object>}

Get a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
options GetCollectionOptions <optional>
options
Source:
Returns:
a promise
Type
Promise.<Object>

get_collection_info()

Get predefined collection info
Source:
Returns:
Array.

get_collection_names()

Get predefined collection names of PKM instance
Source:
Returns:
Array.

get_compile_commands(dbName, queryopt, optionsopt) → {Promise.<Array.<CompileCommand>>}

Get compile commands documents from a database
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<CompileCommand>>

get_cpp_annotations(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get C++ Annotations
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_cpp_comments(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get C++ Comments
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_cpp_source_codes(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get C++ source codes
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_current_user() → {Promise.<User>}

Get current user
Source:
Returns:
a promise
Type
Promise.<User>

get_cves(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get CVE Documents
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_doc_files(dbName, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get Documentation files
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_docs(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Documentation documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_documents(dbName, collection_name, queryopt, optionsopt) → {Promise.<Array.<Object>>|Promise.<GetDocumentsCountMatchesResult>}

Get Documents in a generic manner from a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>> | Promise.<GetDocumentsCountMatchesResult>

get_documents_spanned(dbName, collection_names, queryopt, optionsopt) → {Promise}

Get documents in a generic manner from several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

get_executable_binary_files(dbName, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get Executable Binary files
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_file_collection_names()

Get predefined file collection names of PKM instance
Source:
Returns:
Array.

get_files(dbName, collection_name, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get files in a generic manner from a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_files_spanned(dbName, collection_names, queryopt, optionsopt) → {Promise}

Get files in a generic manner from several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

get_git_config(project_name, git_working_tree_directory) → {Promise.<string>}

Get the Git configuration file of the Git directory associated (usually .git/config) to a Git working tree
Parameters:
Name Type Description
project_name string project name
git_working_tree_directory string Directory of Git working tree
Source:
Returns:
a promise
Type
Promise.<string>

get_git_file_system(project_name, options) → {FileSystem}

Get Git file system of a project
Parameters:
Name Type Description
project_name string project name
options GetGitFileSystemOptions options
Source:
Returns:
the Git file system for the project
Type
FileSystem

get_git_files(dbName, git_working_tree_directory, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get files from a Git working tree
Parameters:
Name Type Attributes Description
dbName string database name
git_working_tree_directory string Directory of Git working tree
query GetGitFilesQuery <optional>
query
options GetGitFilesOptions <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_git_working_tree_file_system(project_name, options) → {FileSystem}

Get Git working tree file system of a project
Parameters:
Name Type Description
project_name string project name
options GetGitWorkingTreeFileSystemOptions options
Source:
Returns:
the Git file system for the project
Type
FileSystem

get_git_working_trees(dbName, queryopt, optionsopt) → {Promise.<Array.<GitWorkingTree>>}

Get Git Working Trees
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<GitWorkingTree>>

get_graphical_docs(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Graphical documentation documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_invocations(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Invocation documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_java_annotations(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Java Annotations
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_java_comments(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Java Comments
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_java_source_codes(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Java source codes
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_logs(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Log Documents
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_methodology_status(dbName, queryopt, optionsopt) → {Promise.<Object>}

Get Methodology status Documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Object>

get_project(project_name, optionsopt) → {Promise.<PkmProject>}

Get a project
Parameters:
Name Type Attributes Description
project_name string project name
options GetProjectOptions <optional>
options
Source:
Returns:
a promise
Type
Promise.<PkmProject>

get_projects(optionsopt) → {Promise.<Array.<PkmProject>>}

Get projects
Parameters:
Name Type Attributes Description
options GetProjectsOptions <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<PkmProject>>

get_reviews(dbName, queryopt, optionsopt) → {Promise.<Object>}

Get review Documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Object>

get_role_names()

Get predefined role names of PKM instance
Source:
Returns:
Array.

get_shared_data_path(filename) → {string}

Get Shared data path
Parameters:
Name Type Description
filename string filename
Source:
Returns:
absolute path of shared data
Type
string

get_source_code_annotations(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get all source codes
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_source_code_comments(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get all source codes
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_source_codes(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get all source codes
Parameters:
Name Type Attributes Description
dbName string Database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_source_files(dbName, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get source files
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_testar_settings(dbName) → {Promise.<Object>}

Get TESTAR settings Document
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise.<Object>

get_testar_state_models(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get one or all TESTAR State Model JSON Documents
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_testar_test_results(dbName, artefactIdopt, optionsopt) → {Promise.<Array.<Object>>}

Get all TESTAR Test Results JSON Documents or one TESTAR Test Results JSON Document using unique artefactId
Parameters:
Name Type Attributes Description
dbName string database name
artefactId string <optional>
unique document identifier
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_tools(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Tool documents
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_traceability_matrix(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get Traceability Matrix Documents
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_uml_class_diagrams(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get UML Class Diagrams
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_uml_files(dbName, queryopt, optionsopt) → {Promise.<Array.<File>>}

Get UML files
Parameters:
Name Type Attributes Description
dbName string database name
query string <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

get_uml_state_machines(dbName, queryopt, optionsopt) → {Promise.<Array.<Object>>}

Get UML state machines
Parameters:
Name Type Attributes Description
dbName string database name
query Object <optional>
query
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

get_user(user_name) → {Promise.<User>}

Get user
Parameters:
Name Type Description
user_name string user name
Source:
Returns:
a promise
Type
Promise.<User>

get_user_projects(user, optionsopt) → {Promise.<Array.<PkmProject>>}

Get user's projects
Parameters:
Name Type Attributes Description
user PkmUser a user
options GetUserProjectsOptions <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<PkmProject>>

get_user_roles(dbName) → {Promise.<Array.<UserRole>>}

Get roles
Parameters:
Name Type Description
dbName string database name
Source:
Returns:
a promise
Type
Promise.<Array.<UserRole>>

get_users(dbNameopt) → {Promise.<Array.<User>>}

Get all PKM users or the PKM users that have a role in a database
Parameters:
Name Type Attributes Description
dbName string <optional>
a database name
Source:
Returns:
a promise
Type
Promise.<Array.<User>>

grant_pkm_management_roles(user) → {User}

Grant the PKM management roles to a user. This function restores PKM management roles that are internal to the implementation. The returned user instance is ready for creating/updating user in the PKM management database.
Parameters:
Name Type Description
user User a user
Source:
Returns:
a user ready for creating/updating in the PKM management database
Type
User

guess_file_attribute(file, attribute) → {string}

Guess file attribute (type, MIME type, collection) based on MIME type, filename suffix and magic number
Parameters:
Name Type Description
file File a file look-alike (either an instance of class File or a file from the database)
attribute string attribute to guess (either mime_type, type or collection)
Source:
Returns:
the guessed attribute
Type
string

has_postprocess_c_annotations(dbName, optionsopt) → {boolean}

Test if C Annotations postprocessing would change the document count
Parameters:
Name Type Attributes Description
dbName string Database name
options Object <optional>
options
Source:
Returns:
test result
Type
boolean

has_postprocess_c_comments(dbName, optionsopt) → {boolean}

Test if C Comments postprocessing would change the document count
Parameters:
Name Type Attributes Description
dbName string Database name
options Object <optional>
options
Source:
Returns:
test result
Type
boolean

has_postprocess_c_source_codes(dbName, optionsopt) → {boolean}

Test if C Source Codes postprocessing would change the document count
Parameters:
Name Type Attributes Description
dbName string Database name
options Object <optional>
options
Source:
Returns:
test result
Type
boolean

has_postprocess_cpp_annotations(dbName, optionsopt) → {boolean}

Test if C Annotations postprocessing would change the document count
Parameters:
Name Type Attributes Description
dbName string Database name
options Object <optional>
options
Source:
Returns:
test result
Type
boolean

has_postprocess_cpp_comments(dbName, optionsopt) → {boolean}

Test if C++ Comments postprocessing would change the document count
Parameters:
Name Type Attributes Description
dbName string Database name
options Object <optional>
options
Source:
Returns:
test result
Type
boolean

has_postprocess_cpp_source_codes(dbName, optionsopt) → {boolean}

Test if C++ Source Codes postprocessing would change the document count
Parameters:
Name Type Attributes Description
dbName string Database name
options Object <optional>
options
Source:
Returns:
test result
Type
boolean

insert_annotations(dbName, annotations) → {Promise}

Insert Annotations
Parameters:
Name Type Description
dbName string Database name
annotations Array.<Object> Annotations
Source:
Returns:
a promise
Type
Promise

insert_any_files(dbName, files, options) → {Promise}

Insert any files in a generic manner into a database
Parameters:
Name Type Description
dbName string database name
files Array.<File> files
options Object options
Source:
Returns:
a promise
Type
Promise

insert_compile_commands(dbName, documents) → {Promise}

Insert compile commands documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<CompileCommand> documents
Source:
Returns:
a promise
Type
Promise

insert_cves(dbName, cve_documents) → {Promise}

Insert some CVE documents into a database
Parameters:
Name Type Description
dbName string database name
cve_documents Array.<Object> CVE documents
Source:
Returns:
a promise
Type
Promise

insert_doc_files(dbName, doc_files) → {Promise}

Insert Documentation files
Parameters:
Name Type Description
dbName string database name
doc_files Array.<File> Documentation files
Source:
Returns:
a promise
Type
Promise

insert_docs(dbName, doc_documents) → {Promise}

Insert Documentation documents
Parameters:
Name Type Description
dbName string database name
doc_documents Array.<Object> Documentation documents
Source:
Returns:
a promise
Type
Promise

insert_documents(dbName, collection_name, documents, optionsopt) → {Promise.<Array.<string>>}

Insert/Update some documents in a generic manner into a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
documents Array.<Object> documents
options InsertUpdateDocumentsOptions <optional>
options
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_documents_spanned(dbName, collection_names, documents, dispatch, signatureopt) → {Promise.<Array.<string>>}

Insert some documents in a generic manner into several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
documents Array.<Object> documents
dispatch function a function (document) => collection_name to dispatch documents to collections that shall throw when dispatching is not possible
signature Object <optional>
signature (properties in the signature are the document keys). When unspecified each document is unique whereas when an empty object {}, the collection holds only a singleton document.
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_executable_binary_files(dbName, executable_binary_files) → {Promise}

Insert Executable Binary files
Parameters:
Name Type Description
dbName string database name
executable_binary_files Array.<File> Executable Binary files
Source:
Returns:
a promise
Type
Promise

insert_git_files(dbName, git_working_tree_directory, files) → {Promise.<Array.<File>>}

Insert files into a Git working tree
Parameters:
Name Type Description
dbName string database name
git_working_tree_directory string Directory of Git working tree
files Array.<File> files
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

insert_git_working_trees(dbName, git_working_tree_documents) → {Promise}

Insert Git Working Tree documents
Parameters:
Name Type Description
dbName string database name
git_working_tree_documents Array.<Object> Git Working Tree documents
Source:
Returns:
a promise
Type
Promise

insert_graphical_docs(dbName, graphical_doc_documents) → {Promise}

Insert Graphical documentation documents
Parameters:
Name Type Description
dbName string database name
graphical_doc_documents Array.<Object> Documentation documents
Source:
Returns:
a promise
Type
Promise

insert_invocations(dbName, invocation_documents) → {Promise}

Insert Invocation documents
Parameters:
Name Type Description
dbName string database name
invocation_documents Array.<Object> Invocation documents
Source:
Returns:
a promise
Type
Promise

insert_java_annotations(dbName, java_annotations_documents) → {Promise}

Insert Java Annotations
Parameters:
Name Type Description
dbName string Database name
java_annotations_documents Array.<Object> Java annotations documents following schema from openJML-schema.json
Source:
Returns:
a promise
Type
Promise

insert_java_comments(dbName, java_comments_documents) → {Promise}

Insert Java Comments
Parameters:
Name Type Description
dbName string Database name
java_comments_documents Array.<Object> Java Comments documents following schema from openJML-schema.json
Source:
Returns:
a promise
Type
Promise

insert_java_source_code(dbName, documents) → {Promise}

Insert some Java source code documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<Object> documents
Source:
Returns:
a promise
Type
Promise

insert_logs(dbName, log_documents) → {Promise.<Array.<string>>}

Insert some Log documents into a database
Parameters:
Name Type Description
dbName string database name
log_documents Array.<Object> Log documents
Source:
Returns:
a promise
Type
Promise.<Array.<string>>

insert_methodology_status(dbName, methodology_status_documents) → {Promise}

Insert Methodology status documents into a database
Parameters:
Name Type Description
dbName string database name
methodology_status_documents Array.<Object> Methodology status documents
Source:
Returns:
a promise
Type
Promise

insert_reviews(dbName, review_documents) → {Promise.<Array.<string>>}

Insert review documents into a database
Parameters:
Name Type Description
dbName string database name
review_documents Array.<Object> Review documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_source_files(dbName, source_files) → {Promise}

Insert source files
Parameters:
Name Type Description
dbName string database name
source_files Array.<File> source files
Source:
Returns:
a promise
Type
Promise

insert_testar_settings(dbName, testar_settings_document) → {Promise}

Insert TESTAR settings into a database
Parameters:
Name Type Description
dbName string database name
testar_settings_document Object TESTAR settings document
Source:
Returns:
a promise
Type
Promise

insert_testar_state_models(dbName, testar_state_model_documents) → {Promise}

Insert testar state models into a database
Parameters:
Name Type Description
dbName string database name
testar_state_model_documents Array.<Object> TESTAR state model documents
Source:
Returns:
a promise
Type
Promise

insert_testar_test_results(dbName, testar_test_results_documents) → {Promise}

Insert testar test results
Parameters:
Name Type Description
dbName string database name
testar_test_results_documents Array.<Object> TESTAR test results documents
Source:
Returns:
a promise
Type
Promise

insert_tools(dbName, tool_documents) → {Promise}

Insert Tool documents
Parameters:
Name Type Description
dbName string database name
tool_documents Array.<Object> Tool documents
Source:
Returns:
a promise
Type
Promise

insert_traceability_matrix(dbName, documents) → {Promise.<Array.<string>>}

Insert some Tracability Matrix documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<Object> documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_uml_class_diagrams(dbName, uml_class_diagram_documents) → {Promise}

Insert UML Class Diagrams
Parameters:
Name Type Description
dbName string database name
uml_class_diagram_documents Array.<Object> UML class diagram documents
Source:
Returns:
a promise
Type
Promise

insert_uml_files(dbName, uml_files) → {Promise}

Insert UML files
Parameters:
Name Type Description
dbName string database name
uml_files Array.<File> UML files
Source:
Returns:
a promise
Type
Promise

insert_uml_state_machines(dbName, uml_state_machine_documents) → {Promise}

Insert UML State Machines
Parameters:
Name Type Description
dbName string database name
uml_state_machine_documents Array.<Object> UML state machine documents
Source:
Returns:
a promise
Type
Promise

insert_update_any_files(dbName, files, update, options) → {Promise}

Insert/Update any files in a generic manner into a database
Parameters:
Name Type Description
dbName string database name
files Array.<File> files
update boolean flag to enable/disable replacing files
options Object options
Source:
Returns:
a promise
Type
Promise

insert_update_cves(dbName, cve_documents, update) → {Promise}

Insert/Update some CVE documents into a database
Parameters:
Name Type Description
dbName string database name
cve_documents Array.<Object> CVE documents
update boolean flag to enable/disable replacing CVE documents
Source:
Returns:
a promise
Type
Promise

insert_update_doc_files(dbName, doc_files, update) → {Promise}

Insert/Update Documentation files
Parameters:
Name Type Description
dbName string database name
doc_files Array.<File> Documentation files
update boolean flag to enable/disable replacing Documentation files
Source:
Returns:
a promise
Type
Promise

insert_update_docs(dbName, doc_documents, update) → {Promise.<Array.<string>>}

Insert/Update Documentation documents
Parameters:
Name Type Description
dbName string database name
doc_documents Array.<Object> Documentation documents
update boolean flag to enable/disable replacing Documentation documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_update_documents(dbName, collection_name, documents, update, optionsopt) → {Promise.<Array.<string>>}

Insert/Update some documents in a generic manner into a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
documents Array.<Object> documents
update boolean flag to enable/disable replacing documents when signature is specified, otherwise ignored
options InsertUpdateDocumentsOptions <optional>
options
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_update_documents_spanned(dbName, collection_names, documents, update, dispatch, signature) → {Promise}

Insert/Update some documents in a generic manner into several collections of a database
Parameters:
Name Type Description
dbName string database name
collection_names Array.<string> collection names
documents Array.<Object> documents
update boolean flag to enable/disable replacing documents when signature is specified, otherwise ignored
dispatch function a function (document) => collection_name to dispatch documents to collections that shall throw when dispatching is not possible
signature Object signature (properties in the signature are the document keys).
Source:
Returns:
a promise
Type
Promise

insert_update_executable_binary_files(dbName, executable_binary_files, update) → {Promise}

Insert/Update Executable Binary files
Parameters:
Name Type Description
dbName string database name
executable_binary_files Array.<File> Executable Binary files
update boolean flag to enable/disable replacing Executable Binary files
Source:
Returns:
a promise
Type
Promise

insert_update_files(dbName, collection_name, files, update, optionsopt) → {Promise}

Insert/Update files in a generic manner in a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
files Array.<File> files
update boolean flag to enable/disable replacing files
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

insert_update_files_spanned(dbName, collection_names, files, update, dispatch, optionsopt) → {Promise}

Insert/Update files in a generic manner into several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
files Array.<File> files
update boolean flag to enable/disable replacing files
dispatch function a function (file) => collection_name to dispatch files to collections that shall throw when dispatching is not possible
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

insert_update_git_files(dbName, git_working_tree_directory, files, update) → {Promise.<Array.<File>>}

Insert/Update files into a Git working tree
Parameters:
Name Type Description
dbName string database name
git_working_tree_directory string Directory of Git working tree
files Array.<File> files
update boolean flag to enable/disable replacing files
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

insert_update_git_working_trees(dbName, git_working_trees_documents, update) → {Promise}

Insert/Update Git Working Tree documents
Parameters:
Name Type Description
dbName string database name
git_working_trees_documents Array.<Object> Git Working Tree documents
update boolean flag to enable/disable replacing Git Working Tree documents
Source:
Returns:
a promise
Type
Promise

insert_update_graphical_docs(dbName, doc_documents, update) → {Promise.<Array.<string>>}

Insert/Update Graphical documentation documents
Parameters:
Name Type Description
dbName string database name
doc_documents Array.<Object> Documentation documents
update boolean flag to enable/disable replacing Graphical documentation documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_update_invocations(dbName, invocation_documents, update) → {Promise}

Insert/Update Invocation documents
Parameters:
Name Type Description
dbName string database name
invocation_documents Array.<Object> Invocation documents
update boolean flag to enable/disable replacing Invocation documents
Source:
Returns:
a promise
Type
Promise

insert_update_java_annotations(dbName, java_annotations_documents, update) → {Promise}

Insert/Update Java Annotations
Parameters:
Name Type Description
dbName string Database name
java_annotations_documents Array.<Object> Java annotations documents following schema from openJML-schema.json
update boolean flag to enable/disable replacing Java Annotation documents
Source:
Returns:
a promise
Type
Promise

insert_update_java_comments(dbName, java_comments_documents, update) → {Promise}

Insert/Update Java Annotations
Parameters:
Name Type Description
dbName string Database name
java_comments_documents Array.<Object> Java comments documents
update boolean flag to enable/disable replacing Java comments documents
Source:
Returns:
a promise
Type
Promise

insert_update_java_source_code(dbName, documents, update) → {Promise}

Insert/Update some Java source code documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<Object> documents
update boolean flag to enable/disable replacing Java Source Code documents
Source:
Returns:
a promise
Type
Promise

insert_update_logs(dbName, log_documents, update) → {Promise.<Array.<string>>}

Insert/Update some Log documents into a database
Parameters:
Name Type Description
dbName string database name
log_documents Array.<Object> Log documents
update boolean flag to enable/disable replacing Log documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_update_methodology_status(dbName, methodology_status_documents, update) → {Promise}

Insert/Update Methodology status documents into a database
Parameters:
Name Type Description
dbName string database name
methodology_status_documents Array.<Object> Methodology status documents
update boolean flag to enable/disable replacing Methodology status document
Source:
Returns:
a promise
Type
Promise

insert_update_reviews(dbName, review_documents, update) → {Promise.<Array.<string>>}

Insert/Update review documents into a database
Parameters:
Name Type Description
dbName string database name
review_documents Array.<Object> Review documents
update boolean flag to enable/disable replacing Review documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_update_source_files(dbName, source_files, update) → {Promise}

Insert/Update source files
Parameters:
Name Type Description
dbName string database name
source_files Array.<File> source files
update boolean flag to enable/disable replacing source code files
Source:
Returns:
a promise
Type
Promise

insert_update_testar_settings(dbName, testar_settings_document, update) → {Promise}

Insert/Update TESTAR settings into a database
Parameters:
Name Type Description
dbName string database name
testar_settings_document Object TESTAR settings document
update boolean flag to enable/disable replacing TESTAR settings document
Source:
Returns:
a promise
Type
Promise

insert_update_tools(dbName, tool_documents, update) → {Promise}

Insert/Update Tool documents
Parameters:
Name Type Description
dbName string database name
tool_documents Array.<Object> Tool documents
update boolean flag to enable/disable replacing Tool documents
Source:
Returns:
a promise
Type
Promise

insert_update_traceability_matrix(dbName, documents, update) → {Promise.<Array.<string>>}

Insert/Update some Tracability Matrix documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<Object> documents
update boolean flag to enable/disable replacing Tracability Matrix documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

insert_update_uml_class_diagrams(dbName, uml_class_diagram_documents, update) → {Promise}

Insert/Update UML class diagrams
Parameters:
Name Type Description
dbName string database name
uml_class_diagram_documents Array.<Object> UML class diagram documents
update boolean flag to enable/disable replacing UML class diagrams
Source:
Returns:
a promise
Type
Promise

insert_update_uml_files(dbName, uml_files, update) → {Promise}

Insert/Update UML files
Parameters:
Name Type Description
dbName string database name
uml_files Array.<File> UML files
update boolean flag to enable/disable replacing UML files
Source:
Returns:
a promise
Type
Promise

insert_update_uml_state_machines(dbName, uml_state_machine_documents, update) → {Promise}

Insert/Update UML state machines
Parameters:
Name Type Description
dbName string database name
uml_state_machine_documents Array.<Object> UML state machine documents
update boolean flag to enable/disable replacing UML state machine documents
Source:
Returns:
a promise
Type
Promise

invalidate_dependent_documents(dbName, identifiers) → {Promise}

Invalidate dependent documents that originated from other documents such as files
Parameters:
Name Type Description
dbName string database name
identifiers Array.<string> identifiers (id or filenames)
Source:
Returns:
a promise
Type
Promise

keep_alive_until_session_timeout()

Keep alive PKM instance until session timeout
Source:

postprocess_c_annotations(dbName, c_annotations_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess C Annotations
Parameters:
Name Type Attributes Description
dbName string Database name
c_annotations_documents Array.<Object> C annotation documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_c_comments(dbName, c_comments_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess C Comments
Parameters:
Name Type Attributes Description
dbName string Database name
c_comments_documents Array.<Object> C comment documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_c_source_codes(dbName, c_source_code_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess C Source Codes
Parameters:
Name Type Attributes Description
dbName string Database name
c_source_code_documents Array.<Object> C source code documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_cpp_annotations(dbName, cpp_annotations_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess C++ Annotations
Parameters:
Name Type Attributes Description
dbName string Database name
cpp_annotations_documents Array.<Object> C++ annotation documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_cpp_comments(dbName, cpp_comments_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess C++ Comments
Parameters:
Name Type Attributes Description
dbName string Database name
cpp_comments_documents Array.<Object> C++ comment documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_cpp_source_codes(dbName, cpp_source_code_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess C++ Source Codes
Parameters:
Name Type Attributes Description
dbName string Database name
cpp_source_code_documents Array.<Object> C source code documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_files(dbName, file_chunk_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess Files. Merge file chunk documents into file documents.
Parameters:
Name Type Attributes Description
dbName string Database name
file_chunk_documents Array.<Object> File chunk documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

postprocess_logs(dbName, log_chunk_documents, optionsopt) → {Promise.<Array.<Object>>}

Postprocess logs.
Parameters:
Name Type Attributes Description
dbName string Database name
log_chunk_documents Array.<Object> Log chunk documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

preprocess_c_annotations(c_annotations_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess C Annotations
Parameters:
Name Type Attributes Description
c_annotations_documents Array.<Object> C Annotations documents
options Object <optional>
options
Source:
Returns:
a promise which result is the preprocessed C Annotations documents
Type
Promise.<Array.<Object>>

preprocess_c_comments(c_comments_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess C Comments
Parameters:
Name Type Attributes Description
c_comments_documents Array.<Object> C Comments documents
options Object <optional>
options
Source:
Returns:
a promise which result is the preprocessed C Comments documents
Type
Promise.<Array.<Object>>

preprocess_c_source_codes(c_source_code_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess C Source Codes
Parameters:
Name Type Attributes Description
c_source_code_documents Array.<Object> C source code documents
options Object <optional>
options
Source:
Returns:
a promise which result is the preprocessed C source code documents
Type
Promise.<Array.<Object>>

preprocess_cpp_annotations(cpp_annotations_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess C++ Annotations
Parameters:
Name Type Attributes Description
cpp_annotations_documents Array.<Object> C Annotations documents
options Object <optional>
options
Source:
Returns:
a promise which result is the preprocessed C Annotations documents
Type
Promise.<Array.<Object>>

preprocess_cpp_comments(cpp_comments_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess C++ Comments
Parameters:
Name Type Attributes Description
cpp_comments_documents Array.<Object> C++ Comments documents
options Object <optional>
options
Source:
Returns:
a promise which result is the preprocessed C++ Comments documents
Type
Promise.<Array.<Object>>

preprocess_cpp_source_codes(cpp_source_code_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess C++ Source Codes
Parameters:
Name Type Attributes Description
cpp_source_code_documents Array.<Object> C++ source code documents
options Object <optional>
options
Source:
Returns:
a promise which result is the preprocessed C++ source code documents
Type
Promise.<Array.<Object>>

preprocess_files(file_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess File documents. Split file document into file chunk documents.
Parameters:
Name Type Attributes Description
file_documents Array.<Object> file documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

preprocess_logs(log_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess log documents
Parameters:
Name Type Attributes Description
log_documents Array.<Object> log documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

preprocess_reviews(review_documents, optionsopt) → {Promise.<Array.<Object>>}

Preprocess review documents
Parameters:
Name Type Attributes Description
review_documents Array.<Object> review documents
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise.<Array.<Object>>

release()

Release a PKM instance
Source:

revoke_pkm_management_roles(user) → {User}

Revoke the PKM management roles from a user. This function hides PKM management roles that are internal to the implementation.
Parameters:
Name Type Description
user User a user
Source:
Returns:
a user
Type
User

test_file_compatibility(file) → {boolean}

Test file compatibility with PKM based on MIME type, filename suffix and magic number
Parameters:
Name Type Description
file File a file look-alike
Source:
Returns:
test result
Type
boolean

update_annotations(dbName, annotations) → {Promise}

Update Annotations
Parameters:
Name Type Description
dbName string Database name
annotations Array.<Object> Annotations
Source:
Returns:
a promise
Type
Promise

update_any_files(dbName, files, options) → {Promise}

Update any files in a generic manner into a database
Parameters:
Name Type Description
dbName string database name
files Array.<File> files
options Object options
Source:
Returns:
a promise
Type
Promise

update_c_annotations(dbName, c_annotations_documents, optionsopt) → {Promise}

Update C annotations
Parameters:
Name Type Attributes Description
dbName string Database name
c_annotations_documents Array.<Object> C annotations documents following schema from pkm-c-acsl-schema-1.1.0.json
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

update_c_comments(dbName, c_comments_documents, optionsopt) → {Promise}

Update C comments
Parameters:
Name Type Attributes Description
dbName string Database name
c_comments_documents Array.<Object> C comments documents following schema from pkm-c-comments-schema-1.0.0.json
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

update_c_source_code(dbName, c_source_code_documents, optionsopt)

Update C source code
Parameters:
Name Type Attributes Description
dbName string Database name
c_source_code_documents Array.<Object> C source code documents following schema from pkm-c-source-code-schema-1.0.0.json
options Object <optional>
options
Source:
Returns:
Promise a promise

update_compile_commands(dbName, documents) → {Promise}

Update compile commands documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<CompileCommand> documents
Source:
Returns:
a promise
Type
Promise

update_cpp_annotations(dbName, cpp_annotations_documents, optionsopt) → {Promise}

Update C++ annotations
Parameters:
Name Type Attributes Description
dbName string Database name
cpp_annotations_documents Array.<Object> C++ annotations documents following schema from pkm-cpp-acsl-schema-1.1.0.json
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

update_cpp_comments(dbName, cpp_comments_documents, optionsopt) → {Promise}

Update C++ comments
Parameters:
Name Type Attributes Description
dbName string Database name
cpp_comments_documents Array.<Object> C++ comments documents following schema from pkm-cpp-comments-schema-1.0.0.json
options Object <optional>
options
Source:
Returns:
a promise
Type
Promise

update_cpp_source_code(dbName, cpp_source_code_documents, optionsopt)

Update C++ source code
Parameters:
Name Type Attributes Description
dbName string Database name
cpp_source_code_documents Array.<Object> C++ source code documents following schema from pkm-cpp-source-code-schema-1.0.0.json
options Object <optional>
options
Source:
Returns:
Promise a promise

update_cves(dbName, cve_documents, update) → {Promise}

Update some CVE documents into a database
Parameters:
Name Type Description
dbName string database name
cve_documents Array.<Object> CVE documents
update boolean flag to enable/disable replacing CVE documents
Source:
Returns:
a promise
Type
Promise

update_doc_files(dbName, doc_files) → {Promise}

update Documentation files
Parameters:
Name Type Description
dbName string database name
doc_files Array.<File> Documentation files
Source:
Returns:
a promise
Type
Promise

update_docs(dbName, doc_documents) → {Promise}

Update Documentation documents
Parameters:
Name Type Description
dbName string database name
doc_documents Array.<Object> Documentation documents
Source:
Returns:
a promise
Type
Promise

update_documents(dbName, collection_name, documents, optionsopt) → {Promise|Promise.<Array.<string>>}

Insert/Update some documents in a generic manner into a collection of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_name string collection name
documents Array.<Object> documents
options InsertUpdateDocumentsOptions <optional>
options
Source:
Returns:
a promise (when signature is undefined, resolve argument is an array of document unique IDs in the collection)
Type
Promise | Promise.<Array.<string>>

update_documents_spanned(dbName, collection_names, documents, dispatch, signatureopt) → {Promise}

Update some documents in a generic manner into several collections of a database
Parameters:
Name Type Attributes Description
dbName string database name
collection_names Array.<string> collection names
documents Array.<Object> documents
dispatch function a function (document) => collection_name to dispatch documents to collections that shall throw when dispatching is not possible
signature Object <optional>
signature (properties in the signature are the document keys). When unspecified each document is unique whereas when an empty object {}, the collection holds only a singleton document.
Source:
Returns:
a promise
Type
Promise

update_executable_binary_files(dbName, executable_binary_files) → {Promise}

update Executable Binary files
Parameters:
Name Type Description
dbName string database name
executable_binary_files Array.<File> Executable Binary files
Source:
Returns:
a promise
Type
Promise

update_git_config(project_name, git_working_tree_directory, git_config_file_content) → {Promise.<string>}

Update the Git configuration file of the Git directory associated (usually .git/config) to a Git working tree
Parameters:
Name Type Description
project_name string project name
git_working_tree_directory string Directory of Git working tree
git_config_file_content string Git config file content
Source:
Returns:
a promise
Type
Promise.<string>

update_git_files(dbName, git_working_tree_directory, files) → {Promise.<Array.<File>>}

Update files into a Git working tree
Parameters:
Name Type Description
dbName string database name
git_working_tree_directory string Directory of Git working tree
files Array.<File> files
Source:
Returns:
a promise
Type
Promise.<Array.<File>>

update_git_working_trees(dbName, git_working_tree_documents) → {Promise}

Update Git Working Tree documents
Parameters:
Name Type Description
dbName string database name
git_working_tree_documents Array.<Object> Git Working Tree documents
Source:
Returns:
a promise
Type
Promise

update_graphical_docs(dbName, graphical_doc_documents) → {Promise}

Update Graphical documentation documents
Parameters:
Name Type Description
dbName string database name
graphical_doc_documents Array.<Object> Graphical documentation documents
Source:
Returns:
a promise
Type
Promise

update_invocations(dbName, invocation_documents) → {Promise}

Update Invocation documents
Parameters:
Name Type Description
dbName string database name
invocation_documents Array.<Object> Invocation documents
Source:
Returns:
a promise
Type
Promise

update_java_annotations(dbName, java_annotations_documents) → {Promise}

Update Java Annotations
Parameters:
Name Type Description
dbName string Database name
java_annotations_documents Array.<Object> Java annotations documents following schema from openJML-schema.json
Source:
Returns:
a promise
Type
Promise

update_java_comments(dbName, java_comments_documents) → {Promise}

Update Java comments
Parameters:
Name Type Description
dbName string Database name
java_comments_documents Array.<Object> Java comments documents following schema from openJML-schema.json
Source:
Returns:
a promise
Type
Promise

update_java_source_code(dbName, documents) → {Promise}

Updates some Java source code documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<Object> documents
Source:
Returns:
a promise
Type
Promise

update_logs(dbName, log_documents, update) → {Promise}

Update some Log documents into a database
Parameters:
Name Type Description
dbName string database name
log_documents Array.<Object> Log documents
update boolean flag to enable/disable replacing Log documents
Source:
Returns:
a promise
Type
Promise

update_methodology_status(dbName, methodology_status_documents) → {Promise}

Update Methodology status documents into a database
Parameters:
Name Type Description
dbName string database name
methodology_status_documents Array.<Object> Methodology status documents
Source:
Returns:
a promise
Type
Promise

update_project(project) → {Promise.<boolean>}

Update a project or create a new one if it does not exist
Parameters:
Name Type Description
project PkmProject project
Source:
Returns:
a promise
Type
Promise.<boolean>

update_reviews(dbName, review_documents) → {Promise.<Array.<string>>}

Update review documents into a database
Parameters:
Name Type Description
dbName string database name
review_documents Array.<Object> Review documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

update_source_files(dbName, source_files) → {Promise}

Update source files
Parameters:
Name Type Description
dbName string database name
source_files Array.<File> source files
Source:
Returns:
a promise
Type
Promise

update_testar_settings(dbName, testar_settings_document) → {Promise}

Update TESTAR settings into a database
Parameters:
Name Type Description
dbName string database name
testar_settings_document Object TESTAR settings document
Source:
Returns:
a promise
Type
Promise

update_tools(dbName, tool_documents) → {Promise}

Update Tool documents
Parameters:
Name Type Description
dbName string database name
tool_documents Array.<Object> Tool documents
Source:
Returns:
a promise
Type
Promise

update_traceability_matrix(dbName, documents, update) → {Promise.<Array.<string>>}

Update some Tracability Matrix documents into a database
Parameters:
Name Type Description
dbName string database name
documents Array.<Object> documents
update boolean flag to enable/disable replacing Tracability Matrix documents
Source:
Returns:
a promise (resolve argument is an array of document unique IDs in the collection)
Type
Promise.<Array.<string>>

update_uml_class_diagrams(dbName, uml_class_diagram_documents) → {Promise}

Update UML Class Diagrams
Parameters:
Name Type Description
dbName string database name
uml_class_diagram_documents Array.<Object> UML class diagram documents
Source:
Returns:
a promise
Type
Promise

update_uml_files(dbName, uml_files) → {Promise}

update UML files
Parameters:
Name Type Description
dbName string database name
uml_files Array.<File> UML files
Source:
Returns:
a promise
Type
Promise

update_uml_state_machines(dbName, uml_state_machine_documents) → {Promise}

Update UML State Machines
Parameters:
Name Type Description
dbName string database name
uml_state_machine_documents Array.<Object> UML state machine documents
Source:
Returns:
a promise
Type
Promise

update_user(user) → {Promise}

Update user
Parameters:
Name Type Description
user User a user
Source:
Returns:
a promise
Type
Promise

update_user_password(new_password) → {Promise}

Update user password
Parameters:
Name Type Description
new_password string new user password
Source:
Returns:
a promise
Type
Promise

update_user_role(dbName, user_role_name, command, user_name) → {Promise}

update user role
Parameters:
Name Type Description
dbName string database name
user_role_name string user role name
command string either 'grant' or 'revoke'
user_name string user name
Source:
Returns:
a promise
Type
Promise

validate_document(collection_name, document)

Validate a C document. If validation is enabled and a valid schema is present, these methods throw an error when document is not valid.
Parameters:
Name Type Description
collection_name string collection name
document Object a document
Source:

Type Definitions

Role

Role
Type:
  • Object
Properties:
Name Type Description
role string role name
privileges Array.<RolePrivilege> role privileges
roles Array.<UserRole> inherited roles /** Create role
Source: