Skip to content

Commit bd36243

Browse files
feat: update to latest version of clouevents sdk (#402)
This commit updates to the latest CESDK which provides a generic interface for CloudEvents. This is an additive, non-breaking change to our registration API
1 parent 2073558 commit bd36243

File tree

12 files changed

+208
-126
lines changed

12 files changed

+208
-126
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- name: Setup Node.js
1313
uses: actions/setup-node@v2
1414
with:
15-
node-version: '16'
15+
node-version: '14'
1616
- name: Install dependencies
17-
run: npm install
17+
run: npm ci
1818
- name: Build docs
1919
run: npm run docs
2020
- name: Ensure there are no changes in docs

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v1
1111
with:
12-
node-version: 12
12+
node-version: 14
1313
registry-url: 'https://wombat-dressing-room.appspot.com'
1414
- id: publish
1515
env:

docs/generated/api.json

Lines changed: 109 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"toolPackage": "@microsoft/api-extractor",
4-
"toolVersion": "7.18.19",
4+
"toolVersion": "7.18.20",
55
"schemaVersion": 1004,
66
"oldestForwardsCompatibleVersion": 1001,
77
"tsdocConfig": {
@@ -180,7 +180,7 @@
180180
},
181181
{
182182
"kind": "Content",
183-
"text": "(functionName: string, handler: "
183+
"text": "<T = unknown>(functionName: string, handler: "
184184
},
185185
{
186186
"kind": "Reference",
@@ -189,7 +189,7 @@
189189
},
190190
{
191191
"kind": "Content",
192-
"text": ") => void"
192+
"text": "<T>) => void"
193193
}
194194
],
195195
"releaseTag": "Public",
@@ -206,10 +206,31 @@
206206
"excerptTokens": [
207207
{
208208
"kind": "Content",
209-
"text": "export declare interface CloudEventFunction "
209+
"text": "export interface CloudEventFunction<T = "
210+
},
211+
{
212+
"kind": "Content",
213+
"text": "unknown"
214+
},
215+
{
216+
"kind": "Content",
217+
"text": "> "
210218
}
211219
],
212220
"releaseTag": "Public",
221+
"typeParameters": [
222+
{
223+
"typeParameterName": "T",
224+
"constraintTokenRange": {
225+
"startIndex": 0,
226+
"endIndex": 0
227+
},
228+
"defaultTypeTokenRange": {
229+
"startIndex": 1,
230+
"endIndex": 2
231+
}
232+
}
233+
],
213234
"name": "CloudEventFunction",
214235
"members": [
215236
{
@@ -226,6 +247,10 @@
226247
"text": "CloudEvent",
227248
"canonicalReference": "cloudevents!CloudEventV1:interface"
228249
},
250+
{
251+
"kind": "Content",
252+
"text": "<T>"
253+
},
229254
{
230255
"kind": "Content",
231256
"text": "): "
@@ -240,8 +265,8 @@
240265
}
241266
],
242267
"returnTypeTokenRange": {
243-
"startIndex": 3,
244-
"endIndex": 4
268+
"startIndex": 4,
269+
"endIndex": 5
245270
},
246271
"releaseTag": "Public",
247272
"overloadIndex": 1,
@@ -250,7 +275,7 @@
250275
"parameterName": "cloudEvent",
251276
"parameterTypeTokenRange": {
252277
"startIndex": 1,
253-
"endIndex": 2
278+
"endIndex": 3
254279
}
255280
}
256281
]
@@ -265,10 +290,31 @@
265290
"excerptTokens": [
266291
{
267292
"kind": "Content",
268-
"text": "export declare interface CloudEventFunctionWithCallback "
293+
"text": "export interface CloudEventFunctionWithCallback<T = "
294+
},
295+
{
296+
"kind": "Content",
297+
"text": "unknown"
298+
},
299+
{
300+
"kind": "Content",
301+
"text": "> "
269302
}
270303
],
271304
"releaseTag": "Public",
305+
"typeParameters": [
306+
{
307+
"typeParameterName": "T",
308+
"constraintTokenRange": {
309+
"startIndex": 0,
310+
"endIndex": 0
311+
},
312+
"defaultTypeTokenRange": {
313+
"startIndex": 1,
314+
"endIndex": 2
315+
}
316+
}
317+
],
272318
"name": "CloudEventFunctionWithCallback",
273319
"members": [
274320
{
@@ -285,6 +331,10 @@
285331
"text": "CloudEvent",
286332
"canonicalReference": "cloudevents!CloudEventV1:interface"
287333
},
334+
{
335+
"kind": "Content",
336+
"text": "<T>"
337+
},
288338
{
289339
"kind": "Content",
290340
"text": ", callback: "
@@ -308,8 +358,8 @@
308358
}
309359
],
310360
"returnTypeTokenRange": {
311-
"startIndex": 5,
312-
"endIndex": 6
361+
"startIndex": 6,
362+
"endIndex": 7
313363
},
314364
"releaseTag": "Public",
315365
"overloadIndex": 1,
@@ -318,14 +368,14 @@
318368
"parameterName": "cloudEvent",
319369
"parameterTypeTokenRange": {
320370
"startIndex": 1,
321-
"endIndex": 2
371+
"endIndex": 3
322372
}
323373
},
324374
{
325375
"parameterName": "callback",
326376
"parameterTypeTokenRange": {
327-
"startIndex": 3,
328-
"endIndex": 4
377+
"startIndex": 4,
378+
"endIndex": 5
329379
}
330380
}
331381
]
@@ -340,7 +390,7 @@
340390
"excerptTokens": [
341391
{
342392
"kind": "Content",
343-
"text": "export declare interface CloudFunctionsContext "
393+
"text": "export interface CloudFunctionsContext "
344394
}
345395
],
346396
"releaseTag": "Public",
@@ -476,6 +526,10 @@
476526
"text": "CloudEvent",
477527
"canonicalReference": "cloudevents!CloudEventV1:interface"
478528
},
529+
{
530+
"kind": "Content",
531+
"text": "<unknown>"
532+
},
479533
{
480534
"kind": "Content",
481535
"text": ";"
@@ -485,7 +539,7 @@
485539
"name": "Context",
486540
"typeTokenRange": {
487541
"startIndex": 1,
488-
"endIndex": 4
542+
"endIndex": 5
489543
}
490544
},
491545
{
@@ -495,7 +549,7 @@
495549
"excerptTokens": [
496550
{
497551
"kind": "Content",
498-
"text": "export declare interface Data "
552+
"text": "export interface Data "
499553
}
500554
],
501555
"releaseTag": "Public",
@@ -537,7 +591,7 @@
537591
"excerptTokens": [
538592
{
539593
"kind": "Content",
540-
"text": "export declare interface EventFunction "
594+
"text": "export interface EventFunction "
541595
}
542596
],
543597
"releaseTag": "Public",
@@ -611,7 +665,7 @@
611665
"excerptTokens": [
612666
{
613667
"kind": "Content",
614-
"text": "export declare interface EventFunctionWithCallback "
668+
"text": "export interface EventFunctionWithCallback "
615669
}
616670
],
617671
"releaseTag": "Public",
@@ -701,7 +755,15 @@
701755
"excerptTokens": [
702756
{
703757
"kind": "Content",
704-
"text": "export declare type HandlerFunction = "
758+
"text": "export declare type HandlerFunction<T = "
759+
},
760+
{
761+
"kind": "Content",
762+
"text": "unknown"
763+
},
764+
{
765+
"kind": "Content",
766+
"text": "> = "
705767
},
706768
{
707769
"kind": "Reference",
@@ -737,23 +799,40 @@
737799
},
738800
{
739801
"kind": "Content",
740-
"text": " | "
802+
"text": "<T> | "
741803
},
742804
{
743805
"kind": "Reference",
744806
"text": "CloudEventFunctionWithCallback",
745807
"canonicalReference": "@google-cloud/functions-framework!CloudEventFunctionWithCallback:interface"
746808
},
809+
{
810+
"kind": "Content",
811+
"text": "<T>"
812+
},
747813
{
748814
"kind": "Content",
749815
"text": ";"
750816
}
751817
],
752818
"releaseTag": "Public",
753819
"name": "HandlerFunction",
820+
"typeParameters": [
821+
{
822+
"typeParameterName": "T",
823+
"constraintTokenRange": {
824+
"startIndex": 0,
825+
"endIndex": 0
826+
},
827+
"defaultTypeTokenRange": {
828+
"startIndex": 1,
829+
"endIndex": 2
830+
}
831+
}
832+
],
754833
"typeTokenRange": {
755-
"startIndex": 1,
756-
"endIndex": 10
834+
"startIndex": 3,
835+
"endIndex": 13
757836
}
758837
},
759838
{
@@ -793,7 +872,7 @@
793872
"excerptTokens": [
794873
{
795874
"kind": "Content",
796-
"text": "export declare interface HttpFunction "
875+
"text": "export interface HttpFunction "
797876
}
798877
],
799878
"releaseTag": "Public",
@@ -810,17 +889,17 @@
810889
},
811890
{
812891
"kind": "Reference",
813-
"text": "Request_2",
814-
"canonicalReference": "@google-cloud/functions-framework!~Request_2:interface"
892+
"text": "Request",
893+
"canonicalReference": "@google-cloud/functions-framework!Request:interface"
815894
},
816895
{
817896
"kind": "Content",
818897
"text": ", res: "
819898
},
820899
{
821900
"kind": "Reference",
822-
"text": "Response_2",
823-
"canonicalReference": "@google-cloud/functions-framework!~Response_2:type"
901+
"text": "Response",
902+
"canonicalReference": "@types/express!~e.Response:interface"
824903
},
825904
{
826905
"kind": "Content",
@@ -903,7 +982,7 @@
903982
"excerptTokens": [
904983
{
905984
"kind": "Content",
906-
"text": "export declare interface LegacyEvent "
985+
"text": "export interface LegacyEvent "
907986
}
908987
],
909988
"releaseTag": "Public",
@@ -972,11 +1051,11 @@
9721051
"excerptTokens": [
9731052
{
9741053
"kind": "Content",
975-
"text": "declare interface Request_2 extends "
1054+
"text": "export interface Request extends "
9761055
},
9771056
{
9781057
"kind": "Reference",
979-
"text": "express.Request",
1058+
"text": "ExpressRequest",
9801059
"canonicalReference": "@types/express!~e.Request:interface"
9811060
},
9821061
{
@@ -1021,32 +1100,6 @@
10211100
"endIndex": 3
10221101
}
10231102
]
1024-
},
1025-
{
1026-
"kind": "TypeAlias",
1027-
"canonicalReference": "@google-cloud/functions-framework!Response_2:type",
1028-
"docComment": "/**\n * @public\n */\n",
1029-
"excerptTokens": [
1030-
{
1031-
"kind": "Content",
1032-
"text": "declare type Response_2 = "
1033-
},
1034-
{
1035-
"kind": "Reference",
1036-
"text": "express.Response",
1037-
"canonicalReference": "@types/express!~e.Response:interface"
1038-
},
1039-
{
1040-
"kind": "Content",
1041-
"text": ";"
1042-
}
1043-
],
1044-
"releaseTag": "Public",
1045-
"name": "Response_2",
1046-
"typeTokenRange": {
1047-
"startIndex": 1,
1048-
"endIndex": 2
1049-
}
10501103
}
10511104
]
10521105
}

0 commit comments

Comments
 (0)