presidium 1.4.7 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,6 +24,7 @@ const createExpressionAttributeValues =
|
|
|
24
24
|
const createKeyConditionExpression =
|
|
25
25
|
require('./internal/createKeyConditionExpression')
|
|
26
26
|
const createFilterExpression = require('./internal/createFilterExpression')
|
|
27
|
+
const AwsError = require('./internal/AwsError')
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* @name DynamoDBGlobalSecondaryIndex
|
package/DynamoDBStream.js
CHANGED
|
@@ -51,8 +51,12 @@ const SymbolUpdateShards = Symbol('UpdateShards')
|
|
|
51
51
|
* * `region` - the AWS region.
|
|
52
52
|
* * `autoReady` - whether to automatically create the DynamoDB Stream if it doesn't exist. Defaults to `true`.
|
|
53
53
|
* * `StreamViewType` - determines what information is written to the DynamoDB Stream.
|
|
54
|
-
* * `ShardIteratorType` - determines how the shard iterator is used to start reading stream records from a shard of the stream. A shard is a replica of a stream for enhanced throughput purposes.
|
|
55
|
-
* * `
|
|
54
|
+
* * `ShardIteratorType` - determines how the shard iterator is used to start reading stream records from a shard of the stream. A shard is a replica of a stream for enhanced throughput purposes. Defaults to `'LATEST'`.
|
|
55
|
+
* * `GetRecordsLimit` - number of records to fetch per DynamoDB Streams GetRecords operation. Defaults to `1000`.
|
|
56
|
+
* * `GetRecordsInterval` - number of milliseconds to wait between DynamoDB Streams GetRecords calls. Defaults to `1000`.
|
|
57
|
+
* * `ShardUpdatePeriod` - number of milliseconds to wait between shard updates. Defaults to `15000`.
|
|
58
|
+
* * `ListStreamsLimit` - number of streams to list per DynamoDB Streams ListStreams calls. Defaults to `100`.
|
|
59
|
+
* * `JSON` - replaces `NewImage` in DynamoDB JSON format with `NewImageJSON` in JSON format and `OldImage` in DynamoDB JSON format with `OldImageJSON` in JSON format for all stream records. Defaults to `false`.
|
|
56
60
|
*
|
|
57
61
|
* `StreamViewType` values:
|
|
58
62
|
* * `KEYS_ONLY` - only the key attributes of the modified item are written to the DynamoDB Stream.
|
package/Password.js
CHANGED
|
@@ -13,7 +13,7 @@ const Password = {}
|
|
|
13
13
|
*
|
|
14
14
|
* @docs
|
|
15
15
|
* ```coffeescript [specscript]
|
|
16
|
-
* Password.hash(plaintext string) -> hash string
|
|
16
|
+
* Password.hash(plaintext string) -> hash Promise<string>
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
19
|
* Creates a hash of the plaintext password.
|
|
@@ -30,7 +30,7 @@ const Password = {}
|
|
|
30
30
|
* const myPasswordHash = await Password.hash(myPassword)
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
|
-
Password.hash = async function (plaintext) {
|
|
33
|
+
Password.hash = async function hash(plaintext) {
|
|
34
34
|
const salt = await bcrypt.genSalt(10)
|
|
35
35
|
const hashed = await bcrypt.hash(plaintext, salt)
|
|
36
36
|
return hashed
|
|
@@ -67,7 +67,7 @@ Password.hash = async function (plaintext) {
|
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
|
-
Password.verify = async function (plaintext, hashed) {
|
|
70
|
+
Password.verify = async function verify(plaintext, hashed) {
|
|
71
71
|
const isValid = await bcrypt.compare(plaintext, hashed)
|
|
72
72
|
if (!isValid) {
|
|
73
73
|
throw new Error('Invalid password')
|
|
@@ -4,7 +4,7 @@ const handleDynamoDBStreamGetRecordsError =
|
|
|
4
4
|
|
|
5
5
|
const test = new Test('handleDynamoDBStreamGetRecordsError', handleDynamoDBStreamGetRecordsError)
|
|
6
6
|
|
|
7
|
-
test.case(new Error('Shard iterator has expired'), [])
|
|
7
|
+
test.case(new Error('Shard iterator has expired'), { Records: [] })
|
|
8
8
|
test.throws(new Error('other'), new Error('other'))
|
|
9
9
|
|
|
10
10
|
if (process.argv[1] == __filename) {
|