fix: mettre à jour les dépendances et ajouter la configuration du sitemap

This commit is contained in:
2026-03-10 14:39:09 +01:00
parent c45b1d6f25
commit f8f9d26254
4 changed files with 520 additions and 41 deletions

View File

@@ -32,6 +32,7 @@
"@iconify-json/vscode-icons": "1.2.45",
"@types/node": "25.4.0",
"@vueuse/nuxt": "14.2.1",
"baseline-browser-mapping": "^2.10.0",
"eslint": "10.0.3",
"typescript": "^5.9.3",
"vue-tsc": "3.2.5",
@@ -1114,7 +1115,7 @@
"base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
"baseline-browser-mapping": ["baseline-browser-mapping@2.9.19", "", { "bin": { "baseline-browser-mapping": "dist/cli.js" } }, "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg=="],
"baseline-browser-mapping": ["baseline-browser-mapping@2.10.0", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA=="],
"better-sqlite3": ["better-sqlite3@12.6.2", "", { "dependencies": { "bindings": "^1.5.0", "prebuild-install": "^7.1.1" } }, "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA=="],
@@ -3036,6 +3037,8 @@
"bl/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
"browserslist/baseline-browser-mapping": ["baseline-browser-mapping@2.9.19", "", { "bin": { "baseline-browser-mapping": "dist/cli.js" } }, "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg=="],
"c12/perfect-debounce": ["perfect-debounce@2.0.0", "", {}, "sha512-fkEH/OBiKrqqI/yIgjR92lMfs2K8105zt/VT6+7eTjNwisrsh47CeIED9z58zI7DfKdH3uHAn25ziRZn3kgAow=="],
"c12/rc9": ["rc9@2.1.2", "", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="],

View File

@@ -166,6 +166,10 @@ export default defineNuxtConfig({
})
},
sitemap: {
zeroRuntime: true
},
seo: {
redirectToCanonicalSiteUrl: true
},

View File

@@ -44,6 +44,7 @@
"@iconify-json/vscode-icons": "1.2.45",
"@types/node": "25.4.0",
"@vueuse/nuxt": "14.2.1",
"baseline-browser-mapping": "^2.10.0",
"eslint": "10.0.3",
"typescript": "^5.9.3",
"vue-tsc": "3.2.5",

View File

@@ -1,14 +1,16 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: 8c48032b4b2801cdbac6e8dbc9d26203)
// Runtime types generated with workerd@1.20251210.0 2025-12-13 nodejs_compat
// Generated by Wrangler by running `wrangler types` (hash: d4a0374e6b0a617a49990dba7b6dc49b)
// Runtime types generated with workerd@1.20260301.1 2025-12-13 nodejs_compat
declare namespace Cloudflare {
interface GlobalProps {
mainModule: typeof import("./.output/server/index");
}
interface Env {
interface PreviewEnv {
CACHE: KVNamespace;
DB: D1Database;
STUDIO_GITHUB_CLIENT_ID: string;
STUDIO_GITHUB_CLIENT_SECRET: string;
STUDIO_GITHUB_MODERATORS: string;
NUXT_DISCORD_USER_ID: string;
NUXT_WAKATIME_CODING: string;
NUXT_WAKATIME_EDITORS: string;
@@ -19,8 +21,24 @@ declare namespace Cloudflare {
NUXT_HUB_CLOUDFLARE_ACCOUNT_ID: string;
NUXT_HUB_CLOUDFLARE_API_TOKEN: string;
NUXT_HUB_CLOUDFLARE_CACHE_NAMESPACE_ID: string;
}
interface Env {
CACHE: KVNamespace;
DB: D1Database;
ASSETS: Fetcher;
STUDIO_GITHUB_CLIENT_ID: string;
STUDIO_GITHUB_CLIENT_SECRET: string;
STUDIO_GITHUB_MODERATORS: string;
NUXT_DISCORD_USER_ID: string;
NUXT_WAKATIME_CODING: string;
NUXT_WAKATIME_EDITORS: string;
NUXT_WAKATIME_LANGUAGES: string;
NUXT_WAKATIME_OS: string;
NUXT_WAKATIME_USER_ID: string;
NUXT_STATUS_PAGE: string;
NUXT_HUB_CLOUDFLARE_ACCOUNT_ID: string;
NUXT_HUB_CLOUDFLARE_API_TOKEN: string;
NUXT_HUB_CLOUDFLARE_CACHE_NAMESPACE_ID: string;
ASSETS?: Fetcher;
}
}
interface Env extends Cloudflare.Env {}
@@ -28,7 +46,7 @@ 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, "STUDIO_GITHUB_CLIENT_ID" | "STUDIO_GITHUB_CLIENT_SECRET" | "NUXT_DISCORD_USER_ID" | "NUXT_WAKATIME_CODING" | "NUXT_WAKATIME_EDITORS" | "NUXT_WAKATIME_LANGUAGES" | "NUXT_WAKATIME_OS" | "NUXT_WAKATIME_USER_ID" | "NUXT_STATUS_PAGE" | "NUXT_HUB_CLOUDFLARE_ACCOUNT_ID" | "NUXT_HUB_CLOUDFLARE_API_TOKEN" | "NUXT_HUB_CLOUDFLARE_CACHE_NAMESPACE_ID">> {}
interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "STUDIO_GITHUB_CLIENT_ID" | "STUDIO_GITHUB_CLIENT_SECRET" | "STUDIO_GITHUB_MODERATORS" | "NUXT_DISCORD_USER_ID" | "NUXT_WAKATIME_CODING" | "NUXT_WAKATIME_EDITORS" | "NUXT_WAKATIME_LANGUAGES" | "NUXT_WAKATIME_OS" | "NUXT_WAKATIME_USER_ID" | "NUXT_STATUS_PAGE" | "NUXT_HUB_CLOUDFLARE_ACCOUNT_ID" | "NUXT_HUB_CLOUDFLARE_API_TOKEN" | "NUXT_HUB_CLOUDFLARE_CACHE_NAMESPACE_ID">> {}
}
// Begin runtime types
@@ -517,8 +535,10 @@ interface DurableObjectNamespaceNewUniqueIdOptions {
jurisdiction?: DurableObjectJurisdiction;
}
type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
type DurableObjectRoutingMode = "primary-only";
interface DurableObjectNamespaceGetDurableObjectOptions {
locationHint?: DurableObjectLocationHint;
routingMode?: DurableObjectRoutingMode;
}
interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {
}
@@ -1406,6 +1426,12 @@ declare abstract class PromiseRejectionEvent extends Event {
*/
declare class FormData {
constructor();
/**
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/append)
*/
append(name: string, value: string | Blob): void;
/**
* The **`append()`** method of the FormData interface appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist.
*
@@ -1442,6 +1468,12 @@ declare class FormData {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/has)
*/
has(name: string): boolean;
/**
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FormData/set)
*/
set(name: string, value: string | Blob): void;
/**
* The **`set()`** method of the FormData interface sets a new value for an existing key inside a `FormData` object, or adds the key/value if it does not already exist.
*
@@ -1768,7 +1800,7 @@ interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> e
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/signal)
*/
signal: AbortSignal;
cf: Cf | undefined;
cf?: Cf;
/**
* The **`integrity`** read-only property of the Request interface contains the subresource integrity value of the request.
*
@@ -2103,6 +2135,8 @@ interface Transformer<I = any, O = any> {
expectedLength?: number;
}
interface StreamPipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
/**
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
*
@@ -2121,8 +2155,6 @@ interface StreamPipeOptions {
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
*/
preventClose?: boolean;
preventAbort?: boolean;
preventCancel?: boolean;
signal?: AbortSignal;
}
type ReadableStreamReadResult<R = any> = {
@@ -2397,13 +2429,13 @@ declare abstract class TransformStreamDefaultController<O = any> {
terminate(): void;
}
interface ReadableWritablePair<R = any, W = any> {
readable: ReadableStream<R>;
/**
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*/
writable: WritableStream<W>;
readable: ReadableStream<R>;
}
/**
* The **`WritableStream`** interface of the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink.
@@ -3333,6 +3365,191 @@ declare abstract class Performance {
get timeOrigin(): number;
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
now(): number;
/**
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
*/
toJSON(): object;
}
// AI Search V2 API Error Interfaces
interface AiSearchInternalError extends Error {
}
interface AiSearchNotFoundError extends Error {
}
interface AiSearchNameNotSetError extends Error {
}
// Filter types (shared with AutoRAG for compatibility)
type ComparisonFilter = {
key: string;
type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
value: string | number | boolean;
};
type CompoundFilter = {
type: 'and' | 'or';
filters: ComparisonFilter[];
};
// AI Search V2 Request Types
type AiSearchSearchRequest = {
messages: Array<{
role: 'system' | 'developer' | 'user' | 'assistant' | 'tool';
content: string | null;
}>;
ai_search_options?: {
retrieval?: {
retrieval_type?: 'vector' | 'keyword' | 'hybrid';
/** Match threshold (0-1, default 0.4) */
match_threshold?: number;
/** Maximum number of results (1-50, default 10) */
max_num_results?: number;
filters?: CompoundFilter | ComparisonFilter;
/** Context expansion (0-3, default 0) */
context_expansion?: number;
[key: string]: unknown;
};
query_rewrite?: {
enabled?: boolean;
model?: string;
rewrite_prompt?: string;
[key: string]: unknown;
};
reranking?: {
/** Enable reranking (default false) */
enabled?: boolean;
model?: '@cf/baai/bge-reranker-base' | '';
/** Match threshold (0-1, default 0.4) */
match_threshold?: number;
[key: string]: unknown;
};
[key: string]: unknown;
};
};
type AiSearchChatCompletionsRequest = {
messages: Array<{
role: 'system' | 'developer' | 'user' | 'assistant' | 'tool';
content: string | null;
}>;
model?: string;
stream?: boolean;
ai_search_options?: {
retrieval?: {
retrieval_type?: 'vector' | 'keyword' | 'hybrid';
match_threshold?: number;
max_num_results?: number;
filters?: CompoundFilter | ComparisonFilter;
context_expansion?: number;
[key: string]: unknown;
};
query_rewrite?: {
enabled?: boolean;
model?: string;
rewrite_prompt?: string;
[key: string]: unknown;
};
reranking?: {
enabled?: boolean;
model?: '@cf/baai/bge-reranker-base' | '';
match_threshold?: number;
[key: string]: unknown;
};
[key: string]: unknown;
};
[key: string]: unknown;
};
// AI Search V2 Response Types
type AiSearchSearchResponse = {
search_query: string;
chunks: Array<{
id: string;
type: string;
/** Match score (0-1) */
score: number;
text: string;
item: {
timestamp?: number;
key: string;
metadata?: Record<string, unknown>;
};
scoring_details?: {
/** Keyword match score (0-1) */
keyword_score?: number;
/** Vector similarity score (0-1) */
vector_score?: number;
};
}>;
};
type AiSearchListResponse = Array<{
id: string;
internal_id?: string;
account_id?: string;
account_tag?: string;
/** Whether the instance is enabled (default true) */
enable?: boolean;
type?: 'r2' | 'web-crawler';
source?: string;
[key: string]: unknown;
}>;
type AiSearchConfig = {
/** Instance ID (1-32 chars, pattern: ^[a-z0-9_]+(?:-[a-z0-9_]+)*$) */
id: string;
type: 'r2' | 'web-crawler';
source: string;
source_params?: object;
/** Token ID (UUID format) */
token_id?: string;
ai_gateway_id?: string;
/** Enable query rewriting (default false) */
rewrite_query?: boolean;
/** Enable reranking (default false) */
reranking?: boolean;
embedding_model?: string;
ai_search_model?: string;
};
type AiSearchInstance = {
id: string;
enable?: boolean;
type?: 'r2' | 'web-crawler';
source?: string;
[key: string]: unknown;
};
// AI Search Instance Service - Instance-level operations
declare abstract class AiSearchInstanceService {
/**
* Search the AI Search instance for relevant chunks.
* @param params Search request with messages and AI search options
* @returns Search response with matching chunks
*/
search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>;
/**
* Generate chat completions with AI Search context.
* @param params Chat completions request with optional streaming
* @returns Response object (if streaming) or chat completion result
*/
chatCompletions(params: AiSearchChatCompletionsRequest): Promise<Response | object>;
/**
* Delete this AI Search instance.
*/
delete(): Promise<void>;
}
// AI Search Account Service - Account-level operations
declare abstract class AiSearchAccountService {
/**
* List all AI Search instances in the account.
* @returns Array of AI Search instances
*/
list(): Promise<AiSearchListResponse>;
/**
* Get an AI Search instance by ID.
* @param name Instance ID
* @returns Instance service for performing operations
*/
get(name: string): AiSearchInstanceService;
/**
* Create a new AI Search instance.
* @param config Instance configuration
* @returns Instance service for performing operations
*/
create(config: AiSearchConfig): Promise<AiSearchInstanceService>;
}
type AiImageClassificationInput = {
image: number[];
@@ -5522,7 +5739,7 @@ interface Ai_Cf_Qwen_Qwq_32B_Messages {
};
})[];
/**
* JSON schema that should be fufilled for the response.
* JSON schema that should be fulfilled for the response.
*/
guided_json?: object;
/**
@@ -5788,7 +6005,7 @@ interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages {
};
})[];
/**
* JSON schema that should be fufilled for the response.
* JSON schema that should be fulfilled for the response.
*/
guided_json?: object;
/**
@@ -5879,7 +6096,7 @@ interface Ai_Cf_Google_Gemma_3_12B_It_Prompt {
*/
prompt: string;
/**
* JSON schema that should be fufilled for the response.
* JSON schema that should be fulfilled for the response.
*/
guided_json?: object;
/**
@@ -6038,7 +6255,7 @@ interface Ai_Cf_Google_Gemma_3_12B_It_Messages {
};
})[];
/**
* JSON schema that should be fufilled for the response.
* JSON schema that should be fulfilled for the response.
*/
guided_json?: object;
/**
@@ -6310,7 +6527,7 @@ interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages {
})[];
response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
/**
* JSON schema that should be fufilled for the response.
* JSON schema that should be fulfilled for the response.
*/
guided_json?: object;
/**
@@ -6540,7 +6757,7 @@ interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner {
})[];
response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
/**
* JSON schema that should be fufilled for the response.
* JSON schema that should be fulfilled for the response.
*/
guided_json?: object;
/**
@@ -7590,7 +7807,7 @@ interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input {
*/
text: string | string[];
/**
* Target langauge to translate to
* Target language to translate to
*/
target_language: "asm_Beng" | "awa_Deva" | "ben_Beng" | "bho_Deva" | "brx_Deva" | "doi_Deva" | "eng_Latn" | "gom_Deva" | "gon_Deva" | "guj_Gujr" | "hin_Deva" | "hne_Deva" | "kan_Knda" | "kas_Arab" | "kas_Deva" | "kha_Latn" | "lus_Latn" | "mag_Deva" | "mai_Deva" | "mal_Mlym" | "mar_Deva" | "mni_Beng" | "mni_Mtei" | "npi_Deva" | "ory_Orya" | "pan_Guru" | "san_Deva" | "sat_Olck" | "snd_Arab" | "snd_Deva" | "tam_Taml" | "tel_Telu" | "urd_Arab" | "unr_Deva";
}
@@ -8521,6 +8738,48 @@ type AiModelListType = Record<string, any>;
declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
aiGatewayLogId: string | null;
gateway(gatewayId: string): AiGateway;
/**
* Access the AI Search API for managing AI-powered search instances.
*
* This is the new API that replaces AutoRAG with better namespace separation:
* - Account-level operations: `list()`, `create()`
* - Instance-level operations: `get(id).search()`, `get(id).chatCompletions()`, `get(id).delete()`
*
* @example
* ```typescript
* // List all AI Search instances
* const instances = await env.AI.aiSearch.list();
*
* // Search an instance
* const results = await env.AI.aiSearch.get('my-search').search({
* messages: [{ role: 'user', content: 'What is the policy?' }],
* ai_search_options: {
* retrieval: { max_num_results: 10 }
* }
* });
*
* // Generate chat completions with AI Search context
* const response = await env.AI.aiSearch.get('my-search').chatCompletions({
* messages: [{ role: 'user', content: 'What is the policy?' }],
* model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast'
* });
* ```
*/
aiSearch(): AiSearchAccountService;
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use `env.AI.aiSearch` instead for better API design and new features.
*
* Migration guide:
* - `env.AI.autorag().list()` → `env.AI.aiSearch.list()`
* - `env.AI.autorag('id').search({ query: '...' })` → `env.AI.aiSearch.get('id').search({ messages: [{ role: 'user', content: '...' }] })`
* - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)`
*
* Note: The old API continues to work for backwards compatibility, but new projects should use AI Search.
*
* @see AiSearchAccountService
* @param autoragId Optional instance ID (omit for account-level operations)
*/
autorag(autoragId: string): AutoRAG;
run<Name extends keyof AiModelList, Options extends AiOptions, InputOptions extends AiModelList[Name]["inputs"]>(model: Name, inputs: InputOptions, options?: Options): Promise<Options extends {
returnRawResponse: true;
@@ -8629,23 +8888,34 @@ declare abstract class AiGateway {
}): Promise<Response>;
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
}
/**
* @deprecated AutoRAG has been replaced by AI Search. Use AiSearchInternalError instead.
* @see AiSearchInternalError
*/
interface AutoRAGInternalError extends Error {
}
/**
* @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNotFoundError instead.
* @see AiSearchNotFoundError
*/
interface AutoRAGNotFoundError extends Error {
}
/**
* @deprecated This error type is no longer used in the AI Search API.
*/
interface AutoRAGUnauthorizedError extends Error {
}
/**
* @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNameNotSetError instead.
* @see AiSearchNameNotSetError
*/
interface AutoRAGNameNotSetError extends Error {
}
type ComparisonFilter = {
key: string;
type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
value: string | number | boolean;
};
type CompoundFilter = {
type: 'and' | 'or';
filters: ComparisonFilter[];
};
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use AiSearchSearchRequest with the new API instead.
* @see AiSearchSearchRequest
*/
type AutoRagSearchRequest = {
query: string;
filters?: CompoundFilter | ComparisonFilter;
@@ -8660,13 +8930,28 @@ type AutoRagSearchRequest = {
};
rewrite_query?: boolean;
};
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use AiSearchChatCompletionsRequest with the new API instead.
* @see AiSearchChatCompletionsRequest
*/
type AutoRagAiSearchRequest = AutoRagSearchRequest & {
stream?: boolean;
system_prompt?: string;
};
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use AiSearchChatCompletionsRequest with stream: true instead.
* @see AiSearchChatCompletionsRequest
*/
type AutoRagAiSearchRequestStreaming = Omit<AutoRagAiSearchRequest, 'stream'> & {
stream: true;
};
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use AiSearchSearchResponse with the new API instead.
* @see AiSearchSearchResponse
*/
type AutoRagSearchResponse = {
object: 'vector_store.search_results.page';
search_query: string;
@@ -8683,6 +8968,11 @@ type AutoRagSearchResponse = {
has_more: boolean;
next_page: string | null;
};
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use AiSearchListResponse with the new API instead.
* @see AiSearchListResponse
*/
type AutoRagListResponse = {
id: string;
enable: boolean;
@@ -8692,14 +8982,51 @@ type AutoRagListResponse = {
paused: boolean;
status: string;
}[];
/**
* @deprecated AutoRAG has been replaced by AI Search.
* The new API returns different response formats for chat completions.
*/
type AutoRagAiSearchResponse = AutoRagSearchResponse & {
response: string;
};
/**
* @deprecated AutoRAG has been replaced by AI Search.
* Use the new AI Search API instead: `env.AI.aiSearch`
*
* Migration guide:
* - `env.AI.autorag().list()` → `env.AI.aiSearch.list()`
* - `env.AI.autorag('id').search(...)` → `env.AI.aiSearch.get('id').search(...)`
* - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)`
*
* @see AiSearchAccountService
* @see AiSearchInstanceService
*/
declare abstract class AutoRAG {
/**
* @deprecated Use `env.AI.aiSearch.list()` instead.
* @see AiSearchAccountService.list
*/
list(): Promise<AutoRagListResponse>;
/**
* @deprecated Use `env.AI.aiSearch.get(id).search(...)` instead.
* Note: The new API uses a messages array instead of a query string.
* @see AiSearchInstanceService.search
*/
search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>;
/**
* @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
* @see AiSearchInstanceService.chatCompletions
*/
aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>;
/**
* @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
* @see AiSearchInstanceService.chatCompletions
*/
aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>;
/**
* @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
* @see AiSearchInstanceService.chatCompletions
*/
aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse | Response>;
}
interface BasicImageTransformations {
@@ -9450,6 +9777,10 @@ interface D1Meta {
* The region of the database instance that executed the query.
*/
served_by_region?: string;
/**
* The three letters airport code of the colo that executed the query.
*/
served_by_colo?: string;
/**
* True if-and-only-if the database instance that executed the query was the primary.
*/
@@ -9538,6 +9869,15 @@ declare abstract class D1PreparedStatement {
// ignored when `Disposable` is included in the standard lib.
interface Disposable {
}
/**
* The returned data after sending an email
*/
interface EmailSendResult {
/**
* The Email Message ID
*/
messageId: string;
}
/**
* An email message that can be sent from a Worker.
*/
@@ -9579,19 +9919,50 @@ interface ForwardableEmailMessage extends EmailMessage {
* @param headers A [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
* @returns A promise that resolves when the email message is forwarded.
*/
forward(rcptTo: string, headers?: Headers): Promise<void>;
forward(rcptTo: string, headers?: Headers): Promise<EmailSendResult>;
/**
* Reply to the sender of this email message with a new EmailMessage object.
* @param message The reply message.
* @returns A promise that resolves when the email message is replied.
*/
reply(message: EmailMessage): Promise<void>;
reply(message: EmailMessage): Promise<EmailSendResult>;
}
/** A file attachment for an email message */
type EmailAttachment = {
disposition: 'inline';
contentId: string;
filename: string;
type: string;
content: string | ArrayBuffer | ArrayBufferView;
} | {
disposition: 'attachment';
contentId?: undefined;
filename: string;
type: string;
content: string | ArrayBuffer | ArrayBufferView;
};
/** An Email Address */
interface EmailAddress {
name: string;
email: string;
}
/**
* A binding that allows a Worker to send email messages.
*/
interface SendEmail {
send(message: EmailMessage): Promise<void>;
send(message: EmailMessage): Promise<EmailSendResult>;
send(builder: {
from: string | EmailAddress;
to: string | string[];
subject: string;
replyTo?: string | EmailAddress;
cc?: string | string[];
bcc?: string | string[];
headers?: Record<string, string>;
text?: string;
html?: string;
attachments?: EmailAttachment[];
}): Promise<EmailSendResult>;
}
declare abstract class EmailEvent extends ExtendableEvent {
readonly message: ForwardableEmailMessage;
@@ -9624,7 +9995,7 @@ interface Hyperdrive {
/**
* Connect directly to Hyperdrive as if it's your database, returning a TCP socket.
*
* Calling this method returns an idential socket to if you call
* Calling this method returns an identical socket to if you call
* `connect("host:port")` using the `host` and `port` fields from this object.
* Pick whichever approach works better with your preferred DB client library.
*
@@ -9737,6 +10108,83 @@ type ImageOutputOptions = {
background?: string;
anim?: boolean;
};
interface ImageMetadata {
id: string;
filename?: string;
uploaded?: string;
requireSignedURLs: boolean;
meta?: Record<string, unknown>;
variants: string[];
draft?: boolean;
creator?: string;
}
interface ImageUploadOptions {
id?: string;
filename?: string;
requireSignedURLs?: boolean;
metadata?: Record<string, unknown>;
creator?: string;
encoding?: 'base64';
}
interface ImageUpdateOptions {
requireSignedURLs?: boolean;
metadata?: Record<string, unknown>;
creator?: string;
}
interface ImageListOptions {
limit?: number;
cursor?: string;
sortOrder?: 'asc' | 'desc';
creator?: string;
}
interface ImageList {
images: ImageMetadata[];
cursor?: string;
listComplete: boolean;
}
interface HostedImagesBinding {
/**
* Get detailed metadata for a hosted image
* @param imageId The ID of the image (UUID or custom ID)
* @returns Image metadata, or null if not found
*/
details(imageId: string): Promise<ImageMetadata | null>;
/**
* Get the raw image data for a hosted image
* @param imageId The ID of the image (UUID or custom ID)
* @returns ReadableStream of image bytes, or null if not found
*/
image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
/**
* Upload a new hosted image
* @param image The image file to upload
* @param options Upload configuration
* @returns Metadata for the uploaded image
* @throws {@link ImagesError} if upload fails
*/
upload(image: ReadableStream<Uint8Array> | ArrayBuffer, options?: ImageUploadOptions): Promise<ImageMetadata>;
/**
* Update hosted image metadata
* @param imageId The ID of the image
* @param options Properties to update
* @returns Updated image metadata
* @throws {@link ImagesError} if update fails
*/
update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
/**
* Delete a hosted image
* @param imageId The ID of the image
* @returns True if deleted, false if not found
*/
delete(imageId: string): Promise<boolean>;
/**
* List hosted images with pagination
* @param options List configuration
* @returns List of images with pagination info
* @throws {@link ImagesError} if list fails
*/
list(options?: ImageListOptions): Promise<ImageList>;
}
interface ImagesBinding {
/**
* Get image metadata (type, width and height)
@@ -9750,6 +10198,10 @@ interface ImagesBinding {
* @returns A transform handle
*/
input(stream: ReadableStream<Uint8Array>, options?: ImageInputOptions): ImageTransformer;
/**
* Access hosted images CRUD operations
*/
readonly hosted: HostedImagesBinding;
}
interface ImageTransformer {
/**
@@ -9816,7 +10268,13 @@ interface MediaTransformer {
* @param transform - Configuration for how the media should be transformed
* @returns A generator for producing the transformed media output
*/
transform(transform: MediaTransformationInputOptions): MediaTransformationGenerator;
transform(transform?: MediaTransformationInputOptions): 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;
}
/**
* Generator for producing media transformation results.
@@ -9828,7 +10286,7 @@ interface MediaTransformationGenerator {
* @param output - Configuration for the output format and parameters
* @returns The final transformation result containing the transformed media
*/
output(output: MediaTransformationOutputOptions): MediaTransformationResult;
output(output?: MediaTransformationOutputOptions): MediaTransformationResult;
}
/**
* Result of a media transformation operation.
@@ -9837,19 +10295,19 @@ interface MediaTransformationGenerator {
interface MediaTransformationResult {
/**
* Returns the transformed media as a readable stream of bytes.
* @returns A stream containing the transformed media data
* @returns A promise containing a readable stream with the transformed media
*/
media(): ReadableStream<Uint8Array>;
media(): Promise<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
* @returns The transformed media as a Promise<Response>, ready to store in cache or return to users
*/
response(): Response;
response(): Promise<Response>;
/**
* Returns the MIME type of the transformed media.
* @returns The content type string (e.g., 'image/jpeg', 'video/mp4')
* @returns A promise containing the content type string (e.g., 'image/jpeg', 'video/mp4')
*/
contentType(): string;
contentType(): Promise<string>;
}
/**
* Configuration options for transforming media input.
@@ -9957,7 +10415,7 @@ declare module "cloudflare:pipelines" {
protected ctx: ExecutionContext;
constructor(ctx: ExecutionContext, env: Env);
/**
* run recieves an array of PipelineRecord which can be
* run receives an array of PipelineRecord which can be
* transformed and returned to the pipeline
* @param records Incoming records from the pipeline to be transformed
* @param metadata Information about the specific pipeline calling the transformation entrypoint
@@ -10238,6 +10696,7 @@ declare namespace CloudflareWorkersModule {
timeout?: WorkflowTimeoutDuration | number;
}): Promise<WorkflowStepEvent<T>>;
}
export type WorkflowInstanceStatus = 'queued' | 'running' | 'paused' | 'errored' | 'terminated' | 'complete' | 'waiting' | 'waitingForPause' | 'unknown';
export abstract class WorkflowEntrypoint<Env = unknown, T extends Rpc.Serializable<T> | unknown = unknown> implements Rpc.WorkflowEntrypointBranded {
[Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never;
protected ctx: ExecutionContext;
@@ -10271,12 +10730,14 @@ type MarkdownDocument = {
blob: Blob;
};
type ConversionResponse = {
id: string;
name: string;
mimeType: string;
format: 'markdown';
tokens: number;
data: string;
} | {
id: string;
name: string;
mimeType: string;
format: 'error';
@@ -10294,6 +10755,7 @@ type ConversionOptions = {
images?: EmbeddedImageConversionOptions & {
convertOGImage?: boolean;
};
hostname?: string;
};
docx?: {
images?: EmbeddedImageConversionOptions;
@@ -10431,6 +10893,15 @@ declare namespace TailStream {
readonly level: "debug" | "error" | "info" | "log" | "warn";
readonly message: object;
}
interface DroppedEventsDiagnostic {
readonly diagnosticsType: "droppedEvents";
readonly count: number;
}
interface StreamDiagnostic {
readonly type: 'streamDiagnostic';
// To add new diagnostic types, define a new interface and add it to this union type.
readonly diagnostic: DroppedEventsDiagnostic;
}
// 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
@@ -10447,7 +10918,7 @@ declare namespace TailStream {
readonly type: "attributes";
readonly info: Attribute[];
}
type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | Return | Attributes;
type EventType = Onset | Outcome | SpanOpen | SpanClose | DiagnosticChannelEvent | Exception | Log | StreamDiagnostic | Return | Attributes;
// Context in which this trace event lives.
interface SpanContext {
// Single id for the entire top-level invocation
@@ -10461,7 +10932,7 @@ declare namespace TailStream {
// 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)
// 2. We are not inheriting 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> {