inngest
Version:
Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
1 lines • 7.86 kB
Source Map (JSON)
{"version":3,"file":"consts.cjs","names":["logPrefix: string"],"sources":["../../src/helpers/consts.ts"],"sourcesContent":["/**\n * Keys for accessing query parameters included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum queryKeys {\n DeployId = \"deployId\",\n FnId = \"fnId\",\n Probe = \"probe\",\n StepId = \"stepId\",\n}\n\nexport enum probe {\n Trust = \"trust\",\n}\n\nexport enum envKeys {\n InngestSigningKey = \"INNGEST_SIGNING_KEY\",\n InngestSigningKeyFallback = \"INNGEST_SIGNING_KEY_FALLBACK\",\n InngestEventKey = \"INNGEST_EVENT_KEY\",\n\n /**\n * @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.\n */\n InngestDevServerUrl = \"INNGEST_DEVSERVER_URL\",\n InngestEnvironment = \"INNGEST_ENV\",\n InngestBaseUrl = \"INNGEST_BASE_URL\",\n InngestEventApiBaseUrl = \"INNGEST_EVENT_API_BASE_URL\",\n InngestApiBaseUrl = \"INNGEST_API_BASE_URL\",\n InngestServeHost = \"INNGEST_SERVE_HOST\", // Deprecated, use INNGEST_SERVE_ORIGIN\n InngestServePath = \"INNGEST_SERVE_PATH\",\n InngestServeOrigin = \"INNGEST_SERVE_ORIGIN\",\n InngestStreaming = \"INNGEST_STREAMING\",\n InngestDevMode = \"INNGEST_DEV\",\n InngestAllowInBandSync = \"INNGEST_ALLOW_IN_BAND_SYNC\",\n InngestConnectMaxWorkerConcurrency = \"INNGEST_CONNECT_MAX_WORKER_CONCURRENCY\",\n InngestConnectIsolateExecution = \"INNGEST_CONNECT_ISOLATE_EXECUTION\",\n InngestConnectGatewayUrl = \"INNGEST_CONNECT_GATEWAY_URL\",\n\n /**\n * @deprecated It's unknown what this env var was used for, but we do not\n * provide explicit support for it. Prefer using `INNGEST_ENV` instead.\n */\n BranchName = \"BRANCH_NAME\",\n\n /**\n * The git branch of the commit the deployment was triggered by. Example:\n * `improve-about-page`.\n *\n * {@link https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables}\n */\n VercelBranch = \"VERCEL_GIT_COMMIT_REF\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsVercel = \"VERCEL\",\n\n /**\n * The branch name of the current deployment. May only be accessible at build\n * time, but included here just in case.\n *\n * {@link https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables}\n */\n CloudflarePagesBranch = \"CF_PAGES_BRANCH\",\n\n /**\n * Expected to be `\"1\"` if defined.\n */\n IsCloudflarePages = \"CF_PAGES\",\n\n /**\n * The branch name of the deployment from Git to Netlify, if available.\n *\n * {@link https://docs.netlify.com/configure-builds/environment-variables/#git-metadata}\n */\n NetlifyBranch = \"BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsNetlify = \"NETLIFY\",\n\n /**\n * The Git branch for a service or deploy.\n *\n * {@link https://render.com/docs/environment-variables#all-services}\n */\n RenderBranch = \"RENDER_GIT_BRANCH\",\n\n /**\n * Expected to be `\"true\"` if defined.\n */\n IsRender = \"RENDER\",\n\n /**\n * The branch that triggered the deployment. Example: `main`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayBranch = \"RAILWAY_GIT_BRANCH\",\n\n /**\n * The railway environment for the deployment. Example: `production`\n *\n * {@link https://docs.railway.app/develop/variables#railway-provided-variables}\n */\n RailwayEnvironment = \"RAILWAY_ENVIRONMENT\",\n\n VercelEnvKey = \"VERCEL_ENV\",\n\n OpenAiApiKey = \"OPENAI_API_KEY\",\n GeminiApiKey = \"GEMINI_API_KEY\",\n AnthropicApiKey = \"ANTHROPIC_API_KEY\",\n}\n\n/**\n * Keys for accessing headers included in requests from Inngest to run\n * functions.\n *\n * Used internally to create handlers using `InngestCommHandler`, but can be\n * imported to be used if creating a custom handler outside of the package.\n *\n * @public\n */\nexport enum headerKeys {\n ContentType = \"content-type\",\n Host = \"host\",\n ForwardedFor = \"x-forwarded-for\",\n RealIp = \"x-real-ip\",\n Location = \"location\",\n ContentLength = \"content-length\",\n Signature = \"x-inngest-signature\",\n SdkVersion = \"x-inngest-sdk\",\n Environment = \"x-inngest-env\",\n Platform = \"x-inngest-platform\",\n Framework = \"x-inngest-framework\",\n NoRetry = \"x-inngest-no-retry\",\n RequestVersion = \"x-inngest-req-version\",\n RetryAfter = \"retry-after\",\n InngestServerKind = \"x-inngest-server-kind\",\n InngestExpectedServerKind = \"x-inngest-expected-server-kind\",\n InngestSyncKind = \"x-inngest-sync-kind\",\n EventIdSeed = \"x-inngest-event-id-seed\",\n TraceParent = \"traceparent\",\n TraceState = \"tracestate\",\n InngestRunId = \"x-run-id\",\n InngestStepId = \"x-inngest-step-id\",\n InngestForceStepPlan = \"x-inngest-force-step-plan\",\n}\n\n/**\n * Headers that are forwarded from the original request when an Inngest function\n * is invoked.\n */\nexport const forwardedHeaders = [headerKeys.TraceParent, headerKeys.TraceState];\n\nexport const defaultInngestApiBaseUrl = \"https://api.inngest.com/\";\nexport const defaultInngestEventBaseUrl = \"https://inn.gs/\";\nexport const defaultDevServerHost = \"http://localhost:8288/\";\n\n/**\n * Events that Inngest may send internally that can be used to trigger\n * functions.\n *\n * @public\n */\nexport enum internalEvents {\n /**\n * A function has failed after exhausting all available retries. This event\n * will contain the original event and the error that caused the failure.\n */\n FunctionFailed = \"inngest/function.failed\",\n FunctionInvoked = \"inngest/function.invoked\",\n FunctionFinished = \"inngest/function.finished\",\n FunctionCancelled = \"inngest/function.cancelled\",\n ScheduledTimer = \"inngest/scheduled.timer\",\n HttpRequest = \"inngest/http.request\",\n}\n\nexport const logPrefix: string = \"[Inngest]\";\n\nexport const debugPrefix = \"inngest\";\n\nexport const dummyEventKey = \"NO_EVENT_KEY_SET\";\n\nexport enum serverKind {\n Dev = \"dev\",\n Cloud = \"cloud\",\n}\n\nexport enum syncKind {\n InBand = \"in_band\",\n OutOfBand = \"out_of_band\",\n}\n\n/**\n * The execution models the SDK is aware of.\n *\n * This is used in a number of places to ensure all execution versions are\n * accounted for for a given operation.\n */\nexport enum ExecutionVersion {\n /**\n * Uses a more flexible approach to execution and is more lenient about\n * determinism, allowing non-step async actions and non-determinism.\n *\n * Nowhere near as stubborn about determinism and so can silently migrate\n * between versions after bug fixes.\n */\n V1 = 1,\n\n /**\n * Identical to V1, but allows the Executor to optimize parallel calls, hugely\n * reducing traffic going to/from the SDK.\n */\n V2 = 2,\n}\n\n/**\n * Default maximum number of retries for function/step executions.\n */\nexport const defaultMaxRetries = 3;\n"],"mappings":";;;;;;;;;;;AASA,IAAY,kDAAL;AACL;AACA;AACA;AACA;;;AAGF,IAAY,0CAAL;AACL;;;AAGF,IAAY,8CAAL;AACL;AACA;AACA;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAMA;;;;;;;AAQA;;;;AAKA;;;;;;;AAQA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;AAKA;;;;;;AAOA;;;;;;AAOA;AAEA;AAEA;AACA;AACA;;;;;;;;;;;;AAYF,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAOF,MAAa,mBAAmB,CAAC,WAAW,aAAa,WAAW,WAAW;AAE/E,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,uBAAuB;;;;;;;AAQpC,IAAY,4DAAL;;;;;AAKL;AACA;AACA;AACA;AACA;AACA;;;AAGF,MAAaA,YAAoB;AAEjC,MAAa,cAAc;AAE3B,MAAa,gBAAgB;AAO7B,IAAY,gDAAL;AACL;AACA;;;;;;;;;AASF,IAAY,gEAAL;;;;;;;;AAQL;;;;;AAMA;;;;;;AAMF,MAAa,oBAAoB"}