gcf-common-lib 0.32.64 → 0.32.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/index.ts +4 -2
- package/tsconfig.json +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcf-common-lib",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.32.
|
|
4
|
+
"version": "0.32.66",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"branches": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=20"
|
|
13
13
|
},
|
|
14
14
|
"main": "src/index",
|
|
15
15
|
"scripts": {
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@google-cloud/pubsub": "^4.4.0",
|
|
24
24
|
"@google-cloud/storage": "^7.11.0",
|
|
25
|
-
"@tsconfig/
|
|
25
|
+
"@tsconfig/node20": "^20.1.4",
|
|
26
26
|
"@types/amqplib": "^0.10.5",
|
|
27
27
|
"@types/bluebird": "^3.5.42",
|
|
28
28
|
"@types/express": "^4.17.21",
|
|
29
29
|
"@types/lodash": "^4.17.1",
|
|
30
|
-
"@types/node": "^
|
|
30
|
+
"@types/node": "^20.17.22",
|
|
31
31
|
"amqplib": "^0.10.4",
|
|
32
32
|
"bluebird": "^3.7.2",
|
|
33
33
|
"lodash": "^4.17.21",
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Request } from 'express';
|
|
|
5
5
|
import isEmpty from 'lodash/isEmpty';
|
|
6
6
|
import mapValues from 'lodash/mapValues';
|
|
7
7
|
import noop from 'lodash/noop';
|
|
8
|
-
import { defer, first, firstValueFrom, from,
|
|
8
|
+
import { defer, first, firstValueFrom, from, timeout } from 'rxjs';
|
|
9
9
|
import { AmqpHelper } from './amqp-helper';
|
|
10
10
|
import { TEvent, TGSEvent, TMetadataOrAttributes, TPayload, TPSEvent, TResponse } from './types';
|
|
11
11
|
import { ms, safeJsonParse } from './utils';
|
|
@@ -38,7 +38,7 @@ export class GcfCommon {
|
|
|
38
38
|
|
|
39
39
|
static async process<T extends TResponse, E = TEvent>(
|
|
40
40
|
payload: TPayload<E>,
|
|
41
|
-
handler: (
|
|
41
|
+
handler: (p: TPayload<E>) => Promise<any> | any,
|
|
42
42
|
timeoutSec = 535,
|
|
43
43
|
) {
|
|
44
44
|
const asyncHandler = async (p: TPayload<E>) => await handler(p);
|
|
@@ -75,6 +75,8 @@ export class GcfCommon {
|
|
|
75
75
|
// );
|
|
76
76
|
// console.timeEnd('safeGetAttributes');
|
|
77
77
|
|
|
78
|
+
console.log('response:', payload);
|
|
79
|
+
|
|
78
80
|
const { topic, exchange, queue, consumer_id, request_id, app_id, env } = this.getMetadataOrAttribute(payload);
|
|
79
81
|
|
|
80
82
|
//
|
package/tsconfig.json
CHANGED