@funcd-dev/shim 0.31.0 → 0.33.0
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.
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -81,6 +81,20 @@ export interface FunctionContext {
|
|
|
81
81
|
claims: Record<string, unknown>;
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
+
/** A Job run's facts (funcd ADR-0347): the run, its Job and the revision it pinned, the call's phase and who
|
|
85
|
+
* started the run. */
|
|
86
|
+
export interface RunInfo {
|
|
87
|
+
name: string;
|
|
88
|
+
job: string;
|
|
89
|
+
revision: string;
|
|
90
|
+
/** `run`, or `preview` in a run's preview call (funcd ADR-0348). */
|
|
91
|
+
phase: 'run' | 'preview';
|
|
92
|
+
startedBy: string;
|
|
93
|
+
}
|
|
94
|
+
/** The context a Job's handler gets (funcd ADR-0347): the FunctionContext plus its run. */
|
|
95
|
+
export interface JobContext extends FunctionContext {
|
|
96
|
+
run: RunInfo;
|
|
97
|
+
}
|
|
84
98
|
/** A function handler: receives the context + CloudEvent, returns a response (or nothing). */
|
|
85
99
|
export type Handler<In = unknown, Out = unknown> = (context: FunctionContext, event: CloudEvent<In>) => Out | Promise<Out>;
|
|
86
100
|
/** An HTTP app (funcd ADR-0243): Hono, or any object whose fetch answers a Web Request. */
|