gcf-common-lib 0.25.49 → 0.25.51

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/types.ts +30 -30
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gcf-common-lib",
3
3
  "description": "",
4
- "version": "0.25.49",
4
+ "version": "0.25.51",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "branches": [
package/src/types.ts CHANGED
@@ -1,5 +1,35 @@
1
1
  import Dict = NodeJS.Dict;
2
2
 
3
+ export type TGSEvent<M = TMetadataOrAttributes> = {
4
+ bucket: string;
5
+ contentType: string;
6
+ crc32c: string;
7
+ etag: string;
8
+ generation: string;
9
+ id: string;
10
+ kind: string; // 'storage#object'
11
+ md5Hash: string;
12
+ mediaLink: string;
13
+ metadata: M;
14
+ metageneration: string;
15
+ name: string;
16
+ selfLink: string;
17
+ size: string;
18
+ storageClass: string;
19
+ timeCreated: string;
20
+ timeStorageClassUpdated: string;
21
+ updated: string;
22
+ };
23
+
24
+ export type TPSEvent<A = TMetadataOrAttributes> = {
25
+ '@type': string; // 'type.googleapis.com/google.pubsub.v1.PubsubMessage'
26
+ attributes?: A;
27
+ data?: string;
28
+ json?: Dict<any>;
29
+ };
30
+
31
+ export type TEvent = TGSEvent | TPSEvent;
32
+
3
33
  export type TMetadataOrAttributes = {
4
34
  topic?: string; // response PubSub topic [t_{GUID}__{YYYY-MM-DD}]
5
35
  exchange?: string; // response amqp exchange
@@ -26,36 +56,6 @@ export type TMetadataOrAttributes = {
26
56
  'request-id'?: string; // for rpc response [GUID]
27
57
  };
28
58
 
29
- export type TGSEvent = {
30
- bucket: string;
31
- contentType: string;
32
- crc32c: string;
33
- etag: string;
34
- generation: string;
35
- id: string;
36
- kind: string; // 'storage#object'
37
- md5Hash: string;
38
- mediaLink: string;
39
- metadata: TMetadataOrAttributes;
40
- metageneration: string;
41
- name: string;
42
- selfLink: string;
43
- size: string;
44
- storageClass: string;
45
- timeCreated: string;
46
- timeStorageClassUpdated: string;
47
- updated: string;
48
- };
49
-
50
- export type TPSEvent = {
51
- '@type': string; // 'type.googleapis.com/google.pubsub.v1.PubsubMessage'
52
- attributes: TMetadataOrAttributes;
53
- data: string;
54
- json?: Dict<any>;
55
- };
56
-
57
- export type TEvent = TGSEvent | TPSEvent;
58
-
59
59
  export type TContext = {
60
60
  eventId: string;
61
61
  timestamp: string;