@webiny/handler-aws 6.0.0 → 6.1.0-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/handler-aws",
3
- "version": "6.0.0",
3
+ "version": "6.1.0-beta.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -14,23 +14,22 @@
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
16
  "@fastify/aws-lambda": "6.4.0",
17
- "@webiny/aws-sdk": "6.0.0",
18
- "@webiny/handler": "6.0.0",
19
- "@webiny/handler-client": "6.0.0",
20
- "@webiny/plugins": "6.0.0",
21
- "@webiny/utils": "6.0.0",
22
- "fastify": "5.8.2",
17
+ "@webiny/aws-sdk": "6.1.0-beta.0",
18
+ "@webiny/handler": "6.1.0-beta.0",
19
+ "@webiny/plugins": "6.1.0-beta.0",
20
+ "@webiny/utils": "6.1.0-beta.0",
21
+ "fastify": "5.8.4",
23
22
  "pino-lambda": "4.4.1"
24
23
  },
25
24
  "devDependencies": {
26
- "@webiny/build-tools": "6.0.0",
25
+ "@webiny/build-tools": "6.1.0-beta.0",
27
26
  "rimraf": "6.1.3",
28
27
  "typescript": "5.9.3",
29
- "vitest": "4.0.18"
28
+ "vitest": "4.1.2"
30
29
  },
31
30
  "publishConfig": {
32
31
  "access": "public",
33
32
  "directory": "dist"
34
33
  },
35
- "gitHead": "9c6892640a45679ff521e25cd6587dff57393a2e"
34
+ "gitHead": "a3bd3695c66c79238e380d7360d9731b5fcf9c87"
36
35
  }
package/plugins/index.js CHANGED
@@ -1,6 +1,7 @@
1
- import { createHandlerClientPlugin } from "./handlerClient.js";
2
1
  export const registerDefaultPlugins = context => {
3
- context.plugins.register([createHandlerClientPlugin()]);
2
+ context.plugins.register([
3
+ //
4
+ ]);
4
5
  };
5
6
 
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createHandlerClientPlugin","registerDefaultPlugins","context","plugins","register"],"sources":["index.ts"],"sourcesContent":["import { createHandlerClientPlugin } from \"./handlerClient.js\";\nimport type { Context } from \"@webiny/handler/types.js\";\n\nexport const registerDefaultPlugins = (context: Context): void => {\n context.plugins.register([createHandlerClientPlugin()]);\n};\n"],"mappings":"AAAA,SAASA,yBAAyB;AAGlC,OAAO,MAAMC,sBAAsB,GAAIC,OAAgB,IAAW;EAC9DA,OAAO,CAACC,OAAO,CAACC,QAAQ,CAAC,CAACJ,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["registerDefaultPlugins","context","plugins","register"],"sources":["index.ts"],"sourcesContent":["import type { Context } from \"@webiny/handler/types.js\";\n\nexport const registerDefaultPlugins = (context: Context): void => {\n context.plugins.register([\n //\n ]);\n};\n"],"mappings":"AAEA,OAAO,MAAMA,sBAAsB,GAAIC,OAAgB,IAAW;EAC9DA,OAAO,CAACC,OAAO,CAACC,QAAQ,CAAC;IACrB;EAAA,CACH,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { HandlerClientPlugin } from "@webiny/handler-client";
2
- export declare const createHandlerClientPlugin: () => HandlerClientPlugin;
@@ -1,46 +0,0 @@
1
- import { LambdaClient, InvokeCommand } from "@webiny/aws-sdk/client-lambda/index.js";
2
- import { HandlerClientPlugin } from "@webiny/handler-client";
3
- export const createHandlerClientPlugin = () => {
4
- const plugin = new HandlerClientPlugin({
5
- invoke: async params => {
6
- const {
7
- await: useAwait,
8
- name,
9
- payload
10
- } = params;
11
- const lambdaClient = new LambdaClient({
12
- region: process.env.AWS_REGION
13
- });
14
- const response = await lambdaClient.send(new InvokeCommand({
15
- FunctionName: name,
16
- InvocationType: useAwait === false ? "Event" : "RequestResponse",
17
- Payload: JSON.stringify(payload)
18
- }));
19
- if (useAwait === false) {
20
- return null;
21
- }
22
- const decoder = new TextDecoder("utf-8");
23
- return JSON.parse(decoder.decode(response.Payload));
24
- },
25
- canUse: params => {
26
- if (!params?.name) {
27
- return true;
28
- }
29
- const {
30
- name
31
- } = params;
32
- /**
33
- * In case we are invoking currently active lambda, let's use this plugin as well.
34
- * When invoking some other lambda, name starts with arn.
35
- */
36
- if (name === process.env.AWS_LAMBDA_FUNCTION_NAME) {
37
- return true;
38
- }
39
- return name.match("arn:") !== null;
40
- }
41
- });
42
- plugin.name = "handler-client";
43
- return plugin;
44
- };
45
-
46
- //# sourceMappingURL=handlerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["LambdaClient","InvokeCommand","HandlerClientPlugin","createHandlerClientPlugin","plugin","invoke","params","await","useAwait","name","payload","lambdaClient","region","process","env","AWS_REGION","response","send","FunctionName","InvocationType","Payload","JSON","stringify","decoder","TextDecoder","parse","decode","canUse","AWS_LAMBDA_FUNCTION_NAME","match"],"sources":["handlerClient.ts"],"sourcesContent":["import { LambdaClient, InvokeCommand } from \"@webiny/aws-sdk/client-lambda/index.js\";\nimport { HandlerClientPlugin } from \"@webiny/handler-client\";\n\nexport const createHandlerClientPlugin = () => {\n const plugin = new HandlerClientPlugin({\n invoke: async params => {\n const { await: useAwait, name, payload } = params;\n const lambdaClient = new LambdaClient({\n region: process.env.AWS_REGION\n });\n const response = await lambdaClient.send(\n new InvokeCommand({\n FunctionName: name,\n InvocationType: useAwait === false ? \"Event\" : \"RequestResponse\",\n Payload: JSON.stringify(payload)\n })\n );\n\n if (useAwait === false) {\n return null;\n }\n\n const decoder = new TextDecoder(\"utf-8\");\n return JSON.parse(decoder.decode(response.Payload));\n },\n canUse: params => {\n if (!params?.name) {\n return true;\n }\n const { name } = params;\n /**\n * In case we are invoking currently active lambda, let's use this plugin as well.\n * When invoking some other lambda, name starts with arn.\n */\n if (name === process.env.AWS_LAMBDA_FUNCTION_NAME) {\n return true;\n }\n return name.match(\"arn:\") !== null;\n }\n });\n\n plugin.name = \"handler-client\";\n\n return plugin;\n};\n"],"mappings":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