14055 lines · 446.8 KB · TypeScript
RawDownload
/* eslint-disable */// Generated by Wrangler by running `wrangler types` (hash: 953401e5c876d4a2fbf15b329e4397dc)// Runtime types generated with workerd@1.20260405.1 2025-04-01 nodejs_compatdeclare namespace Cloudflare {  interface GlobalProps {    mainModule: typeof import("./src/server");    durableNamespaces: "McpSessionDO";  }  interface Env {    HYPERDRIVE: Hyperdrive;    LOADER: WorkerLoader;    WORKOS_API_KEY: string;    WORKOS_CLIENT_ID: string;    WORKOS_COOKIE_PASSWORD: string;    APP_URL: string;    WORKOS_CLAIM_TOKEN: string;    MCP_SESSION: DurableObjectNamespace<import("./src/server").McpSessionDOSqlite>;    MARKETING: Fetcher /* executor-marketing */;  }}interface Env extends Cloudflare.Env {}type StringifyValues<EnvType extends Record<string, unknown>> = {  [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;};declare namespace NodeJS {  interface ProcessEnv extends StringifyValues<    Pick<      Cloudflare.Env,      | "WORKOS_API_KEY"      | "WORKOS_CLIENT_ID"      | "WORKOS_COOKIE_PASSWORD"      | "APP_URL"      | "WORKOS_CLAIM_TOKEN"    >  > {}} // Begin runtime types/*! *****************************************************************************Copyright (c) Cloudflare. All rights reserved.Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not usethis file except in compliance with the License. You may obtain a copy of theLicense at http://www.apache.org/licenses/LICENSE-2.0THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIEDWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,MERCHANTABLITY OR NON-INFRINGEMENT.See the Apache Version 2.0 License for specific language governing permissionsand limitations under the License.***************************************************************************** *//* eslint-disable */// noinspection JSUnusedGlobalSymbolsdeclare var onmessage: never;/** * The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) */declare class DOMException extends Error {  constructor(message?: string, name?: string);  /**   * The **`message`** read-only property of the a message or description associated with the given error name.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)   */  readonly message: string;  /**   * The **`name`** read-only property of the one of the strings associated with an error name.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)   */  readonly name: string;  /**   * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.   * @deprecated   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)   */  readonly code: number;  static readonly INDEX_SIZE_ERR: number;  static readonly DOMSTRING_SIZE_ERR: number;  static readonly HIERARCHY_REQUEST_ERR: number;  static readonly WRONG_DOCUMENT_ERR: number;  static readonly INVALID_CHARACTER_ERR: number;  static readonly NO_DATA_ALLOWED_ERR: number;  static readonly NO_MODIFICATION_ALLOWED_ERR: number;  static readonly NOT_FOUND_ERR: number;  static readonly NOT_SUPPORTED_ERR: number;  static readonly INUSE_ATTRIBUTE_ERR: number;  static readonly INVALID_STATE_ERR: number;  static readonly SYNTAX_ERR: number;  static readonly INVALID_MODIFICATION_ERR: number;  static readonly NAMESPACE_ERR: number;  static readonly INVALID_ACCESS_ERR: number;  static readonly VALIDATION_ERR: number;  static readonly TYPE_MISMATCH_ERR: number;  static readonly SECURITY_ERR: number;  static readonly NETWORK_ERR: number;  static readonly ABORT_ERR: number;  static readonly URL_MISMATCH_ERR: number;  static readonly QUOTA_EXCEEDED_ERR: number;  static readonly TIMEOUT_ERR: number;  static readonly INVALID_NODE_TYPE_ERR: number;  static readonly DATA_CLONE_ERR: number;  get stack(): any;  set stack(value: any);}type WorkerGlobalScopeEventMap = {  fetch: FetchEvent;  scheduled: ScheduledEvent;  queue: QueueEvent;  unhandledrejection: PromiseRejectionEvent;  rejectionhandled: PromiseRejectionEvent;};declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {  EventTarget: typeof EventTarget;}/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). * * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */interface Console {  "assert"(condition?: boolean, ...data: any[]): void;  /**   * The **`console.clear()`** static method clears the console if possible.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)   */  clear(): void;  /**   * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)   */  count(label?: string): void;  /**   * The **`console.countReset()`** static method resets counter used with console/count_static.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)   */  countReset(label?: string): void;  /**   * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)   */  debug(...data: any[]): void;  /**   * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)   */  dir(item?: any, options?: any): void;  /**   * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)   */  dirxml(...data: any[]): void;  /**   * The **`console.error()`** static method outputs a message to the console at the 'error' log level.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)   */  error(...data: any[]): void;  /**   * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)   */  group(...data: any[]): void;  /**   * The **`console.groupCollapsed()`** static method creates a new inline group in the console.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)   */  groupCollapsed(...data: any[]): void;  /**   * The **`console.groupEnd()`** static method exits the current inline group in the console.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)   */  groupEnd(): void;  /**   * The **`console.info()`** static method outputs a message to the console at the 'info' log level.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)   */  info(...data: any[]): void;  /**   * The **`console.log()`** static method outputs a message to the console.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)   */  log(...data: any[]): void;  /**   * The **`console.table()`** static method displays tabular data as a table.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)   */  table(tabularData?: any, properties?: string[]): void;  /**   * The **`console.time()`** static method starts a timer you can use to track how long an operation takes.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)   */  time(label?: string): void;  /**   * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)   */  timeEnd(label?: string): void;  /**   * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)   */  timeLog(label?: string, ...data: any[]): void;  timeStamp(label?: string): void;  /**   * The **`console.trace()`** static method outputs a stack trace to the console.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)   */  trace(...data: any[]): void;  /**   * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.   *   * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)   */  warn(...data: any[]): void;}declare const console: Console;type BufferSource = ArrayBufferView | ArrayBuffer;type TypedArray =  | Int8Array  | Uint8Array  | Uint8ClampedArray  | Int16Array  | Uint16Array  | Int32Array  | Uint32Array  | Float32Array  | Float64Array  | BigInt64Array  | BigUint64Array;declare namespace WebAssembly {  class CompileError extends Error {    constructor(message?: string);  }  class RuntimeError extends Error {    constructor(message?: string);  }  type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";  interface GlobalDescriptor {    value: ValueType;    mutable?: boolean;  }  class Global {    constructor(descriptor: GlobalDescriptor, value?: any);    value: any;    valueOf(): any;  }  type ImportValue = ExportValue | number;  type ModuleImports = Record<string, ImportValue>;  type Imports = Record<string, ModuleImports>;  type ExportValue = Function | Global | Memory | Table;  type Exports = Record<string, ExportValue>;  class Instance {    constructor(module: Module, imports?: Imports);    readonly exports: Exports;  }  interface MemoryDescriptor {    initial: number;    maximum?: number;    shared?: boolean;  }  class Memory {    constructor(descriptor: MemoryDescriptor);    readonly buffer: ArrayBuffer;    grow(delta: number): number;  }  type ImportExportKind = "function" | "global" | "memory" | "table";  interface ModuleExportDescriptor {    kind: ImportExportKind;    name: string;  }  interface ModuleImportDescriptor {    kind: ImportExportKind;    module: string;    name: string;  }  abstract class Module {    static customSections(module: Module, sectionName: string): ArrayBuffer[];    static exports(module: Module): ModuleExportDescriptor[];    static imports(module: Module): ModuleImportDescriptor[];  }  type TableKind = "anyfunc" | "externref";  interface TableDescriptor {    element: TableKind;    initial: number;    maximum?: number;  }  class Table {    constructor(descriptor: TableDescriptor, value?: any);    readonly length: number;    get(index: number): any;    grow(delta: number, value?: any): number;    set(index: number, value?: any): void;  }  function instantiate(module: Module, imports?: Imports): Promise<Instance>;  function validate(bytes: BufferSource): boolean;}/** * The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker. * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope) */interface ServiceWorkerGlobalScope extends WorkerGlobalScope {  DOMException: typeof DOMException;  WorkerGlobalScope: typeof WorkerGlobalScope;  btoa(data: string): string;  atob(data: string): string;  setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;  setTimeout<Args extends any[]>(    callback: (...args: Args) => void,    msDelay?: number,    ...args: Args  ): number;  clearTimeout(timeoutId: number | null): void;  setInterval(callback: (...args: any[]) => void, msDelay?: number): number;  setInterval<Args extends any[]>(    callback: (...args: Args) => void,    msDelay?: number,    ...args: Args  ): number;  clearInterval(timeoutId: number | null): void;  queueMicrotask(task: Function): void;  structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;  reportError(error: any): void;  fetch(input: RequestInfo | URL, init?: RequestInit<RequestInitCfProperties>): Promise<Response>;  self: ServiceWorkerGlobalScope;  crypto: Crypto;  caches: CacheStorage;  scheduler: Scheduler;  performance: Performance;  Cloudflare: Cloudflare;  readonly origin: string;  Event: typeof Event;  ExtendableEvent: typeof ExtendableEvent;  CustomEvent: typeof CustomEvent;  PromiseRejectionEvent: typeof PromiseRejectionEvent;  FetchEvent: typeof FetchEvent;  TailEvent: typeof TailEvent;  TraceEvent: typeof TailEvent;  ScheduledEvent: typeof ScheduledEvent;  MessageEvent: typeof MessageEvent;  CloseEvent: typeof CloseEvent;  ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;  ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;  ReadableStream: typeof ReadableStream;  WritableStream: typeof WritableStream;  WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;  TransformStream: typeof TransformStream;  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;  CountQueuingStrategy: typeof CountQueuingStrategy;  ErrorEvent: typeof ErrorEvent;  EventSource: typeof EventSource;  ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;  ReadableStreamDefaultController: typeof ReadableStreamDefaultController;  ReadableByteStreamController: typeof ReadableByteStreamController;  WritableStreamDefaultController: typeof WritableStreamDefaultController;  TransformStreamDefaultController: typeof TransformStreamDefaultController;  CompressionStream: typeof CompressionStream;  DecompressionStream: typeof DecompressionStream;  TextEncoderStream: typeof TextEncoderStream;  TextDecoderStream: typeof TextDecoderStream;  Headers: typeof Headers;  Body: typeof Body;  Request: typeof Request;  Response: typeof Response;  WebSocket: typeof WebSocket;  WebSocketPair: typeof WebSocketPair;  WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;  AbortController: typeof AbortController;  AbortSignal: typeof AbortSignal;  TextDecoder: typeof TextDecoder;  TextEncoder: typeof TextEncoder;  navigator: Navigator;  Navigator: typeof Navigator;  URL: typeof URL;  URLSearchParams: typeof URLSearchParams;  URLPattern: typeof URLPattern;  Blob: typeof Blob;  File: typeof File;  FormData: typeof FormData;  Crypto: typeof Crypto;  SubtleCrypto: typeof SubtleCrypto;  CryptoKey: typeof CryptoKey;  CacheStorage: typeof CacheStorage;  Cache: typeof Cache;  FixedLengthStream: typeof FixedLengthStream;  IdentityTransformStream: typeof IdentityTransformStream;  HTMLRewriter: typeof HTMLRewriter;}declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(  type: Type,  handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,  options?: EventTargetAddEventListenerOptions | boolean,): void;declare function removeEventListener<Type extends keyof WorkerGlobalScopeEventMap>(  type: Type,  handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,  options?: EventTargetEventListenerOptions | boolean,): void;/** * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) */declare function dispatchEvent(  event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap],): boolean;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */declare function btoa(data: string): string;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */declare function atob(data: string): string;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */declare function setTimeout<Args extends any[]>(  callback: (...args: Args) => void,  msDelay?: number,  ...args: Args): number;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */declare function clearTimeout(timeoutId: number | null): void;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */declare function setInterval<Args extends any[]>(  callback: (...args: Args) => void,  msDelay?: number,  ...args: Args): number;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */declare function clearInterval(timeoutId: number | null): void;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */declare function queueMicrotask(task: Function): void;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */declare function structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */declare function reportError(error: any): void;/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */declare function fetch(  input: RequestInfo | URL,  init?: RequestInit<RequestInitCfProperties>,): Promise<Response>;declare const self: ServiceWorkerGlobalScope;/** * The Web Crypto API provides a set of low-level functions for common cryptographic tasks. * The Workers runtime implements the full surface of this API, but with some differences in * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms) * compared to those implemented in most browsers. * * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/) */declare const crypto: Crypto;/** * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache. * * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/) */declare const caches: CacheStorage;declare const scheduler: Scheduler;/** * The Workers runtime supports a subset of the Performance API, used to measure timing and performance, * as well as timing of subrequests and other operations. * * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/) */declare const performance: Performance;declare const Cloudflare: Cloudflare;declare const origin: string;declare const navigator: Navigator;interface TestController {}interface ExecutionContext<Props = unknown> {  waitUntil(promise: Promise<any>): void;  passThroughOnException(): void;  readonly props: Props;}type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (  request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,  env: Env,  ctx: ExecutionContext<Props>,

Lines 1–500 of 14055.