0.6.22 • Published 9 days ago

@veterancrowd/aws-service-search v0.6.22

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
9 days ago

Backup Status

aws-service-search

AWS service search utilities.

API Documentation

Functions

dehydratePageKeys(entityManager, entityToken, indexTokens, shardKeyTokens, pageKeys, logger) ⇒ string

Dehydrate a shard-keyed map of page keys into a compressed string. Supports multiple paged queries on different indexes. In this case, present indexTokens, shardKeyTokens, and pageKeys as arrays of the same length. If all pageKeys entries are empty objects, returns an empty string.

Kind: global function
Returns: string - Dehydrated page keys.

ParamTypeDescription
entityManagerEntityManagerEntityManager instance.
entityTokenstringEntity token.
indexTokensArray.<string>Index token or array of key tokens. May be an array of same, of the same length as pageKeys.
shardKeyTokensstring | Array.<string>Shard key token. May be an array of same, of the same length as pageKeys.
pageKeysobject | Array.<object>Rehydrated page keys. May be an array of same.
loggerobjectLogger (defaults to console).

rehydratePageKeys(entityManager, entityToken, indexToken, shardKeyToken, pageKeys, logger) ⇒ string

Rehydrate a single shardKeyToken's shard-keyed map of page keys from a dehydrated map, possibly representing multiple shardKeyTokens.

Kind: global function
Returns: string - Rehydrated page keys.

ParamTypeDescription
entityManagerEntityManagerEntityManager instance.
entityTokenstringEntity token.
indexTokenstringIndex token or array of key tokens.
shardKeyTokenstringShard key token.
pageKeysobjectDehydrated page keys.
loggerobjectLogger (defaults to console).

addFilterCondition(options) ⇒ undefined

Add filter condition to DynamoDB query objects.

Kind: global function

ParamTypeDescription
optionsobjectconfig object
options.attributeNamestringThe name of the attribute to filter on.
options.attributeValuestringThe beginning value of the attribute to filter on.
options.expressionAttributeNamesobjectThe expression attribute names object to add the attribute name to.
options.expressionAttributeValuesobjectThe expression attribute values object to add the attribute value to.
options.filterConditionsArray.<string>The filter conditions array to add the filter condition to.
options.negatebooleanWhether to negate the filter condition.
options.operatorstringThe operator to use for the filter condition.

addFilterConditionExists(options) ⇒ undefined

Add exists filter condition to DynamoDB query objects.

Kind: global function

ParamTypeDescription
optionsobjectconfig object
options.attributeNamestringThe name of the attribute to filter on.
options.existsbooleanThe value indicating whether the attribute should exist or not.
options.expressionAttributeNamesobjectThe expression attribute names object to add the attribute name to.
options.filterConditionsArray.<string>The filter conditions array to add the filter condition to.

addFilterConditionRange(options) ⇒ undefined

Add range filter condition to DynamoDB query objects.

Kind: global function

ParamTypeDescription
optionsobjectconfig object
options.attributeNamestringThe name of the attribute to filter on.
options.attributeValueFromstringThe beginning value of the attribute to filter on.
options.attributeValueTostringThe ending value of the attribute to filter on.
options.expressionAttributeNamesobjectThe expression attribute names object to add the attribute name to.
options.expressionAttributeValuesobjectThe expression attribute values object to add the attribute value to.
options.filterConditionsArray.<string>The filter conditions array to add the filter condition to.
options.negatebooleanWhether to negate the filter condition.

getShardQuery(options) ⇒ function

Get a shard query function for use with Entity Manager query function.

Kind: global function
Returns: function - The shard query function.

ParamTypeDescription
optionsobjectconfig object
options.dbClientWrappedDynamoDbClientThe Wrapped DynamoDB client.
options.expressionAttributeNamesobjectThe expression attribute names object.
options.expressionAttributeValuesobjectThe expression attribute values object.
options.filterConditionsArray.<string>The filter conditions array.
options.indexNamestringThe name of the index to query.
options.partitionKeyNamestringThe name of the partition key.
options.scanIndexForwardbooleanWhether to scan the index forward.
options.sortKeyConditionstringThe sort key condition.

getSortKeyCondition(options) ⇒ string | undefined

Get a sort key condition for a DynamoDB query & update query objects.

Kind: global function
Returns: string | undefined - The sort key condition.

ParamTypeDescription
optionsobjectconfig object
options.entityManagerEntityManagerThe entity manager.
options.entityTokenstringThe entity token.
options.expressionAttributeNamesobjectThe expression attribute names object to add the attribute name to.
options.expressionAttributeValuesobjectThe expression attribute values object to add the attribute value to.
options.itemobjectAn item containing enough data to generate the partial sort key.
options.operatorstringThe sort key operator.
options.sortKeyNamestringThe name of the sort key.

getSortKeyConditionRange(options) ⇒ string | undefined

Get a range sort key condition for a DynamoDB query & update query objects.

Kind: global function
Returns: string | undefined - The sort key condition.

ParamTypeDescription
optionsobjectconfig object
options.entityManagerEntityManagerThe entity manager.
options.entityTokenstringThe entity token.
options.expressionAttributeNamesobjectThe expression attribute names object to add the attribute name to.
options.expressionAttributeValuesobjectThe expression attribute values object to add the attribute value to.
options.itemFromobjectAn item containing enough data to generate the 'from' sort key.
options.itemToobjectAn item containing enough data to generate the 'to' sort key.
options.sortKeyNamestringThe name of the sort key.

parseBooleanQueryParam(param, token) ⇒ boolean | undefined

Parse a string query parameter into a boolean value.

Kind: global function
Returns: boolean | undefined - The parsed boolean value.

ParamTypeDescription
paramstringThe query parameter to parse.
tokenstringThe name of the query parameter.

parseDelimitedQueryParam(param, token, enumeration, delimiter) ⇒ Array.<string>

Parse a delimited string query parameter into an array, optionally against an enumeration.

Kind: global function
Returns: Array.<string> - The parsed string array.

ParamTypeDescription
paramstringThe query parameter to parse.
tokenstringThe name of the query parameter.
enumerationobjectThe enumeration to parse against.
delimiterstringThe delimiter to split the string on.

parseNumberQueryParam(param, token) ⇒ number | undefined

Parse a string query parameter into a number value.

Kind: global function
Returns: number | undefined - The parsed number value.

ParamTypeDescription
paramstringThe query parameter to parse.
tokenstringThe name of the query parameter.

parseWholeNumberQueryParam(param, token) ⇒ number | undefined

Parse a string query parameter into a whole number value. 'all' returns Infinity.

Kind: global function
Returns: number | undefined - The parsed whole number value.

ParamTypeDescription
paramstringThe query parameter to parse.
tokenstringThe name of the query parameter.

See more great templates and other tools on my GitHub Profile!

0.6.22

9 days ago

0.6.21

22 days ago

0.6.20

22 days ago

0.6.19

24 days ago

0.6.18

1 month ago

0.6.17

1 month ago

0.6.16

1 month ago

0.6.15

1 month ago

0.6.14

2 months ago

0.6.13

3 months ago

0.6.12

4 months ago

0.6.11

4 months ago

0.6.10

4 months ago

0.6.9

4 months ago

0.6.8

5 months ago

0.6.7

5 months ago

0.6.6

6 months ago

0.6.3

7 months ago

0.5.4

8 months ago

0.6.2

7 months ago

0.5.3

8 months ago

0.4.4

10 months ago

0.6.5

7 months ago

0.6.4

7 months ago

0.5.5

8 months ago

0.5.0

9 months ago

0.6.1

7 months ago

0.5.2

8 months ago

0.4.3

10 months ago

0.4.2-0

10 months ago

0.6.0

8 months ago

0.5.1

9 months ago

0.4.2

10 months ago

0.1.0

12 months ago

0.3.0

11 months ago

0.2.1

12 months ago

0.1.2

12 months ago

0.2.0

12 months ago

0.1.1

12 months ago

0.4.0-0

11 months ago

0.4.1

10 months ago

0.1.4

12 months ago

0.0.5

12 months ago

0.4.0

11 months ago

0.3.1

11 months ago

0.1.3

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago