Skip to content

Commit ad75658

Browse files
authored
Revert "refactor: use cesdk (#391)" (#399)
This reverts commit ee2c747.
1 parent ee2c747 commit ad75658

File tree

10 files changed

+395
-45
lines changed

10 files changed

+395
-45
lines changed

docs/generated/api.json

Lines changed: 282 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@
223223
},
224224
{
225225
"kind": "Reference",
226-
"text": "CloudEvent",
227-
"canonicalReference": "cloudevents!CloudEvent:class"
226+
"text": "CloudEventsContext",
227+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext:interface"
228228
},
229229
{
230230
"kind": "Content",
@@ -282,8 +282,8 @@
282282
},
283283
{
284284
"kind": "Reference",
285-
"text": "CloudEvent",
286-
"canonicalReference": "cloudevents!CloudEvent:class"
285+
"text": "CloudEventsContext",
286+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext:interface"
287287
},
288288
{
289289
"kind": "Content",
@@ -333,6 +333,282 @@
333333
],
334334
"extendsTokenRanges": []
335335
},
336+
{
337+
"kind": "Interface",
338+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext:interface",
339+
"docComment": "/**\n * The CloudEvents v1.0 context attributes. {@link https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#context-attributes}\n *\n * @public\n */\n",
340+
"excerptTokens": [
341+
{
342+
"kind": "Content",
343+
"text": "export interface CloudEventsContext "
344+
}
345+
],
346+
"releaseTag": "Public",
347+
"name": "CloudEventsContext",
348+
"members": [
349+
{
350+
"kind": "PropertySignature",
351+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#data:member",
352+
"docComment": "/**\n * The event payload.\n */\n",
353+
"excerptTokens": [
354+
{
355+
"kind": "Content",
356+
"text": "data?: "
357+
},
358+
{
359+
"kind": "Content",
360+
"text": "any"
361+
},
362+
{
363+
"kind": "Content",
364+
"text": ";"
365+
}
366+
],
367+
"isOptional": true,
368+
"releaseTag": "Public",
369+
"name": "data",
370+
"propertyTypeTokenRange": {
371+
"startIndex": 1,
372+
"endIndex": 2
373+
}
374+
},
375+
{
376+
"kind": "PropertySignature",
377+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#datacontenttype:member",
378+
"docComment": "/**\n * Content type of the event data.\n */\n",
379+
"excerptTokens": [
380+
{
381+
"kind": "Content",
382+
"text": "datacontenttype?: "
383+
},
384+
{
385+
"kind": "Content",
386+
"text": "string"
387+
},
388+
{
389+
"kind": "Content",
390+
"text": ";"
391+
}
392+
],
393+
"isOptional": true,
394+
"releaseTag": "Public",
395+
"name": "datacontenttype",
396+
"propertyTypeTokenRange": {
397+
"startIndex": 1,
398+
"endIndex": 2
399+
}
400+
},
401+
{
402+
"kind": "PropertySignature",
403+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#dataschema:member",
404+
"docComment": "/**\n * A link to the schema that the event data adheres to.\n */\n",
405+
"excerptTokens": [
406+
{
407+
"kind": "Content",
408+
"text": "dataschema?: "
409+
},
410+
{
411+
"kind": "Content",
412+
"text": "string"
413+
},
414+
{
415+
"kind": "Content",
416+
"text": ";"
417+
}
418+
],
419+
"isOptional": true,
420+
"releaseTag": "Public",
421+
"name": "dataschema",
422+
"propertyTypeTokenRange": {
423+
"startIndex": 1,
424+
"endIndex": 2
425+
}
426+
},
427+
{
428+
"kind": "PropertySignature",
429+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#id:member",
430+
"docComment": "/**\n * ID of the event.\n */\n",
431+
"excerptTokens": [
432+
{
433+
"kind": "Content",
434+
"text": "id: "
435+
},
436+
{
437+
"kind": "Content",
438+
"text": "string"
439+
},
440+
{
441+
"kind": "Content",
442+
"text": ";"
443+
}
444+
],
445+
"isOptional": false,
446+
"releaseTag": "Public",
447+
"name": "id",
448+
"propertyTypeTokenRange": {
449+
"startIndex": 1,
450+
"endIndex": 2
451+
}
452+
},
453+
{
454+
"kind": "PropertySignature",
455+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#source:member",
456+
"docComment": "/**\n * The event producer.\n */\n",
457+
"excerptTokens": [
458+
{
459+
"kind": "Content",
460+
"text": "source: "
461+
},
462+
{
463+
"kind": "Content",
464+
"text": "string"
465+
},
466+
{
467+
"kind": "Content",
468+
"text": ";"
469+
}
470+
],
471+
"isOptional": false,
472+
"releaseTag": "Public",
473+
"name": "source",
474+
"propertyTypeTokenRange": {
475+
"startIndex": 1,
476+
"endIndex": 2
477+
}
478+
},
479+
{
480+
"kind": "PropertySignature",
481+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#specversion:member",
482+
"docComment": "/**\n * The version of the CloudEvents specification which the event uses.\n */\n",
483+
"excerptTokens": [
484+
{
485+
"kind": "Content",
486+
"text": "specversion: "
487+
},
488+
{
489+
"kind": "Content",
490+
"text": "string"
491+
},
492+
{
493+
"kind": "Content",
494+
"text": ";"
495+
}
496+
],
497+
"isOptional": false,
498+
"releaseTag": "Public",
499+
"name": "specversion",
500+
"propertyTypeTokenRange": {
501+
"startIndex": 1,
502+
"endIndex": 2
503+
}
504+
},
505+
{
506+
"kind": "PropertySignature",
507+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#subject:member",
508+
"docComment": "/**\n * Describes the subject of the event in the context of the event producer.\n */\n",
509+
"excerptTokens": [
510+
{
511+
"kind": "Content",
512+
"text": "subject?: "
513+
},
514+
{
515+
"kind": "Content",
516+
"text": "string"
517+
},
518+
{
519+
"kind": "Content",
520+
"text": ";"
521+
}
522+
],
523+
"isOptional": true,
524+
"releaseTag": "Public",
525+
"name": "subject",
526+
"propertyTypeTokenRange": {
527+
"startIndex": 1,
528+
"endIndex": 2
529+
}
530+
},
531+
{
532+
"kind": "PropertySignature",
533+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#time:member",
534+
"docComment": "/**\n * Timestamp of when the event happened.\n */\n",
535+
"excerptTokens": [
536+
{
537+
"kind": "Content",
538+
"text": "time?: "
539+
},
540+
{
541+
"kind": "Content",
542+
"text": "string"
543+
},
544+
{
545+
"kind": "Content",
546+
"text": ";"
547+
}
548+
],
549+
"isOptional": true,
550+
"releaseTag": "Public",
551+
"name": "time",
552+
"propertyTypeTokenRange": {
553+
"startIndex": 1,
554+
"endIndex": 2
555+
}
556+
},
557+
{
558+
"kind": "PropertySignature",
559+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#traceparent:member",
560+
"docComment": "/**\n * The traceparent string, containing a trace version, trace ID, span ID, and trace options.\n *\n * @see\n *\n * https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md\n */\n",
561+
"excerptTokens": [
562+
{
563+
"kind": "Content",
564+
"text": "traceparent?: "
565+
},
566+
{
567+
"kind": "Content",
568+
"text": "string"
569+
},
570+
{
571+
"kind": "Content",
572+
"text": ";"
573+
}
574+
],
575+
"isOptional": true,
576+
"releaseTag": "Public",
577+
"name": "traceparent",
578+
"propertyTypeTokenRange": {
579+
"startIndex": 1,
580+
"endIndex": 2
581+
}
582+
},
583+
{
584+
"kind": "PropertySignature",
585+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext#type:member",
586+
"docComment": "/**\n * Type of occurrence which has happened.\n */\n",
587+
"excerptTokens": [
588+
{
589+
"kind": "Content",
590+
"text": "type: "
591+
},
592+
{
593+
"kind": "Content",
594+
"text": "string"
595+
},
596+
{
597+
"kind": "Content",
598+
"text": ";"
599+
}
600+
],
601+
"isOptional": false,
602+
"releaseTag": "Public",
603+
"name": "type",
604+
"propertyTypeTokenRange": {
605+
"startIndex": 1,
606+
"endIndex": 2
607+
}
608+
}
609+
],
610+
"extendsTokenRanges": []
611+
},
336612
{
337613
"kind": "Interface",
338614
"canonicalReference": "@google-cloud/functions-framework!CloudFunctionsContext:interface",
@@ -473,8 +749,8 @@
473749
},
474750
{
475751
"kind": "Reference",
476-
"text": "CloudEvent",
477-
"canonicalReference": "cloudevents!CloudEvent:class"
752+
"text": "CloudEventsContext",
753+
"canonicalReference": "@google-cloud/functions-framework!CloudEventsContext:interface"
478754
},
479755
{
480756
"kind": "Content",

docs/generated/api.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
/// <reference types="node" />
88

9-
import { CloudEvent } from 'cloudevents';
109
import * as express from 'express';
1110

1211
// @public
@@ -15,13 +14,27 @@ export const cloudEvent: (functionName: string, handler: CloudEventFunction) =>
1514
// @public
1615
export interface CloudEventFunction {
1716
// (undocumented)
18-
(cloudEvent: CloudEvent): any;
17+
(cloudEvent: CloudEventsContext): any;
1918
}
2019

2120
// @public
2221
export interface CloudEventFunctionWithCallback {
2322
// (undocumented)
24-
(cloudEvent: CloudEvent, callback: Function): any;
23+
(cloudEvent: CloudEventsContext, callback: Function): any;
24+
}
25+
26+
// @public
27+
export interface CloudEventsContext {
28+
data?: any;
29+
datacontenttype?: string;
30+
dataschema?: string;
31+
id: string;
32+
source: string;
33+
specversion: string;
34+
subject?: string;
35+
time?: string;
36+
traceparent?: string;
37+
type: string;
2538
}
2639

2740
// @public
@@ -35,7 +48,7 @@ export interface CloudFunctionsContext {
3548
}
3649

3750
// @public
38-
export type Context = CloudFunctionsContext | CloudEvent;
51+
export type Context = CloudFunctionsContext | CloudEventsContext;
3952

4053
// @public
4154
export interface Data {

0 commit comments

Comments
 (0)