@kennethwkz/serverless-prune-plugin 2.2.0 → 2.2.1
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/index.js +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -51,7 +51,15 @@ function lambdaRequest(provider, action, params) {
|
|
|
51
51
|
lambdaClientPromises.set(provider, clientPromise);
|
|
52
52
|
}
|
|
53
53
|
return clientPromise.then((client) => {
|
|
54
|
-
|
|
54
|
+
// AWS SDK v3 Command classes are PascalCase (e.g. ListVersionsByFunctionCommand),
|
|
55
|
+
// while the v2 provider.request() action names are camelCase (e.g. listVersionsByFunction).
|
|
56
|
+
const commandName = action.charAt(0).toUpperCase() + action.slice(1) + 'Command';
|
|
57
|
+
const Command = require('@aws-sdk/client-lambda')[commandName];
|
|
58
|
+
if (typeof Command !== 'function') {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Unsupported Lambda action: ${action} (@aws-sdk/client-lambda does not export ${commandName})`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
55
63
|
return client.send(new Command(params));
|
|
56
64
|
});
|
|
57
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kennethwkz/serverless-prune-plugin",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Serverless plugin to delete old versions of deployed functions from AWS",
|
|
5
5
|
"author": "Clay Gregory <clay@claygregory.com> (https://claygregory.com/)",
|
|
6
6
|
"publishConfig": {
|