chore(deps): 更新依赖和配置
Some checks failed
CI/CD Pipeline / lint-build-and-typecheck (push) Successful in 2m0s
CI/CD Pipeline / deploy (push) Has been cancelled
/ playwright (push) Has been cancelled

This commit is contained in:
严浩
2025-09-18 12:54:13 +08:00
parent df0109205f
commit 077e7b5c90
4 changed files with 210 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: a5d3a0d06638640f4072385a766cb44d)
// Runtime types generated with workerd@1.20250902.0 2025-09-09
// Runtime types generated with workerd@1.20250906.0 2025-09-09
declare namespace Cloudflare {
interface Env {
KV: KVNamespace;
@@ -414,7 +414,7 @@ interface DurableObjectId {
equals(other: DurableObjectId): boolean;
readonly name?: string;
}
interface DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
idFromName(name: string): DurableObjectId;
idFromString(id: string): DurableObjectId;
@@ -432,6 +432,7 @@ interface DurableObjectNamespaceGetDurableObjectOptions {
}
interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
props: any;
readonly id: DurableObjectId;
readonly storage: DurableObjectStorage;
container?: Container;
@@ -474,6 +475,7 @@ interface DurableObjectStorage {
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
sync(): Promise<void>;
sql: SqlStorage;
kv: SyncKvStorage;
transactionSync<T>(closure: () => T): T;
getCurrentBookmark(): Promise<string>;
getBookmarkForTime(timestamp: number | Date): Promise<string>;
@@ -2045,6 +2047,7 @@ interface TraceItem {
readonly scriptVersion?: ScriptVersion;
readonly dispatchNamespace?: string;
readonly scriptTags?: string[];
readonly durableObjectId?: string;
readonly outcome: string;
readonly executionModel: string;
readonly truncated: boolean;
@@ -2566,6 +2569,23 @@ declare class MessageChannel {
interface MessagePortPostMessageOptions {
transfer?: any[];
}
interface SyncKvStorage {
get<T = unknown>(key: string): T | undefined;
list<T = unknown>(options?: SyncKvListOptions): Iterable<[
string,
T
]>;
put<T>(key: string, value: T): void;
delete(key: string): boolean;
}
interface SyncKvListOptions {
start?: string;
startAfter?: string;
end?: string;
prefix?: string;
reverse?: boolean;
limit?: number;
}
type AiImageClassificationInput = {
image: number[];
};
@@ -5440,7 +5460,7 @@ type AIGatewayHeaders = {
[key: string]: string | number | boolean | object;
};
type AIGatewayUniversalRequest = {
provider: AIGatewayProviders | string;
provider: AIGatewayProviders | string; // eslint-disable-line
endpoint: string;
headers: Partial<AIGatewayHeaders>;
query: unknown;
@@ -5456,7 +5476,7 @@ declare abstract class AiGateway {
gateway?: UniversalGatewayOptions;
extraHeaders?: object;
}): Promise<Response>;
getUrl(provider?: AIGatewayProviders | string): Promise<string>;
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
}
interface AutoRAGInternalError extends Error {
}
@@ -6555,6 +6575,7 @@ type ImageOutputOptions = {
format: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/avif' | 'rgb' | 'rgba';
quality?: number;
background?: string;
anim?: boolean;
};
interface ImagesBinding {
/**
@@ -6613,6 +6634,108 @@ interface ImagesError extends Error {
readonly message: string;
readonly stack?: string;
}
/**
* Media binding for transforming media streams.
* Provides the entry point for media transformation operations.
*/
interface MediaBinding {
/**
* Creates a media transformer from an input stream.
* @param media - The input media bytes
* @returns A MediaTransformer instance for applying transformations
*/
input(media: ReadableStream<Uint8Array>): MediaTransformer;
}
/**
* Media transformer for applying transformation operations to media content.
* Handles sizing, fitting, and other input transformation parameters.
*/
interface MediaTransformer {
/**
* Applies transformation options to the media content.
* @param transform - Configuration for how the media should be transformed
* @returns A generator for producing the transformed media output
*/
transform(transform: MediaTransformationInputOptions): MediaTransformationGenerator;
}
/**
* Generator for producing media transformation results.
* Configures the output format and parameters for the transformed media.
*/
interface MediaTransformationGenerator {
/**
* Generates the final media output with specified options.
* @param output - Configuration for the output format and parameters
* @returns The final transformation result containing the transformed media
*/
output(output: MediaTransformationOutputOptions): MediaTransformationResult;
}
/**
* Result of a media transformation operation.
* Provides multiple ways to access the transformed media content.
*/
interface MediaTransformationResult {
/**
* Returns the transformed media as a readable stream of bytes.
* @returns A stream containing the transformed media data
*/
media(): ReadableStream<Uint8Array>;
/**
* Returns the transformed media as an HTTP response object.
* @returns The transformed media as a Response, ready to store in cache or return to users
*/
response(): Response;
/**
* Returns the MIME type of the transformed media.
* @returns The content type string (e.g., 'image/jpeg', 'video/mp4')
*/
contentType(): string;
}
/**
* Configuration options for transforming media input.
* Controls how the media should be resized and fitted.
*/
type MediaTransformationInputOptions = {
/** How the media should be resized to fit the specified dimensions */
fit?: 'contain' | 'cover' | 'scale-down';
/** Target width in pixels */
width?: number;
/** Target height in pixels */
height?: number;
};
/**
* Configuration options for Media Transformations output.
* Controls the format, timing, and type of the generated output.
*/
type MediaTransformationOutputOptions = {
/**
* Output mode determining the type of media to generate
*/
mode?: 'video' | 'spritesheet' | 'frame' | 'audio';
/** Whether to include audio in the output */
audio?: boolean;
/**
* Starting timestamp for frame extraction or start time for clips. (e.g. '2s').
*/
time?: string;
/**
* Duration for video clips, audio extraction, and spritesheet generation (e.g. '5s').
*/
duration?: string;
/**
* Output format for the generated media.
*/
format?: 'jpg' | 'png' | 'm4a';
};
/**
* Error object for media transformation operations.
* Extends the standard Error interface with additional media-specific information.
*/
interface MediaError extends Error {
readonly code: number;
readonly message: string;
readonly stack?: string;
}
type Params<P extends string = any> = Record<P, string | string[]>;
type EventContext<Env, P extends string, Data> = {
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
@@ -6999,21 +7122,17 @@ declare namespace TailStream {
readonly tag?: string;
readonly message?: string;
}
interface Trigger {
readonly traceId: string;
readonly invocationId: string;
readonly spanId: string;
}
interface Onset {
readonly type: "onset";
readonly attributes: Attribute[];
// id for the span being opened by this Onset event.
readonly spanId: string;
readonly dispatchNamespace?: string;
readonly entrypoint?: string;
readonly executionModel: string;
readonly scriptName?: string;
readonly scriptTags?: string[];
readonly scriptVersion?: ScriptVersion;
readonly trigger?: Trigger;
readonly info: FetchEventInfo | JsRpcEventInfo | ScheduledEventInfo | AlarmEventInfo | QueueEventInfo | EmailEventInfo | TraceEventInfo | HibernatableWebSocketEventInfo | CustomEventInfo;
}
interface Outcome {
@@ -7025,6 +7144,8 @@ declare namespace TailStream {
interface SpanOpen {
readonly type: "spanOpen";
readonly name: string;
// id for the span being opened by this SpanOpen event.
readonly spanId: string;
readonly info?: FetchEventInfo | JsRpcEventInfo | Attributes;
}
interface SpanClose {
@@ -7047,6 +7168,10 @@ declare namespace TailStream {
readonly level: "debug" | "error" | "info" | "log" | "warn";
readonly message: object;
}
// This marks the worker handler return information.
// This is separate from Outcome because the worker invocation can live for a long time after
// returning. For example - Websockets that return an http upgrade response but then continue
// streaming information or SSE http connections.
interface Return {
readonly type: "return";
readonly info?: FetchResponseInfo;
@@ -7060,9 +7185,28 @@ declare namespace TailStream {
readonly info: Attribute[];
}
type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | Return | Attributes;
// Context in which this trace event lives.
interface SpanContext {
// Single id for the entire top-level invocation
// This should be a new traceId for the first worker stage invoked in the eyeball request and then
// same-account service-bindings should reuse the same traceId but cross-account service-bindings
// should use a new traceId.
readonly traceId: string;
// spanId in which this event is handled
// for Onset and SpanOpen events this would be the parent span id
// for Outcome and SpanClose these this would be the span id of the opening Onset and SpanOpen events
// For Hibernate and Mark this would be the span under which they were emitted.
// spanId is not set ONLY if:
// 1. This is an Onset event
// 2. We are not inherting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation)
readonly spanId?: string;
}
interface TailEvent<Event extends EventType> {
// invocation id of the currently invoked worker stage.
// invocation id will always be unique to every Onset event and will be the same until the Outcome event.
readonly invocationId: string;
readonly spanId: string;
// Inherited spanContext for this event.
readonly spanContext: SpanContext;
readonly timestamp: Date;
readonly sequence: number;
readonly event: Event;