@mcma/aws-lambda-worker-invoker
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -1,3 +0,7 @@ | ||
import { InvokeWorker } from "@mcma/api"; | ||
import { InvokeWorker, WorkerInvoker } from "@mcma/api"; | ||
export const invokeLambdaWorker: InvokeWorker; | ||
export const invokeLambdaWorker: InvokeWorker; | ||
export class LambdaWorkerInvoker extends WorkerInvoker { | ||
constructor(); | ||
} |
const util = require("util"); | ||
const AWS = require("aws-sdk"); | ||
const { WorkerInvoker } = require("@mcma/api"); | ||
const Lambda = new AWS.Lambda({ apiVersion: "2015-03-31" }); | ||
const LambdaInvoke = util.promisify(Lambda.invoke.bind(Lambda)); | ||
async function invokeLambdaWorker(workerFunctionName, payload) { | ||
async function invokeLambdaWorker(workerFunctionId, workerRequest) { | ||
await LambdaInvoke({ | ||
FunctionName: workerFunctionName, | ||
FunctionName: workerFunctionId, | ||
InvocationType: "Event", | ||
LogType: "None", | ||
Payload: JSON.stringify(payload) | ||
Payload: JSON.stringify(workerRequest) | ||
}); | ||
} | ||
class LambdaWorkerInvoker extends WorkerInvoker { | ||
constructor() { | ||
super(invokeLambdaWorker); | ||
} | ||
} | ||
module.exports = { | ||
invokeLambdaWorker | ||
invokeLambdaWorker, | ||
LambdaWorkerInvoker | ||
}; |
{ | ||
"name": "@mcma/aws-lambda-worker-invoker", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Node module with code for invoking MCMA workers running as Lambda functions, via the AWS SDK", | ||
@@ -29,3 +29,3 @@ "engines": { | ||
"dependencies": { | ||
"@mcma/api": "0.4.1", | ||
"@mcma/api": "0.4.2", | ||
"aws-sdk": "^2.291.0" | ||
@@ -32,0 +32,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
1857
25
+ Added@mcma/api@0.4.2(transitive)
+ Added@mcma/client@0.4.2(transitive)
+ Added@mcma/core@0.4.2(transitive)
+ Added@mcma/data@0.4.2(transitive)
- Removed@mcma/api@0.4.1(transitive)
- Removed@mcma/client@0.4.1(transitive)
- Removed@mcma/core@0.4.1(transitive)
- Removed@mcma/data@0.4.1(transitive)
Updated@mcma/api@0.4.2