@cloudflare/workers-types 4.20260415.1 → 4.20260416.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2021-11-03/index.d.ts +480 -110
- package/2021-11-03/index.ts +483 -109
- package/2022-01-31/index.d.ts +480 -110
- package/2022-01-31/index.ts +483 -109
- package/2022-03-21/index.d.ts +480 -110
- package/2022-03-21/index.ts +483 -109
- package/2022-08-04/index.d.ts +480 -110
- package/2022-08-04/index.ts +483 -109
- package/2022-10-31/index.d.ts +480 -110
- package/2022-10-31/index.ts +483 -109
- package/2022-11-30/index.d.ts +480 -110
- package/2022-11-30/index.ts +483 -109
- package/2023-03-01/index.d.ts +480 -110
- package/2023-03-01/index.ts +483 -109
- package/2023-07-01/index.d.ts +480 -110
- package/2023-07-01/index.ts +483 -109
- package/experimental/index.d.ts +441 -109
- package/experimental/index.ts +444 -108
- package/index.d.ts +480 -110
- package/index.ts +483 -109
- package/latest/index.d.ts +480 -110
- package/latest/index.ts +483 -109
- package/oldest/index.d.ts +480 -110
- package/oldest/index.ts +483 -109
- package/package.json +1 -1
package/2023-07-01/index.d.ts
CHANGED
|
@@ -2330,11 +2330,34 @@ interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
2330
2330
|
}
|
|
2331
2331
|
type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
2332
2332
|
interface Queue<Body = unknown> {
|
|
2333
|
-
|
|
2333
|
+
metrics(): Promise<QueueMetrics>;
|
|
2334
|
+
send(message: Body, options?: QueueSendOptions): Promise<QueueSendResponse>;
|
|
2334
2335
|
sendBatch(
|
|
2335
2336
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
2336
2337
|
options?: QueueSendBatchOptions,
|
|
2337
|
-
): Promise<
|
|
2338
|
+
): Promise<QueueSendBatchResponse>;
|
|
2339
|
+
}
|
|
2340
|
+
interface QueueSendMetrics {
|
|
2341
|
+
backlogCount: number;
|
|
2342
|
+
backlogBytes: number;
|
|
2343
|
+
oldestMessageTimestamp?: Date;
|
|
2344
|
+
}
|
|
2345
|
+
interface QueueSendMetadata {
|
|
2346
|
+
metrics: QueueSendMetrics;
|
|
2347
|
+
}
|
|
2348
|
+
interface QueueSendResponse {
|
|
2349
|
+
metadata: QueueSendMetadata;
|
|
2350
|
+
}
|
|
2351
|
+
interface QueueSendBatchMetrics {
|
|
2352
|
+
backlogCount: number;
|
|
2353
|
+
backlogBytes: number;
|
|
2354
|
+
oldestMessageTimestamp?: Date;
|
|
2355
|
+
}
|
|
2356
|
+
interface QueueSendBatchMetadata {
|
|
2357
|
+
metrics: QueueSendBatchMetrics;
|
|
2358
|
+
}
|
|
2359
|
+
interface QueueSendBatchResponse {
|
|
2360
|
+
metadata: QueueSendBatchMetadata;
|
|
2338
2361
|
}
|
|
2339
2362
|
interface QueueSendOptions {
|
|
2340
2363
|
contentType?: QueueContentType;
|
|
@@ -2348,6 +2371,19 @@ interface MessageSendRequest<Body = unknown> {
|
|
|
2348
2371
|
contentType?: QueueContentType;
|
|
2349
2372
|
delaySeconds?: number;
|
|
2350
2373
|
}
|
|
2374
|
+
interface QueueMetrics {
|
|
2375
|
+
backlogCount: number;
|
|
2376
|
+
backlogBytes: number;
|
|
2377
|
+
oldestMessageTimestamp?: Date;
|
|
2378
|
+
}
|
|
2379
|
+
interface MessageBatchMetrics {
|
|
2380
|
+
backlogCount: number;
|
|
2381
|
+
backlogBytes: number;
|
|
2382
|
+
oldestMessageTimestamp?: Date;
|
|
2383
|
+
}
|
|
2384
|
+
interface MessageBatchMetadata {
|
|
2385
|
+
metrics: MessageBatchMetrics;
|
|
2386
|
+
}
|
|
2351
2387
|
interface QueueRetryOptions {
|
|
2352
2388
|
delaySeconds?: number;
|
|
2353
2389
|
}
|
|
@@ -2362,12 +2398,14 @@ interface Message<Body = unknown> {
|
|
|
2362
2398
|
interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
2363
2399
|
readonly messages: readonly Message<Body>[];
|
|
2364
2400
|
readonly queue: string;
|
|
2401
|
+
readonly metadata: MessageBatchMetadata;
|
|
2365
2402
|
retryAll(options?: QueueRetryOptions): void;
|
|
2366
2403
|
ackAll(): void;
|
|
2367
2404
|
}
|
|
2368
2405
|
interface MessageBatch<Body = unknown> {
|
|
2369
2406
|
readonly messages: readonly Message<Body>[];
|
|
2370
2407
|
readonly queue: string;
|
|
2408
|
+
readonly metadata: MessageBatchMetadata;
|
|
2371
2409
|
retryAll(options?: QueueRetryOptions): void;
|
|
2372
2410
|
ackAll(): void;
|
|
2373
2411
|
}
|
|
@@ -3985,73 +4023,145 @@ declare abstract class Performance {
|
|
|
3985
4023
|
// ============ AI Search Error Interfaces ============
|
|
3986
4024
|
interface AiSearchInternalError extends Error {}
|
|
3987
4025
|
interface AiSearchNotFoundError extends Error {}
|
|
3988
|
-
// ============ AI Search
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4026
|
+
// ============ AI Search Common Types ============
|
|
4027
|
+
/** A single message in a conversation-style search or chat request. */
|
|
4028
|
+
type AiSearchMessage = {
|
|
4029
|
+
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
4030
|
+
content: string | null;
|
|
4031
|
+
};
|
|
4032
|
+
/**
|
|
4033
|
+
* Common shape for `ai_search_options` used by both single-instance and multi-instance requests.
|
|
4034
|
+
* Contains retrieval, query rewrite, reranking, and cache sub-options.
|
|
4035
|
+
*/
|
|
4036
|
+
type AiSearchOptions = {
|
|
4037
|
+
retrieval?: {
|
|
4038
|
+
/** Which retrieval backend to use. Defaults to the instance's configured index_method. */
|
|
4039
|
+
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4040
|
+
/** Fusion method for combining vector + keyword results. */
|
|
4041
|
+
fusion_method?: "max" | "rrf";
|
|
4042
|
+
/** How keyword terms are combined: "and" = all terms must match, "or" = any term matches. */
|
|
4043
|
+
keyword_match_mode?: "and" | "or";
|
|
4044
|
+
/** Minimum similarity score (0-1) for a result to be included. Default 0.4. */
|
|
4045
|
+
match_threshold?: number;
|
|
4046
|
+
/** Maximum number of results to return (1-50). Default 10. */
|
|
4047
|
+
max_num_results?: number;
|
|
4048
|
+
/** Vectorize metadata filters applied to the search. */
|
|
4049
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
4050
|
+
/** Number of surrounding chunks to include for context (0-3). Default 0. */
|
|
4051
|
+
context_expansion?: number;
|
|
4052
|
+
/** If true, return only item metadata without chunk text. */
|
|
4053
|
+
metadata_only?: boolean;
|
|
4054
|
+
/** If true (default), return empty results on retrieval failure instead of throwing. */
|
|
4055
|
+
return_on_failure?: boolean;
|
|
4056
|
+
/** Boost results by metadata field values. Max 3 entries. */
|
|
4057
|
+
boost_by?: Array<{
|
|
4058
|
+
field: string;
|
|
4059
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4060
|
+
}>;
|
|
4061
|
+
[key: string]: unknown;
|
|
4062
|
+
};
|
|
4063
|
+
query_rewrite?: {
|
|
4064
|
+
enabled?: boolean;
|
|
4065
|
+
model?: string;
|
|
4066
|
+
rewrite_prompt?: string;
|
|
4067
|
+
[key: string]: unknown;
|
|
4068
|
+
};
|
|
4069
|
+
reranking?: {
|
|
4070
|
+
enabled?: boolean;
|
|
4071
|
+
model?: string;
|
|
4072
|
+
/** Match threshold (0-1, default 0.4) */
|
|
4073
|
+
match_threshold?: number;
|
|
4019
4074
|
[key: string]: unknown;
|
|
4020
4075
|
};
|
|
4076
|
+
cache?: {
|
|
4077
|
+
enabled?: boolean;
|
|
4078
|
+
cache_threshold?:
|
|
4079
|
+
| "super_strict_match"
|
|
4080
|
+
| "close_enough"
|
|
4081
|
+
| "flexible_friend"
|
|
4082
|
+
| "anything_goes";
|
|
4083
|
+
};
|
|
4084
|
+
[key: string]: unknown;
|
|
4021
4085
|
};
|
|
4086
|
+
// ============ AI Search Request Types ============
|
|
4087
|
+
/**
|
|
4088
|
+
* Request body for single-instance search.
|
|
4089
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
4090
|
+
*/
|
|
4091
|
+
type AiSearchSearchRequest =
|
|
4092
|
+
| {
|
|
4093
|
+
/** Simple query string. */
|
|
4094
|
+
query: string;
|
|
4095
|
+
messages?: never;
|
|
4096
|
+
ai_search_options?: AiSearchOptions;
|
|
4097
|
+
}
|
|
4098
|
+
| {
|
|
4099
|
+
query?: never;
|
|
4100
|
+
/** Conversation-style input. At least one user message with non-empty content is required. */
|
|
4101
|
+
messages: AiSearchMessage[];
|
|
4102
|
+
ai_search_options?: AiSearchOptions;
|
|
4103
|
+
};
|
|
4022
4104
|
type AiSearchChatCompletionsRequest = {
|
|
4023
|
-
messages:
|
|
4024
|
-
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
4025
|
-
content: string | null;
|
|
4026
|
-
[key: string]: unknown;
|
|
4027
|
-
}>;
|
|
4105
|
+
messages: AiSearchMessage[];
|
|
4028
4106
|
model?: string;
|
|
4029
4107
|
stream?: boolean;
|
|
4030
|
-
ai_search_options?:
|
|
4031
|
-
retrieval?: {
|
|
4032
|
-
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4033
|
-
match_threshold?: number;
|
|
4034
|
-
max_num_results?: number;
|
|
4035
|
-
filters?: VectorizeVectorMetadataFilter;
|
|
4036
|
-
context_expansion?: number;
|
|
4037
|
-
[key: string]: unknown;
|
|
4038
|
-
};
|
|
4039
|
-
query_rewrite?: {
|
|
4040
|
-
enabled?: boolean;
|
|
4041
|
-
model?: string;
|
|
4042
|
-
rewrite_prompt?: string;
|
|
4043
|
-
[key: string]: unknown;
|
|
4044
|
-
};
|
|
4045
|
-
reranking?: {
|
|
4046
|
-
enabled?: boolean;
|
|
4047
|
-
model?: "@cf/baai/bge-reranker-base" | string;
|
|
4048
|
-
match_threshold?: number;
|
|
4049
|
-
[key: string]: unknown;
|
|
4050
|
-
};
|
|
4051
|
-
[key: string]: unknown;
|
|
4052
|
-
};
|
|
4108
|
+
ai_search_options?: AiSearchOptions;
|
|
4053
4109
|
[key: string]: unknown;
|
|
4054
4110
|
};
|
|
4111
|
+
// ============ AI Search Multi-Instance Types (Namespace-Scoped) ============
|
|
4112
|
+
/** `ai_search_options` shape for multi-instance requests — requires `instance_ids`. */
|
|
4113
|
+
type AiSearchMultiSearchOptions = AiSearchOptions & {
|
|
4114
|
+
/** Instance IDs to search across (1-10). */
|
|
4115
|
+
instance_ids: string[];
|
|
4116
|
+
};
|
|
4117
|
+
/**
|
|
4118
|
+
* Request for searching across multiple instances within a namespace.
|
|
4119
|
+
* `ai_search_options` is required and must include `instance_ids`.
|
|
4120
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
4121
|
+
*/
|
|
4122
|
+
type AiSearchMultiSearchRequest =
|
|
4123
|
+
| {
|
|
4124
|
+
/** Simple query string. */
|
|
4125
|
+
query: string;
|
|
4126
|
+
messages?: never;
|
|
4127
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4128
|
+
}
|
|
4129
|
+
| {
|
|
4130
|
+
query?: never;
|
|
4131
|
+
/** Conversation-style input. */
|
|
4132
|
+
messages: AiSearchMessage[];
|
|
4133
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4134
|
+
};
|
|
4135
|
+
/** A search result chunk tagged with the instance it originated from. */
|
|
4136
|
+
type AiSearchMultiSearchChunk = AiSearchSearchResponse["chunks"][number] & {
|
|
4137
|
+
instance_id: string;
|
|
4138
|
+
};
|
|
4139
|
+
/** Describes a per-instance error during a multi-instance operation. */
|
|
4140
|
+
type AiSearchMultiSearchError = {
|
|
4141
|
+
instance_id: string;
|
|
4142
|
+
message: string;
|
|
4143
|
+
};
|
|
4144
|
+
/** Response from a multi-instance search, with chunks tagged by instance and optional partial-failure errors. */
|
|
4145
|
+
type AiSearchMultiSearchResponse = {
|
|
4146
|
+
search_query: string;
|
|
4147
|
+
chunks: AiSearchMultiSearchChunk[];
|
|
4148
|
+
errors?: AiSearchMultiSearchError[];
|
|
4149
|
+
};
|
|
4150
|
+
/** Request for chat completions across multiple instances within a namespace. `ai_search_options` is required and must include `instance_ids`. */
|
|
4151
|
+
type AiSearchMultiChatCompletionsRequest = Omit<
|
|
4152
|
+
AiSearchChatCompletionsRequest,
|
|
4153
|
+
"ai_search_options"
|
|
4154
|
+
> & {
|
|
4155
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4156
|
+
};
|
|
4157
|
+
/** Response from multi-instance chat completions, with chunks tagged by instance and optional partial-failure errors. */
|
|
4158
|
+
type AiSearchMultiChatCompletionsResponse = Omit<
|
|
4159
|
+
AiSearchChatCompletionsResponse,
|
|
4160
|
+
"chunks"
|
|
4161
|
+
> & {
|
|
4162
|
+
chunks: AiSearchMultiSearchChunk[];
|
|
4163
|
+
errors?: AiSearchMultiSearchError[];
|
|
4164
|
+
};
|
|
4055
4165
|
// ============ AI Search Response Types ============
|
|
4056
4166
|
type AiSearchSearchResponse = {
|
|
4057
4167
|
search_query: string;
|
|
@@ -4071,6 +4181,14 @@ type AiSearchSearchResponse = {
|
|
|
4071
4181
|
keyword_score?: number;
|
|
4072
4182
|
/** Vector similarity score (0-1) */
|
|
4073
4183
|
vector_score?: number;
|
|
4184
|
+
/** Keyword rank position */
|
|
4185
|
+
keyword_rank?: number;
|
|
4186
|
+
/** Vector rank position */
|
|
4187
|
+
vector_rank?: number;
|
|
4188
|
+
/** Reranking model score */
|
|
4189
|
+
reranking_score?: number;
|
|
4190
|
+
/** Fusion method used to combine results */
|
|
4191
|
+
fusion_method?: "rrf" | "max";
|
|
4074
4192
|
[key: string]: unknown;
|
|
4075
4193
|
};
|
|
4076
4194
|
}>;
|
|
@@ -4099,19 +4217,88 @@ type AiSearchStatsResponse = {
|
|
|
4099
4217
|
skipped?: number;
|
|
4100
4218
|
outdated?: number;
|
|
4101
4219
|
last_activity?: string;
|
|
4220
|
+
/** Storage engine statistics. */
|
|
4221
|
+
engine?: {
|
|
4222
|
+
vectorize?: {
|
|
4223
|
+
vectorsCount: number;
|
|
4224
|
+
dimensions: number;
|
|
4225
|
+
};
|
|
4226
|
+
r2?: {
|
|
4227
|
+
payloadSizeBytes: number;
|
|
4228
|
+
metadataSizeBytes: number;
|
|
4229
|
+
objectCount: number;
|
|
4230
|
+
};
|
|
4231
|
+
};
|
|
4102
4232
|
};
|
|
4103
4233
|
// ============ AI Search Instance Info Types ============
|
|
4104
4234
|
type AiSearchInstanceInfo = {
|
|
4105
4235
|
id: string;
|
|
4106
4236
|
type?: "r2" | "web-crawler" | string;
|
|
4107
4237
|
source?: string;
|
|
4238
|
+
source_params?: unknown;
|
|
4108
4239
|
paused?: boolean;
|
|
4109
4240
|
status?: string;
|
|
4110
4241
|
namespace?: string;
|
|
4111
4242
|
created_at?: string;
|
|
4112
4243
|
modified_at?: string;
|
|
4244
|
+
token_id?: string;
|
|
4245
|
+
ai_gateway_id?: string;
|
|
4246
|
+
rewrite_query?: boolean;
|
|
4247
|
+
reranking?: boolean;
|
|
4248
|
+
embedding_model?: string;
|
|
4249
|
+
ai_search_model?: string;
|
|
4250
|
+
rewrite_model?: string;
|
|
4251
|
+
reranking_model?: string;
|
|
4252
|
+
/** @deprecated Use index_method instead. */
|
|
4253
|
+
hybrid_search_enabled?: boolean;
|
|
4254
|
+
/** Controls which storage backends are active. */
|
|
4255
|
+
index_method?: {
|
|
4256
|
+
vector?: boolean;
|
|
4257
|
+
keyword?: boolean;
|
|
4258
|
+
};
|
|
4259
|
+
/** Fusion method for combining vector and keyword results. */
|
|
4260
|
+
fusion_method?: "max" | "rrf";
|
|
4261
|
+
indexing_options?: {
|
|
4262
|
+
keyword_tokenizer?: "porter" | "trigram";
|
|
4263
|
+
} | null;
|
|
4264
|
+
retrieval_options?: {
|
|
4265
|
+
keyword_match_mode?: "and" | "or";
|
|
4266
|
+
boost_by?: Array<{
|
|
4267
|
+
field: string;
|
|
4268
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4269
|
+
}>;
|
|
4270
|
+
} | null;
|
|
4271
|
+
chunk?: boolean;
|
|
4272
|
+
chunk_size?: number;
|
|
4273
|
+
chunk_overlap?: number;
|
|
4274
|
+
score_threshold?: number;
|
|
4275
|
+
max_num_results?: number;
|
|
4276
|
+
cache?: boolean;
|
|
4277
|
+
cache_threshold?:
|
|
4278
|
+
| "super_strict_match"
|
|
4279
|
+
| "close_enough"
|
|
4280
|
+
| "flexible_friend"
|
|
4281
|
+
| "anything_goes";
|
|
4282
|
+
custom_metadata?: Array<{
|
|
4283
|
+
field_name: string;
|
|
4284
|
+
data_type: "text" | "number" | "boolean" | "datetime";
|
|
4285
|
+
}>;
|
|
4286
|
+
/** Sync interval in seconds. */
|
|
4287
|
+
sync_interval?: 3600 | 7200 | 14400 | 21600 | 43200 | 86400;
|
|
4288
|
+
metadata?: Record<string, unknown>;
|
|
4113
4289
|
[key: string]: unknown;
|
|
4114
4290
|
};
|
|
4291
|
+
/** Pagination, search, and ordering parameters for listing instances within a namespace. */
|
|
4292
|
+
type AiSearchListInstancesParams = {
|
|
4293
|
+
page?: number;
|
|
4294
|
+
per_page?: number;
|
|
4295
|
+
/** Search instances by ID. */
|
|
4296
|
+
search?: string;
|
|
4297
|
+
/** Field to sort by. */
|
|
4298
|
+
order_by?: "created_at";
|
|
4299
|
+
/** Sort direction. */
|
|
4300
|
+
order_by_direction?: "asc" | "desc";
|
|
4301
|
+
};
|
|
4115
4302
|
type AiSearchListResponse = {
|
|
4116
4303
|
result: AiSearchInstanceInfo[];
|
|
4117
4304
|
result_info?: {
|
|
@@ -4139,19 +4326,64 @@ type AiSearchConfig = {
|
|
|
4139
4326
|
reranking?: boolean;
|
|
4140
4327
|
embedding_model?: string;
|
|
4141
4328
|
ai_search_model?: string;
|
|
4329
|
+
rewrite_model?: string;
|
|
4330
|
+
reranking_model?: string;
|
|
4331
|
+
/** @deprecated Use index_method instead. */
|
|
4332
|
+
hybrid_search_enabled?: boolean;
|
|
4333
|
+
/** Controls which storage backends are used during indexing. Defaults to vector-only. */
|
|
4334
|
+
index_method?: {
|
|
4335
|
+
vector?: boolean;
|
|
4336
|
+
keyword?: boolean;
|
|
4337
|
+
};
|
|
4338
|
+
/** Fusion method for combining vector and keyword results. "rrf" = reciprocal rank fusion (default), "max" = maximum score. */
|
|
4339
|
+
fusion_method?: "max" | "rrf";
|
|
4340
|
+
indexing_options?: {
|
|
4341
|
+
keyword_tokenizer?: "porter" | "trigram";
|
|
4342
|
+
} | null;
|
|
4343
|
+
retrieval_options?: {
|
|
4344
|
+
keyword_match_mode?: "and" | "or";
|
|
4345
|
+
boost_by?: Array<{
|
|
4346
|
+
field: string;
|
|
4347
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4348
|
+
}>;
|
|
4349
|
+
} | null;
|
|
4350
|
+
chunk?: boolean;
|
|
4351
|
+
chunk_size?: number;
|
|
4352
|
+
chunk_overlap?: number;
|
|
4353
|
+
/** Minimum similarity score (0-1) for a result to be included. */
|
|
4354
|
+
score_threshold?: number;
|
|
4355
|
+
max_num_results?: number;
|
|
4356
|
+
cache?: boolean;
|
|
4357
|
+
/** Similarity threshold for cache hits. Stricter = fewer cache hits but higher relevance. */
|
|
4358
|
+
cache_threshold?:
|
|
4359
|
+
| "super_strict_match"
|
|
4360
|
+
| "close_enough"
|
|
4361
|
+
| "flexible_friend"
|
|
4362
|
+
| "anything_goes";
|
|
4363
|
+
custom_metadata?: Array<{
|
|
4364
|
+
field_name: string;
|
|
4365
|
+
data_type: "text" | "number" | "boolean" | "datetime";
|
|
4366
|
+
}>;
|
|
4367
|
+
namespace?: string;
|
|
4368
|
+
/** Sync interval in seconds. 3600=1h, 7200=2h, 14400=4h, 21600=6h, 43200=12h, 86400=24h. */
|
|
4369
|
+
sync_interval?: 3600 | 7200 | 14400 | 21600 | 43200 | 86400;
|
|
4370
|
+
metadata?: Record<string, unknown>;
|
|
4142
4371
|
[key: string]: unknown;
|
|
4143
4372
|
};
|
|
4144
4373
|
// ============ AI Search Item Types ============
|
|
4145
4374
|
type AiSearchItemInfo = {
|
|
4146
4375
|
id: string;
|
|
4147
4376
|
key: string;
|
|
4148
|
-
status:
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4377
|
+
status: "completed" | "error" | "skipped" | "queued" | "running" | "outdated";
|
|
4378
|
+
next_action?: "INDEX" | "DELETE" | null;
|
|
4379
|
+
error?: string;
|
|
4380
|
+
checksum?: string;
|
|
4381
|
+
namespace?: string;
|
|
4382
|
+
chunks_count?: number | null;
|
|
4383
|
+
file_size?: number | null;
|
|
4384
|
+
source_id?: string | null;
|
|
4385
|
+
last_seen_at?: string;
|
|
4386
|
+
created_at?: string;
|
|
4155
4387
|
metadata?: Record<string, unknown>;
|
|
4156
4388
|
[key: string]: unknown;
|
|
4157
4389
|
};
|
|
@@ -4167,6 +4399,22 @@ type AiSearchUploadItemOptions = {
|
|
|
4167
4399
|
type AiSearchListItemsParams = {
|
|
4168
4400
|
page?: number;
|
|
4169
4401
|
per_page?: number;
|
|
4402
|
+
/** Search items by key name. */
|
|
4403
|
+
search?: string;
|
|
4404
|
+
/** Sort order for results. */
|
|
4405
|
+
sort_by?: "status" | "modified_at";
|
|
4406
|
+
/** Filter items by processing status. */
|
|
4407
|
+
status?:
|
|
4408
|
+
| "queued"
|
|
4409
|
+
| "running"
|
|
4410
|
+
| "completed"
|
|
4411
|
+
| "error"
|
|
4412
|
+
| "skipped"
|
|
4413
|
+
| "outdated";
|
|
4414
|
+
/** Filter items by source (e.g. "builtin" or "web-crawler:https://example.com"). */
|
|
4415
|
+
source?: string;
|
|
4416
|
+
/** JSON-encoded Vectorize filter for metadata filtering. */
|
|
4417
|
+
metadata_filter?: string;
|
|
4170
4418
|
};
|
|
4171
4419
|
type AiSearchListItemsResponse = {
|
|
4172
4420
|
result: AiSearchItemInfo[];
|
|
@@ -4177,6 +4425,61 @@ type AiSearchListItemsResponse = {
|
|
|
4177
4425
|
total_count: number;
|
|
4178
4426
|
};
|
|
4179
4427
|
};
|
|
4428
|
+
// ============ AI Search Item Logs Types ============
|
|
4429
|
+
type AiSearchItemLogsParams = {
|
|
4430
|
+
/** Maximum number of log entries to return (1-100, default 50). */
|
|
4431
|
+
limit?: number;
|
|
4432
|
+
/** Opaque cursor for pagination. Pass the `cursor` value from a previous response. */
|
|
4433
|
+
cursor?: string;
|
|
4434
|
+
};
|
|
4435
|
+
type AiSearchItemLog = {
|
|
4436
|
+
timestamp: string;
|
|
4437
|
+
action: string;
|
|
4438
|
+
message: string;
|
|
4439
|
+
fileKey?: string;
|
|
4440
|
+
chunkCount?: number;
|
|
4441
|
+
processingTimeMs?: number;
|
|
4442
|
+
errorType?: string;
|
|
4443
|
+
};
|
|
4444
|
+
/** Paginated response for item processing logs (cursor-based). */
|
|
4445
|
+
type AiSearchItemLogsResponse = {
|
|
4446
|
+
result: AiSearchItemLog[];
|
|
4447
|
+
result_info: {
|
|
4448
|
+
count: number;
|
|
4449
|
+
per_page: number;
|
|
4450
|
+
cursor: string | null;
|
|
4451
|
+
truncated: boolean;
|
|
4452
|
+
};
|
|
4453
|
+
};
|
|
4454
|
+
// ============ AI Search Item Chunks Types ============
|
|
4455
|
+
type AiSearchItemChunksParams = {
|
|
4456
|
+
/** Maximum number of chunks to return (1-100, default 20). */
|
|
4457
|
+
limit?: number;
|
|
4458
|
+
/** Offset into the chunks list (default 0). */
|
|
4459
|
+
offset?: number;
|
|
4460
|
+
};
|
|
4461
|
+
/** A single indexed chunk belonging to an item, including its text content and byte range. */
|
|
4462
|
+
type AiSearchItemChunk = {
|
|
4463
|
+
id: string;
|
|
4464
|
+
text: string;
|
|
4465
|
+
start_byte: number;
|
|
4466
|
+
end_byte: number;
|
|
4467
|
+
item?: {
|
|
4468
|
+
timestamp?: number;
|
|
4469
|
+
key: string;
|
|
4470
|
+
metadata?: Record<string, unknown>;
|
|
4471
|
+
};
|
|
4472
|
+
};
|
|
4473
|
+
/** Paginated response for item chunks (offset-based). */
|
|
4474
|
+
type AiSearchItemChunksResponse = {
|
|
4475
|
+
result: AiSearchItemChunk[];
|
|
4476
|
+
result_info: {
|
|
4477
|
+
count: number;
|
|
4478
|
+
total: number;
|
|
4479
|
+
limit: number;
|
|
4480
|
+
offset: number;
|
|
4481
|
+
};
|
|
4482
|
+
};
|
|
4180
4483
|
// ============ AI Search Job Types ============
|
|
4181
4484
|
type AiSearchJobInfo = {
|
|
4182
4485
|
id: string;
|
|
@@ -4225,7 +4528,7 @@ type AiSearchJobLogsResponse = {
|
|
|
4225
4528
|
// ============ AI Search Sub-Service Classes ============
|
|
4226
4529
|
/**
|
|
4227
4530
|
* Single item service for an AI Search instance.
|
|
4228
|
-
* Provides info,
|
|
4531
|
+
* Provides info, download, sync, logs, and chunks operations on a specific item.
|
|
4229
4532
|
*/
|
|
4230
4533
|
declare abstract class AiSearchItem {
|
|
4231
4534
|
/** Get metadata about this item. */
|
|
@@ -4235,6 +4538,25 @@ declare abstract class AiSearchItem {
|
|
|
4235
4538
|
* @returns Object with body stream, content type, filename, and size.
|
|
4236
4539
|
*/
|
|
4237
4540
|
download(): Promise<AiSearchItemContentResult>;
|
|
4541
|
+
/**
|
|
4542
|
+
* Trigger re-indexing of this item.
|
|
4543
|
+
* @returns The updated item info.
|
|
4544
|
+
*/
|
|
4545
|
+
sync(): Promise<AiSearchItemInfo>;
|
|
4546
|
+
/**
|
|
4547
|
+
* Retrieve processing logs for this item (cursor-based pagination).
|
|
4548
|
+
* @param params Optional pagination parameters (limit, cursor).
|
|
4549
|
+
* @returns Paginated log entries for this item.
|
|
4550
|
+
*/
|
|
4551
|
+
logs(params?: AiSearchItemLogsParams): Promise<AiSearchItemLogsResponse>;
|
|
4552
|
+
/**
|
|
4553
|
+
* List indexed chunks for this item (offset-based pagination).
|
|
4554
|
+
* @param params Optional pagination parameters (limit, offset).
|
|
4555
|
+
* @returns Paginated chunk entries for this item.
|
|
4556
|
+
*/
|
|
4557
|
+
chunks(
|
|
4558
|
+
params?: AiSearchItemChunksParams,
|
|
4559
|
+
): Promise<AiSearchItemChunksResponse>;
|
|
4238
4560
|
}
|
|
4239
4561
|
/**
|
|
4240
4562
|
* Items collection service for an AI Search instance.
|
|
@@ -4244,49 +4566,64 @@ declare abstract class AiSearchItems {
|
|
|
4244
4566
|
/** List items in this instance. */
|
|
4245
4567
|
list(params?: AiSearchListItemsParams): Promise<AiSearchListItemsResponse>;
|
|
4246
4568
|
/**
|
|
4247
|
-
* Upload a file as an item.
|
|
4569
|
+
* Upload a file as an item. Behaves as an upsert: if an item with the same
|
|
4570
|
+
* filename already exists, it is overwritten and re-indexed.
|
|
4248
4571
|
* @param name Filename for the uploaded item.
|
|
4249
|
-
* @param content File content as a ReadableStream,
|
|
4572
|
+
* @param content File content as a ReadableStream, Blob, or string.
|
|
4250
4573
|
* @param options Optional metadata to attach to the item.
|
|
4251
4574
|
* @returns The created item info.
|
|
4252
4575
|
*/
|
|
4253
4576
|
upload(
|
|
4254
4577
|
name: string,
|
|
4255
|
-
content: ReadableStream |
|
|
4578
|
+
content: ReadableStream | Blob | string,
|
|
4256
4579
|
options?: AiSearchUploadItemOptions,
|
|
4257
4580
|
): Promise<AiSearchItemInfo>;
|
|
4258
4581
|
/**
|
|
4259
4582
|
* Upload a file and poll until processing completes.
|
|
4583
|
+
* Behaves as an upsert: if an item with the same filename already exists,
|
|
4584
|
+
* it is overwritten and re-indexed.
|
|
4260
4585
|
* @param name Filename for the uploaded item.
|
|
4261
|
-
* @param content File content as a ReadableStream,
|
|
4262
|
-
* @param options Optional metadata
|
|
4586
|
+
* @param content File content as a ReadableStream, Blob, or string.
|
|
4587
|
+
* @param options Optional metadata and polling configuration.
|
|
4263
4588
|
* @returns The item info after processing completes (or timeout).
|
|
4264
4589
|
*/
|
|
4265
4590
|
uploadAndPoll(
|
|
4266
4591
|
name: string,
|
|
4267
|
-
content: ReadableStream |
|
|
4268
|
-
options?: AiSearchUploadItemOptions
|
|
4592
|
+
content: ReadableStream | Blob | string,
|
|
4593
|
+
options?: AiSearchUploadItemOptions & {
|
|
4594
|
+
/** Polling interval in milliseconds (default 1000). */
|
|
4595
|
+
pollIntervalMs?: number;
|
|
4596
|
+
/** Maximum time to wait in milliseconds (default 30000). */
|
|
4597
|
+
timeoutMs?: number;
|
|
4598
|
+
},
|
|
4269
4599
|
): Promise<AiSearchItemInfo>;
|
|
4270
4600
|
/**
|
|
4271
4601
|
* Get an item by ID.
|
|
4272
4602
|
* @param itemId The item identifier.
|
|
4273
|
-
* @returns Item service for info,
|
|
4603
|
+
* @returns Item service for info, download, sync, logs, and chunks operations.
|
|
4274
4604
|
*/
|
|
4275
4605
|
get(itemId: string): AiSearchItem;
|
|
4276
|
-
/**
|
|
4606
|
+
/**
|
|
4607
|
+
* Delete an item from the instance.
|
|
4277
4608
|
* @param itemId The item identifier.
|
|
4278
4609
|
*/
|
|
4279
4610
|
delete(itemId: string): Promise<void>;
|
|
4280
4611
|
}
|
|
4281
4612
|
/**
|
|
4282
4613
|
* Single job service for an AI Search instance.
|
|
4283
|
-
* Provides info and
|
|
4614
|
+
* Provides info, logs, and cancel operations for a specific job.
|
|
4284
4615
|
*/
|
|
4285
4616
|
declare abstract class AiSearchJob {
|
|
4286
4617
|
/** Get metadata about this job. */
|
|
4287
4618
|
info(): Promise<AiSearchJobInfo>;
|
|
4288
4619
|
/** Get logs for this job. */
|
|
4289
4620
|
logs(params?: AiSearchJobLogsParams): Promise<AiSearchJobLogsResponse>;
|
|
4621
|
+
/**
|
|
4622
|
+
* Cancel a running job.
|
|
4623
|
+
* @returns The updated job info.
|
|
4624
|
+
* @throws AiSearchNotFoundError if the job does not exist.
|
|
4625
|
+
*/
|
|
4626
|
+
cancel(): Promise<AiSearchJobInfo>;
|
|
4290
4627
|
}
|
|
4291
4628
|
/**
|
|
4292
4629
|
* Jobs collection service for an AI Search instance.
|
|
@@ -4304,7 +4641,7 @@ declare abstract class AiSearchJobs {
|
|
|
4304
4641
|
/**
|
|
4305
4642
|
* Get a job by ID.
|
|
4306
4643
|
* @param jobId The job identifier.
|
|
4307
|
-
* @returns Job service for info and
|
|
4644
|
+
* @returns Job service for info, logs, and cancel operations.
|
|
4308
4645
|
*/
|
|
4309
4646
|
get(jobId: string): AiSearchJob;
|
|
4310
4647
|
}
|
|
@@ -4323,7 +4660,7 @@ declare abstract class AiSearchJobs {
|
|
|
4323
4660
|
* // Via namespace binding
|
|
4324
4661
|
* const instance = env.AI_SEARCH.get("blog");
|
|
4325
4662
|
* const results = await instance.search({
|
|
4326
|
-
*
|
|
4663
|
+
* query: "How does caching work?",
|
|
4327
4664
|
* });
|
|
4328
4665
|
*
|
|
4329
4666
|
* // Via single instance binding
|
|
@@ -4335,7 +4672,7 @@ declare abstract class AiSearchJobs {
|
|
|
4335
4672
|
declare abstract class AiSearchInstance {
|
|
4336
4673
|
/**
|
|
4337
4674
|
* Search the AI Search instance for relevant chunks.
|
|
4338
|
-
* @param params Search request with messages and optional AI search options.
|
|
4675
|
+
* @param params Search request with query or messages and optional AI search options.
|
|
4339
4676
|
* @returns Search response with matching chunks and search query.
|
|
4340
4677
|
*/
|
|
4341
4678
|
search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>;
|
|
@@ -4367,7 +4704,7 @@ declare abstract class AiSearchInstance {
|
|
|
4367
4704
|
info(): Promise<AiSearchInstanceInfo>;
|
|
4368
4705
|
/**
|
|
4369
4706
|
* Get instance statistics (item count, indexing status, etc.).
|
|
4370
|
-
* @returns Statistics with counts per status
|
|
4707
|
+
* @returns Statistics with counts per status, last activity time, and engine details.
|
|
4371
4708
|
*/
|
|
4372
4709
|
stats(): Promise<AiSearchStatsResponse>;
|
|
4373
4710
|
/** Items collection — list, upload, and manage items in this instance. */
|
|
@@ -4379,27 +4716,30 @@ declare abstract class AiSearchInstance {
|
|
|
4379
4716
|
* Namespace-level AI Search service.
|
|
4380
4717
|
*
|
|
4381
4718
|
* Used as the type of `env.AI_SEARCH` (namespace binding via `ai_search_namespaces`).
|
|
4382
|
-
* Scoped to a single namespace. Provides dynamic instance access, creation,
|
|
4719
|
+
* Scoped to a single namespace. Provides dynamic instance access, creation, deletion,
|
|
4720
|
+
* and multi-instance search/chat operations.
|
|
4383
4721
|
*
|
|
4384
4722
|
* @example
|
|
4385
4723
|
* ```ts
|
|
4386
4724
|
* // Access an instance within the namespace
|
|
4387
4725
|
* const blog = env.AI_SEARCH.get("blog");
|
|
4388
|
-
* const results = await blog.search({
|
|
4389
|
-
* messages: [{ role: "user", content: "How does caching work?" }],
|
|
4390
|
-
* });
|
|
4726
|
+
* const results = await blog.search({ query: "How does caching work?" });
|
|
4391
4727
|
*
|
|
4392
4728
|
* // List all instances in the namespace
|
|
4393
4729
|
* const instances = await env.AI_SEARCH.list();
|
|
4394
4730
|
*
|
|
4395
4731
|
* // Create a new instance with built-in storage
|
|
4396
|
-
* const tenant = await env.AI_SEARCH.create({
|
|
4397
|
-
* id: "tenant-123",
|
|
4398
|
-
* });
|
|
4732
|
+
* const tenant = await env.AI_SEARCH.create({ id: "tenant-123" });
|
|
4399
4733
|
*
|
|
4400
4734
|
* // Upload items into the instance
|
|
4401
4735
|
* await tenant.items.upload("doc.pdf", fileContent);
|
|
4402
4736
|
*
|
|
4737
|
+
* // Search across multiple instances
|
|
4738
|
+
* const multi = await env.AI_SEARCH.search({
|
|
4739
|
+
* query: "caching",
|
|
4740
|
+
* ai_search_options: { instance_ids: ["blog", "docs"] },
|
|
4741
|
+
* });
|
|
4742
|
+
*
|
|
4403
4743
|
* // Delete an instance
|
|
4404
4744
|
* await env.AI_SEARCH.delete("tenant-123");
|
|
4405
4745
|
* ```
|
|
@@ -4412,10 +4752,11 @@ declare abstract class AiSearchNamespace {
|
|
|
4412
4752
|
*/
|
|
4413
4753
|
get(name: string): AiSearchInstance;
|
|
4414
4754
|
/**
|
|
4415
|
-
* List
|
|
4416
|
-
* @
|
|
4755
|
+
* List instances in the bound namespace.
|
|
4756
|
+
* @param params Optional pagination, search, and ordering parameters.
|
|
4757
|
+
* @returns Array of instance metadata with pagination info.
|
|
4417
4758
|
*/
|
|
4418
|
-
list(): Promise<AiSearchListResponse>;
|
|
4759
|
+
list(params?: AiSearchListInstancesParams): Promise<AiSearchListResponse>;
|
|
4419
4760
|
/**
|
|
4420
4761
|
* Create a new instance within the bound namespace.
|
|
4421
4762
|
* @param config Instance configuration. Only `id` is required — omit `type` and `source` to create with built-in storage.
|
|
@@ -4440,6 +4781,35 @@ declare abstract class AiSearchNamespace {
|
|
|
4440
4781
|
* @param name Instance name to delete.
|
|
4441
4782
|
*/
|
|
4442
4783
|
delete(name: string): Promise<void>;
|
|
4784
|
+
/**
|
|
4785
|
+
* Search across multiple instances within the bound namespace.
|
|
4786
|
+
* Fans out to the specified instance_ids and merges results.
|
|
4787
|
+
* @param params Search request with required `ai_search_options.instance_ids`.
|
|
4788
|
+
* @returns Search response with chunks tagged by instance_id and optional partial-failure errors.
|
|
4789
|
+
*/
|
|
4790
|
+
search(
|
|
4791
|
+
params: AiSearchMultiSearchRequest,
|
|
4792
|
+
): Promise<AiSearchMultiSearchResponse>;
|
|
4793
|
+
/**
|
|
4794
|
+
* Generate chat completions across multiple instances within the bound namespace (streaming).
|
|
4795
|
+
* Fans out to the specified instance_ids, merges context, and generates a response.
|
|
4796
|
+
* @param params Chat completions request with stream: true and required `ai_search_options.instance_ids`.
|
|
4797
|
+
* @returns ReadableStream of server-sent events.
|
|
4798
|
+
*/
|
|
4799
|
+
chatCompletions(
|
|
4800
|
+
params: AiSearchMultiChatCompletionsRequest & {
|
|
4801
|
+
stream: true;
|
|
4802
|
+
},
|
|
4803
|
+
): Promise<ReadableStream>;
|
|
4804
|
+
/**
|
|
4805
|
+
* Generate chat completions across multiple instances within the bound namespace.
|
|
4806
|
+
* Fans out to the specified instance_ids, merges context, and generates a response.
|
|
4807
|
+
* @param params Chat completions request with required `ai_search_options.instance_ids`.
|
|
4808
|
+
* @returns Chat completion response with choices, chunks tagged by instance_id, and optional partial-failure errors.
|
|
4809
|
+
*/
|
|
4810
|
+
chatCompletions(
|
|
4811
|
+
params: AiSearchMultiChatCompletionsRequest,
|
|
4812
|
+
): Promise<AiSearchMultiChatCompletionsResponse>;
|
|
4443
4813
|
}
|
|
4444
4814
|
type AiImageClassificationInput = {
|
|
4445
4815
|
image: number[];
|
|
@@ -12091,8 +12461,8 @@ declare module "cloudflare:email" {
|
|
|
12091
12461
|
* Evaluation context for targeting rules.
|
|
12092
12462
|
* Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
|
|
12093
12463
|
*/
|
|
12094
|
-
type
|
|
12095
|
-
interface
|
|
12464
|
+
type FlagshipEvaluationContext = Record<string, string | number | boolean>;
|
|
12465
|
+
interface FlagshipEvaluationDetails<T> {
|
|
12096
12466
|
flagKey: string;
|
|
12097
12467
|
value: T;
|
|
12098
12468
|
variant?: string | undefined;
|
|
@@ -12100,7 +12470,7 @@ interface EvaluationDetails<T> {
|
|
|
12100
12470
|
errorCode?: string | undefined;
|
|
12101
12471
|
errorMessage?: string | undefined;
|
|
12102
12472
|
}
|
|
12103
|
-
interface
|
|
12473
|
+
interface FlagshipEvaluationError extends Error {}
|
|
12104
12474
|
/**
|
|
12105
12475
|
* Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
|
|
12106
12476
|
*
|
|
@@ -12120,7 +12490,7 @@ interface FlagEvaluationError extends Error {}
|
|
|
12120
12490
|
* console.log(details.variant, details.reason);
|
|
12121
12491
|
* ```
|
|
12122
12492
|
*/
|
|
12123
|
-
declare abstract class
|
|
12493
|
+
declare abstract class Flagship {
|
|
12124
12494
|
/**
|
|
12125
12495
|
* Get a flag value without type checking.
|
|
12126
12496
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12130,7 +12500,7 @@ declare abstract class Flags {
|
|
|
12130
12500
|
get(
|
|
12131
12501
|
flagKey: string,
|
|
12132
12502
|
defaultValue?: unknown,
|
|
12133
|
-
context?:
|
|
12503
|
+
context?: FlagshipEvaluationContext,
|
|
12134
12504
|
): Promise<unknown>;
|
|
12135
12505
|
/**
|
|
12136
12506
|
* Get a boolean flag value.
|
|
@@ -12141,7 +12511,7 @@ declare abstract class Flags {
|
|
|
12141
12511
|
getBooleanValue(
|
|
12142
12512
|
flagKey: string,
|
|
12143
12513
|
defaultValue: boolean,
|
|
12144
|
-
context?:
|
|
12514
|
+
context?: FlagshipEvaluationContext,
|
|
12145
12515
|
): Promise<boolean>;
|
|
12146
12516
|
/**
|
|
12147
12517
|
* Get a string flag value.
|
|
@@ -12152,7 +12522,7 @@ declare abstract class Flags {
|
|
|
12152
12522
|
getStringValue(
|
|
12153
12523
|
flagKey: string,
|
|
12154
12524
|
defaultValue: string,
|
|
12155
|
-
context?:
|
|
12525
|
+
context?: FlagshipEvaluationContext,
|
|
12156
12526
|
): Promise<string>;
|
|
12157
12527
|
/**
|
|
12158
12528
|
* Get a number flag value.
|
|
@@ -12163,7 +12533,7 @@ declare abstract class Flags {
|
|
|
12163
12533
|
getNumberValue(
|
|
12164
12534
|
flagKey: string,
|
|
12165
12535
|
defaultValue: number,
|
|
12166
|
-
context?:
|
|
12536
|
+
context?: FlagshipEvaluationContext,
|
|
12167
12537
|
): Promise<number>;
|
|
12168
12538
|
/**
|
|
12169
12539
|
* Get an object flag value.
|
|
@@ -12174,7 +12544,7 @@ declare abstract class Flags {
|
|
|
12174
12544
|
getObjectValue<T extends object>(
|
|
12175
12545
|
flagKey: string,
|
|
12176
12546
|
defaultValue: T,
|
|
12177
|
-
context?:
|
|
12547
|
+
context?: FlagshipEvaluationContext,
|
|
12178
12548
|
): Promise<T>;
|
|
12179
12549
|
/**
|
|
12180
12550
|
* Get a boolean flag value with full evaluation details.
|
|
@@ -12185,8 +12555,8 @@ declare abstract class Flags {
|
|
|
12185
12555
|
getBooleanDetails(
|
|
12186
12556
|
flagKey: string,
|
|
12187
12557
|
defaultValue: boolean,
|
|
12188
|
-
context?:
|
|
12189
|
-
): Promise<
|
|
12558
|
+
context?: FlagshipEvaluationContext,
|
|
12559
|
+
): Promise<FlagshipEvaluationDetails<boolean>>;
|
|
12190
12560
|
/**
|
|
12191
12561
|
* Get a string flag value with full evaluation details.
|
|
12192
12562
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12196,8 +12566,8 @@ declare abstract class Flags {
|
|
|
12196
12566
|
getStringDetails(
|
|
12197
12567
|
flagKey: string,
|
|
12198
12568
|
defaultValue: string,
|
|
12199
|
-
context?:
|
|
12200
|
-
): Promise<
|
|
12569
|
+
context?: FlagshipEvaluationContext,
|
|
12570
|
+
): Promise<FlagshipEvaluationDetails<string>>;
|
|
12201
12571
|
/**
|
|
12202
12572
|
* Get a number flag value with full evaluation details.
|
|
12203
12573
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12207,8 +12577,8 @@ declare abstract class Flags {
|
|
|
12207
12577
|
getNumberDetails(
|
|
12208
12578
|
flagKey: string,
|
|
12209
12579
|
defaultValue: number,
|
|
12210
|
-
context?:
|
|
12211
|
-
): Promise<
|
|
12580
|
+
context?: FlagshipEvaluationContext,
|
|
12581
|
+
): Promise<FlagshipEvaluationDetails<number>>;
|
|
12212
12582
|
/**
|
|
12213
12583
|
* Get an object flag value with full evaluation details.
|
|
12214
12584
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12218,8 +12588,8 @@ declare abstract class Flags {
|
|
|
12218
12588
|
getObjectDetails<T extends object>(
|
|
12219
12589
|
flagKey: string,
|
|
12220
12590
|
defaultValue: T,
|
|
12221
|
-
context?:
|
|
12222
|
-
): Promise<
|
|
12591
|
+
context?: FlagshipEvaluationContext,
|
|
12592
|
+
): Promise<FlagshipEvaluationDetails<T>>;
|
|
12223
12593
|
}
|
|
12224
12594
|
/**
|
|
12225
12595
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|