gcf-common-lib 0.25.41 → 0.25.43

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gcf-common-lib",
3
3
  "description": "",
4
- "version": "0.25.41",
4
+ "version": "0.25.43",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "branches": [
package/src/index.js CHANGED
@@ -64,7 +64,7 @@ class GcfCommon {
64
64
  * @param handler
65
65
  * @param timeout Seconds
66
66
  */
67
- static process(event, context, handler = (e, c) => __awaiter(this, void 0, void 0, function* () { return ({}); }), timeout = 535) {
67
+ static process(event, context, handler = (e, c) => __awaiter(this, void 0, void 0, function* () { return e; }), timeout = 535) {
68
68
  return __awaiter(this, void 0, void 0, function* () {
69
69
  return Promise.race([(0, utils_1.timeoutAfter)(timeout), handler(event, context)])
70
70
  .then((res) => __awaiter(this, void 0, void 0, function* () {
package/src/index.ts CHANGED
@@ -43,7 +43,7 @@ export class GcfCommon {
43
43
  static async process<T extends TResponse>(
44
44
  event: TEvent,
45
45
  context: TContext,
46
- handler: (event: TEvent, context: TContext) => Promise<T> = async (e, c) => ({}) as T,
46
+ handler: (event: TEvent, context: TContext) => Promise<T> = async (e, c) => e as any,
47
47
  timeout = 535,
48
48
  ) {
49
49
  return Promise.race([timeoutAfter(timeout), handler(event, context)])
package/src/types.ts CHANGED
@@ -5,13 +5,28 @@ export type TMetadataOrAttributes = {
5
5
  exchange?: string; // response amqp exchange
6
6
  queue?: string; // response amqp queue
7
7
  //
8
+ filename?: string;
9
+ referer?: string;
10
+ 'remote-address'?: string;
11
+ 'upload-id'?: string;
12
+ 'user-agent'?: string;
13
+ timestamp?: string;
14
+ //
15
+ action?: string;
16
+ pipeline?: string;
17
+ options?: string;
18
+ 'job-uid'?: string;
19
+ 'user-id'?: string;
20
+ 'tenant-id'?: string;
21
+ //
8
22
  env?: string; // app environment
9
23
  appId?: string; // app id
10
24
  'app-id'?: string; // app id
11
25
  requestId?: string; // for rpc response [GUID]
12
26
  'request-id'?: string; // for rpc response [GUID]
13
- options?: string;
14
- }
27
+
28
+ [prop: string]: any;
29
+ };
15
30
 
16
31
  export type TGSEvent = {
17
32
  bucket: string;