@webiny/handler-aws 5.30.0-beta.1 → 5.31.0-beta.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/dynamodb/index.d.ts +11 -0
- package/dynamodb/index.js +92 -0
- package/dynamodb/index.js.map +1 -0
- package/dynamodb/plugins/DynamoDBEventHandler.d.ts +19 -0
- package/dynamodb/plugins/DynamoDBEventHandler.js +30 -0
- package/dynamodb/plugins/DynamoDBEventHandler.js.map +1 -0
- package/eventBridge/index.d.ts +11 -0
- package/eventBridge/index.js +92 -0
- package/eventBridge/index.js.map +1 -0
- package/eventBridge/plugins/EventBridgeEventHandler.d.ts +19 -0
- package/eventBridge/plugins/EventBridgeEventHandler.js +30 -0
- package/eventBridge/plugins/EventBridgeEventHandler.js.map +1 -0
- package/execute.d.ts +7 -0
- package/execute.js +75 -0
- package/execute.js.map +1 -0
- package/gateway/index.d.ts +14 -0
- package/gateway/index.js +68 -0
- package/gateway/index.js.map +1 -0
- package/index.d.ts +6 -19
- package/index.js +234 -29
- package/index.js.map +1 -1
- package/package.json +14 -16
- package/plugins/handlerClient.d.ts +2 -3
- package/plugins/handlerClient.js +50 -28
- package/plugins/handlerClient.js.map +1 -1
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +14 -0
- package/plugins/index.js.map +1 -0
- package/raw/index.d.ts +19 -0
- package/raw/index.js +94 -0
- package/raw/index.js.map +1 -0
- package/raw/plugins/RawEventHandler.d.ts +13 -0
- package/raw/plugins/RawEventHandler.js +23 -0
- package/raw/plugins/RawEventHandler.js.map +1 -0
- package/s3/index.d.ts +11 -0
- package/s3/index.js +92 -0
- package/s3/index.js.map +1 -0
- package/s3/plugins/S3EventHandler.d.ts +19 -0
- package/s3/plugins/S3EventHandler.js +30 -0
- package/s3/plugins/S3EventHandler.js.map +1 -0
- package/sqs/index.d.ts +11 -0
- package/sqs/index.js +92 -0
- package/sqs/index.js.map +1 -0
- package/sqs/plugins/SQSEventHandler.d.ts +19 -0
- package/sqs/plugins/SQSEventHandler.js +30 -0
- package/sqs/plugins/SQSEventHandler.js.map +1 -0
- package/types.d.ts +18 -0
- package/types.js +32 -0
- package/types.js.map +1 -0
- package/plugins/handlerArgs.d.ts +0 -7
- package/plugins/handlerArgs.js +0 -16
- package/plugins/handlerArgs.js.map +0 -1
- package/plugins/handlerHttp.d.ts +0 -16
- package/plugins/handlerHttp.js +0 -65
- package/plugins/handlerHttp.js.map +0 -1
package/s3/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreateHandlerParams as BaseCreateHandlerParams } from "@webiny/handler";
|
|
2
|
+
import { S3Event, Context as LambdaContext } from "aws-lambda";
|
|
3
|
+
import { APIGatewayProxyResult } from "aws-lambda/trigger/api-gateway-proxy";
|
|
4
|
+
export interface HandlerCallable {
|
|
5
|
+
(payload: S3Event, context: LambdaContext): Promise<APIGatewayProxyResult>;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateHandlerParams extends BaseCreateHandlerParams {
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const createHandler: (params: CreateHandlerParams) => HandlerCallable;
|
|
11
|
+
export * from "./plugins/S3EventHandler";
|
package/s3/index.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
createHandler: true
|
|
10
|
+
};
|
|
11
|
+
exports.createHandler = void 0;
|
|
12
|
+
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
var _handler = require("@webiny/handler");
|
|
16
|
+
|
|
17
|
+
var _S3EventHandler = require("./plugins/S3EventHandler");
|
|
18
|
+
|
|
19
|
+
Object.keys(_S3EventHandler).forEach(function (key) {
|
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
22
|
+
if (key in exports && exports[key] === _S3EventHandler[key]) return;
|
|
23
|
+
Object.defineProperty(exports, key, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return _S3EventHandler[key];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var _plugins = require("../plugins");
|
|
32
|
+
|
|
33
|
+
var _execute = require("../execute");
|
|
34
|
+
|
|
35
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
+
|
|
37
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
38
|
+
|
|
39
|
+
const Reply = require("fastify/lib/reply");
|
|
40
|
+
|
|
41
|
+
const url = "/webiny-s3-event";
|
|
42
|
+
|
|
43
|
+
const createHandler = params => {
|
|
44
|
+
return (payload, context) => {
|
|
45
|
+
const app = (0, _handler.createHandler)({
|
|
46
|
+
plugins: params.plugins,
|
|
47
|
+
options: _objectSpread({
|
|
48
|
+
logger: params.debug === true
|
|
49
|
+
}, params.options || {})
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* We always must add our default plugins to the app.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
(0, _plugins.registerDefaultPlugins)(app.webiny);
|
|
56
|
+
/**
|
|
57
|
+
* There must be an event plugin for this handler to work.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
const plugins = app.webiny.plugins.byType(_S3EventHandler.S3EventHandler.type);
|
|
61
|
+
const handler = plugins.shift();
|
|
62
|
+
|
|
63
|
+
if (!handler) {
|
|
64
|
+
throw new Error(`To run @webiny/handler-aws/s3, you must have S3EventHandler set.`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
app.post(url, async (request, reply) => {
|
|
68
|
+
const params = {
|
|
69
|
+
request,
|
|
70
|
+
reply,
|
|
71
|
+
context: app.webiny,
|
|
72
|
+
event: payload,
|
|
73
|
+
lambdaContext: context
|
|
74
|
+
};
|
|
75
|
+
const result = await handler.cb(params);
|
|
76
|
+
|
|
77
|
+
if (result instanceof Reply) {
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
app.__webiny_raw_result = result;
|
|
82
|
+
return reply.send({});
|
|
83
|
+
});
|
|
84
|
+
return (0, _execute.execute)({
|
|
85
|
+
app,
|
|
86
|
+
url,
|
|
87
|
+
payload
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
exports.createHandler = createHandler;
|
package/s3/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Reply","require","url","createHandler","params","payload","context","app","createBaseHandler","plugins","options","logger","debug","registerDefaultPlugins","webiny","byType","S3EventHandler","type","handler","shift","Error","post","request","reply","event","lambdaContext","result","cb","__webiny_raw_result","send","execute"],"sources":["index.ts"],"sourcesContent":["import {\n createHandler as createBaseHandler,\n CreateHandlerParams as BaseCreateHandlerParams\n} from \"@webiny/handler\";\nconst Reply = require(\"fastify/lib/reply\");\nimport { S3Event, Context as LambdaContext } from \"aws-lambda\";\nimport { S3EventHandler, S3EventHandlerCallableParams } from \"./plugins/S3EventHandler\";\nimport { APIGatewayProxyResult } from \"aws-lambda/trigger/api-gateway-proxy\";\nimport { registerDefaultPlugins } from \"~/plugins\";\nimport { execute } from \"~/execute\";\n\nconst url = \"/webiny-s3-event\";\n\nexport interface HandlerCallable {\n (payload: S3Event, context: LambdaContext): Promise<APIGatewayProxyResult>;\n}\n\nexport interface CreateHandlerParams extends BaseCreateHandlerParams {\n debug?: boolean;\n}\n\nexport const createHandler = (params: CreateHandlerParams): HandlerCallable => {\n return (payload, context) => {\n const app = createBaseHandler({\n plugins: params.plugins,\n options: {\n logger: params.debug === true,\n ...(params.options || {})\n }\n });\n /**\n * We always must add our default plugins to the app.\n */\n registerDefaultPlugins(app.webiny);\n /**\n * There must be an event plugin for this handler to work.\n */\n const plugins = app.webiny.plugins.byType<S3EventHandler>(S3EventHandler.type);\n const handler = plugins.shift();\n if (!handler) {\n throw new Error(`To run @webiny/handler-aws/s3, you must have S3EventHandler set.`);\n }\n\n app.post(url, async (request, reply) => {\n const params: S3EventHandlerCallableParams = {\n request,\n reply,\n context: app.webiny,\n event: payload,\n lambdaContext: context\n };\n const result = await handler.cb(params);\n\n if (result instanceof Reply) {\n return result;\n }\n\n (app as any).__webiny_raw_result = result;\n return reply.send({});\n });\n return execute({\n app,\n url,\n payload\n });\n };\n};\n\nexport * from \"./plugins/S3EventHandler\";\n"],"mappings":";;;;;;;;;;;;;;AAAA;;AAMA;;AA8DA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AA5DA;;AACA;;;;;;AALA,MAAMA,KAAK,GAAGC,OAAO,CAAC,mBAAD,CAArB;;AAOA,MAAMC,GAAG,GAAG,kBAAZ;;AAUO,MAAMC,aAAa,GAAIC,MAAD,IAAkD;EAC3E,OAAO,CAACC,OAAD,EAAUC,OAAV,KAAsB;IACzB,MAAMC,GAAG,GAAG,IAAAC,sBAAA,EAAkB;MAC1BC,OAAO,EAAEL,MAAM,CAACK,OADU;MAE1BC,OAAO;QACHC,MAAM,EAAEP,MAAM,CAACQ,KAAP,KAAiB;MADtB,GAECR,MAAM,CAACM,OAAP,IAAkB,EAFnB;IAFmB,CAAlB,CAAZ;IAOA;AACR;AACA;;IACQ,IAAAG,+BAAA,EAAuBN,GAAG,CAACO,MAA3B;IACA;AACR;AACA;;IACQ,MAAML,OAAO,GAAGF,GAAG,CAACO,MAAJ,CAAWL,OAAX,CAAmBM,MAAnB,CAA0CC,8BAAA,CAAeC,IAAzD,CAAhB;IACA,MAAMC,OAAO,GAAGT,OAAO,CAACU,KAAR,EAAhB;;IACA,IAAI,CAACD,OAAL,EAAc;MACV,MAAM,IAAIE,KAAJ,CAAW,kEAAX,CAAN;IACH;;IAEDb,GAAG,CAACc,IAAJ,CAASnB,GAAT,EAAc,OAAOoB,OAAP,EAAgBC,KAAhB,KAA0B;MACpC,MAAMnB,MAAoC,GAAG;QACzCkB,OADyC;QAEzCC,KAFyC;QAGzCjB,OAAO,EAAEC,GAAG,CAACO,MAH4B;QAIzCU,KAAK,EAAEnB,OAJkC;QAKzCoB,aAAa,EAAEnB;MAL0B,CAA7C;MAOA,MAAMoB,MAAM,GAAG,MAAMR,OAAO,CAACS,EAAR,CAAWvB,MAAX,CAArB;;MAEA,IAAIsB,MAAM,YAAY1B,KAAtB,EAA6B;QACzB,OAAO0B,MAAP;MACH;;MAEAnB,GAAD,CAAaqB,mBAAb,GAAmCF,MAAnC;MACA,OAAOH,KAAK,CAACM,IAAN,CAAW,EAAX,CAAP;IACH,CAhBD;IAiBA,OAAO,IAAAC,gBAAA,EAAQ;MACXvB,GADW;MAEXL,GAFW;MAGXG;IAHW,CAAR,CAAP;EAKH,CA3CD;AA4CH,CA7CM"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins/Plugin";
|
|
2
|
+
import { Request, Reply, Context } from "@webiny/handler/types";
|
|
3
|
+
import { S3Event, Context as LambdaContext } from "aws-lambda";
|
|
4
|
+
export interface S3EventHandlerCallableParams {
|
|
5
|
+
request: Request;
|
|
6
|
+
context: Context;
|
|
7
|
+
event: S3Event;
|
|
8
|
+
lambdaContext: LambdaContext;
|
|
9
|
+
reply: Reply;
|
|
10
|
+
}
|
|
11
|
+
export interface S3EventHandlerCallable<Response> {
|
|
12
|
+
(params: S3EventHandlerCallableParams): Promise<Response | Reply>;
|
|
13
|
+
}
|
|
14
|
+
export declare class S3EventHandler<Response = any> extends Plugin {
|
|
15
|
+
static type: string;
|
|
16
|
+
readonly cb: S3EventHandlerCallable<Response>;
|
|
17
|
+
constructor(cb: S3EventHandlerCallable<Response>);
|
|
18
|
+
}
|
|
19
|
+
export declare const createEventHandler: <Response_1>(cb: S3EventHandlerCallable<Response_1>) => S3EventHandler<Response_1>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createEventHandler = exports.S3EventHandler = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _Plugin = require("@webiny/plugins/Plugin");
|
|
13
|
+
|
|
14
|
+
class S3EventHandler extends _Plugin.Plugin {
|
|
15
|
+
constructor(cb) {
|
|
16
|
+
super();
|
|
17
|
+
(0, _defineProperty2.default)(this, "cb", void 0);
|
|
18
|
+
this.cb = cb;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.S3EventHandler = S3EventHandler;
|
|
24
|
+
(0, _defineProperty2.default)(S3EventHandler, "type", "handler.fastify.aws.s3.eventHandler");
|
|
25
|
+
|
|
26
|
+
const createEventHandler = cb => {
|
|
27
|
+
return new S3EventHandler(cb);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.createEventHandler = createEventHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["S3EventHandler","Plugin","constructor","cb","createEventHandler"],"sources":["S3EventHandler.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { Request, Reply, Context } from \"@webiny/handler/types\";\nimport { S3Event, Context as LambdaContext } from \"aws-lambda\";\n\nexport interface S3EventHandlerCallableParams {\n request: Request;\n context: Context;\n event: S3Event;\n lambdaContext: LambdaContext;\n reply: Reply;\n}\nexport interface S3EventHandlerCallable<Response> {\n (params: S3EventHandlerCallableParams): Promise<Response | Reply>;\n}\n\nexport class S3EventHandler<Response = any> extends Plugin {\n public static override type = \"handler.fastify.aws.s3.eventHandler\";\n\n public readonly cb: S3EventHandlerCallable<Response>;\n\n public constructor(cb: S3EventHandlerCallable<Response>) {\n super();\n this.cb = cb;\n }\n}\n\nexport const createEventHandler = <Response>(cb: S3EventHandlerCallable<Response>) => {\n return new S3EventHandler<Response>(cb);\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAeO,MAAMA,cAAN,SAA6CC,cAA7C,CAAoD;EAKhDC,WAAW,CAACC,EAAD,EAAuC;IACrD;IADqD;IAErD,KAAKA,EAAL,GAAUA,EAAV;EACH;;AARsD;;;8BAA9CH,c,UACqB,qC;;AAU3B,MAAMI,kBAAkB,GAAcD,EAAX,IAAoD;EAClF,OAAO,IAAIH,cAAJ,CAA6BG,EAA7B,CAAP;AACH,CAFM"}
|
package/sqs/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreateHandlerParams as BaseCreateHandlerParams } from "@webiny/handler";
|
|
2
|
+
import { SQSEvent, Context as LambdaContext } from "aws-lambda";
|
|
3
|
+
import { APIGatewayProxyResult } from "aws-lambda/trigger/api-gateway-proxy";
|
|
4
|
+
export interface HandlerCallable {
|
|
5
|
+
(payload: SQSEvent, context: LambdaContext): Promise<APIGatewayProxyResult>;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateHandlerParams extends BaseCreateHandlerParams {
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const createHandler: (params: CreateHandlerParams) => HandlerCallable;
|
|
11
|
+
export * from "./plugins/SQSEventHandler";
|
package/sqs/index.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
createHandler: true
|
|
10
|
+
};
|
|
11
|
+
exports.createHandler = void 0;
|
|
12
|
+
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
var _handler = require("@webiny/handler");
|
|
16
|
+
|
|
17
|
+
var _SQSEventHandler = require("./plugins/SQSEventHandler");
|
|
18
|
+
|
|
19
|
+
Object.keys(_SQSEventHandler).forEach(function (key) {
|
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
22
|
+
if (key in exports && exports[key] === _SQSEventHandler[key]) return;
|
|
23
|
+
Object.defineProperty(exports, key, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return _SQSEventHandler[key];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var _plugins = require("../plugins");
|
|
32
|
+
|
|
33
|
+
var _execute = require("../execute");
|
|
34
|
+
|
|
35
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
+
|
|
37
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
38
|
+
|
|
39
|
+
const Reply = require("fastify/lib/reply");
|
|
40
|
+
|
|
41
|
+
const url = "/webiny-sqs-event";
|
|
42
|
+
|
|
43
|
+
const createHandler = params => {
|
|
44
|
+
return (payload, context) => {
|
|
45
|
+
const app = (0, _handler.createHandler)({
|
|
46
|
+
plugins: params.plugins,
|
|
47
|
+
options: _objectSpread({
|
|
48
|
+
logger: params.debug === true
|
|
49
|
+
}, params.options || {})
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* We always must add our default plugins to the app.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
(0, _plugins.registerDefaultPlugins)(app.webiny);
|
|
56
|
+
/**
|
|
57
|
+
* There must be an event plugin for this handler to work.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
const plugins = app.webiny.plugins.byType(_SQSEventHandler.SQSEventHandler.type);
|
|
61
|
+
const handler = plugins.shift();
|
|
62
|
+
|
|
63
|
+
if (!handler) {
|
|
64
|
+
throw new Error(`To run @webiny/handler-aws/sqs, you must have SQSEventHandler set.`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
app.post(url, async (request, reply) => {
|
|
68
|
+
const params = {
|
|
69
|
+
request,
|
|
70
|
+
reply,
|
|
71
|
+
context: app.webiny,
|
|
72
|
+
event: payload,
|
|
73
|
+
lambdaContext: context
|
|
74
|
+
};
|
|
75
|
+
const result = await handler.cb(params);
|
|
76
|
+
|
|
77
|
+
if (result instanceof Reply) {
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
app.__webiny_raw_result = result;
|
|
82
|
+
return reply.send({});
|
|
83
|
+
});
|
|
84
|
+
return (0, _execute.execute)({
|
|
85
|
+
app,
|
|
86
|
+
url,
|
|
87
|
+
payload
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
exports.createHandler = createHandler;
|
package/sqs/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Reply","require","url","createHandler","params","payload","context","app","createBaseHandler","plugins","options","logger","debug","registerDefaultPlugins","webiny","byType","SQSEventHandler","type","handler","shift","Error","post","request","reply","event","lambdaContext","result","cb","__webiny_raw_result","send","execute"],"sources":["index.ts"],"sourcesContent":["import {\n createHandler as createBaseHandler,\n CreateHandlerParams as BaseCreateHandlerParams\n} from \"@webiny/handler\";\nconst Reply = require(\"fastify/lib/reply\");\nimport { SQSEvent, Context as LambdaContext } from \"aws-lambda\";\nimport { SQSEventHandler, SQSEventHandlerCallableParams } from \"./plugins/SQSEventHandler\";\nimport { APIGatewayProxyResult } from \"aws-lambda/trigger/api-gateway-proxy\";\nimport { registerDefaultPlugins } from \"~/plugins\";\nimport { execute } from \"~/execute\";\n\nconst url = \"/webiny-sqs-event\";\n\nexport interface HandlerCallable {\n (payload: SQSEvent, context: LambdaContext): Promise<APIGatewayProxyResult>;\n}\n\nexport interface CreateHandlerParams extends BaseCreateHandlerParams {\n debug?: boolean;\n}\n\nexport const createHandler = (params: CreateHandlerParams): HandlerCallable => {\n return (payload, context) => {\n const app = createBaseHandler({\n plugins: params.plugins,\n options: {\n logger: params.debug === true,\n ...(params.options || {})\n }\n });\n /**\n * We always must add our default plugins to the app.\n */\n registerDefaultPlugins(app.webiny);\n /**\n * There must be an event plugin for this handler to work.\n */\n const plugins = app.webiny.plugins.byType<SQSEventHandler>(SQSEventHandler.type);\n const handler = plugins.shift();\n if (!handler) {\n throw new Error(`To run @webiny/handler-aws/sqs, you must have SQSEventHandler set.`);\n }\n\n app.post(url, async (request, reply) => {\n const params: SQSEventHandlerCallableParams = {\n request,\n reply,\n context: app.webiny,\n event: payload,\n lambdaContext: context\n };\n const result = await handler.cb(params);\n\n if (result instanceof Reply) {\n return result;\n }\n\n (app as any).__webiny_raw_result = result;\n return reply.send({});\n });\n return execute({\n app,\n url,\n payload\n });\n };\n};\n\nexport * from \"./plugins/SQSEventHandler\";\n"],"mappings":";;;;;;;;;;;;;;AAAA;;AAMA;;AA8DA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AA5DA;;AACA;;;;;;AALA,MAAMA,KAAK,GAAGC,OAAO,CAAC,mBAAD,CAArB;;AAOA,MAAMC,GAAG,GAAG,mBAAZ;;AAUO,MAAMC,aAAa,GAAIC,MAAD,IAAkD;EAC3E,OAAO,CAACC,OAAD,EAAUC,OAAV,KAAsB;IACzB,MAAMC,GAAG,GAAG,IAAAC,sBAAA,EAAkB;MAC1BC,OAAO,EAAEL,MAAM,CAACK,OADU;MAE1BC,OAAO;QACHC,MAAM,EAAEP,MAAM,CAACQ,KAAP,KAAiB;MADtB,GAECR,MAAM,CAACM,OAAP,IAAkB,EAFnB;IAFmB,CAAlB,CAAZ;IAOA;AACR;AACA;;IACQ,IAAAG,+BAAA,EAAuBN,GAAG,CAACO,MAA3B;IACA;AACR;AACA;;IACQ,MAAML,OAAO,GAAGF,GAAG,CAACO,MAAJ,CAAWL,OAAX,CAAmBM,MAAnB,CAA2CC,gCAAA,CAAgBC,IAA3D,CAAhB;IACA,MAAMC,OAAO,GAAGT,OAAO,CAACU,KAAR,EAAhB;;IACA,IAAI,CAACD,OAAL,EAAc;MACV,MAAM,IAAIE,KAAJ,CAAW,oEAAX,CAAN;IACH;;IAEDb,GAAG,CAACc,IAAJ,CAASnB,GAAT,EAAc,OAAOoB,OAAP,EAAgBC,KAAhB,KAA0B;MACpC,MAAMnB,MAAqC,GAAG;QAC1CkB,OAD0C;QAE1CC,KAF0C;QAG1CjB,OAAO,EAAEC,GAAG,CAACO,MAH6B;QAI1CU,KAAK,EAAEnB,OAJmC;QAK1CoB,aAAa,EAAEnB;MAL2B,CAA9C;MAOA,MAAMoB,MAAM,GAAG,MAAMR,OAAO,CAACS,EAAR,CAAWvB,MAAX,CAArB;;MAEA,IAAIsB,MAAM,YAAY1B,KAAtB,EAA6B;QACzB,OAAO0B,MAAP;MACH;;MAEAnB,GAAD,CAAaqB,mBAAb,GAAmCF,MAAnC;MACA,OAAOH,KAAK,CAACM,IAAN,CAAW,EAAX,CAAP;IACH,CAhBD;IAiBA,OAAO,IAAAC,gBAAA,EAAQ;MACXvB,GADW;MAEXL,GAFW;MAGXG;IAHW,CAAR,CAAP;EAKH,CA3CD;AA4CH,CA7CM"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins/Plugin";
|
|
2
|
+
import { Request, Reply, Context } from "@webiny/handler/types";
|
|
3
|
+
import { SQSEvent, Context as LambdaContext } from "aws-lambda";
|
|
4
|
+
export interface SQSEventHandlerCallableParams {
|
|
5
|
+
request: Request;
|
|
6
|
+
reply: Reply;
|
|
7
|
+
context: Context;
|
|
8
|
+
event: SQSEvent;
|
|
9
|
+
lambdaContext: LambdaContext;
|
|
10
|
+
}
|
|
11
|
+
export interface SQSEventHandlerCallable<Response> {
|
|
12
|
+
(params: SQSEventHandlerCallableParams): Promise<Response | Reply>;
|
|
13
|
+
}
|
|
14
|
+
export declare class SQSEventHandler<Response = any> extends Plugin {
|
|
15
|
+
static type: string;
|
|
16
|
+
readonly cb: SQSEventHandlerCallable<Response>;
|
|
17
|
+
constructor(cb: SQSEventHandlerCallable<Response>);
|
|
18
|
+
}
|
|
19
|
+
export declare const createEventHandler: <Response_1>(cb: SQSEventHandlerCallable<Response_1>) => SQSEventHandler<Response_1>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createEventHandler = exports.SQSEventHandler = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _Plugin = require("@webiny/plugins/Plugin");
|
|
13
|
+
|
|
14
|
+
class SQSEventHandler extends _Plugin.Plugin {
|
|
15
|
+
constructor(cb) {
|
|
16
|
+
super();
|
|
17
|
+
(0, _defineProperty2.default)(this, "cb", void 0);
|
|
18
|
+
this.cb = cb;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.SQSEventHandler = SQSEventHandler;
|
|
24
|
+
(0, _defineProperty2.default)(SQSEventHandler, "type", "handler.fastify.aws.sqs.eventHandler");
|
|
25
|
+
|
|
26
|
+
const createEventHandler = cb => {
|
|
27
|
+
return new SQSEventHandler(cb);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.createEventHandler = createEventHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SQSEventHandler","Plugin","constructor","cb","createEventHandler"],"sources":["SQSEventHandler.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { Request, Reply, Context } from \"@webiny/handler/types\";\nimport { SQSEvent, Context as LambdaContext } from \"aws-lambda\";\n\nexport interface SQSEventHandlerCallableParams {\n request: Request;\n reply: Reply;\n context: Context;\n event: SQSEvent;\n lambdaContext: LambdaContext;\n}\nexport interface SQSEventHandlerCallable<Response> {\n (params: SQSEventHandlerCallableParams): Promise<Response | Reply>;\n}\n\nexport class SQSEventHandler<Response = any> extends Plugin {\n public static override type = \"handler.fastify.aws.sqs.eventHandler\";\n\n public readonly cb: SQSEventHandlerCallable<Response>;\n\n public constructor(cb: SQSEventHandlerCallable<Response>) {\n super();\n this.cb = cb;\n }\n}\n\nexport const createEventHandler = <Response>(cb: SQSEventHandlerCallable<Response>) => {\n return new SQSEventHandler<Response>(cb);\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAeO,MAAMA,eAAN,SAA8CC,cAA9C,CAAqD;EAKjDC,WAAW,CAACC,EAAD,EAAwC;IACtD;IADsD;IAEtD,KAAKA,EAAL,GAAUA,EAAV;EACH;;AARuD;;;8BAA/CH,e,UACqB,sC;;AAU3B,MAAMI,kBAAkB,GAAcD,EAAX,IAAqD;EACnF,OAAO,IAAIH,eAAJ,CAA8BG,EAA9B,CAAP;AACH,CAFM"}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { APIGatewayEvent, Context as LambdaContext } from "aws-lambda";
|
|
2
|
+
import "fastify";
|
|
3
|
+
export * from "@webiny/handler/types";
|
|
4
|
+
export declare enum Base64EncodeHeader {
|
|
5
|
+
encoded = "x-webiny-base64-encoded",
|
|
6
|
+
binary = "x-webiny-binary"
|
|
7
|
+
}
|
|
8
|
+
declare module "fastify" {
|
|
9
|
+
interface FastifyInstance {
|
|
10
|
+
__webiny_raw_result: any;
|
|
11
|
+
}
|
|
12
|
+
interface FastifyRequest {
|
|
13
|
+
awsLambda: {
|
|
14
|
+
event: APIGatewayEvent;
|
|
15
|
+
context: LambdaContext;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
package/types.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Base64EncodeHeader: true
|
|
8
|
+
};
|
|
9
|
+
exports.Base64EncodeHeader = void 0;
|
|
10
|
+
|
|
11
|
+
require("fastify");
|
|
12
|
+
|
|
13
|
+
var _types = require("@webiny/handler/types");
|
|
14
|
+
|
|
15
|
+
Object.keys(_types).forEach(function (key) {
|
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _types[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
let Base64EncodeHeader;
|
|
27
|
+
exports.Base64EncodeHeader = Base64EncodeHeader;
|
|
28
|
+
|
|
29
|
+
(function (Base64EncodeHeader) {
|
|
30
|
+
Base64EncodeHeader["encoded"] = "x-webiny-base64-encoded";
|
|
31
|
+
Base64EncodeHeader["binary"] = "x-webiny-binary";
|
|
32
|
+
})(Base64EncodeHeader || (exports.Base64EncodeHeader = Base64EncodeHeader = {}));
|
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Base64EncodeHeader"],"sources":["types.ts"],"sourcesContent":["import { APIGatewayEvent, Context as LambdaContext } from \"aws-lambda\";\nimport \"fastify\";\nexport * from \"@webiny/handler/types\";\n\nexport enum Base64EncodeHeader {\n encoded = \"x-webiny-base64-encoded\",\n binary = \"x-webiny-binary\"\n}\n\ndeclare module \"fastify\" {\n interface FastifyInstance {\n __webiny_raw_result: any;\n }\n interface FastifyRequest {\n awsLambda: {\n event: APIGatewayEvent;\n context: LambdaContext;\n };\n }\n}\n"],"mappings":";;;;;;;;;;AACA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;IAEYA,kB;;;WAAAA,kB;EAAAA,kB;EAAAA,kB;GAAAA,kB,kCAAAA,kB"}
|
package/plugins/handlerArgs.d.ts
DELETED
package/plugins/handlerArgs.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
type: "context",
|
|
9
|
-
|
|
10
|
-
apply(context) {
|
|
11
|
-
const [event] = context.args;
|
|
12
|
-
context.invocationArgs = event;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["type","apply","context","event","args","invocationArgs"],"sources":["handlerArgs.ts"],"sourcesContent":["import { ArgsContext } from \"@webiny/handler-args/types\";\nimport { Context } from \"@webiny/handler/types\";\n\nexport default {\n type: \"context\",\n apply(context: Context & ArgsContext) {\n const [event] = context.args;\n context.invocationArgs = event;\n }\n};\n"],"mappings":";;;;;;eAGe;EACXA,IAAI,EAAE,SADK;;EAEXC,KAAK,CAACC,OAAD,EAAiC;IAClC,MAAM,CAACC,KAAD,IAAUD,OAAO,CAACE,IAAxB;IACAF,OAAO,CAACG,cAAR,GAAyBF,KAAzB;EACH;;AALU,C"}
|
package/plugins/handlerHttp.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { HttpContext } from "@webiny/handler-http/types";
|
|
2
|
-
import { ContextPlugin } from "@webiny/handler/types";
|
|
3
|
-
import { ArgsContext } from "@webiny/handler-args/types";
|
|
4
|
-
interface InputArgs {
|
|
5
|
-
httpMethod: string;
|
|
6
|
-
isBase64Encoded?: boolean;
|
|
7
|
-
rawPath: string;
|
|
8
|
-
pathParameters: {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
queryStringParameters: {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
declare const _default: ContextPlugin<HttpContext & ArgsContext<InputArgs>, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context, import("@webiny/handler/types").Context>;
|
|
16
|
-
export default _default;
|
package/plugins/handlerHttp.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
const lowercaseKeys = obj => {
|
|
9
|
-
return Object.keys(obj).reduce((acc, key) => {
|
|
10
|
-
acc[key.toLowerCase()] = obj[key];
|
|
11
|
-
return acc;
|
|
12
|
-
}, {});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
var _default = {
|
|
16
|
-
type: "context",
|
|
17
|
-
|
|
18
|
-
apply(context) {
|
|
19
|
-
const {
|
|
20
|
-
invocationArgs
|
|
21
|
-
} = context;
|
|
22
|
-
|
|
23
|
-
if (!invocationArgs || !invocationArgs.httpMethod) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
isBase64Encoded
|
|
29
|
-
} = invocationArgs;
|
|
30
|
-
const request = {
|
|
31
|
-
method: invocationArgs.httpMethod,
|
|
32
|
-
body: invocationArgs.body,
|
|
33
|
-
headers: lowercaseKeys(invocationArgs.headers || {}),
|
|
34
|
-
cookies: invocationArgs.cookies,
|
|
35
|
-
path: {
|
|
36
|
-
base: invocationArgs.rawPath,
|
|
37
|
-
parameters: invocationArgs.pathParameters,
|
|
38
|
-
query: invocationArgs.queryStringParameters
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
context.http = {
|
|
42
|
-
request,
|
|
43
|
-
|
|
44
|
-
response({
|
|
45
|
-
statusCode = 200,
|
|
46
|
-
body = "",
|
|
47
|
-
headers = {}
|
|
48
|
-
}) {
|
|
49
|
-
return {
|
|
50
|
-
statusCode,
|
|
51
|
-
body: isBase64Encoded ? Buffer.from(body).toString("base64") : body,
|
|
52
|
-
headers,
|
|
53
|
-
isBase64Encoded
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
if (isBase64Encoded) {
|
|
60
|
-
context.http.request.body = Buffer.from(context.http.request.body, "base64").toString("utf-8");
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["lowercaseKeys","obj","Object","keys","reduce","acc","key","toLowerCase","type","apply","context","invocationArgs","httpMethod","isBase64Encoded","request","method","body","headers","cookies","path","base","rawPath","parameters","pathParameters","query","queryStringParameters","http","response","statusCode","Buffer","from","toString"],"sources":["handlerHttp.ts"],"sourcesContent":["import { HttpContext } from \"@webiny/handler-http/types\";\nimport { ContextPlugin } from \"@webiny/handler/types\";\nimport { ArgsContext } from \"@webiny/handler-args/types\";\n\nconst lowercaseKeys = (obj: Record<string, string>) => {\n return Object.keys(obj).reduce((acc, key) => {\n acc[key.toLowerCase()] = obj[key];\n return acc;\n }, {} as Record<string, string>);\n};\n\ninterface InputArgs {\n httpMethod: string;\n isBase64Encoded?: boolean;\n rawPath: string;\n pathParameters: {\n [key: string]: any;\n };\n queryStringParameters: {\n [key: string]: any;\n };\n}\n\nexport default {\n type: \"context\",\n apply(context) {\n const { invocationArgs } = context;\n if (!invocationArgs || !invocationArgs.httpMethod) {\n return;\n }\n\n const { isBase64Encoded } = invocationArgs;\n\n const request = {\n method: invocationArgs.httpMethod,\n body: invocationArgs.body,\n headers: lowercaseKeys(invocationArgs.headers || {}),\n cookies: invocationArgs.cookies,\n path: {\n base: invocationArgs.rawPath,\n parameters: invocationArgs.pathParameters,\n query: invocationArgs.queryStringParameters\n }\n };\n\n context.http = {\n request,\n response({ statusCode = 200, body = \"\", headers = {} }) {\n return {\n statusCode,\n body: isBase64Encoded ? Buffer.from(body).toString(\"base64\") : body,\n headers,\n isBase64Encoded\n };\n }\n };\n\n if (isBase64Encoded) {\n context.http.request.body = Buffer.from(context.http.request.body, \"base64\").toString(\n \"utf-8\"\n );\n }\n }\n} as ContextPlugin<HttpContext & ArgsContext<InputArgs>>;\n"],"mappings":";;;;;;;AAIA,MAAMA,aAAa,GAAIC,GAAD,IAAiC;EACnD,OAAOC,MAAM,CAACC,IAAP,CAAYF,GAAZ,EAAiBG,MAAjB,CAAwB,CAACC,GAAD,EAAMC,GAAN,KAAc;IACzCD,GAAG,CAACC,GAAG,CAACC,WAAJ,EAAD,CAAH,GAAyBN,GAAG,CAACK,GAAD,CAA5B;IACA,OAAOD,GAAP;EACH,CAHM,EAGJ,EAHI,CAAP;AAIH,CALD;;eAmBe;EACXG,IAAI,EAAE,SADK;;EAEXC,KAAK,CAACC,OAAD,EAAU;IACX,MAAM;MAAEC;IAAF,IAAqBD,OAA3B;;IACA,IAAI,CAACC,cAAD,IAAmB,CAACA,cAAc,CAACC,UAAvC,EAAmD;MAC/C;IACH;;IAED,MAAM;MAAEC;IAAF,IAAsBF,cAA5B;IAEA,MAAMG,OAAO,GAAG;MACZC,MAAM,EAAEJ,cAAc,CAACC,UADX;MAEZI,IAAI,EAAEL,cAAc,CAACK,IAFT;MAGZC,OAAO,EAAEjB,aAAa,CAACW,cAAc,CAACM,OAAf,IAA0B,EAA3B,CAHV;MAIZC,OAAO,EAAEP,cAAc,CAACO,OAJZ;MAKZC,IAAI,EAAE;QACFC,IAAI,EAAET,cAAc,CAACU,OADnB;QAEFC,UAAU,EAAEX,cAAc,CAACY,cAFzB;QAGFC,KAAK,EAAEb,cAAc,CAACc;MAHpB;IALM,CAAhB;IAYAf,OAAO,CAACgB,IAAR,GAAe;MACXZ,OADW;;MAEXa,QAAQ,CAAC;QAAEC,UAAU,GAAG,GAAf;QAAoBZ,IAAI,GAAG,EAA3B;QAA+BC,OAAO,GAAG;MAAzC,CAAD,EAAgD;QACpD,OAAO;UACHW,UADG;UAEHZ,IAAI,EAAEH,eAAe,GAAGgB,MAAM,CAACC,IAAP,CAAYd,IAAZ,EAAkBe,QAAlB,CAA2B,QAA3B,CAAH,GAA0Cf,IAF5D;UAGHC,OAHG;UAIHJ;QAJG,CAAP;MAMH;;IATU,CAAf;;IAYA,IAAIA,eAAJ,EAAqB;MACjBH,OAAO,CAACgB,IAAR,CAAaZ,OAAb,CAAqBE,IAArB,GAA4Ba,MAAM,CAACC,IAAP,CAAYpB,OAAO,CAACgB,IAAR,CAAaZ,OAAb,CAAqBE,IAAjC,EAAuC,QAAvC,EAAiDe,QAAjD,CACxB,OADwB,CAA5B;IAGH;EACJ;;AAvCU,C"}
|