aws-v3-sdk 1.0.0 → 1.0.2

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/lib/aws.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Load all service classes
2
- let AWS = require('./clients/all')
2
+ const AWS = require('./clients/all')
3
3
 
4
4
  /**
5
5
  * @api private
@@ -1,9 +1,13 @@
1
+ const { LambdaClient, InvokeCommand, InvokeAsyncCommand } = require('@aws-sdk/client-lambda')
2
+ const { toUtf8, fromUtf8 } = require('@aws-sdk/util-utf8-node')
1
3
 
2
4
  class Lambda {
3
5
  async invoke (params, callback) {
4
- const response = {
5
- status: 200
6
- }
6
+ const client = new LambdaClient()
7
+ const command = new InvokeCommand(params)
8
+ const response = await client.send(command)
9
+ response.Payload = toUtf8(response.Payload)
10
+ delete response.$metadata
7
11
  callback(null, response)
8
12
  }
9
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-v3-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "AWS v3 SDK Utils",
5
5
  "main": "index.js",
6
6
  "scripts": {