quidproquo-actionprocessor-awslambda 0.0.246 → 0.0.248
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/commonjs/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js +3 -3
- package/lib/commonjs/lambdas/dynamicModuleLoader/dynamicModuleLoader.d.ts +1 -1
- package/lib/commonjs/lambdas/dynamicModuleLoader/dynamicModuleLoader.js +2 -2
- package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js +2 -2
- package/lib/esm/lambdas/dynamicModuleLoader/dynamicModuleLoader.d.ts +1 -1
- package/lib/esm/lambdas/dynamicModuleLoader/dynamicModuleLoader.js +2 -2
- package/package.json +5 -5
|
@@ -12,11 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getCloudFrontRequestEvent_viewerRequest = exports.viewerRequestEventHandler = void 0;
|
|
13
13
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
14
|
const viewerRequestEventHandler = (event, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
16
16
|
console.log(JSON.stringify(event));
|
|
17
17
|
const request = event.Records[0].cf.request;
|
|
18
|
-
const headers = request.headers;
|
|
19
|
-
const userAgent = ((_a = headers['user-agent'][0]) === null ||
|
|
18
|
+
const headers = request.headers || {};
|
|
19
|
+
const userAgent = ((_b = (_a = headers['user-agent']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value) || 'unknown';
|
|
20
20
|
// let isBot = userAgent.match(/bot|crawl|spider|slurp|facebot|facebookexternalhit/i);
|
|
21
21
|
// Bot testing for integrating Prerender ~ you then do what you want inside the app business logic
|
|
22
22
|
// For more info: https://docs.prerender.io/docs/apache-2
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { QpqFunctionRuntime } from 'quidproquo-core';
|
|
2
|
-
export declare const dynamicModuleLoader: <T = any>(
|
|
2
|
+
export declare const dynamicModuleLoader: <T = any>(qpqFunctionRuntime: QpqFunctionRuntime) => Promise<T>;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.dynamicModuleLoader = void 0;
|
|
13
13
|
// @ts-expect-error - Special webpack file injected
|
|
14
14
|
const quidproquo_dynamic_loader_1 = require("quidproquo-dynamic-loader");
|
|
15
|
-
const dynamicModuleLoader = (
|
|
16
|
-
return (0, quidproquo_dynamic_loader_1.qpqDynamicModuleLoader)(
|
|
15
|
+
const dynamicModuleLoader = (qpqFunctionRuntime) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
return (0, quidproquo_dynamic_loader_1.qpqDynamicModuleLoader)(qpqFunctionRuntime);
|
|
17
17
|
});
|
|
18
18
|
exports.dynamicModuleLoader = dynamicModuleLoader;
|
|
@@ -2,8 +2,8 @@ import { qpqHeaderIsBot } from 'quidproquo-webserver';
|
|
|
2
2
|
export const viewerRequestEventHandler = async (event, context) => {
|
|
3
3
|
console.log(JSON.stringify(event));
|
|
4
4
|
const request = event.Records[0].cf.request;
|
|
5
|
-
const headers = request.headers;
|
|
6
|
-
const userAgent = headers['user-agent'][0]?.value || 'unknown';
|
|
5
|
+
const headers = request.headers || {};
|
|
6
|
+
const userAgent = headers['user-agent']?.[0]?.value || 'unknown';
|
|
7
7
|
// let isBot = userAgent.match(/bot|crawl|spider|slurp|facebot|facebookexternalhit/i);
|
|
8
8
|
// Bot testing for integrating Prerender ~ you then do what you want inside the app business logic
|
|
9
9
|
// For more info: https://docs.prerender.io/docs/apache-2
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { QpqFunctionRuntime } from 'quidproquo-core';
|
|
2
|
-
export declare const dynamicModuleLoader: <T = any>(
|
|
2
|
+
export declare const dynamicModuleLoader: <T = any>(qpqFunctionRuntime: QpqFunctionRuntime) => Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-expect-error - Special webpack file injected
|
|
2
2
|
import { qpqDynamicModuleLoader } from 'quidproquo-dynamic-loader';
|
|
3
|
-
export const dynamicModuleLoader = async (
|
|
4
|
-
return qpqDynamicModuleLoader(
|
|
3
|
+
export const dynamicModuleLoader = async (qpqFunctionRuntime) => {
|
|
4
|
+
return qpqDynamicModuleLoader(qpqFunctionRuntime);
|
|
5
5
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-awslambda",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.248",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"node-cache": "^5.1.2",
|
|
57
57
|
"node-match-path": "^0.6.3",
|
|
58
|
-
"quidproquo-config-aws": "0.0.
|
|
59
|
-
"quidproquo-core": "0.0.
|
|
60
|
-
"quidproquo-webserver": "0.0.
|
|
58
|
+
"quidproquo-config-aws": "0.0.248",
|
|
59
|
+
"quidproquo-core": "0.0.248",
|
|
60
|
+
"quidproquo-webserver": "0.0.248"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/aws-lambda": "^8.10.109",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/jsonwebtoken": "^9.0.2",
|
|
66
66
|
"@types/lodash": "^4.14.194",
|
|
67
67
|
"@types/node": "^18.11.9",
|
|
68
|
-
"quidproquo-tsconfig": "0.0.
|
|
68
|
+
"quidproquo-tsconfig": "0.0.248",
|
|
69
69
|
"typescript": "^4.9.3"
|
|
70
70
|
}
|
|
71
71
|
}
|