1- import { CloudEvent , HTTPReceiver } from ' ../../..' ;
2- import { CloudEventV1 } from ' ../../../lib/v1' ;
1+ import { CloudEvent , HTTPReceiver } from " ../../.." ;
2+ import { CloudEventV1 } from " ../../../lib/v1" ;
33
44export function doSomeStuff ( ) {
55 const receiver = new HTTPReceiver ( ) ;
66
77 const myevent : CloudEventV1 = new CloudEvent ( {
8- source : ' /source' ,
9- type : ' type' ,
10- dataContentType : ' text/plain' ,
11- dataSchema : ' https://d.schema.com/my.json' ,
12- subject : ' cha.json' ,
13- data : ' my-data'
8+ source : " /source" ,
9+ type : " type" ,
10+ dataContentType : " text/plain" ,
11+ dataSchema : " https://d.schema.com/my.json" ,
12+ subject : " cha.json" ,
13+ data : " my-data"
1414 } ) ;
15- myevent . addExtension ( ' extension-1' , ' some extension data' ) ;
15+ myevent . addExtension ( " extension-1" , " some extension data" ) ;
1616
1717 console . log ( "My structured event:" , myevent . toString ( ) ) ;
1818 console . log ( "My structured event extensions:" , myevent . getExtensions ( ) ) ;
@@ -24,7 +24,7 @@ export function doSomeStuff() {
2424
2525 // Typically used with an incoming HTTP request where myevent.format() is the actual
2626 // body of the HTTP
27- console . log ( ' Received structured event:' , receiver . accept ( headers , myevent . format ( ) ) . toString ( ) ) ;
27+ console . log ( " Received structured event:" , receiver . accept ( headers , myevent . format ( ) ) . toString ( ) ) ;
2828
2929 // ------ receiver binary
3030 const data = {
0 commit comments