From e9e4c60012806f6718c2688d0ebb5551f316d16d Mon Sep 17 00:00:00 2001 From: Jack Williams <1736957+jpwilliams@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:56:53 +0000 Subject: [PATCH] Push API diff --- packages/inngest/etc/inngest.api.md | 38 ++++++++++++++++++++++++++--- packages/inngest/src/index.ts | 4 +-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/packages/inngest/etc/inngest.api.md b/packages/inngest/etc/inngest.api.md index 375eca40a..80ab1a0b6 100644 --- a/packages/inngest/etc/inngest.api.md +++ b/packages/inngest/etc/inngest.api.md @@ -121,10 +121,19 @@ export interface FunctionOptions, Ev retries?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; } +// Warning: (ae-internal-missing-underscore) The name "FunctionTrigger" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal +export type FunctionTrigger = { + event: T; + expression?: string; +} | { + cron: string; +}; + // @public export type GetEvents> = EventsFromOpts>; -// Warning: (ae-forgotten-export) The symbol "Handler" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ExtendWithMiddleware" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "builtInMiddleware" needs to be exported by the entry point index.d.ts // @@ -139,6 +148,12 @@ export type GetStepTools, TTrigger extends keyof G step: infer TStep; } ? TStep : never; +// Warning: (ae-forgotten-export) The symbol "Context" needs to be exported by the entry point index.d.ts +// +// @public +export type Handler, TTrigger extends keyof TEvents & string, TOverrides extends Record = Record> = ( +ctx: Context) => unknown; + // @public export enum headerKeys { // (undocumented) @@ -163,8 +178,7 @@ export enum headerKeys { export class Inngest { constructor({ id, eventKey, baseUrl, fetch, env, logger, middleware, }: TOpts); // Warning: (ae-forgotten-export) The symbol "ExclusiveKeys" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "InngestFunction" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "FunctionTrigger" needs to be exported by the entry point index.d.ts + // Warning: (ae-incompatible-release-tags) The symbol "createFunction" is marked as @public, but its signature references "FunctionTrigger" which is marked as @internal // // (undocumented) createFunction & string>, TTriggerName extends keyof EventsFromOpts & string = EventNameFromTrigger, TTrigger>>(options: ExclusiveKeys, TTriggerName>, "onFailure" | "middleware"> & { @@ -233,6 +247,24 @@ export class InngestCommHandler = EventsFromOpts, Trigger extends FunctionTrigger = FunctionTrigger, Opts extends FunctionOptions> = FunctionOptions>> { + constructor(client: Inngest, + opts: Opts, trigger: Trigger, fn: Handler); + // (undocumented) + static failureSuffix: string; + id(prefix?: string): string; + get name(): string; + // (undocumented) + readonly opts: Opts; + // (undocumented) + static stepId: string; + // (undocumented) + readonly trigger: Trigger; +} + // @public export class InngestMiddleware { constructor({ name, init }: TOpts); diff --git a/packages/inngest/src/index.ts b/packages/inngest/src/index.ts index 908b0e730..f5d27a552 100644 --- a/packages/inngest/src/index.ts +++ b/packages/inngest/src/index.ts @@ -42,12 +42,12 @@ export type { FailureEventArgs, FailureEventPayload, FunctionOptions, + FunctionTrigger, + Handler, LogLevel, RegisterOptions, StepOptions, StepOptionsOrId, TimeStr, TriggerOptions, - FunctionTrigger, - Handler, } from "./types";