@architect/functions
Advanced tools
Comparing version 5.0.4-RC.0 to 5.0.4-RC.1
{ | ||
"name": "@architect/functions", | ||
"version": "5.0.4-RC.0", | ||
"version": "5.0.4-RC.1", | ||
"description": "Cloud function signatures for HTTP handlers, pub/sub + scheduled, queued functions, table triggers, and more", | ||
@@ -37,6 +37,6 @@ "homepage": "https://github.com/architect/functions", | ||
"@architect/req-res-fixtures": "git+https://github.com/architect/req-res-fixtures.git", | ||
"@architect/sandbox": "^5.0.3-RC.0", | ||
"@architect/sandbox": "^5.1.0-RC.0", | ||
"aws-sdk": "~2.880.0", | ||
"cross-env": "~7.0.3", | ||
"eslint": "~8.9.0", | ||
"eslint": "~8.10.0", | ||
"mock-fs": "~5.1.2", | ||
@@ -43,0 +43,0 @@ "nyc": "~15.1.0", |
@@ -15,3 +15,3 @@ let https = require('https') | ||
// eslint-disable-next-line | ||
let aws = require('aws-sdk') | ||
let dynamo = require('aws-sdk/clients/dynamodb') | ||
@@ -26,4 +26,4 @@ // We might normally like to throw if `local && !port`, but this is also a direct DynamoDB interface in global scope | ||
let local = ARC_ENV === 'testing' || ARC_LOCAL | ||
let DB = aws.DynamoDB | ||
let Doc = aws.DynamoDB.DocumentClient | ||
let DB = dynamo | ||
let Doc = dynamo.DocumentClient | ||
@@ -50,13 +50,13 @@ if (db && type === 'db') { | ||
}) | ||
aws.config.update({ | ||
let config = { | ||
httpOptions: { agent } | ||
}) | ||
} | ||
// TODO? migrate to using `AWS_NODEJS_CONNECTION_REUSE_ENABLED`? | ||
if (type === 'db') { | ||
db = new DB | ||
db = new DB(config) | ||
return callback(null, db) | ||
} | ||
if (type === 'doc') { | ||
doc = new Doc | ||
doc = new Doc(config) | ||
return callback(null, doc) | ||
@@ -73,13 +73,12 @@ } | ||
} | ||
let localConfig = { | ||
endpoint: new aws.Endpoint(`http://localhost:${port}`), | ||
let config = { | ||
endpoint: `http://localhost:${port}`, | ||
region: AWS_REGION || 'us-west-2' // Do not assume region is set! | ||
} | ||
if (type === 'db') { | ||
db = new DB(localConfig) | ||
db = new DB(config) | ||
return callback(null, db) | ||
} | ||
if (type === 'doc') { | ||
doc = new Doc(localConfig) | ||
doc = new Doc(config) | ||
return callback(null, doc) | ||
@@ -86,0 +85,0 @@ } |
@@ -8,6 +8,5 @@ let dynamo = require('./dynamo') | ||
module.exports = function reflectFactory (tables, callback) { | ||
let { db, doc } = dynamo | ||
let local = process.env.ARC_ENV === 'testing' | ||
parallel({ db, doc }, function done (err, { db, doc }) { | ||
parallel(dynamo, function done (err, { db, doc }) { | ||
if (err) return callback(err) | ||
@@ -14,0 +13,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57415
1705