quidproquo-actionprocessor-awslambda 0.0.197 → 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.
Files changed (163) hide show
  1. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/autoRespond.d.ts +6 -0
  2. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/autoRespond.js +47 -0
  3. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getRecords.d.ts +6 -0
  4. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getRecords.js +47 -0
  5. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getStorySession.d.ts +6 -0
  6. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/getStorySession.js +22 -0
  7. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/index.d.ts +8 -0
  8. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/index.js +13 -0
  9. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/matchStory.d.ts +6 -0
  10. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/matchStory.js +45 -0
  11. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/transformResponseResult.d.ts +6 -0
  12. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/transformResponseResult.js +64 -0
  13. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/types.d.ts +10 -0
  14. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/api/types.js +2 -0
  15. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/index.d.ts +2 -0
  16. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/index.js +18 -0
  17. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/autoRespond.d.ts +6 -0
  18. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/autoRespond.js +22 -0
  19. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getRecords.d.ts +6 -0
  20. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getRecords.js +38 -0
  21. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getStorySession.d.ts +6 -0
  22. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/getStorySession.js +22 -0
  23. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/index.d.ts +8 -0
  24. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/index.js +13 -0
  25. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/matchStory.d.ts +6 -0
  26. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/matchStory.js +43 -0
  27. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/transformResponseResult.d.ts +6 -0
  28. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/transformResponseResult.js +29 -0
  29. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/types.d.ts +16 -0
  30. package/lib/commonjs/getActionProcessor/core/event/apiGatwayEvent/websocket/types.js +5 -0
  31. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/autoRespond.d.ts +6 -0
  32. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/autoRespond.js +22 -0
  33. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getRecords.d.ts +6 -0
  34. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getRecords.js +39 -0
  35. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getStorySession.d.ts +6 -0
  36. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/getStorySession.js +22 -0
  37. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/index.d.ts +8 -0
  38. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/index.js +13 -0
  39. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/matchStory.d.ts +6 -0
  40. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/matchStory.js +43 -0
  41. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/transformResponseResult.d.ts +6 -0
  42. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/transformResponseResult.js +71 -0
  43. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/types.d.ts +8 -0
  44. package/lib/commonjs/getActionProcessor/core/event/cloudFrontOriginRequest/types.js +2 -0
  45. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/autoRespond.d.ts +6 -0
  46. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/autoRespond.js +46 -0
  47. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getRecords.d.ts +6 -0
  48. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getRecords.js +45 -0
  49. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getStorySession.d.ts +6 -0
  50. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/getStorySession.js +22 -0
  51. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/index.d.ts +8 -0
  52. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/index.js +13 -0
  53. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/matchStory.d.ts +6 -0
  54. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/matchStory.js +45 -0
  55. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/transformResponseResult.d.ts +6 -0
  56. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/transformResponseResult.js +30 -0
  57. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/types.d.ts +9 -0
  58. package/lib/commonjs/getActionProcessor/core/event/cognitoCustomMessage/types.js +4 -0
  59. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/autoRespond.d.ts +6 -0
  60. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/autoRespond.js +26 -0
  61. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getRecords.d.ts +6 -0
  62. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getRecords.js +44 -0
  63. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getStorySession.d.ts +6 -0
  64. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/getStorySession.js +22 -0
  65. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/index.d.ts +8 -0
  66. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/index.js +13 -0
  67. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/matchStory.d.ts +6 -0
  68. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/matchStory.js +31 -0
  69. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/transformResponseResult.d.ts +6 -0
  70. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/transformResponseResult.js +28 -0
  71. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/types.d.ts +15 -0
  72. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/deployStack/types.js +2 -0
  73. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/index.d.ts +2 -0
  74. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/index.js +18 -0
  75. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/autoRespond.d.ts +6 -0
  76. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/autoRespond.js +22 -0
  77. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getRecords.d.ts +6 -0
  78. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getRecords.js +27 -0
  79. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getStorySession.d.ts +6 -0
  80. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getStorySession.js +22 -0
  81. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/index.d.ts +8 -0
  82. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/index.js +13 -0
  83. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/matchStory.d.ts +6 -0
  84. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/matchStory.js +28 -0
  85. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/transformResponseResult.d.ts +6 -0
  86. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/transformResponseResult.js +28 -0
  87. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/types.d.ts +7 -0
  88. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/types.js +2 -0
  89. package/lib/commonjs/getActionProcessor/core/event/index.d.ts +7 -0
  90. package/lib/commonjs/getActionProcessor/core/event/index.js +23 -0
  91. package/lib/commonjs/getActionProcessor/core/event/lambda/index.d.ts +1 -0
  92. package/lib/commonjs/getActionProcessor/core/event/lambda/index.js +17 -0
  93. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/autoRespond.d.ts +6 -0
  94. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/autoRespond.js +22 -0
  95. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getRecords.d.ts +6 -0
  96. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getRecords.js +26 -0
  97. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getStorySession.d.ts +6 -0
  98. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/getStorySession.js +22 -0
  99. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/index.d.ts +8 -0
  100. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/index.js +13 -0
  101. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/matchStory.d.ts +6 -0
  102. package/lib/commonjs/getActionProcessor/core/event/{getServiceFunctionExecuteEventActionProcessor.js → lambda/serviceFunction/matchStory.js} +3 -21
  103. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/transformResponseResult.d.ts +6 -0
  104. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/transformResponseResult.js +25 -0
  105. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/types.d.ts +11 -0
  106. package/lib/commonjs/getActionProcessor/core/event/lambda/serviceFunction/types.js +2 -0
  107. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/autoRespond.d.ts +6 -0
  108. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/autoRespond.js +22 -0
  109. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getRecords.d.ts +6 -0
  110. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getRecords.js +33 -0
  111. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getStorySession.d.ts +6 -0
  112. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/getStorySession.js +22 -0
  113. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/index.d.ts +8 -0
  114. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/index.js +13 -0
  115. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/matchStory.d.ts +6 -0
  116. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/matchStory.js +23 -0
  117. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/transformResponseResult.d.ts +6 -0
  118. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/transformResponseResult.js +28 -0
  119. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/types.d.ts +10 -0
  120. package/lib/commonjs/getActionProcessor/core/event/s3/fileEvent/types.js +6 -0
  121. package/lib/commonjs/getActionProcessor/core/event/s3/index.d.ts +1 -0
  122. package/lib/commonjs/getActionProcessor/core/event/s3/index.js +17 -0
  123. package/lib/commonjs/getActionProcessor/core/event/sqs/index.d.ts +1 -0
  124. package/lib/commonjs/getActionProcessor/core/event/sqs/index.js +17 -0
  125. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/autoRespond.d.ts +6 -0
  126. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/autoRespond.js +22 -0
  127. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getRecords.d.ts +6 -0
  128. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getRecords.js +35 -0
  129. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getStorySession.d.ts +6 -0
  130. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/getStorySession.js +28 -0
  131. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/index.d.ts +8 -0
  132. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/index.js +13 -0
  133. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/matchStory.d.ts +7 -0
  134. package/lib/commonjs/getActionProcessor/core/event/{getSQSEventRecordActionProcessor.js → sqs/queue/matchStory.js} +5 -28
  135. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/transformResponseResult.d.ts +6 -0
  136. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/transformResponseResult.js +35 -0
  137. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/types.d.ts +12 -0
  138. package/lib/commonjs/getActionProcessor/core/event/sqs/queue/types.js +2 -0
  139. package/lib/commonjs/getActionProcessor/core/index.d.ts +1 -10
  140. package/lib/commonjs/getActionProcessor/core/index.js +16 -21
  141. package/lib/commonjs/getActionProcessor/core/system/getExecuteStoryActionProcessor.d.ts +1 -1
  142. package/lib/commonjs/getActionProcessor/core/system/getExecuteStoryActionProcessor.js +7 -1
  143. package/lib/commonjs/getActionProcessor/core/system/index.d.ts +1 -1
  144. package/lib/commonjs/getActionProcessor/webserver/serviceFunction/getServiceFunctionActionProcessor.js +6 -3
  145. package/package.json +5 -5
  146. package/lib/commonjs/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.d.ts +0 -12
  147. package/lib/commonjs/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.js +0 -127
  148. package/lib/commonjs/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.d.ts +0 -11
  149. package/lib/commonjs/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.js +0 -73
  150. package/lib/commonjs/getActionProcessor/core/event/getCustomResourceCloudflareDnsEventActionProcessor.d.ts +0 -12
  151. package/lib/commonjs/getActionProcessor/core/event/getCustomResourceCloudflareDnsEventActionProcessor.js +0 -80
  152. package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventActionProcessor.d.ts +0 -13
  153. package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventActionProcessor.js +0 -49
  154. package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventStackDeployActionProcessor.d.ts +0 -18
  155. package/lib/commonjs/getActionProcessor/core/event/getEventBridgeEventStackDeployActionProcessor.js +0 -75
  156. package/lib/commonjs/getActionProcessor/core/event/getLambdaCognitoCustomMessage.d.ts +0 -12
  157. package/lib/commonjs/getActionProcessor/core/event/getLambdaCognitoCustomMessage.js +0 -104
  158. package/lib/commonjs/getActionProcessor/core/event/getS3FileEventActionProcessor.d.ts +0 -12
  159. package/lib/commonjs/getActionProcessor/core/event/getS3FileEventActionProcessor.js +0 -54
  160. package/lib/commonjs/getActionProcessor/core/event/getSQSEventRecordActionProcessor.d.ts +0 -13
  161. package/lib/commonjs/getActionProcessor/core/event/getServiceFunctionExecuteEventActionProcessor.d.ts +0 -14
  162. package/lib/commonjs/getActionProcessor/core/event/getWebsocketAPIGatewayEventActionProcessor.d.ts +0 -22
  163. package/lib/commonjs/getActionProcessor/core/event/getWebsocketAPIGatewayEventActionProcessor.js +0 -82
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventTransformResponseResultActionProcessor } from 'quidproquo-core';
2
+ import { EventInput, EventOutput } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<EventInput, any, EventOutput>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,25 @@
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 getProcessTransformResponseResult = (qpqConfig) => {
14
+ // We might need to JSON.stringify the body.
15
+ return ({ eventParams, qpqEventRecordResponses }) => __awaiter(void 0, void 0, void 0, function* () {
16
+ const [record] = qpqEventRecordResponses;
17
+ // Just return the either result back, let the caller deal with it.
18
+ return (0, quidproquo_core_1.actionResult)(record);
19
+ });
20
+ };
21
+ exports.default = (qpqConfig) => {
22
+ return {
23
+ [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
24
+ };
25
+ };
@@ -0,0 +1,11 @@
1
+ import { ExecuteServiceFunctionEvent } from 'quidproquo-webserver';
2
+ import { Context } from 'aws-lambda';
3
+ import { EitherActionResult, MatchStoryResult, StorySession } from 'quidproquo-core';
4
+ export type AnyExecuteServiceFunctionEventWithSession = ExecuteServiceFunctionEvent<any[]> & {
5
+ storySession: StorySession;
6
+ };
7
+ export type EventInput = [AnyExecuteServiceFunctionEventWithSession, Context];
8
+ export type EventOutput = EitherActionResult<any>;
9
+ export type InternalEventRecord = ExecuteServiceFunctionEvent<any[]>;
10
+ export type InternalEventOutput = any;
11
+ export type MatchResult = MatchStoryResult<unknown, unknown>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventAutoRespondActionProcessor } from 'quidproquo-core';
2
+ import { MatchResult } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<import("quidproquo-webserver").StorageDriveEvent, MatchResult, void>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,22 @@
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 getProcessAutoRespond = (qpqConfig) => {
14
+ return ({ qpqEventRecord, matchResult }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, quidproquo_core_1.actionResult)(null);
16
+ });
17
+ };
18
+ exports.default = (qpqConfig) => {
19
+ return {
20
+ [quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(qpqConfig),
21
+ };
22
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventGetRecordsActionProcessor } from 'quidproquo-core';
2
+ import { EventInput } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/Event/GetRecords": EventGetRecordsActionProcessor<EventInput, import("quidproquo-webserver").StorageDriveEvent>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,33 @@
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 types_1 = require("./types");
15
+ const getProcessGetRecords = (qpqConfig) => {
16
+ return ({ eventParams: [s3Event, context] }) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const records = s3Event.Records.map((r) => {
18
+ const internalEventRecord = {
19
+ driveName: types_1.GLOBAL_STORAGE_DRIVE_NAME,
20
+ // TODO: This only needs to be a single filepath now!
21
+ filePaths: [decodeURIComponent(r.s3.object.key)],
22
+ eventType: r.eventName.startsWith('ObjectCreated') ? quidproquo_webserver_1.StorageDriveEventType.Create : quidproquo_webserver_1.StorageDriveEventType.Delete,
23
+ };
24
+ return internalEventRecord;
25
+ });
26
+ return (0, quidproquo_core_1.actionResult)(records);
27
+ });
28
+ };
29
+ exports.default = (qpqConfig) => {
30
+ return {
31
+ [quidproquo_core_1.EventActionType.GetRecords]: getProcessGetRecords(qpqConfig),
32
+ };
33
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventGetStorySessionActionProcessor } from 'quidproquo-core';
2
+ import { EventInput } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/GetStorySession": EventGetStorySessionActionProcessor<EventInput, import("quidproquo-webserver").StorageDriveEvent>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,22 @@
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 getProcessGetStorySession = (qpqConfig) => {
14
+ return ({ qpqEventRecord, eventParams }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, quidproquo_core_1.actionResult)(void 0);
16
+ });
17
+ };
18
+ exports.default = (qpqConfig) => {
19
+ return {
20
+ [quidproquo_core_1.EventActionType.GetStorySession]: getProcessGetStorySession(qpqConfig),
21
+ };
22
+ };
@@ -0,0 +1,8 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ export declare const getS3FileEventEventProcessor: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-core/event/TransformResponseResult": import("quidproquo-core").EventTransformResponseResultActionProcessor<import("./types").EventInput, void, void>;
4
+ "@quidproquo-core/event/AutoRespond": import("quidproquo-core").EventAutoRespondActionProcessor<import("quidproquo-webserver").StorageDriveEvent, import("./types").MatchResult, void>;
5
+ "@quidproquo-core/event/MatchStory": import("quidproquo-core").EventMatchStoryActionProcessor<import("quidproquo-webserver").StorageDriveEvent, import("./types").MatchResult>;
6
+ "@quidproquo-core/Event/GetRecords": import("quidproquo-core").EventGetRecordsActionProcessor<import("./types").EventInput, import("quidproquo-webserver").StorageDriveEvent>;
7
+ "@quidproquo-core/event/GetStorySession": import("quidproquo-core").EventGetStorySessionActionProcessor<import("./types").EventInput, import("quidproquo-webserver").StorageDriveEvent>;
8
+ };
@@ -0,0 +1,13 @@
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.getS3FileEventEventProcessor = void 0;
7
+ const autoRespond_1 = __importDefault(require("./autoRespond"));
8
+ const getRecords_1 = __importDefault(require("./getRecords"));
9
+ const matchStory_1 = __importDefault(require("./matchStory"));
10
+ const transformResponseResult_1 = __importDefault(require("./transformResponseResult"));
11
+ const getStorySession_1 = __importDefault(require("./getStorySession"));
12
+ const getS3FileEventEventProcessor = (qpqConfig) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, getStorySession_1.default)(qpqConfig)), (0, getRecords_1.default)(qpqConfig)), (0, matchStory_1.default)(qpqConfig)), (0, autoRespond_1.default)(qpqConfig)), (0, transformResponseResult_1.default)(qpqConfig)));
13
+ exports.getS3FileEventEventProcessor = getS3FileEventEventProcessor;
@@ -0,0 +1,6 @@
1
+ import { EventMatchStoryActionProcessor, QPQConfig } from 'quidproquo-core';
2
+ import { MatchResult } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<import("quidproquo-webserver").StorageDriveEvent, MatchResult>;
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 quidproquo_core_1 = require("quidproquo-core");
13
+ const types_1 = require("./types");
14
+ const getProcessMatchStory = (qpqConfig) => {
15
+ return ({ qpqEventRecord }) => __awaiter(void 0, void 0, void 0, function* () {
16
+ return (0, quidproquo_core_1.actionResult)(types_1.GLOBAL_STORAGE_DRIVE_RUNTIME);
17
+ });
18
+ };
19
+ exports.default = (qpqConfig) => {
20
+ return {
21
+ [quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(qpqConfig),
22
+ };
23
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventTransformResponseResultActionProcessor } from 'quidproquo-core';
2
+ import { EventInput } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<EventInput, void, void>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,28 @@
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 getProcessTransformResponseResult = (qpqConfig) => {
14
+ // We might need to JSON.stringify the body.
15
+ return ({ eventParams, qpqEventRecordResponses }) => __awaiter(void 0, void 0, void 0, function* () {
16
+ const onesThatErrored = qpqEventRecordResponses.filter((r) => !r.success);
17
+ if (onesThatErrored.length > 0) {
18
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `[${onesThatErrored.length}] files unable to be processed.`);
19
+ }
20
+ // Transform back to api gateway
21
+ return (0, quidproquo_core_1.actionResult)(void 0);
22
+ });
23
+ };
24
+ exports.default = (qpqConfig) => {
25
+ return {
26
+ [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
27
+ };
28
+ };
@@ -0,0 +1,10 @@
1
+ import { StorageDriveEvent, StorageDriveEventResponse } from 'quidproquo-webserver';
2
+ import { S3Event, Context } from 'aws-lambda';
3
+ import { MatchStoryResult, QpqSourceEntry } from 'quidproquo-core';
4
+ export declare const GLOBAL_STORAGE_DRIVE_NAME: string;
5
+ export declare const GLOBAL_STORAGE_DRIVE_RUNTIME: QpqSourceEntry;
6
+ export type EventInput = [S3Event, Context];
7
+ export type EventOutput = void;
8
+ export type InternalEventRecord = StorageDriveEvent;
9
+ export type InternalEventOutput = StorageDriveEventResponse;
10
+ export type MatchResult = MatchStoryResult<any, any>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GLOBAL_STORAGE_DRIVE_RUNTIME = exports.GLOBAL_STORAGE_DRIVE_NAME = void 0;
4
+ // Customs
5
+ exports.GLOBAL_STORAGE_DRIVE_NAME = process.env.storageDriveName;
6
+ exports.GLOBAL_STORAGE_DRIVE_RUNTIME = JSON.parse(process.env.storageDriveEntry || '{}');
@@ -0,0 +1 @@
1
+ export * from './fileEvent';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./fileEvent"), exports);
@@ -0,0 +1 @@
1
+ export * from './queue';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./queue"), exports);
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventAutoRespondActionProcessor } from 'quidproquo-core';
2
+ import { InternalEventRecord, MatchResult } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<InternalEventRecord, MatchResult, boolean>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,22 @@
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 getProcessAutoRespond = (qpqConfig) => {
14
+ return ({ qpqEventRecord, matchResult }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ return (0, quidproquo_core_1.actionResult)(null);
16
+ });
17
+ };
18
+ exports.default = (qpqConfig) => {
19
+ return {
20
+ [quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(qpqConfig),
21
+ };
22
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventGetRecordsActionProcessor } from 'quidproquo-core';
2
+ import { EventInput, InternalEventRecord } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/Event/GetRecords": EventGetRecordsActionProcessor<EventInput, InternalEventRecord>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,35 @@
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 getProcessGetRecords = (qpqConfig) => {
14
+ return ({ eventParams: [sqsEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const records = sqsEvent.Records.map((record) => {
16
+ const parsedInternalEventRecord = JSON.parse(record.body);
17
+ // TODO: Remove the session from this object
18
+ // note: we still need to access the session in the story execution for depth and auth etc.
19
+ const internalEventRecord = {
20
+ message: {
21
+ type: parsedInternalEventRecord.type || 'AWS_ALARM',
22
+ payload: parsedInternalEventRecord.payload || {},
23
+ },
24
+ id: record.messageId,
25
+ };
26
+ return internalEventRecord;
27
+ });
28
+ return (0, quidproquo_core_1.actionResult)(records);
29
+ });
30
+ };
31
+ exports.default = (qpqConfig) => {
32
+ return {
33
+ [quidproquo_core_1.EventActionType.GetRecords]: getProcessGetRecords(qpqConfig),
34
+ };
35
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventGetStorySessionActionProcessor } from 'quidproquo-core';
2
+ import { EventInput, InternalEventRecord } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/GetStorySession": EventGetStorySessionActionProcessor<EventInput, InternalEventRecord>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,28 @@
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 getProcessGetStorySession = (qpqConfig) => {
14
+ return ({ qpqEventRecord, eventParams: [sqsEvent] }) => __awaiter(void 0, void 0, void 0, function* () {
15
+ // Find the src record and pull out the session from that if we can
16
+ const srcRecord = sqsEvent.Records.find((r) => r.messageId === qpqEventRecord.id);
17
+ if (srcRecord) {
18
+ const parsedInternalEventRecord = JSON.parse(srcRecord.body);
19
+ return (0, quidproquo_core_1.actionResult)(parsedInternalEventRecord.storySession);
20
+ }
21
+ return (0, quidproquo_core_1.actionResult)(void 0);
22
+ });
23
+ };
24
+ exports.default = (qpqConfig) => {
25
+ return {
26
+ [quidproquo_core_1.EventActionType.GetStorySession]: getProcessGetStorySession(qpqConfig),
27
+ };
28
+ };
@@ -0,0 +1,8 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ export declare const getSqsQueueEventProcessor: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-core/event/TransformResponseResult": import("quidproquo-core").EventTransformResponseResultActionProcessor<import("./types").EventInput, boolean, import("aws-lambda").SQSBatchResponse>;
4
+ "@quidproquo-core/event/AutoRespond": import("quidproquo-core").EventAutoRespondActionProcessor<import("./types").InternalEventRecord, import("./types").MatchResult, boolean>;
5
+ "@quidproquo-core/event/MatchStory": import("quidproquo-core").EventMatchStoryActionProcessor<import("./types").InternalEventRecord, import("./types").MatchResult>;
6
+ "@quidproquo-core/Event/GetRecords": import("quidproquo-core").EventGetRecordsActionProcessor<import("./types").EventInput, import("./types").InternalEventRecord>;
7
+ "@quidproquo-core/event/GetStorySession": import("quidproquo-core").EventGetStorySessionActionProcessor<import("./types").EventInput, import("./types").InternalEventRecord>;
8
+ };
@@ -0,0 +1,13 @@
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.getSqsQueueEventProcessor = void 0;
7
+ const autoRespond_1 = __importDefault(require("./autoRespond"));
8
+ const getRecords_1 = __importDefault(require("./getRecords"));
9
+ const matchStory_1 = __importDefault(require("./matchStory"));
10
+ const transformResponseResult_1 = __importDefault(require("./transformResponseResult"));
11
+ const getStorySession_1 = __importDefault(require("./getStorySession"));
12
+ const getSqsQueueEventProcessor = (qpqConfig) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, getStorySession_1.default)(qpqConfig)), (0, getRecords_1.default)(qpqConfig)), (0, matchStory_1.default)(qpqConfig)), (0, autoRespond_1.default)(qpqConfig)), (0, transformResponseResult_1.default)(qpqConfig)));
13
+ exports.getSqsQueueEventProcessor = getSqsQueueEventProcessor;
@@ -0,0 +1,7 @@
1
+ import { EventMatchStoryActionProcessor, QPQConfig, QueueQPQConfigSetting } from 'quidproquo-core';
2
+ import { InternalEventRecord, MatchResult } from './types';
3
+ export declare const getQueueConfigSetting: () => QueueQPQConfigSetting;
4
+ declare const _default: (qpqConfig: QPQConfig) => {
5
+ "@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<InternalEventRecord, MatchResult>;
6
+ };
7
+ export default _default;
@@ -11,43 +11,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getQueueConfigSetting = void 0;
13
13
  const quidproquo_core_1 = require("quidproquo-core");
14
- const awsLambdaUtils_1 = require("../../../awsLambdaUtils");
14
+ const awsLambdaUtils_1 = require("../../../../../awsLambdaUtils");
15
15
  const getQueueConfigSetting = () => {
16
16
  const queueQPQConfigSetting = JSON.parse(process.env.queueQPQConfigSetting);
17
17
  // TODO: Validate here
18
18
  return queueQPQConfigSetting;
19
19
  };
20
20
  exports.getQueueConfigSetting = getQueueConfigSetting;
21
- const getProcessTransformEventParams = (qpqConfig) => {
22
- return ({ eventParams: [record, context] }) => __awaiter(void 0, void 0, void 0, function* () {
23
- return (0, quidproquo_core_1.actionResult)({
24
- message: {
25
- type: record.type,
26
- payload: record.payload,
27
- },
28
- });
29
- });
30
- };
31
- const getProcessTransformResponseResult = (configs) => {
32
- return ({ response }) => __awaiter(void 0, void 0, void 0, function* () {
33
- return (0, quidproquo_core_1.actionResult)(response);
34
- });
35
- };
36
- const getProcessAutoRespond = () => {
37
- return (payload) => __awaiter(void 0, void 0, void 0, function* () {
38
- // If we couldn't match and hasn't thrown error, we will just gracefully exit.
39
- return (0, quidproquo_core_1.actionResult)(!payload.matchResult.src);
40
- });
41
- };
42
21
  const getProcessMatchStory = (qpqConfig) => {
22
+ // TODO: Get this out of the qpqconfig like the other event processors
43
23
  const queueQPQConfigSetting = (0, exports.getQueueConfigSetting)();
44
- return (payload) => __awaiter(void 0, void 0, void 0, function* () {
24
+ return ({ qpqEventRecord }) => __awaiter(void 0, void 0, void 0, function* () {
45
25
  const queueQueueProcessors = quidproquo_core_1.qpqCoreUtils.getQueueQueueProcessors(queueQPQConfigSetting.name, qpqConfig);
46
26
  const queueTypes = Object.keys(queueQueueProcessors).sort();
47
27
  // Find the most relevant match
48
28
  const matchedQueueType = queueTypes
49
29
  .map((qt) => ({
50
- match: (0, awsLambdaUtils_1.matchUrl)(qt, payload.transformedEventParams.message.type),
30
+ match: (0, awsLambdaUtils_1.matchUrl)(qt, qpqEventRecord.message.type),
51
31
  queueType: qt,
52
32
  }))
53
33
  .find((m) => m.match.didMatch);
@@ -57,7 +37,7 @@ const getProcessMatchStory = (qpqConfig) => {
57
37
  if (queueQPQConfigSetting.eventBusSubscriptions.length > 0) {
58
38
  return (0, quidproquo_core_1.actionResult)({});
59
39
  }
60
- return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `queue type not found ${payload.transformedEventParams.message.type}`);
40
+ return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `queue type not found ${qpqEventRecord.message.type}`);
61
41
  }
62
42
  const sourceEntry = queueQueueProcessors[matchedQueueType.queueType];
63
43
  return (0, quidproquo_core_1.actionResult)({
@@ -70,9 +50,6 @@ const getProcessMatchStory = (qpqConfig) => {
70
50
  };
71
51
  exports.default = (qpqConfig) => {
72
52
  return {
73
- [quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(qpqConfig),
74
- [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
75
- [quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(),
76
53
  [quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(qpqConfig),
77
54
  };
78
55
  };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig, EventTransformResponseResultActionProcessor } from 'quidproquo-core';
2
+ import { EventInput } from './types';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<EventInput, boolean, import("aws-lambda").SQSBatchResponse>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,35 @@
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 getProcessTransformResponseResult = (qpqConfig) => {
14
+ // We might need to JSON.stringify the body.
15
+ return ({ eventParams, qpqEventRecordResponses }) => __awaiter(void 0, void 0, void 0, function* () {
16
+ const [sqsEvent] = eventParams;
17
+ const batchItemFailures = qpqEventRecordResponses
18
+ .filter((record) => !record.success)
19
+ .map((record, index) => {
20
+ const batchItemFailure = {
21
+ itemIdentifier: sqsEvent.Records[index].messageId,
22
+ };
23
+ return batchItemFailure;
24
+ });
25
+ // Transform back to api gateway
26
+ return (0, quidproquo_core_1.actionResult)({
27
+ batchItemFailures,
28
+ });
29
+ });
30
+ };
31
+ exports.default = (qpqConfig) => {
32
+ return {
33
+ [quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(qpqConfig),
34
+ };
35
+ };
@@ -0,0 +1,12 @@
1
+ import { QueueEventResponse } from 'quidproquo-webserver';
2
+ import { SQSEvent, Context, SQSBatchResponse } from 'aws-lambda';
3
+ import { MatchStoryResult, QueueMessage, StorySession } from 'quidproquo-core';
4
+ import { QueueEvent } from 'quidproquo-webserver';
5
+ export type AnyQueueMessageWithSession = QueueMessage<any> & {
6
+ storySession: StorySession;
7
+ };
8
+ export type EventInput = [SQSEvent, Context];
9
+ export type EventOutput = SQSBatchResponse;
10
+ export type InternalEventRecord = QueueEvent<QueueMessage<any>>;
11
+ export type InternalEventOutput = QueueEventResponse;
12
+ export type MatchResult = MatchStoryResult<any, any>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,19 +3,10 @@ export { default as getConfigGetParameterActionProcessor } from './config/getCon
3
3
  export { default as getConfigGetParametersActionProcessor } from './config/getConfigGetParametersActionProcessor';
4
4
  export { default as getConfigGetGlobalActionProcessor } from './config/getConfigGetGlobalActionProcessor';
5
5
  export { default as getConfigSetParameterActionProcessor } from './config/getConfigSetParameterActionProcessor';
6
- export { default as getAPIGatewayEventActionProcessor } from './event/getAPIGatewayEventActionProcessor';
7
- export { default as getCloudFrontOriginRequestEventActionProcessor } from './event/getCloudFrontOriginRequestEventActionProcessor';
8
- export { default as getSQSEventRecordActionProcessor } from './event/getSQSEventRecordActionProcessor';
9
- export { default as getServiceFunctionExecuteEventActionProcessor } from './event/getServiceFunctionExecuteEventActionProcessor';
10
- export { default as getEventBridgeEventStackDeployActionProcessor } from './event/getEventBridgeEventStackDeployActionProcessor';
11
- export { default as getEventBridgeEventActionProcessor } from './event/getEventBridgeEventActionProcessor';
12
- export { default as getLambdaCognitoCustomMessage } from './event/getLambdaCognitoCustomMessage';
13
- export { default as getWebsocketAPIGatewayEventActionProcessor } from './event/getWebsocketAPIGatewayEventActionProcessor';
14
- export { default as getS3FileEventActionProcessor } from './event/getS3FileEventActionProcessor';
15
- export { default as getCustomResourceCloudflareDnsEventActionProcessor } from './event/getCustomResourceCloudflareDnsEventActionProcessor';
16
6
  export { default as getSystemActionProcessor } from './system';
17
7
  export { default as getFileActionProcessor } from './file';
18
8
  export { default as getKeyValueStoreActionProcessor } from './keyValueStore';
19
9
  export { default as getQueueActionProcessor } from './queue';
20
10
  export { default as getUserDirectoryActionProcessor } from './userDirectory';
21
11
  export { default as getEventBusActionProcessor } from './eventBus';
12
+ export * from './event';