NPM module - izara-shared: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
= | = graphSharedLib = | ||
Helper functions for interacting with Neptune graph databases from any service. | Helper functions for interacting with Neptune graph databases from any service. | ||
== | == graphSharedLib.createVertexId == | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Line 55: | Line 55: | ||
# Concatenate ''vertexTag'' + "_" + ''uniqueId'' | # Concatenate ''vertexTag'' + "_" + ''uniqueId'' | ||
== | == graphSharedLib.getVerticesByVertexLabel == | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Line 69: | Line 69: | ||
# .. | # .. | ||
== | == graphSharedLib.getVertexByVertexId == | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Line 83: | Line 83: | ||
# .. | # .. | ||
== | == graphSharedLib.getVertexOutEdges == | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Line 99: | Line 99: | ||
# .. | # .. | ||
== | == graphSharedLib.getVertexOutEdgesAndVertices == | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
Line 117: | Line 117: | ||
== | == graphSharedLib.getObjectVertexByEdgeId == | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> |
Revision as of 00:13, 5 March 2021
Overview
Shared libraries
Repository
https://bitbucket.org/stb_working/izara-shared/src/master/
Helper functions for interacting with DynamoDB resources.
/**
* Creates a string set element for use with documentClient
* @param {string[]} stringSet
*
* @returns {string} String formatted as a string set for Dynamo
*/
Helper functions for Config tables.
/**
* @param {string} configTag
* @param {string} configKey
*
* @returns {Object} returns the configValue for a single config record, or null if none found
*/
Helper functions for interacting with Neptune graph databases from any service.
/**
* Creates vertexId from vertexTag and unique id
* @param {string} vertexTag - is the type of object
* @param {string} uniqueId
*
* @returns {string} vertexId
*/
- Concatenate vertexTag + "_" + uniqueId
/**
* Returns all vertices that match the vertex label for the given graph
* @param {string} graphServiceName
* @param {string} vertexLabel
*
* @returns {string} vertexId
*/
- ..
/**
* Returns vertex that matched the vertex id
* @param {string} graphServiceName
* @param {string} vertexId
*
* @returns {string} vertexId
*/
- ..
/**
* Returns all edges, allowing label and property filters
* @param {string} graphServiceName
* @param {string} subjectVertexId
* @param {string} [edgeLabel=""]
* @param {object} [edgeProperties={}]
*
* @returns {string} vertexId
*/
- ..
/**
* Find related vertices and their connecting edges, including properties, allowing label and property filters
* @param {string} graphServiceName
* @param {string} subjectVertexId
* @param {string} [edgeLabel=""] - edge label to filter edges by
* @param {object} [edgeProperties={}] - edge properties to filter by, is an array of key > value pairs
* @param {object} [vertexProperties={}] - object vertex properties to filter by, is an array of key > value pairs
*
* @returns {Object[]} array of vertices and the connecting edges
*/
- ..
/**
* Find the object/target vertex for a specific edgeId
* @param {string} edgeId - edge label to filter edges by
*
* @returns {Object} vertex or null if not found
*/
- ..