quidproquo-actionprocessor-awslambda 0.0.198 → 0.0.199
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/getActionProcessor/core/event/apiGatwayEvent/api/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/autoRespond.js +47 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getRecords.js +47 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/matchStory.js +45 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/transformResponseResult.js +64 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/types.d.ts +10 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/types.js +2 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/index.d.ts +2 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/index.js +18 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/autoRespond.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getRecords.js +38 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/matchStory.js +43 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/transformResponseResult.js +29 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/types.d.ts +16 -0
- package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/types.js +5 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/autoRespond.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getRecords.js +39 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/matchStory.js +43 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/transformResponseResult.js +71 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/types.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/types.js +2 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/autoRespond.js +46 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getRecords.js +45 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/matchStory.js +45 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/transformResponseResult.js +30 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/types.d.ts +9 -0
- package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/types.js +4 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/autoRespond.js +26 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getRecords.js +44 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/matchStory.js +31 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/transformResponseResult.js +28 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/types.d.ts +15 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/types.js +2 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/index.d.ts +2 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/index.js +18 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/autoRespond.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getRecords.js +27 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/matchStory.js +28 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/transformResponseResult.js +28 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/types.d.ts +7 -0
- package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/types.js +2 -0
- package/lib/commonjs/getActionProcessor/core/event/index.d.ts +7 -0
- package/lib/commonjs/getActionProcessor/core/event/index.js +23 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/index.d.ts +1 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/index.js +17 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/autoRespond.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getRecords.js +26 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/{getServiceFunctionExecuteEventActionProcessor.js → lambda/serviceFunction/matchStory.js} +3 -21
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/transformResponseResult.js +25 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/types.d.ts +11 -0
- package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/types.js +2 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/autoRespond.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getRecords.js +33 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getStorySession.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/matchStory.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/matchStory.js +23 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/transformResponseResult.js +28 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/types.d.ts +10 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/types.js +6 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/index.d.ts +1 -0
- package/lib/commonjs/getActionProcessor/core/event/s3/index.js +17 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/index.d.ts +1 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/index.js +17 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/autoRespond.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/autoRespond.js +22 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getRecords.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getRecords.js +35 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getStorySession.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getStorySession.js +28 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/index.d.ts +8 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/index.js +13 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/matchStory.d.ts +7 -0
- package/lib/commonjs/getActionProcessor/core/event/{getSQSEventRecordActionProcessor.js → sqs/queue/matchStory.js} +5 -28
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/transformResponseResult.d.ts +6 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/transformResponseResult.js +35 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/types.d.ts +12 -0
- package/lib/commonjs/getActionProcessor/core/event/sqs/queue/types.js +2 -0
- package/lib/commonjs/getActionProcessor/core/index.d.ts +1 -10
- package/lib/commonjs/getActionProcessor/core/index.js +16 -21
- package/lib/commonjs/getActionProcessor/core/system/getExecuteStoryActionProcessor.d.ts +1 -1
- package/lib/commonjs/getActionProcessor/core/system/getExecuteStoryActionProcessor.js +7 -1
- package/lib/commonjs/getActionProcessor/core/system/index.d.ts +1 -1
- package/lib/commonjs/getActionProcessor/webserver/serviceFunction/getServiceFunctionActionProcessor.js +6 -3
- package/package.json +5 -5
- package/lib/commonjs/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.d.ts +0 -12
- package/lib/commonjs/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.js +0 -127
- package/lib/commonjs/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.d.ts +0 -11
- package/lib/commonjs/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.js +0 -73
- package/lib/commonjs/getActionProcessor/core/event/getCustomResourceCloudflareDnsEventActionProcessor.d.ts +0 -12
- package/lib/commonjs/getActionProcessor/core/event/getCustomResourceCloudflareDnsEventActionProcessor.js +0 -80
- package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventActionProcessor.d.ts +0 -13
- package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventActionProcessor.js +0 -49
- package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventStackDeployActionProcessor.d.ts +0 -18
- package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventStackDeployActionProcessor.js +0 -75
- package/lib/commonjs/getActionProcessor/core/event/getLambdaCognitoCustomMessage.d.ts +0 -12
- package/lib/commonjs/getActionProcessor/core/event/getLambdaCognitoCustomMessage.js +0 -104
- package/lib/commonjs/getActionProcessor/core/event/getS3FileEventActionProcessor.d.ts +0 -12
- package/lib/commonjs/getActionProcessor/core/event/getS3FileEventActionProcessor.js +0 -54
- package/lib/commonjs/getActionProcessor/core/event/getSQSEventRecordActionProcessor.d.ts +0 -13
- package/lib/commonjs/getActionProcessor/core/event/getServiceFunctionExecuteEventActionProcessor.d.ts +0 -14
- package/lib/commonjs/getActionProcessor/core/event/getWebsocketAPIGatewayEventActionProcessor.d.ts +0 -22
- package/lib/commonjs/getActionProcessor/core/event/getWebsocketAPIGatewayEventActionProcessor.js +0 -82
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { QPQConfig, MatchStoryResult, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor } from 'quidproquo-core';
|
|
2
|
-
import { EmailSendEvent, EmailSendEventResponse } from 'quidproquo-webserver';
|
|
3
|
-
import { CustomMessageTriggerEvent, Context } from 'aws-lambda';
|
|
4
|
-
type EventInput = [CustomMessageTriggerEvent, Context];
|
|
5
|
-
type MatchResult = MatchStoryResult<any, any>;
|
|
6
|
-
declare const _default: (qpqConfig: QPQConfig) => {
|
|
7
|
-
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<EventInput, EmailSendEvent>;
|
|
8
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<EmailSendEventResponse, EmailSendEvent, EmailSendEventResponse>;
|
|
9
|
-
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<EmailSendEvent, MatchResult, boolean>;
|
|
10
|
-
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<EmailSendEvent, MatchResult>;
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
// TODO: Don't use Globals like this
|
|
15
|
-
const GLOBAL_USER_DIRECTORY_NAME = process.env.userDirectoryName;
|
|
16
|
-
const getProcessTransformEventParams = (serviceName) => {
|
|
17
|
-
return ({ eventParams: [customMessageTriggerEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
var _a;
|
|
19
|
-
const transformedEventParams = {
|
|
20
|
-
eventType: quidproquo_webserver_1.EmailSendEventType.VerifyEmail,
|
|
21
|
-
code: customMessageTriggerEvent.request.codeParameter,
|
|
22
|
-
link: customMessageTriggerEvent.request.linkParameter,
|
|
23
|
-
attributes: customMessageTriggerEvent.request.userAttributes,
|
|
24
|
-
username: customMessageTriggerEvent.request.usernameParameter,
|
|
25
|
-
};
|
|
26
|
-
switch (customMessageTriggerEvent.triggerSource) {
|
|
27
|
-
case 'CustomMessage_ForgotPassword': {
|
|
28
|
-
if (((_a = customMessageTriggerEvent.request.clientMetadata) === null || _a === void 0 ? void 0 : _a['userInitiated']) === 'true') {
|
|
29
|
-
transformedEventParams.eventType = quidproquo_webserver_1.EmailSendEventType.ResetPassword;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
transformedEventParams.eventType = quidproquo_webserver_1.EmailSendEventType.ResetPasswordAdmin;
|
|
33
|
-
}
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
case 'CustomMessage_VerifyUserAttribute':
|
|
37
|
-
transformedEventParams.eventType = quidproquo_webserver_1.EmailSendEventType.VerifyEmail;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
return (0, quidproquo_core_1.actionResult)(transformedEventParams);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const getProcessTransformResponseResult = (qpqConfig) => {
|
|
44
|
-
// We might need to JSON.stringify the body.
|
|
45
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
47
|
-
subject: payload.response.subject,
|
|
48
|
-
body: payload.response.body,
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
const getProcessAutoRespond = (qpqConfig) => {
|
|
53
|
-
const userDirectoryConfig = quidproquo_core_1.qpqCoreUtils.getUserDirectories(qpqConfig).find(ud => ud.name === GLOBAL_USER_DIRECTORY_NAME);
|
|
54
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
-
var _a, _b, _c, _d, _e, _f;
|
|
56
|
-
switch (payload.transformedEventParams.eventType) {
|
|
57
|
-
case quidproquo_webserver_1.EmailSendEventType.ResetPassword:
|
|
58
|
-
return (0, quidproquo_core_1.actionResult)(!((_a = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPassword) === null || _a === void 0 ? void 0 : _a.src) &&
|
|
59
|
-
!((_b = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPassword) === null || _b === void 0 ? void 0 : _b.runtime));
|
|
60
|
-
case quidproquo_webserver_1.EmailSendEventType.ResetPasswordAdmin:
|
|
61
|
-
return (0, quidproquo_core_1.actionResult)(!((_c = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPasswordAdmin) === null || _c === void 0 ? void 0 : _c.src) &&
|
|
62
|
-
!((_d = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPasswordAdmin) === null || _d === void 0 ? void 0 : _d.runtime));
|
|
63
|
-
case quidproquo_webserver_1.EmailSendEventType.VerifyEmail:
|
|
64
|
-
return (0, quidproquo_core_1.actionResult)(!((_e = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.verifyEmail) === null || _e === void 0 ? void 0 : _e.src) &&
|
|
65
|
-
!((_f = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.verifyEmail) === null || _f === void 0 ? void 0 : _f.runtime));
|
|
66
|
-
}
|
|
67
|
-
return (0, quidproquo_core_1.actionResult)(false);
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
const getProcessMatchStory = (qpqConfig) => {
|
|
71
|
-
const userDirectoryConfig = quidproquo_core_1.qpqCoreUtils.getUserDirectories(qpqConfig).find(ud => ud.name === GLOBAL_USER_DIRECTORY_NAME);
|
|
72
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
-
var _a, _b, _c, _d, _e, _f;
|
|
74
|
-
switch (payload.transformedEventParams.eventType) {
|
|
75
|
-
case quidproquo_webserver_1.EmailSendEventType.ResetPassword:
|
|
76
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
77
|
-
src: (_a = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPassword) === null || _a === void 0 ? void 0 : _a.src,
|
|
78
|
-
runtime: (_b = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPassword) === null || _b === void 0 ? void 0 : _b.runtime
|
|
79
|
-
});
|
|
80
|
-
case quidproquo_webserver_1.EmailSendEventType.ResetPasswordAdmin:
|
|
81
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
82
|
-
src: (_c = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPasswordAdmin) === null || _c === void 0 ? void 0 : _c.src,
|
|
83
|
-
runtime: (_d = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.resetPasswordAdmin) === null || _d === void 0 ? void 0 : _d.runtime
|
|
84
|
-
});
|
|
85
|
-
case quidproquo_webserver_1.EmailSendEventType.VerifyEmail:
|
|
86
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
87
|
-
src: (_e = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.verifyEmail) === null || _e === void 0 ? void 0 : _e.src,
|
|
88
|
-
runtime: (_f = userDirectoryConfig === null || userDirectoryConfig === void 0 ? void 0 : userDirectoryConfig.emailTemplates.verifyEmail) === null || _f === void 0 ? void 0 : _f.runtime
|
|
89
|
-
});
|
|
90
|
-
default:
|
|
91
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Email lambda not implemented for ${payload.transformedEventParams.eventType}`);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
exports.default = (qpqConfig) => {
|
|
96
|
-
// TODO: Make this aware of the API that we are eventing
|
|
97
|
-
const serviceName = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
98
|
-
return {
|
|
99
|
-
[quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(serviceName),
|
|
100
|
-
[quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
|
|
101
|
-
[quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(qpqConfig),
|
|
102
|
-
[quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(qpqConfig),
|
|
103
|
-
};
|
|
104
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { QPQConfig, MatchStoryResult, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor } from 'quidproquo-core';
|
|
2
|
-
import { StorageDriveEvent } from 'quidproquo-webserver';
|
|
3
|
-
import { S3Event, Context } from 'aws-lambda';
|
|
4
|
-
type EventInput = [S3Event, Context];
|
|
5
|
-
type MatchResult = MatchStoryResult<any, any>;
|
|
6
|
-
declare const _default: (qpqConfig: QPQConfig) => {
|
|
7
|
-
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<EventInput, StorageDriveEvent>;
|
|
8
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<void, StorageDriveEvent, void>;
|
|
9
|
-
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<StorageDriveEvent, MatchResult, boolean>;
|
|
10
|
-
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<StorageDriveEvent, MatchResult>;
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
@@ -1,54 +0,0 @@
|
|
|
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 GLOBAL_STORAGE_DRIVE_NAME = process.env.storageDriveName;
|
|
15
|
-
const GLOBAL_STORAGE_DRIVE_RUNTIME = JSON.parse(process.env.storageDriveEntry || '{}');
|
|
16
|
-
const getProcessTransformEventParams = () => {
|
|
17
|
-
return ({ eventParams: [s3Event, context] }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const transformedEventParams = {
|
|
19
|
-
driveName: GLOBAL_STORAGE_DRIVE_NAME,
|
|
20
|
-
// TODO: Fix this to work for create delete for each record in one set?
|
|
21
|
-
filePaths: s3Event.Records.map((r) => decodeURIComponent(r.s3.object.key)),
|
|
22
|
-
eventType: s3Event.Records[0].eventName.startsWith('ObjectCreated')
|
|
23
|
-
? quidproquo_webserver_1.StorageDriveEventType.Create
|
|
24
|
-
: quidproquo_webserver_1.StorageDriveEventType.Delete,
|
|
25
|
-
};
|
|
26
|
-
return (0, quidproquo_core_1.actionResult)(transformedEventParams);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const getProcessTransformResponseResult = (qpqConfig) => {
|
|
30
|
-
// We might need to JSON.stringify the body.
|
|
31
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
// always success
|
|
33
|
-
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const getProcessAutoRespond = (qpqConfig) => {
|
|
37
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
// always allow
|
|
39
|
-
return (0, quidproquo_core_1.actionResult)(false);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const getProcessMatchStory = (qpqConfig) => {
|
|
43
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
return (0, quidproquo_core_1.actionResult)(GLOBAL_STORAGE_DRIVE_RUNTIME);
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
exports.default = (qpqConfig) => {
|
|
48
|
-
return {
|
|
49
|
-
[quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(),
|
|
50
|
-
[quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
|
|
51
|
-
[quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(qpqConfig),
|
|
52
|
-
[quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(qpqConfig),
|
|
53
|
-
};
|
|
54
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { QPQConfig, MatchStoryResult, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor, QueueMessage, QueueQPQConfigSetting } from 'quidproquo-core';
|
|
2
|
-
import { QueueEvent, QueueEventTypeParams } from 'quidproquo-webserver';
|
|
3
|
-
import { Context } from 'aws-lambda';
|
|
4
|
-
type AnyQueueEvent = QueueEvent<QueueMessage<any>>;
|
|
5
|
-
export type SqsEventMatchStoryResult = MatchStoryResult<QueueEventTypeParams, string>;
|
|
6
|
-
export declare const getQueueConfigSetting: () => QueueQPQConfigSetting;
|
|
7
|
-
declare const _default: (qpqConfig: QPQConfig) => {
|
|
8
|
-
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<[QueueMessage<any>, Context], AnyQueueEvent>;
|
|
9
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<boolean, AnyQueueEvent, boolean>;
|
|
10
|
-
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<AnyQueueEvent, SqsEventMatchStoryResult, boolean>;
|
|
11
|
-
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<AnyQueueEvent, SqsEventMatchStoryResult>;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { QPQConfig, MatchStoryResult, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor } from 'quidproquo-core';
|
|
2
|
-
import { ExecuteServiceFunctionEvent } from 'quidproquo-webserver';
|
|
3
|
-
import { Context } from 'aws-lambda';
|
|
4
|
-
export type ServiceFunctionMatchStoryResult = MatchStoryResult<unknown, unknown>;
|
|
5
|
-
export type ServiceFunctionExecuteEventParams = [ExecuteServiceFunctionEvent<any>, Context];
|
|
6
|
-
export type TransformedServiceFunctionExecuteEventParams = ExecuteServiceFunctionEvent<any>;
|
|
7
|
-
export type ServiceFunctionExecuteEventResponse = any;
|
|
8
|
-
declare const _default: (qpqConfig: QPQConfig) => {
|
|
9
|
-
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<ServiceFunctionExecuteEventParams, TransformedServiceFunctionExecuteEventParams>;
|
|
10
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<any, TransformedServiceFunctionExecuteEventParams, any>;
|
|
11
|
-
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<any, ServiceFunctionMatchStoryResult, any>;
|
|
12
|
-
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<TransformedServiceFunctionExecuteEventParams, ServiceFunctionMatchStoryResult>;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
package/lib/commonjs/getActionProcessor/core/event/getWebsocketAPIGatewayEventActionProcessor.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { QPQConfig, MatchStoryResult, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor } from 'quidproquo-core';
|
|
2
|
-
import { WebsocketEvent } from 'quidproquo-webserver';
|
|
3
|
-
import { APIGatewayEventWebsocketRequestContextV2, APIGatewayProxyWebsocketEventV2WithRequestContext, Context } from 'aws-lambda';
|
|
4
|
-
type ApiGatwayEventWebsocketWithIdentity = APIGatewayProxyWebsocketEventV2WithRequestContext<APIGatewayEventWebsocketRequestContextV2 & {
|
|
5
|
-
identity: {
|
|
6
|
-
sourceIp: string;
|
|
7
|
-
userAgent: string;
|
|
8
|
-
};
|
|
9
|
-
}>;
|
|
10
|
-
type EventInput = [ApiGatwayEventWebsocketWithIdentity, Context];
|
|
11
|
-
type EventOutput = {
|
|
12
|
-
statusCode: number;
|
|
13
|
-
};
|
|
14
|
-
type InternalEventInput = WebsocketEvent<string | Blob | ArrayBuffer>;
|
|
15
|
-
type MatchResult = MatchStoryResult<any, any>;
|
|
16
|
-
declare const _default: (qpqConfig: QPQConfig) => {
|
|
17
|
-
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<EventInput, InternalEventInput>;
|
|
18
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<void, InternalEventInput, EventOutput>;
|
|
19
|
-
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<InternalEventInput, MatchResult, boolean>;
|
|
20
|
-
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<InternalEventInput, MatchResult>;
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
package/lib/commonjs/getActionProcessor/core/event/getWebsocketAPIGatewayEventActionProcessor.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
// TODO: Don't use Globals like this
|
|
15
|
-
const GLOBAL_WEBSOCKET_API_NAME = process.env.websocketApiName;
|
|
16
|
-
const awsToQoqEventTypeMap = {
|
|
17
|
-
"MESSAGE": quidproquo_webserver_1.WebSocketEventType.Message,
|
|
18
|
-
"CONNECT": quidproquo_webserver_1.WebSocketEventType.Connect,
|
|
19
|
-
"DISCONNECT": quidproquo_webserver_1.WebSocketEventType.Disconnect,
|
|
20
|
-
};
|
|
21
|
-
const getProcessTransformEventParams = () => {
|
|
22
|
-
return ({ eventParams: [websocketEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const transformedEventParams = {
|
|
24
|
-
eventType: awsToQoqEventTypeMap[websocketEvent.requestContext.eventType],
|
|
25
|
-
messageId: websocketEvent.requestContext.messageId,
|
|
26
|
-
connectionId: websocketEvent.requestContext.connectionId,
|
|
27
|
-
requestTimeEpoch: websocketEvent.requestContext.requestTimeEpoch,
|
|
28
|
-
sourceIp: websocketEvent.requestContext.identity.sourceIp,
|
|
29
|
-
userAgent: websocketEvent.requestContext.identity.userAgent,
|
|
30
|
-
requestTime: new Date(websocketEvent.requestContext.requestTimeEpoch).toISOString(),
|
|
31
|
-
body: websocketEvent.body
|
|
32
|
-
};
|
|
33
|
-
return (0, quidproquo_core_1.actionResult)(transformedEventParams);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const getProcessTransformResponseResult = (qpqConfig) => {
|
|
37
|
-
// We might need to JSON.stringify the body.
|
|
38
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
// always success
|
|
40
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
41
|
-
statusCode: 200,
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
const getProcessAutoRespond = (qpqConfig) => {
|
|
46
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
// always allow
|
|
48
|
-
return (0, quidproquo_core_1.actionResult)(false);
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
const getProcessMatchStory = (qpqConfig) => {
|
|
52
|
-
const userDirectoryConfig = quidproquo_webserver_1.qpqWebServerUtils.getWebsocketEntryByApiName(GLOBAL_WEBSOCKET_API_NAME, qpqConfig);
|
|
53
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
-
switch (payload.transformedEventParams.eventType) {
|
|
55
|
-
case quidproquo_webserver_1.WebSocketEventType.Connect:
|
|
56
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
57
|
-
src: userDirectoryConfig.eventProcessors.onConnect.src,
|
|
58
|
-
runtime: userDirectoryConfig.eventProcessors.onConnect.runtime
|
|
59
|
-
});
|
|
60
|
-
case quidproquo_webserver_1.WebSocketEventType.Disconnect:
|
|
61
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
62
|
-
src: userDirectoryConfig.eventProcessors.onDisconnect.src,
|
|
63
|
-
runtime: userDirectoryConfig.eventProcessors.onDisconnect.runtime
|
|
64
|
-
});
|
|
65
|
-
case quidproquo_webserver_1.WebSocketEventType.Message:
|
|
66
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
67
|
-
src: userDirectoryConfig.eventProcessors.onMessage.src,
|
|
68
|
-
runtime: userDirectoryConfig.eventProcessors.onMessage.runtime
|
|
69
|
-
});
|
|
70
|
-
default:
|
|
71
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Websocket lambda not implemented for ${payload.transformedEventParams.eventType}`);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
exports.default = (qpqConfig) => {
|
|
76
|
-
return {
|
|
77
|
-
[quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(),
|
|
78
|
-
[quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
|
|
79
|
-
[quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(qpqConfig),
|
|
80
|
-
[quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(qpqConfig),
|
|
81
|
-
};
|
|
82
|
-
};
|