quidproquo-actionprocessor-awslambda 0.0.237 → 0.0.239
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.
|
@@ -20,6 +20,7 @@ const client_s3_1 = require("@aws-sdk/client-s3");
|
|
|
20
20
|
const awsNamingUtils_1 = require("../../awsNamingUtils");
|
|
21
21
|
const tempDirectory = '/tmp/qpqlogs';
|
|
22
22
|
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
23
|
+
const crypto_1 = require("crypto");
|
|
23
24
|
const storyLogger = (result, bucketName, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
25
|
try {
|
|
25
26
|
const s3Client = new client_s3_1.S3Client({ region });
|
|
@@ -82,6 +83,7 @@ const getLogger = (qpqConfig) => {
|
|
|
82
83
|
const application = quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
|
|
83
84
|
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
84
85
|
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
86
|
+
console.log('Env for bucket: ', environment);
|
|
85
87
|
// Workout the bucket name.
|
|
86
88
|
const bucketName = (0, awsNamingUtils_1.getConfigRuntimeResourceName)('qpq-logs', application, service, environment, feature);
|
|
87
89
|
// Where is this bucket?
|
|
@@ -98,9 +100,10 @@ const getLogger = (qpqConfig) => {
|
|
|
98
100
|
}),
|
|
99
101
|
waitToFinishWriting: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
102
|
console.log('logs.length', logs.length);
|
|
101
|
-
|
|
103
|
+
const id = (0, crypto_1.randomUUID)();
|
|
104
|
+
console.time(`Writing Logs ${id}`);
|
|
102
105
|
yield Promise.all(logs);
|
|
103
|
-
console.timeEnd(
|
|
106
|
+
console.timeEnd(`Writing Logs ${id}`);
|
|
104
107
|
console.log('done writing logs');
|
|
105
108
|
}),
|
|
106
109
|
moveToPermanentStorage: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -5,6 +5,7 @@ import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
|
|
5
5
|
import { getConfigRuntimeResourceName } from '../../awsNamingUtils';
|
|
6
6
|
const tempDirectory = '/tmp/qpqlogs';
|
|
7
7
|
import { getAwsServiceAccountInfoByDeploymentInfo, getAwsServiceAccountInfoConfig } from 'quidproquo-config-aws';
|
|
8
|
+
import { randomUUID } from 'crypto';
|
|
8
9
|
export const storyLogger = async (result, bucketName, region) => {
|
|
9
10
|
try {
|
|
10
11
|
const s3Client = new S3Client({ region });
|
|
@@ -64,6 +65,7 @@ export const getLogger = (qpqConfig) => {
|
|
|
64
65
|
const application = qpqCoreUtils.getApplicationName(qpqConfig);
|
|
65
66
|
const environment = qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
66
67
|
const feature = qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
68
|
+
console.log('Env for bucket: ', environment);
|
|
67
69
|
// Workout the bucket name.
|
|
68
70
|
const bucketName = getConfigRuntimeResourceName('qpq-logs', application, service, environment, feature);
|
|
69
71
|
// Where is this bucket?
|
|
@@ -80,9 +82,10 @@ export const getLogger = (qpqConfig) => {
|
|
|
80
82
|
},
|
|
81
83
|
waitToFinishWriting: async () => {
|
|
82
84
|
console.log('logs.length', logs.length);
|
|
83
|
-
|
|
85
|
+
const id = randomUUID();
|
|
86
|
+
console.time(`Writing Logs ${id}`);
|
|
84
87
|
await Promise.all(logs);
|
|
85
|
-
console.timeEnd(
|
|
88
|
+
console.timeEnd(`Writing Logs ${id}`);
|
|
86
89
|
console.log('done writing logs');
|
|
87
90
|
},
|
|
88
91
|
moveToPermanentStorage: async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-awslambda",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.239",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"node-cache": "^5.1.2",
|
|
57
57
|
"node-match-path": "^0.6.3",
|
|
58
|
-
"quidproquo-config-aws": "0.0.
|
|
59
|
-
"quidproquo-core": "0.0.
|
|
60
|
-
"quidproquo-webserver": "0.0.
|
|
58
|
+
"quidproquo-config-aws": "0.0.239",
|
|
59
|
+
"quidproquo-core": "0.0.239",
|
|
60
|
+
"quidproquo-webserver": "0.0.239"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/aws-lambda": "^8.10.109",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/jsonwebtoken": "^9.0.2",
|
|
66
66
|
"@types/lodash": "^4.14.194",
|
|
67
67
|
"@types/node": "^18.11.9",
|
|
68
|
-
"quidproquo-tsconfig": "0.0.
|
|
68
|
+
"quidproquo-tsconfig": "0.0.239",
|
|
69
69
|
"typescript": "^4.9.3"
|
|
70
70
|
}
|
|
71
71
|
}
|