faas-js-runtime
Advanced tools
Comparing version 0.9.4 to 0.9.5
@@ -29,3 +29,3 @@ /** | ||
// to a Message first and respond with the headers/body | ||
if (fnReturn instanceof CloudEvent) { | ||
if (fnReturn instanceof CloudEvent || fnReturn.constructor?.name === 'CloudEvent') { | ||
try { | ||
@@ -32,0 +32,0 @@ const message = HTTP.binary(fnReturn); |
@@ -8,8 +8,8 @@ /* eslint-disable no-unused-vars */ | ||
*/ | ||
export interface CloudEventFunction { | ||
(context: Context, event: CloudEvent): CloudEventFunctionReturn; | ||
export interface CloudEventFunction<I=never, R=unknown> { | ||
(context: Context, event?: CloudEvent<I>): CloudEventFunctionReturn<R>; | ||
} | ||
// CloudEventFunctionReturn is the return type for a CloudEventFunction. | ||
export type CloudEventFunctionReturn = Promise<CloudEvent> | CloudEvent | HTTPFunctionReturn; | ||
export type CloudEventFunctionReturn<T=unknown> = Promise<CloudEvent<T>> | CloudEvent<T> | HTTPFunctionReturn; | ||
@@ -54,3 +54,3 @@ /** | ||
httpVersionMinor: number; | ||
cloudevent: CloudEvent; | ||
cloudevent: CloudEvent<unknown>; | ||
cloudEventResponse(data: string|object): CloudEventResponse; | ||
@@ -57,0 +57,0 @@ } |
{ | ||
"name": "faas-js-runtime", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40482