quidproquo-actionprocessor-awslambda 0.0.90 → 0.0.92

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 (42) hide show
  1. package/lib/awsLambdaUtils.d.ts +1 -1
  2. package/lib/getActionProcessor/core/index.d.ts +1 -0
  3. package/lib/getActionProcessor/core/index.js +3 -1
  4. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreDeleteActionProcessor.d.ts +6 -0
  5. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreDeleteActionProcessor.js +26 -0
  6. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreGetActionProcessor.d.ts +6 -0
  7. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreGetActionProcessor.js +26 -0
  8. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreGetAllActionProcessor.d.ts +6 -0
  9. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreGetAllActionProcessor.js +26 -0
  10. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreSetActionProcessor.d.ts +6 -0
  11. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreSetActionProcessor.js +28 -0
  12. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreUpdateActionProcessor.d.ts +6 -0
  13. package/lib/getActionProcessor/core/keyValueStore/getKeyValueStoreUpdateActionProcessor.js +28 -0
  14. package/lib/getActionProcessor/core/keyValueStore/index.d.ts +8 -0
  15. package/lib/getActionProcessor/core/keyValueStore/index.js +10 -0
  16. package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.d.ts +2 -2
  17. package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.js +5 -8
  18. package/lib/getActionProcessor/core/system/index.d.ts +3 -2
  19. package/lib/getActionProcessor/core/system/index.js +1 -1
  20. package/lib/getActionProcessor/webserver/admin/getAdminActionProcessor.d.ts +7 -0
  21. package/lib/getActionProcessor/webserver/admin/getAdminActionProcessor.js +41 -0
  22. package/lib/getActionProcessor/webserver/admin/index.d.ts +6 -0
  23. package/lib/getActionProcessor/webserver/admin/index.js +7 -0
  24. package/lib/getActionProcessor/webserver/index.d.ts +1 -0
  25. package/lib/getActionProcessor/webserver/index.js +3 -1
  26. package/lib/logic/dynamo/deleteItem.d.ts +1 -0
  27. package/lib/logic/dynamo/deleteItem.js +28 -0
  28. package/lib/logic/dynamo/getAllItems.d.ts +1 -0
  29. package/lib/logic/dynamo/getAllItems.js +37 -0
  30. package/lib/logic/dynamo/getItem.d.ts +1 -0
  31. package/lib/logic/dynamo/getItem.js +35 -0
  32. package/lib/logic/dynamo/getPagedItemsOverRange.d.ts +2 -0
  33. package/lib/logic/dynamo/getPagedItemsOverRange.js +67 -0
  34. package/lib/logic/dynamo/index.d.ts +5 -0
  35. package/lib/logic/dynamo/index.js +21 -0
  36. package/lib/logic/dynamo/putItem.d.ts +4 -0
  37. package/lib/logic/dynamo/putItem.js +23 -0
  38. package/lib/logic/dynamo/updateItem.d.ts +3 -0
  39. package/lib/logic/dynamo/updateItem.js +54 -0
  40. package/lib/logic/s3/listFiles.d.ts +1 -1
  41. package/lib/logic/s3/listFiles.js +3 -3
  42. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- export declare const randomGuid: () => string;
1
+ export declare const randomGuid: () => `${string}-${string}-${string}-${string}-${string}`;
2
2
  export interface UrlMatch {
3
3
  didMatch: boolean;
4
4
  params: Record<string, string> | null;
@@ -8,6 +8,7 @@ export { default as getServiceFunctionExecuteEventActionProcessor } from './even
8
8
  export { default as getEventBridgeEventActionProcessor } from './event/getEventBridgeEventActionProcessor';
9
9
  export { default as getSystemActionProcessor } from './system';
10
10
  export { default as getFileActionProcessor } from './file';
11
+ export { default as getKeyValueStoreActionProcessor } from './keyValueStore';
11
12
  export { default as getQueueActionProcessor } from './queue';
12
13
  export { default as getUserDirectoryActionProcessor } from './userDirectory';
13
14
  export { default as getEventBusActionProcessor } from './eventBus';
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getEventBusActionProcessor = exports.getUserDirectoryActionProcessor = exports.getQueueActionProcessor = exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getEventBridgeEventActionProcessor = exports.getServiceFunctionExecuteEventActionProcessor = exports.getSQSEventRecordActionProcessor = exports.getCloudFrontOriginRequestEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
6
+ exports.getEventBusActionProcessor = exports.getUserDirectoryActionProcessor = exports.getQueueActionProcessor = exports.getKeyValueStoreActionProcessor = exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getEventBridgeEventActionProcessor = exports.getServiceFunctionExecuteEventActionProcessor = exports.getSQSEventRecordActionProcessor = exports.getCloudFrontOriginRequestEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
7
7
  var getConfigGetSecretActionProcessor_1 = require("./config/getConfigGetSecretActionProcessor");
8
8
  Object.defineProperty(exports, "getConfigGetSecretActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetSecretActionProcessor_1).default; } });
9
9
  var getConfigGetParameterActionProcessor_1 = require("./config/getConfigGetParameterActionProcessor");
@@ -24,6 +24,8 @@ var system_1 = require("./system");
24
24
  Object.defineProperty(exports, "getSystemActionProcessor", { enumerable: true, get: function () { return __importDefault(system_1).default; } });
25
25
  var file_1 = require("./file");
26
26
  Object.defineProperty(exports, "getFileActionProcessor", { enumerable: true, get: function () { return __importDefault(file_1).default; } });
27
+ var keyValueStore_1 = require("./keyValueStore");
28
+ Object.defineProperty(exports, "getKeyValueStoreActionProcessor", { enumerable: true, get: function () { return __importDefault(keyValueStore_1).default; } });
27
29
  var queue_1 = require("./queue");
28
30
  Object.defineProperty(exports, "getQueueActionProcessor", { enumerable: true, get: function () { return __importDefault(queue_1).default; } });
29
31
  var userDirectory_1 = require("./userDirectory");
@@ -0,0 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ import { KeyValueStoreDeleteActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/KeyValueStore/Delete": KeyValueStoreDeleteActionProcessor;
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 awsNamingUtils_1 = require("../../../awsNamingUtils");
14
+ const quidproquo_core_2 = require("quidproquo-core");
15
+ const dynamo_1 = require("../../../logic/dynamo");
16
+ const getProcessKeyValueStoreDelete = (qpqConfig) => {
17
+ return ({ keyValueStoreName, key }) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const dynamoTableName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(keyValueStoreName, qpqConfig, 'kvs');
19
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
20
+ yield (0, dynamo_1.deleteItem)(dynamoTableName, key, region);
21
+ return (0, quidproquo_core_2.actionResult)(void 0);
22
+ });
23
+ };
24
+ exports.default = (qpqConfig) => ({
25
+ [quidproquo_core_2.KeyValueStoreActionType.Delete]: getProcessKeyValueStoreDelete(qpqConfig),
26
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ import { KeyValueStoreGetActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/KeyValueStore/Get": KeyValueStoreGetActionProcessor<any>;
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 awsNamingUtils_1 = require("../../../awsNamingUtils");
14
+ const quidproquo_core_2 = require("quidproquo-core");
15
+ const dynamo_1 = require("../../../logic/dynamo");
16
+ const getProcessKeyValueStoreGet = (qpqConfig) => {
17
+ return ({ keyValueStoreName, key }) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const dynamoTableName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(keyValueStoreName, qpqConfig, 'kvs');
19
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
20
+ const result = yield (0, dynamo_1.getItem)(dynamoTableName, key, region);
21
+ return (0, quidproquo_core_2.actionResult)(result);
22
+ });
23
+ };
24
+ exports.default = (qpqConfig) => ({
25
+ [quidproquo_core_2.KeyValueStoreActionType.Get]: getProcessKeyValueStoreGet(qpqConfig),
26
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ import { KeyValueStoreGetAllActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/KeyValueStore/GetAll": KeyValueStoreGetAllActionProcessor<any>;
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 awsNamingUtils_1 = require("../../../awsNamingUtils");
14
+ const quidproquo_core_2 = require("quidproquo-core");
15
+ const dynamo_1 = require("../../../logic/dynamo");
16
+ const getProcessKeyValueStoreGetAll = (qpqConfig) => {
17
+ return ({ keyValueStoreName }) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const dynamoTableName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(keyValueStoreName, qpqConfig, 'kvs');
19
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
20
+ const result = yield (0, dynamo_1.getAllItems)(dynamoTableName, region);
21
+ return (0, quidproquo_core_2.actionResult)(result);
22
+ });
23
+ };
24
+ exports.default = (qpqConfig) => ({
25
+ [quidproquo_core_2.KeyValueStoreActionType.GetAll]: getProcessKeyValueStoreGetAll(qpqConfig),
26
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ import { KeyValueStoreSetActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/KeyValueStore/Set": KeyValueStoreSetActionProcessor<any>;
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 awsNamingUtils_1 = require("../../../awsNamingUtils");
14
+ const quidproquo_core_2 = require("quidproquo-core");
15
+ const dynamo_1 = require("../../../logic/dynamo");
16
+ const getProcessKeyValueStoreSet = (qpqConfig) => {
17
+ return ({ keyValueStoreName, key, value, options }) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const dynamoTableName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(keyValueStoreName, qpqConfig, 'kvs');
19
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
20
+ yield (0, dynamo_1.putItem)(dynamoTableName, key, value, {
21
+ expires: options === null || options === void 0 ? void 0 : options.ttl,
22
+ }, region);
23
+ return (0, quidproquo_core_2.actionResult)(void 0);
24
+ });
25
+ };
26
+ exports.default = (qpqConfig) => ({
27
+ [quidproquo_core_2.KeyValueStoreActionType.Set]: getProcessKeyValueStoreSet(qpqConfig),
28
+ });
@@ -0,0 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ import { KeyValueStoreUpdateActionProcessor } from 'quidproquo-core';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-core/KeyValueStore/Update": KeyValueStoreUpdateActionProcessor<any>;
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 awsNamingUtils_1 = require("../../../awsNamingUtils");
14
+ const quidproquo_core_2 = require("quidproquo-core");
15
+ const dynamo_1 = require("../../../logic/dynamo");
16
+ const getProcessKeyValueStoreUpdate = (qpqConfig) => {
17
+ return ({ keyValueStoreName, key, value, options }) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const dynamoTableName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(keyValueStoreName, qpqConfig, 'kvs');
19
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
20
+ yield (0, dynamo_1.updateItem)(dynamoTableName, key, value, {
21
+ expires: options === null || options === void 0 ? void 0 : options.ttl,
22
+ }, region);
23
+ return (0, quidproquo_core_2.actionResult)(void 0);
24
+ });
25
+ };
26
+ exports.default = (qpqConfig) => ({
27
+ [quidproquo_core_2.KeyValueStoreActionType.Update]: getProcessKeyValueStoreUpdate(qpqConfig),
28
+ });
@@ -0,0 +1,8 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ declare const _default: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-core/KeyValueStore/Update": import("quidproquo-core").KeyValueStoreUpdateActionProcessor<any>;
4
+ "@quidproquo-core/KeyValueStore/Set": import("quidproquo-core").KeyValueStoreSetActionProcessor<any>;
5
+ "@quidproquo-core/KeyValueStore/Get": import("quidproquo-core").KeyValueStoreGetActionProcessor<any>;
6
+ "@quidproquo-core/KeyValueStore/Delete": import("quidproquo-core").KeyValueStoreDeleteActionProcessor;
7
+ };
8
+ export default _default;
@@ -0,0 +1,10 @@
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 getKeyValueStoreDeleteActionProcessor_1 = __importDefault(require("./getKeyValueStoreDeleteActionProcessor"));
7
+ const getKeyValueStoreGetActionProcessor_1 = __importDefault(require("./getKeyValueStoreGetActionProcessor"));
8
+ const getKeyValueStoreSetActionProcessor_1 = __importDefault(require("./getKeyValueStoreSetActionProcessor"));
9
+ const getKeyValueStoreUpdateActionProcessor_1 = __importDefault(require("./getKeyValueStoreUpdateActionProcessor"));
10
+ exports.default = (qpqConfig) => (Object.assign(Object.assign(Object.assign(Object.assign({}, (0, getKeyValueStoreDeleteActionProcessor_1.default)(qpqConfig)), (0, getKeyValueStoreGetActionProcessor_1.default)(qpqConfig)), (0, getKeyValueStoreSetActionProcessor_1.default)(qpqConfig)), (0, getKeyValueStoreUpdateActionProcessor_1.default)(qpqConfig)));
@@ -1,7 +1,7 @@
1
- import { SystemExecuteStoryActionProcessor } from 'quidproquo-core';
1
+ import { QPQConfig, SystemExecuteStoryActionProcessor } from 'quidproquo-core';
2
2
  import { DynamicModuleLoader } from '../../../types/DynamicLoader';
3
3
  export declare const getDateNow: () => string;
4
- declare const _default: (dynamicModuleLoader: DynamicModuleLoader) => {
4
+ declare const _default: (qpqConfig: QPQConfig, dynamicModuleLoader: DynamicModuleLoader) => {
5
5
  "@quidproquo-core/System/ExecuteStory": SystemExecuteStoryActionProcessor<any[]>;
6
6
  };
7
7
  export default _default;
@@ -14,8 +14,8 @@ const quidproquo_core_1 = require("quidproquo-core");
14
14
  const awsLambdaUtils_1 = require("./../../../awsLambdaUtils");
15
15
  const getDateNow = () => new Date().toISOString();
16
16
  exports.getDateNow = getDateNow;
17
- const getProcessExecuteStory = (dynamicModuleLoader) => {
18
- return (payload, session, actionProcessors) => __awaiter(void 0, void 0, void 0, function* () {
17
+ const getProcessExecuteStory = (qpqConfig, dynamicModuleLoader) => {
18
+ return (payload, session, actionProcessors, logger) => __awaiter(void 0, void 0, void 0, function* () {
19
19
  let module = yield dynamicModuleLoader(payload.src);
20
20
  if (module === null) {
21
21
  return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Module not found [${payload.src}]`);
@@ -24,10 +24,7 @@ const getProcessExecuteStory = (dynamicModuleLoader) => {
24
24
  if (!story) {
25
25
  return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `[${payload.runtime}] not found in module [${payload.src}]`);
26
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);
27
+ const resolveStory = (0, quidproquo_core_1.createRuntime)(qpqConfig, session, actionProcessors, exports.getDateNow, logger, awsLambdaUtils_1.randomGuid, quidproquo_core_1.QpqRuntimeType.EXECUTE_STORY, [`${payload.src}::${payload.runtime}`]);
31
28
  const storyResult = yield resolveStory(story, payload.params);
32
29
  if (storyResult.error) {
33
30
  return (0, quidproquo_core_1.actionResultError)(storyResult.error.errorType, `story error! in ${payload.src}::${payload.runtime} -> [${storyResult.error.errorText}]`, storyResult.error.errorStack);
@@ -35,8 +32,8 @@ const getProcessExecuteStory = (dynamicModuleLoader) => {
35
32
  return (0, quidproquo_core_1.actionResult)(storyResult.result);
36
33
  });
37
34
  };
38
- exports.default = (dynamicModuleLoader) => {
35
+ exports.default = (qpqConfig, dynamicModuleLoader) => {
39
36
  return {
40
- [quidproquo_core_1.SystemActionType.ExecuteStory]: getProcessExecuteStory(dynamicModuleLoader),
37
+ [quidproquo_core_1.SystemActionType.ExecuteStory]: getProcessExecuteStory(qpqConfig, dynamicModuleLoader),
41
38
  };
42
39
  };
@@ -1,5 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
1
2
  import { DynamicModuleLoader } from '../../../types/DynamicLoader';
2
- declare const _default: (dynamicModuleLoader: DynamicModuleLoader) => {
3
- "@quidproquo-core/System/ExecuteStory": import("quidproquo-core/lib").SystemExecuteStoryActionProcessor<any[]>;
3
+ declare const _default: (qpqConfig: QPQConfig, dynamicModuleLoader: DynamicModuleLoader) => {
4
+ "@quidproquo-core/System/ExecuteStory": import("quidproquo-core").SystemExecuteStoryActionProcessor<any[]>;
4
5
  };
5
6
  export default _default;
@@ -4,4 +4,4 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const getExecuteStoryActionProcessor_1 = __importDefault(require("./getExecuteStoryActionProcessor"));
7
- exports.default = (dynamicModuleLoader) => (Object.assign({}, (0, getExecuteStoryActionProcessor_1.default)(dynamicModuleLoader)));
7
+ exports.default = (qpqConfig, dynamicModuleLoader) => (Object.assign({}, (0, getExecuteStoryActionProcessor_1.default)(qpqConfig, dynamicModuleLoader)));
@@ -0,0 +1,7 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ import { AdminGetLogsActionProcessor, AdminGetLogActionProcessor } from 'quidproquo-webserver';
3
+ declare const _default: (qpqConfig: QPQConfig) => {
4
+ "@quidproquo-webserver/Admin/GetLogs": AdminGetLogsActionProcessor;
5
+ "@quidproquo-webserver/Admin/GetLog": AdminGetLogActionProcessor;
6
+ };
7
+ export default _default;
@@ -0,0 +1,41 @@
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 awsNamingUtils_1 = require("../../../awsNamingUtils");
15
+ const getPagedItemsOverRange_1 = require("../../../logic/dynamo/getPagedItemsOverRange");
16
+ const readTextFile_1 = require("../../../logic/s3/readTextFile");
17
+ // TODO: Centralize this
18
+ const QPQ_LOG_BUCKET_NAME = 'logs';
19
+ const getAdminGetLogsActionProcessor = (qpqConfig) => {
20
+ return ({ runtimeType, nextPageKey, startIsoDateTime, endIsoDateTime }) => __awaiter(void 0, void 0, void 0, function* () {
21
+ const tableName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(QPQ_LOG_BUCKET_NAME, qpqConfig, 'log');
22
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
23
+ const response = yield (0, getPagedItemsOverRange_1.getPagedItemsOverRange)(tableName, region, runtimeType, startIsoDateTime, endIsoDateTime, nextPageKey);
24
+ return (0, quidproquo_core_1.actionResult)(response);
25
+ });
26
+ };
27
+ const getAdminGetLogActionProcessor = (qpqConfig) => {
28
+ return ({ correlationId }) => __awaiter(void 0, void 0, void 0, function* () {
29
+ const bucketName = (0, awsNamingUtils_1.getQpqRuntimeResourceNameFromConfig)(QPQ_LOG_BUCKET_NAME, qpqConfig, 'log');
30
+ const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
31
+ const logJson = yield (0, readTextFile_1.readTextFile)(bucketName, `${correlationId}.json`, region);
32
+ const response = JSON.parse(logJson);
33
+ return (0, quidproquo_core_1.actionResult)(response);
34
+ });
35
+ };
36
+ exports.default = (qpqConfig) => {
37
+ return {
38
+ [quidproquo_webserver_1.AdminActionType.GetLogs]: getAdminGetLogsActionProcessor(qpqConfig),
39
+ [quidproquo_webserver_1.AdminActionType.GetLog]: getAdminGetLogActionProcessor(qpqConfig),
40
+ };
41
+ };
@@ -0,0 +1,6 @@
1
+ import { QPQConfig } from 'quidproquo-core';
2
+ declare const _default: (qpqConfig: QPQConfig) => {
3
+ "@quidproquo-webserver/Admin/GetLogs": import("quidproquo-webserver/lib").AdminGetLogsActionProcessor;
4
+ "@quidproquo-webserver/Admin/GetLog": import("quidproquo-webserver/lib").AdminGetLogActionProcessor;
5
+ };
6
+ 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 getAdminActionProcessor_1 = __importDefault(require("./getAdminActionProcessor"));
7
+ exports.default = (qpqConfig) => (Object.assign({}, (0, getAdminActionProcessor_1.default)(qpqConfig)));
@@ -1,2 +1,3 @@
1
1
  export { default as getWebEntryActionProcessor } from './webEntry';
2
2
  export { default as getServiceFunctionActionProcessor } from './serviceFunction';
3
+ export { default as getAdminActionProcessor } from './admin';
@@ -3,8 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getServiceFunctionActionProcessor = exports.getWebEntryActionProcessor = void 0;
6
+ exports.getAdminActionProcessor = exports.getServiceFunctionActionProcessor = exports.getWebEntryActionProcessor = void 0;
7
7
  var webEntry_1 = require("./webEntry");
8
8
  Object.defineProperty(exports, "getWebEntryActionProcessor", { enumerable: true, get: function () { return __importDefault(webEntry_1).default; } });
9
9
  var serviceFunction_1 = require("./serviceFunction");
10
10
  Object.defineProperty(exports, "getServiceFunctionActionProcessor", { enumerable: true, get: function () { return __importDefault(serviceFunction_1).default; } });
11
+ var admin_1 = require("./admin");
12
+ Object.defineProperty(exports, "getAdminActionProcessor", { enumerable: true, get: function () { return __importDefault(admin_1).default; } });
@@ -0,0 +1 @@
1
+ export declare function deleteItem(tableName: string, key: string, region: string): Promise<void>;
@@ -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
+ exports.deleteItem = void 0;
13
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
+ function deleteItem(tableName, key, region) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const dynamoClient = new client_dynamodb_1.DynamoDBClient({ region });
17
+ const deleteItemParams = {
18
+ TableName: tableName,
19
+ Key: {
20
+ key: {
21
+ S: key,
22
+ },
23
+ },
24
+ };
25
+ yield dynamoClient.send(new client_dynamodb_1.DeleteItemCommand(deleteItemParams));
26
+ });
27
+ }
28
+ exports.deleteItem = deleteItem;
@@ -0,0 +1 @@
1
+ export declare function getAllItems(tableName: string, region: string): Promise<any[]>;
@@ -0,0 +1,37 @@
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.getAllItems = void 0;
13
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
+ function getAllItems(tableName, region) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const dynamoDBClient = new client_dynamodb_1.DynamoDBClient({ region });
17
+ let records = [];
18
+ let lastEvaluatedKey;
19
+ do {
20
+ const scanParams = {
21
+ TableName: tableName,
22
+ ExclusiveStartKey: lastEvaluatedKey,
23
+ };
24
+ try {
25
+ const result = yield dynamoDBClient.send(new client_dynamodb_1.ScanCommand(scanParams));
26
+ records = records.concat(result.Items);
27
+ lastEvaluatedKey = result.LastEvaluatedKey;
28
+ }
29
+ catch (error) {
30
+ console.error('Error scanning DynamoDB table:', error);
31
+ throw error;
32
+ }
33
+ } while (lastEvaluatedKey);
34
+ return records;
35
+ });
36
+ }
37
+ exports.getAllItems = getAllItems;
@@ -0,0 +1 @@
1
+ export declare function getItem(tableName: string, key: string, region: string): Promise<any | null>;
@@ -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
+ exports.getItem = void 0;
13
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
+ function getItem(tableName, key, region) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const dynamoDBClient = new client_dynamodb_1.DynamoDBClient({ region });
17
+ const getItemParams = {
18
+ TableName: tableName,
19
+ Key: {
20
+ key: {
21
+ S: key,
22
+ },
23
+ },
24
+ };
25
+ try {
26
+ const result = yield dynamoDBClient.send(new client_dynamodb_1.GetItemCommand(getItemParams));
27
+ return result.Item ? JSON.parse(result.Item.value.S) : null;
28
+ }
29
+ catch (error) {
30
+ console.error('Error getting item from DynamoDB:', error);
31
+ throw error;
32
+ }
33
+ });
34
+ }
35
+ exports.getItem = getItem;
@@ -0,0 +1,2 @@
1
+ import { QpqLogList } from 'quidproquo-webserver';
2
+ export declare function getPagedItemsOverRange(tableName: string, region: string, runtimeType: string, startIsoDateTime: string, endIsoDateTime: string, pageKey?: string): Promise<QpqLogList>;
@@ -0,0 +1,67 @@
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.getPagedItemsOverRange = void 0;
13
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
+ function lastEvaluatedKeyToString(lastEvaluatedKey) {
15
+ return Buffer.from(JSON.stringify(lastEvaluatedKey)).toString('base64');
16
+ }
17
+ function stringToLastEvaluatedKey(encodedKey) {
18
+ return JSON.parse(Buffer.from(encodedKey, 'base64').toString());
19
+ }
20
+ function getPagedItemsOverRange(tableName, region, runtimeType, startIsoDateTime, endIsoDateTime, pageKey) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const dynamoDBClient = new client_dynamodb_1.DynamoDBClient({ region });
23
+ const queryParams = {
24
+ TableName: tableName,
25
+ KeyConditionExpression: 'runtimeType = :runtimeType AND startedAtWithCorrelation BETWEEN :startIsoDateTime AND :endIsoDateTime',
26
+ ExpressionAttributeValues: {
27
+ ':runtimeType': { S: runtimeType },
28
+ ':startIsoDateTime': { S: startIsoDateTime + '#00000000-0000-0000-0000-000000000000' },
29
+ ':endIsoDateTime': { S: endIsoDateTime + '#ffffffff-ffff-ffff-ffff-ffffffffffff' },
30
+ },
31
+ ScanIndexForward: false,
32
+ };
33
+ if (pageKey) {
34
+ queryParams.ExclusiveStartKey = stringToLastEvaluatedKey(pageKey);
35
+ }
36
+ try {
37
+ const queryResult = yield dynamoDBClient.send(new client_dynamodb_1.QueryCommand(queryParams));
38
+ const items = (queryResult.Items || []).map((i) => {
39
+ var _a, _b, _c;
40
+ const [startedAt, correlation] = ((_a = i.startedAtWithCorrelation.S) === null || _a === void 0 ? void 0 : _a.split('#')) || [];
41
+ const metaData = {
42
+ generic: i.generic.S || '',
43
+ runtimeType: i.runtimeType.S,
44
+ error: (_b = i.error) === null || _b === void 0 ? void 0 : _b.S,
45
+ startedAt: startedAt,
46
+ correlation,
47
+ moduleName: i.moduleName.S || '',
48
+ fromCorrelation: (_c = i.fromCorrelation) === null || _c === void 0 ? void 0 : _c.S,
49
+ };
50
+ return metaData;
51
+ });
52
+ if (queryResult.LastEvaluatedKey) {
53
+ const nextPageKey = lastEvaluatedKeyToString(queryResult.LastEvaluatedKey);
54
+ // You can return the nextPageKey along with the items, so it can be used for the next query.
55
+ return { items, nextPageKey };
56
+ }
57
+ else {
58
+ return { items };
59
+ }
60
+ }
61
+ catch (err) {
62
+ console.error(`Failed to query items in the specified date range: ${err}`);
63
+ throw err;
64
+ }
65
+ });
66
+ }
67
+ exports.getPagedItemsOverRange = getPagedItemsOverRange;
@@ -0,0 +1,5 @@
1
+ export * from './deleteItem';
2
+ export * from './getAllItems';
3
+ export * from './getItem';
4
+ export * from './putItem';
5
+ export * from './updateItem';
@@ -0,0 +1,21 @@
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("./deleteItem"), exports);
18
+ __exportStar(require("./getAllItems"), exports);
19
+ __exportStar(require("./getItem"), exports);
20
+ __exportStar(require("./putItem"), exports);
21
+ __exportStar(require("./updateItem"), exports);
@@ -0,0 +1,4 @@
1
+ export interface PutItemOptions {
2
+ expires?: number;
3
+ }
4
+ export declare function putItem<Value>(tableName: string, key: string, value: Value, options: PutItemOptions, region: string): Promise<void>;
@@ -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
+ exports.putItem = void 0;
13
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
+ function putItem(tableName, key, value, options, region) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const dynamoClient = new client_dynamodb_1.DynamoDBClient({ region });
17
+ yield dynamoClient.send(new client_dynamodb_1.PutItemCommand({
18
+ TableName: tableName,
19
+ Item: Object.assign({ key: { S: key }, value: { S: JSON.stringify(value) } }, (options.expires ? { expires: { N: options.expires.toString() } } : {})),
20
+ }));
21
+ });
22
+ }
23
+ exports.putItem = putItem;
@@ -0,0 +1,3 @@
1
+ export declare function updateItem(tableName: string, key: string, value: any, options: {
2
+ expires?: number | undefined;
3
+ } | undefined, region: string): Promise<void>;
@@ -0,0 +1,54 @@
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.updateItem = void 0;
13
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
+ // THIS DOES NOT WORK ~ DO NOT USE
15
+ function updateItem(tableName, key, value, options = {}, region) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const dynamoClient = new client_dynamodb_1.DynamoDBClient({ region });
18
+ const updateExpressions = Object.keys(value).map((attr, idx) => {
19
+ return `SET #value.#${attr} = :${attr}`;
20
+ });
21
+ const expressionAttributeNames = Object.assign({ '#value': 'value' }, Object.keys(value).reduce((obj, attr) => {
22
+ obj[`#${attr}`] = attr;
23
+ return obj;
24
+ }, {}));
25
+ const expressionAttributeValues = Object.keys(value).reduce((obj, attr) => {
26
+ obj[`:${attr}`] = { S: JSON.stringify(value[attr]) };
27
+ return obj;
28
+ }, {});
29
+ if (options.expires) {
30
+ updateExpressions.push('SET expires = :expires');
31
+ expressionAttributeValues[':expires'] = { N: options.expires.toString() };
32
+ }
33
+ const updateItemParams = {
34
+ TableName: tableName,
35
+ Key: {
36
+ key: {
37
+ S: key,
38
+ },
39
+ },
40
+ UpdateExpression: updateExpressions.join(', '),
41
+ ExpressionAttributeNames: expressionAttributeNames,
42
+ ExpressionAttributeValues: expressionAttributeValues,
43
+ };
44
+ console.log('updateItemParams:', JSON.stringify(updateItemParams, null, 2));
45
+ try {
46
+ yield dynamoClient.send(new client_dynamodb_1.UpdateItemCommand(updateItemParams));
47
+ }
48
+ catch (error) {
49
+ console.error('Error updating item:', error);
50
+ throw error;
51
+ }
52
+ });
53
+ }
54
+ exports.updateItem = updateItem;
@@ -7,4 +7,4 @@ export interface S3FileList {
7
7
  fileInfos: S3FileInfo[];
8
8
  pageToken?: string;
9
9
  }
10
- export declare const listFiles: (drive: string, region: string, folder?: string, maxKeys?: number, pageToken?: string) => Promise<S3FileList>;
10
+ export declare const listFiles: (bucketName: string, region: string, folder?: string, maxKeys?: number, pageToken?: string) => Promise<S3FileList>;
@@ -13,10 +13,10 @@ exports.listFiles = void 0;
13
13
  const client_s3_1 = require("@aws-sdk/client-s3");
14
14
  const client_s3_2 = require("@aws-sdk/client-s3");
15
15
  const quidproquo_core_1 = require("quidproquo-core");
16
- const listFiles = (drive, region, folder = '', maxKeys = 1000, pageToken) => __awaiter(void 0, void 0, void 0, function* () {
16
+ const listFiles = (bucketName, region, folder = '', maxKeys = 1000, pageToken) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  const validatedPrefix = `${folder}${folder.endsWith(quidproquo_core_1.filePathDelimiter) || !folder ? '' : quidproquo_core_1.filePathDelimiter}`;
18
18
  const bucketParams = {
19
- Bucket: drive,
19
+ Bucket: bucketName,
20
20
  Delimiter: quidproquo_core_1.filePathDelimiter,
21
21
  Prefix: validatedPrefix,
22
22
  ContinuationToken: pageToken,
@@ -31,7 +31,7 @@ const listFiles = (drive, region, folder = '', maxKeys = 1000, pageToken) => __a
31
31
  ...files,
32
32
  ...response.CommonPrefixes.filter((cp) => !!cp.Prefix).map((cp) => ({
33
33
  filepath: cp.Prefix,
34
- drive: drive,
34
+ drive: bucketName,
35
35
  isDir: true,
36
36
  })),
37
37
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-awslambda",
3
- "version": "0.0.90",
3
+ "version": "0.0.92",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -29,6 +29,7 @@
29
29
  "@aws-sdk/client-cloudformation": "^3.278.0",
30
30
  "@aws-sdk/client-cloudfront": "^3.289.0",
31
31
  "@aws-sdk/client-cognito-identity-provider": "^3.278.0",
32
+ "@aws-sdk/client-dynamodb": "^3.310.0",
32
33
  "@aws-sdk/client-lambda": "^3.278.0",
33
34
  "@aws-sdk/client-s3": "^3.278.0",
34
35
  "@aws-sdk/client-secrets-manager": "^3.278.0",