presidium 0.29.11 → 0.29.13

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.
package/AwsCredentials.js CHANGED
@@ -24,6 +24,17 @@ const pathResolve = require('./internal/pathResolve')
24
24
  */
25
25
 
26
26
  const AwsCredentials = async function (options = {}) {
27
+ if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
28
+ const awsCreds = {
29
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID,
30
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
31
+ }
32
+ if (process.env.AWS_REGION) {
33
+ awsCreds.region = process.env.AWS_REGION
34
+ }
35
+ return awsCreds
36
+ }
37
+
27
38
  const profile = (
28
39
  typeof options == 'string' ? options : options.profile
29
40
  ) ?? 'default'
@@ -35,6 +35,24 @@ aws_secret_access_key = FFF
35
35
  assert.equal(awsCreds.secretAccessKey, 'FFF')
36
36
  }
37
37
 
38
+ {
39
+ process.env.AWS_ACCESS_KEY_ID = 'AA2'
40
+ process.env.AWS_SECRET_ACCESS_KEY = 'FF2'
41
+ const awsCreds = await AwsCredentials()
42
+ assert.equal(awsCreds.accessKeyId, 'AA2')
43
+ assert.equal(awsCreds.secretAccessKey, 'FF2')
44
+ }
45
+
46
+ {
47
+ process.env.AWS_ACCESS_KEY_ID = 'AA2'
48
+ process.env.AWS_SECRET_ACCESS_KEY = 'FF2'
49
+ process.env.AWS_REGION = 'us-east-2'
50
+ const awsCreds = await AwsCredentials()
51
+ assert.equal(awsCreds.accessKeyId, 'AA2')
52
+ assert.equal(awsCreds.secretAccessKey, 'FF2')
53
+ assert.equal(awsCreds.region, 'us-east-2')
54
+ }
55
+
38
56
  await fs.promises.rm(`${__dirname}/../.aws`, { recursive: true })
39
57
  }).case()
40
58
 
package/DynamoStream.js CHANGED
@@ -181,7 +181,10 @@ DynamoStream.prototype.getRecords = async function* getRecords(
181
181
  ShardIterator: records.NextShardIterator,
182
182
  Limit: this.getRecordsLimit
183
183
  }).catch(handleGetRecordsError)
184
- if (records.Records.length > 0) {
184
+ if (records.Records == null) {
185
+ console.error(`DynamoStream: records.Records undefined: ${records}`)
186
+ break
187
+ } else if (records.Records.length > 0) {
185
188
  yield* records.Records.map(assign({
186
189
  table: always(this.table),
187
190
  shardId: always(Shard.ShardId),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "0.29.11",
3
+ "version": "0.29.13",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",