quidproquo-actionprocessor-awslambda 0.0.38 → 0.0.39

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.
Files changed (89) hide show
  1. package/lib/awsLambdaUtils.d.ts +6 -0
  2. package/lib/awsLambdaUtils.js +19 -0
  3. package/lib/getActionProcessor/core/config/getConfigGetParameterActionProcessor.d.ts +6 -0
  4. package/lib/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +26 -0
  5. package/lib/getActionProcessor/core/config/getConfigGetParametersActionProcessor.d.ts +6 -0
  6. package/lib/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +26 -0
  7. package/lib/getActionProcessor/core/config/getConfigGetSecretActionProcessor.d.ts +6 -0
  8. package/lib/getActionProcessor/core/config/getConfigGetSecretActionProcessor.js +26 -0
  9. package/lib/getActionProcessor/core/config/index.d.ts +7 -0
  10. package/lib/getActionProcessor/core/config/index.js +9 -0
  11. package/lib/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.d.ts +10 -0
  12. package/lib/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.js +95 -0
  13. package/lib/getActionProcessor/core/event/getEventBridgeEventActionProcessor.d.ts +10 -0
  14. package/lib/getActionProcessor/core/event/getEventBridgeEventActionProcessor.js +51 -0
  15. package/lib/getActionProcessor/core/file/getFileDeleteActionProcessor.d.ts +6 -0
  16. package/lib/getActionProcessor/core/file/getFileDeleteActionProcessor.js +31 -0
  17. package/lib/getActionProcessor/core/file/getFileExistsActionProcessor.d.ts +6 -0
  18. package/lib/getActionProcessor/core/file/getFileExistsActionProcessor.js +23 -0
  19. package/lib/getActionProcessor/core/file/getFileListDirectoryActionProcessor.d.ts +6 -0
  20. package/lib/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +29 -0
  21. package/lib/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.d.ts +6 -0
  22. package/lib/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.js +23 -0
  23. package/lib/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.d.ts +6 -0
  24. package/lib/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +24 -0
  25. package/lib/getActionProcessor/core/file/index.d.ts +9 -0
  26. package/lib/getActionProcessor/core/file/index.js +11 -0
  27. package/{src/getActionProcessor/core/index.ts → lib/getActionProcessor/core/index.d.ts} +0 -0
  28. package/lib/getActionProcessor/core/index.js +20 -0
  29. package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.d.ts +7 -0
  30. package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.js +45 -0
  31. package/lib/getActionProcessor/core/system/index.d.ts +5 -0
  32. package/lib/getActionProcessor/core/system/index.js +7 -0
  33. package/{src/getActionProcessor/index.ts → lib/getActionProcessor/index.d.ts} +0 -0
  34. package/lib/getActionProcessor/index.js +17 -0
  35. package/{src/index.ts → lib/index.d.ts} +0 -2
  36. package/lib/index.js +33 -0
  37. package/lib/logic/parametersManager/getParameter.d.ts +1 -0
  38. package/lib/logic/parametersManager/getParameter.js +22 -0
  39. package/lib/logic/parametersManager/getParameters.d.ts +1 -0
  40. package/lib/logic/parametersManager/getParameters.js +22 -0
  41. package/lib/logic/s3/deleteFiles.d.ts +1 -0
  42. package/lib/logic/s3/deleteFiles.js +29 -0
  43. package/lib/logic/s3/listFiles.d.ts +10 -0
  44. package/lib/logic/s3/listFiles.js +56 -0
  45. package/lib/logic/s3/objectExists.d.ts +1 -0
  46. package/lib/logic/s3/objectExists.js +30 -0
  47. package/lib/logic/s3/readTextFile.d.ts +1 -0
  48. package/lib/logic/s3/readTextFile.js +26 -0
  49. package/{src/logic/s3/s3Client.ts → lib/logic/s3/s3Client.d.ts} +1 -3
  50. package/lib/logic/s3/s3Client.js +5 -0
  51. package/{src/logic/s3/s3Utils.ts → lib/logic/s3/s3Utils.d.ts} +0 -0
  52. package/lib/logic/s3/s3Utils.js +21 -0
  53. package/lib/logic/s3/writeTextFile.d.ts +1 -0
  54. package/lib/logic/s3/writeTextFile.js +25 -0
  55. package/lib/logic/secretsManager/getSecret.d.ts +1 -0
  56. package/lib/logic/secretsManager/getSecret.js +21 -0
  57. package/lib/runtimeConfig/QPQAWSLambdaConfig.d.ts +12 -0
  58. package/lib/runtimeConfig/QPQAWSLambdaConfig.js +2 -0
  59. package/lib/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.d.ts +4 -0
  60. package/lib/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js +15 -0
  61. package/{src/types/DynamicLoader.ts → lib/types/DynamicLoader.d.ts} +0 -0
  62. package/lib/types/DynamicLoader.js +2 -0
  63. package/package.json +4 -1
  64. package/src/awsLambdaUtils.ts +0 -22
  65. package/src/getActionProcessor/core/config/getConfigGetParameterActionProcessor.ts +0 -23
  66. package/src/getActionProcessor/core/config/getConfigGetParametersActionProcessor.ts +0 -27
  67. package/src/getActionProcessor/core/config/getConfigGetSecretActionProcessor.ts +0 -23
  68. package/src/getActionProcessor/core/config/index.ts +0 -11
  69. package/src/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.ts +0 -134
  70. package/src/getActionProcessor/core/event/getEventBridgeEventActionProcessor.ts +0 -66
  71. package/src/getActionProcessor/core/file/getFileDeleteActionProcessor.ts +0 -31
  72. package/src/getActionProcessor/core/file/getFileExistsActionProcessor.ts +0 -16
  73. package/src/getActionProcessor/core/file/getFileListDirectoryActionProcessor.ts +0 -28
  74. package/src/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.ts +0 -18
  75. package/src/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.ts +0 -23
  76. package/src/getActionProcessor/core/file/index.ts +0 -15
  77. package/src/getActionProcessor/core/system/getExecuteStoryActionProcessor.ts +0 -67
  78. package/src/getActionProcessor/core/system/index.ts +0 -6
  79. package/src/logic/parametersManager/getParameter.ts +0 -13
  80. package/src/logic/parametersManager/getParameters.ts +0 -15
  81. package/src/logic/s3/deleteFiles.ts +0 -17
  82. package/src/logic/s3/listFiles.ts +0 -66
  83. package/src/logic/s3/objectExists.ts +0 -18
  84. package/src/logic/s3/readTextFile.ts +0 -14
  85. package/src/logic/s3/writeTextFile.ts +0 -17
  86. package/src/logic/secretsManager/getSecret.ts +0 -13
  87. package/src/runtimeConfig/QPQAWSLambdaConfig.ts +0 -15
  88. package/src/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.ts +0 -19
  89. package/tsconfig.json +0 -8
@@ -0,0 +1,6 @@
1
+ export declare const randomGuid: () => string;
2
+ export interface UrlMatch {
3
+ didMatch: boolean;
4
+ params: Record<string, string> | null;
5
+ }
6
+ export declare const matchUrl: (path: string, url: string) => UrlMatch;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchUrl = exports.randomGuid = void 0;
4
+ const crypto_1 = require("crypto");
5
+ const node_match_path_1 = require("node-match-path");
6
+ const randomGuid = () => {
7
+ return (0, crypto_1.randomUUID)();
8
+ };
9
+ exports.randomGuid = randomGuid;
10
+ const matchUrl = (path, url) => {
11
+ // /attempt/{attemptUuid}/result/{test} => /attempt/:attemptUuid/result/:test
12
+ const modifiedPath = path.replaceAll(/{(.+?)}/g, (m, g) => `:${g}`);
13
+ const matchResult = (0, node_match_path_1.match)(modifiedPath, url);
14
+ return {
15
+ didMatch: matchResult.matches,
16
+ params: matchResult.params,
17
+ };
18
+ };
19
+ exports.matchUrl = matchUrl;
@@ -0,0 +1,6 @@
1
+ import { ConfigGetParameterActionProcessor } from 'quidproquo-core';
2
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/Config/GetParameter": ConfigGetParameterActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
14
+ const getParameter_1 = require("../../../logic/parametersManager/getParameter");
15
+ const getProcessConfigGetParameter = (runtimeConfig) => {
16
+ return ({ parameterName }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const awsParameterKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(parameterName, runtimeConfig);
18
+ const parameterValue = yield (0, getParameter_1.getParameter)(awsParameterKey);
19
+ return (0, quidproquo_core_1.actionResult)(parameterValue);
20
+ });
21
+ };
22
+ exports.default = (runtimeConfig) => {
23
+ return {
24
+ [quidproquo_core_1.ConfigActionType.GetParameter]: getProcessConfigGetParameter(runtimeConfig),
25
+ };
26
+ };
@@ -0,0 +1,6 @@
1
+ import { ConfigGetParametersActionProcessor } from 'quidproquo-core';
2
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/Config/GetParameters": ConfigGetParametersActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
14
+ const getParameters_1 = require("../../../logic/parametersManager/getParameters");
15
+ const getProcessConfigGetParameters = (runtimeConfig) => {
16
+ return ({ parameterNames }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const awsParameterKeys = parameterNames.map((pn) => (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(pn, runtimeConfig));
18
+ const parameterValues = yield (0, getParameters_1.getParameters)(awsParameterKeys);
19
+ return (0, quidproquo_core_1.actionResult)(parameterValues);
20
+ });
21
+ };
22
+ exports.default = (runtimeConfig) => {
23
+ return {
24
+ [quidproquo_core_1.ConfigActionType.GetParameters]: getProcessConfigGetParameters(runtimeConfig),
25
+ };
26
+ };
@@ -0,0 +1,6 @@
1
+ import { ConfigGetSecretActionProcessor } from 'quidproquo-core';
2
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/Config/GetSecret": ConfigGetSecretActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
14
+ const getSecret_1 = require("../../../logic/secretsManager/getSecret");
15
+ const getProcessConfigActionType = (runtimeConfig) => {
16
+ return ({ secretName }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const awsSecretKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveSecretKey)(secretName, runtimeConfig);
18
+ const secretValue = yield (0, getSecret_1.getSecret)(awsSecretKey);
19
+ return (0, quidproquo_core_1.actionResult)(secretValue);
20
+ });
21
+ };
22
+ exports.default = (runtimeConfig) => {
23
+ return {
24
+ [quidproquo_core_1.ConfigActionType.GetSecret]: getProcessConfigActionType(runtimeConfig),
25
+ };
26
+ };
@@ -0,0 +1,7 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
3
+ "@quidproquo-core/Config/GetSecret": import("quidproquo-core/lib").ConfigGetSecretActionProcessor;
4
+ "@quidproquo-core/Config/GetParameters": import("quidproquo-core/lib").ConfigGetParametersActionProcessor;
5
+ "@quidproquo-core/Config/GetParameter": import("quidproquo-core/lib").ConfigGetParameterActionProcessor;
6
+ };
7
+ export default _default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const getConfigGetParameterActionProcessor_1 = __importDefault(require("./getConfigGetParameterActionProcessor"));
7
+ const getConfigGetParametersActionProcessor_1 = __importDefault(require("./getConfigGetParametersActionProcessor"));
8
+ const getConfigGetSecretActionProcessor_1 = __importDefault(require("./getConfigGetSecretActionProcessor"));
9
+ exports.default = (runtimeConfig) => (Object.assign(Object.assign(Object.assign({}, (0, getConfigGetParameterActionProcessor_1.default)(runtimeConfig)), (0, getConfigGetParametersActionProcessor_1.default)(runtimeConfig)), (0, getConfigGetSecretActionProcessor_1.default)(runtimeConfig)));
@@ -0,0 +1,10 @@
1
+ import { QPQConfig, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor } from 'quidproquo-core';
2
+ import { HTTPEventParams } from 'quidproquo-webserver';
3
+ import { Context, APIGatewayProxyResult } from 'aws-lambda';
4
+ declare const _default: (config: QPQConfig) => {
5
+ "@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<[import("aws-lambda").APIGatewayProxyEvent, Context], HTTPEventParams<any>>;
6
+ "@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<APIGatewayProxyResult>;
7
+ "@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<HTTPEventParams<any>>;
8
+ "@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<HTTPEventParams<any>>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const quidproquo_webserver_1 = require("quidproquo-webserver");
14
+ const awsLambdaUtils_1 = require("../../../awsLambdaUtils");
15
+ const getProcessTransformEventParams = (appName) => {
16
+ return ({ eventParams: [apiGatewayEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const path = (apiGatewayEvent.path || '').replace(new RegExp(`^(\/${appName})/`), '/');
18
+ console.log('getProcessTransformEventParams', JSON.stringify(apiGatewayEvent));
19
+ return (0, quidproquo_core_1.actionResult)({
20
+ path,
21
+ query: Object.assign(Object.assign({}, (apiGatewayEvent.multiValueQueryStringParameters || {})), (apiGatewayEvent.queryStringParameters || {})),
22
+ body: apiGatewayEvent.body ? JSON.parse(apiGatewayEvent.body) : undefined,
23
+ headers: apiGatewayEvent.headers,
24
+ method: apiGatewayEvent.httpMethod,
25
+ correlation: context.awsRequestId,
26
+ sourceIp: apiGatewayEvent.requestContext.identity.sourceIp,
27
+ });
28
+ });
29
+ };
30
+ const getProcessTransformResponseResult = (configs) => {
31
+ // We might need to JSON.stringify the body.
32
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
33
+ // Validate response
34
+ // if !valid actionResultError
35
+ console.log('getProcessTransformResponseResult', JSON.stringify(payload));
36
+ return (0, quidproquo_core_1.actionResult)({
37
+ statusCode: payload.response.result.statusCode,
38
+ body: payload.response.result.body,
39
+ headers: Object.assign(Object.assign({ 'Content-Type': 'application/json' }, quidproquo_webserver_1.qpqWebServerUtils.getCorsHeaders(configs, {}, payload.transformedEventParams.headers)), (payload.response.headers || {})),
40
+ });
41
+ });
42
+ };
43
+ const getProcessAutoRespond = (configs) => {
44
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
45
+ if (payload.transformedEventParams.method === 'OPTIONS') {
46
+ return (0, quidproquo_core_1.actionResult)({
47
+ result: {
48
+ statusCode: 200,
49
+ headers: quidproquo_webserver_1.qpqWebServerUtils.getCorsHeaders(configs, {}, payload.transformedEventParams.headers),
50
+ },
51
+ });
52
+ }
53
+ return (0, quidproquo_core_1.actionResult)(null);
54
+ });
55
+ };
56
+ const getProcessMatchStory = (routes) => {
57
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
58
+ // Sort the routes by string length
59
+ // Note: We may need to filter variable routes out {} as the variables are length independent
60
+ const sortedRoutes = routes
61
+ .filter((r) => r.method === payload.transformedEventParams.method)
62
+ .sort((a, b) => {
63
+ if (a.path.length < b.path.length)
64
+ return -1;
65
+ if (a.path.length > b.path.length)
66
+ return 1;
67
+ return 0;
68
+ });
69
+ // Find the most relevant match
70
+ const matchedRoute = sortedRoutes
71
+ .map((r) => ({
72
+ match: (0, awsLambdaUtils_1.matchUrl)(r.path, payload.transformedEventParams.path),
73
+ route: r,
74
+ }))
75
+ .find((m) => m.match.didMatch);
76
+ if (!matchedRoute) {
77
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, 'route not found');
78
+ }
79
+ return (0, quidproquo_core_1.actionResult)({
80
+ src: matchedRoute.route.src,
81
+ runtime: matchedRoute.route.runtime,
82
+ options: matchedRoute.match.params || {},
83
+ });
84
+ });
85
+ };
86
+ exports.default = (config) => {
87
+ const routes = quidproquo_webserver_1.qpqWebServerUtils.getAllRoutes(config);
88
+ const appName = quidproquo_core_1.qpqCoreUtils.getAppName(config);
89
+ return {
90
+ [quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(appName),
91
+ [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(config),
92
+ [quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(config),
93
+ [quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(routes),
94
+ };
95
+ };
@@ -0,0 +1,10 @@
1
+ import { EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor, ScheduledEventParams } from 'quidproquo-core';
2
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
3
+ import { EventBridgeEvent, Context } from 'aws-lambda';
4
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
5
+ "@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<[EventBridgeEvent<any, any>, Context], ScheduledEventParams<any>>;
6
+ "@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<any>;
7
+ "@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<ScheduledEventParams<any>>;
8
+ "@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<ScheduledEventParams<any>>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const quidproquo_core_1 = require("quidproquo-core");
13
+ const getProcessTransformEventParams = () => {
14
+ return ({ eventParams: [eventBridgeEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, quidproquo_core_1.actionResult)({
16
+ time: eventBridgeEvent.time,
17
+ correlation: context.awsRequestId,
18
+ detail: eventBridgeEvent.detail,
19
+ });
20
+ });
21
+ };
22
+ // No transform
23
+ const getProcessTransformResponseResult = () => {
24
+ return ({ response }) => __awaiter(void 0, void 0, void 0, function* () { return (0, quidproquo_core_1.actionResult)(response); });
25
+ };
26
+ // never early exit (maybe add validation?)
27
+ const getProcessAutoRespond = () => {
28
+ return () => __awaiter(void 0, void 0, void 0, function* () { return (0, quidproquo_core_1.actionResult)(null); });
29
+ };
30
+ const getProcessMatchStory = (lambdaRuntimeConfig) => {
31
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
32
+ console.log('Trying to match story');
33
+ console.log(JSON.stringify(lambdaRuntimeConfig));
34
+ if (!lambdaRuntimeConfig) {
35
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, 'event runtime not found');
36
+ }
37
+ return (0, quidproquo_core_1.actionResult)({
38
+ src: lambdaRuntimeConfig.src,
39
+ runtime: lambdaRuntimeConfig.runtime,
40
+ options: {},
41
+ });
42
+ });
43
+ };
44
+ exports.default = (runtimeConfig) => {
45
+ return {
46
+ [quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(),
47
+ [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(),
48
+ [quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(),
49
+ [quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(runtimeConfig.lambdaRuntimeConfig),
50
+ };
51
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ import { FileDeleteActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/File/Delete": FileDeleteActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const s3Utils_1 = require("../../../logic/s3/s3Utils");
15
+ const getProcessFileDelete = (runtimeConfig) => {
16
+ return ({ drive, filepaths }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
18
+ const errored = yield (0, s3Utils_1.deleteFiles)(s3BucketName, filepaths);
19
+ // errored deletes are a graceful success ~ Retry
20
+ // if (errored.length > 0) {
21
+ // return actionResultError(
22
+ // ErrorTypeEnum.GenericError,
23
+ // `Could not delete files ${errored.length}`,
24
+ // );
25
+ // }
26
+ return (0, quidproquo_core_1.actionResult)(errored);
27
+ });
28
+ };
29
+ exports.default = (runtimeConfig) => ({
30
+ [quidproquo_core_1.FileActionType.Delete]: getProcessFileDelete(runtimeConfig),
31
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ import { FileExistsActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/File/Exists": FileExistsActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const s3Utils_1 = require("../../../logic/s3/s3Utils");
15
+ const getProcessFileExists = (runtimeConfig) => {
16
+ return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
18
+ return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.objectExists)(s3BucketName, filepath));
19
+ });
20
+ };
21
+ exports.default = (runtimeConfig) => ({
22
+ [quidproquo_core_1.FileActionType.Exists]: getProcessFileExists(runtimeConfig),
23
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ import { FileListDirectoryActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/File/ListDirectory": FileListDirectoryActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const s3Utils_1 = require("../../../logic/s3/s3Utils");
15
+ const getProcessFileListDirectory = (runtimeConfig) => {
16
+ return ({ drive, folderPath, maxFiles, pageToken }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
18
+ const s3FileList = yield (0, s3Utils_1.listFiles)(s3BucketName, folderPath, maxFiles, pageToken);
19
+ // Add the drive onto the list
20
+ const fileInfos = s3FileList.fileInfos.map((s3fi) => (Object.assign(Object.assign({}, s3fi), { drive: drive })));
21
+ return (0, quidproquo_core_1.actionResult)({
22
+ fileInfos,
23
+ pageToken: s3FileList.pageToken,
24
+ });
25
+ });
26
+ };
27
+ exports.default = (runtimeConfig) => ({
28
+ [quidproquo_core_1.FileActionType.ListDirectory]: getProcessFileListDirectory(runtimeConfig),
29
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ import { FileReadTextContentsActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/File/ReadTextContents": FileReadTextContentsActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const s3Utils_1 = require("../../../logic/s3/s3Utils");
15
+ const getProcessFileReadTextContents = (runtimeConfig) => {
16
+ return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
18
+ return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readTextFile)(s3BucketName, filepath));
19
+ });
20
+ };
21
+ exports.default = (runtimeConfig) => ({
22
+ [quidproquo_core_1.FileActionType.ReadTextContents]: getProcessFileReadTextContents(runtimeConfig),
23
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ import { FileWriteTextContentsActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
4
+ "@quidproquo-core/File/WriteTextContents": FileWriteTextContentsActionProcessor;
5
+ };
6
+ export default _default;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const s3Utils_1 = require("../../../logic/s3/s3Utils");
15
+ const getProcessFileWriteTextContents = (runtimeConfig) => {
16
+ return ({ drive, filepath, data }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
18
+ yield (0, s3Utils_1.writeTextFile)(s3BucketName, filepath, data);
19
+ return (0, quidproquo_core_1.actionResult)(void 0);
20
+ });
21
+ };
22
+ exports.default = (runtimeConfig) => ({
23
+ [quidproquo_core_1.FileActionType.WriteTextContents]: getProcessFileWriteTextContents(runtimeConfig),
24
+ });
@@ -0,0 +1,9 @@
1
+ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
2
+ declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
3
+ "@quidproquo-core/File/WriteTextContents": import("quidproquo-core/lib").FileWriteTextContentsActionProcessor;
4
+ "@quidproquo-core/File/ReadTextContents": import("quidproquo-core/lib").FileReadTextContentsActionProcessor;
5
+ "@quidproquo-core/File/ListDirectory": import("quidproquo-core/lib").FileListDirectoryActionProcessor;
6
+ "@quidproquo-core/File/Exists": import("quidproquo-core/lib").FileExistsActionProcessor;
7
+ "@quidproquo-core/File/Delete": import("quidproquo-core/lib").FileDeleteActionProcessor;
8
+ };
9
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const getFileDeleteActionProcessor_1 = __importDefault(require("./getFileDeleteActionProcessor"));
7
+ const getFileExistsActionProcessor_1 = __importDefault(require("./getFileExistsActionProcessor"));
8
+ const getFileListDirectoryActionProcessor_1 = __importDefault(require("./getFileListDirectoryActionProcessor"));
9
+ const getFileReadTextContentsActionProcessor_1 = __importDefault(require("./getFileReadTextContentsActionProcessor"));
10
+ const getFileWriteTextContentsActionProcessor_1 = __importDefault(require("./getFileWriteTextContentsActionProcessor"));
11
+ exports.default = (runtimeConfig) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, getFileDeleteActionProcessor_1.default)(runtimeConfig)), (0, getFileExistsActionProcessor_1.default)(runtimeConfig)), (0, getFileListDirectoryActionProcessor_1.default)(runtimeConfig)), (0, getFileReadTextContentsActionProcessor_1.default)(runtimeConfig)), (0, getFileWriteTextContentsActionProcessor_1.default)(runtimeConfig)));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getEventBridgeEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
7
+ var getConfigGetSecretActionProcessor_1 = require("./config/getConfigGetSecretActionProcessor");
8
+ Object.defineProperty(exports, "getConfigGetSecretActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetSecretActionProcessor_1).default; } });
9
+ var getConfigGetParameterActionProcessor_1 = require("./config/getConfigGetParameterActionProcessor");
10
+ Object.defineProperty(exports, "getConfigGetParameterActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetParameterActionProcessor_1).default; } });
11
+ var getConfigGetParametersActionProcessor_1 = require("./config/getConfigGetParametersActionProcessor");
12
+ Object.defineProperty(exports, "getConfigGetParametersActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetParametersActionProcessor_1).default; } });
13
+ var getAPIGatewayEventActionProcessor_1 = require("./event/getAPIGatewayEventActionProcessor");
14
+ Object.defineProperty(exports, "getAPIGatewayEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getAPIGatewayEventActionProcessor_1).default; } });
15
+ var getEventBridgeEventActionProcessor_1 = require("./event/getEventBridgeEventActionProcessor");
16
+ Object.defineProperty(exports, "getEventBridgeEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getEventBridgeEventActionProcessor_1).default; } });
17
+ var system_1 = require("./system");
18
+ Object.defineProperty(exports, "getSystemActionProcessor", { enumerable: true, get: function () { return __importDefault(system_1).default; } });
19
+ var file_1 = require("./file");
20
+ Object.defineProperty(exports, "getFileActionProcessor", { enumerable: true, get: function () { return __importDefault(file_1).default; } });
@@ -0,0 +1,7 @@
1
+ import { SystemExecuteStoryActionProcessor } from 'quidproquo-core';
2
+ import { DynamicModuleLoader } from '../../../types/DynamicLoader';
3
+ export declare const getDateNow: () => string;
4
+ declare const _default: (dynamicModuleLoader: DynamicModuleLoader) => {
5
+ "@quidproquo-core/System/ExecuteStory": SystemExecuteStoryActionProcessor<any[]>;
6
+ };
7
+ export default _default;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getDateNow = void 0;
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const awsLambdaUtils_1 = require("./../../../awsLambdaUtils");
15
+ const getDateNow = () => new Date().toISOString();
16
+ exports.getDateNow = getDateNow;
17
+ const getProcessExecuteStory = (dynamicModuleLoader) => {
18
+ return (payload, session, actionProcessors) => __awaiter(void 0, void 0, void 0, function* () {
19
+ let module = yield dynamicModuleLoader(payload.src);
20
+ if (module === null) {
21
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Module not found [${payload.src}]`);
22
+ }
23
+ const story = module[payload.runtime];
24
+ if (!story) {
25
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `[${payload.runtime}] not found in module [${payload.src}]`);
26
+ }
27
+ const logger = (result) => __awaiter(void 0, void 0, void 0, function* () {
28
+ // return await addResult(service, getDateNow(), payload.params[0][0].path, 'user-route', payload.src, payload.runtime, result);
29
+ });
30
+ const resolveStory = (0, quidproquo_core_1.createRuntime)(session, actionProcessors, exports.getDateNow, logger, awsLambdaUtils_1.randomGuid);
31
+ const storyResult = yield resolveStory(story, payload.params);
32
+ if (storyResult.error) {
33
+ return (0, quidproquo_core_1.actionResultError)(storyResult.error.errorType, `story error! in ${payload.src}::${payload.runtime} -> [${storyResult.error.errorText}]`, storyResult.error.errorStack);
34
+ }
35
+ return (0, quidproquo_core_1.actionResult)({
36
+ result: storyResult.result,
37
+ session: storyResult.session,
38
+ });
39
+ });
40
+ };
41
+ exports.default = (dynamicModuleLoader) => {
42
+ return {
43
+ [quidproquo_core_1.SystemActionType.ExecuteStory]: getProcessExecuteStory(dynamicModuleLoader),
44
+ };
45
+ };
@@ -0,0 +1,5 @@
1
+ import { DynamicModuleLoader } from '../../../types/DynamicLoader';
2
+ declare const _default: (dynamicModuleLoader: DynamicModuleLoader) => {
3
+ "@quidproquo-core/System/ExecuteStory": import("quidproquo-core/lib").SystemExecuteStoryActionProcessor<any[]>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const getExecuteStoryActionProcessor_1 = __importDefault(require("./getExecuteStoryActionProcessor"));
7
+ exports.default = (dynamicModuleLoader) => (Object.assign({}, (0, getExecuteStoryActionProcessor_1.default)(dynamicModuleLoader)));