@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/2022-08-04/index.d.ts
CHANGED
|
@@ -2319,11 +2319,34 @@ interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
2319
2319
|
}
|
|
2320
2320
|
type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
2321
2321
|
interface Queue<Body = unknown> {
|
|
2322
|
-
|
|
2322
|
+
metrics(): Promise<QueueMetrics>;
|
|
2323
|
+
send(message: Body, options?: QueueSendOptions): Promise<QueueSendResponse>;
|
|
2323
2324
|
sendBatch(
|
|
2324
2325
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
2325
2326
|
options?: QueueSendBatchOptions,
|
|
2326
|
-
): Promise<
|
|
2327
|
+
): Promise<QueueSendBatchResponse>;
|
|
2328
|
+
}
|
|
2329
|
+
interface QueueSendMetrics {
|
|
2330
|
+
backlogCount: number;
|
|
2331
|
+
backlogBytes: number;
|
|
2332
|
+
oldestMessageTimestamp?: Date;
|
|
2333
|
+
}
|
|
2334
|
+
interface QueueSendMetadata {
|
|
2335
|
+
metrics: QueueSendMetrics;
|
|
2336
|
+
}
|
|
2337
|
+
interface QueueSendResponse {
|
|
2338
|
+
metadata: QueueSendMetadata;
|
|
2339
|
+
}
|
|
2340
|
+
interface QueueSendBatchMetrics {
|
|
2341
|
+
backlogCount: number;
|
|
2342
|
+
backlogBytes: number;
|
|
2343
|
+
oldestMessageTimestamp?: Date;
|
|
2344
|
+
}
|
|
2345
|
+
interface QueueSendBatchMetadata {
|
|
2346
|
+
metrics: QueueSendBatchMetrics;
|
|
2347
|
+
}
|
|
2348
|
+
interface QueueSendBatchResponse {
|
|
2349
|
+
metadata: QueueSendBatchMetadata;
|
|
2327
2350
|
}
|
|
2328
2351
|
interface QueueSendOptions {
|
|
2329
2352
|
contentType?: QueueContentType;
|
|
@@ -2337,6 +2360,19 @@ interface MessageSendRequest<Body = unknown> {
|
|
|
2337
2360
|
contentType?: QueueContentType;
|
|
2338
2361
|
delaySeconds?: number;
|
|
2339
2362
|
}
|
|
2363
|
+
interface QueueMetrics {
|
|
2364
|
+
backlogCount: number;
|
|
2365
|
+
backlogBytes: number;
|
|
2366
|
+
oldestMessageTimestamp?: Date;
|
|
2367
|
+
}
|
|
2368
|
+
interface MessageBatchMetrics {
|
|
2369
|
+
backlogCount: number;
|
|
2370
|
+
backlogBytes: number;
|
|
2371
|
+
oldestMessageTimestamp?: Date;
|
|
2372
|
+
}
|
|
2373
|
+
interface MessageBatchMetadata {
|
|
2374
|
+
metrics: MessageBatchMetrics;
|
|
2375
|
+
}
|
|
2340
2376
|
interface QueueRetryOptions {
|
|
2341
2377
|
delaySeconds?: number;
|
|
2342
2378
|
}
|
|
@@ -2351,12 +2387,14 @@ interface Message<Body = unknown> {
|
|
|
2351
2387
|
interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
2352
2388
|
readonly messages: readonly Message<Body>[];
|
|
2353
2389
|
readonly queue: string;
|
|
2390
|
+
readonly metadata: MessageBatchMetadata;
|
|
2354
2391
|
retryAll(options?: QueueRetryOptions): void;
|
|
2355
2392
|
ackAll(): void;
|
|
2356
2393
|
}
|
|
2357
2394
|
interface MessageBatch<Body = unknown> {
|
|
2358
2395
|
readonly messages: readonly Message<Body>[];
|
|
2359
2396
|
readonly queue: string;
|
|
2397
|
+
readonly metadata: MessageBatchMetadata;
|
|
2360
2398
|
retryAll(options?: QueueRetryOptions): void;
|
|
2361
2399
|
ackAll(): void;
|
|
2362
2400
|
}
|
|
@@ -3954,73 +3992,145 @@ declare abstract class Performance {
|
|
|
3954
3992
|
// ============ AI Search Error Interfaces ============
|
|
3955
3993
|
interface AiSearchInternalError extends Error {}
|
|
3956
3994
|
interface AiSearchNotFoundError extends Error {}
|
|
3957
|
-
// ============ AI Search
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3995
|
+
// ============ AI Search Common Types ============
|
|
3996
|
+
/** A single message in a conversation-style search or chat request. */
|
|
3997
|
+
type AiSearchMessage = {
|
|
3998
|
+
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
3999
|
+
content: string | null;
|
|
4000
|
+
};
|
|
4001
|
+
/**
|
|
4002
|
+
* Common shape for `ai_search_options` used by both single-instance and multi-instance requests.
|
|
4003
|
+
* Contains retrieval, query rewrite, reranking, and cache sub-options.
|
|
4004
|
+
*/
|
|
4005
|
+
type AiSearchOptions = {
|
|
4006
|
+
retrieval?: {
|
|
4007
|
+
/** Which retrieval backend to use. Defaults to the instance's configured index_method. */
|
|
4008
|
+
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4009
|
+
/** Fusion method for combining vector + keyword results. */
|
|
4010
|
+
fusion_method?: "max" | "rrf";
|
|
4011
|
+
/** How keyword terms are combined: "and" = all terms must match, "or" = any term matches. */
|
|
4012
|
+
keyword_match_mode?: "and" | "or";
|
|
4013
|
+
/** Minimum similarity score (0-1) for a result to be included. Default 0.4. */
|
|
4014
|
+
match_threshold?: number;
|
|
4015
|
+
/** Maximum number of results to return (1-50). Default 10. */
|
|
4016
|
+
max_num_results?: number;
|
|
4017
|
+
/** Vectorize metadata filters applied to the search. */
|
|
4018
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
4019
|
+
/** Number of surrounding chunks to include for context (0-3). Default 0. */
|
|
4020
|
+
context_expansion?: number;
|
|
4021
|
+
/** If true, return only item metadata without chunk text. */
|
|
4022
|
+
metadata_only?: boolean;
|
|
4023
|
+
/** If true (default), return empty results on retrieval failure instead of throwing. */
|
|
4024
|
+
return_on_failure?: boolean;
|
|
4025
|
+
/** Boost results by metadata field values. Max 3 entries. */
|
|
4026
|
+
boost_by?: Array<{
|
|
4027
|
+
field: string;
|
|
4028
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4029
|
+
}>;
|
|
4030
|
+
[key: string]: unknown;
|
|
4031
|
+
};
|
|
4032
|
+
query_rewrite?: {
|
|
4033
|
+
enabled?: boolean;
|
|
4034
|
+
model?: string;
|
|
4035
|
+
rewrite_prompt?: string;
|
|
4036
|
+
[key: string]: unknown;
|
|
4037
|
+
};
|
|
4038
|
+
reranking?: {
|
|
4039
|
+
enabled?: boolean;
|
|
4040
|
+
model?: string;
|
|
4041
|
+
/** Match threshold (0-1, default 0.4) */
|
|
4042
|
+
match_threshold?: number;
|
|
3988
4043
|
[key: string]: unknown;
|
|
3989
4044
|
};
|
|
4045
|
+
cache?: {
|
|
4046
|
+
enabled?: boolean;
|
|
4047
|
+
cache_threshold?:
|
|
4048
|
+
| "super_strict_match"
|
|
4049
|
+
| "close_enough"
|
|
4050
|
+
| "flexible_friend"
|
|
4051
|
+
| "anything_goes";
|
|
4052
|
+
};
|
|
4053
|
+
[key: string]: unknown;
|
|
3990
4054
|
};
|
|
4055
|
+
// ============ AI Search Request Types ============
|
|
4056
|
+
/**
|
|
4057
|
+
* Request body for single-instance search.
|
|
4058
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
4059
|
+
*/
|
|
4060
|
+
type AiSearchSearchRequest =
|
|
4061
|
+
| {
|
|
4062
|
+
/** Simple query string. */
|
|
4063
|
+
query: string;
|
|
4064
|
+
messages?: never;
|
|
4065
|
+
ai_search_options?: AiSearchOptions;
|
|
4066
|
+
}
|
|
4067
|
+
| {
|
|
4068
|
+
query?: never;
|
|
4069
|
+
/** Conversation-style input. At least one user message with non-empty content is required. */
|
|
4070
|
+
messages: AiSearchMessage[];
|
|
4071
|
+
ai_search_options?: AiSearchOptions;
|
|
4072
|
+
};
|
|
3991
4073
|
type AiSearchChatCompletionsRequest = {
|
|
3992
|
-
messages:
|
|
3993
|
-
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
3994
|
-
content: string | null;
|
|
3995
|
-
[key: string]: unknown;
|
|
3996
|
-
}>;
|
|
4074
|
+
messages: AiSearchMessage[];
|
|
3997
4075
|
model?: string;
|
|
3998
4076
|
stream?: boolean;
|
|
3999
|
-
ai_search_options?:
|
|
4000
|
-
retrieval?: {
|
|
4001
|
-
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4002
|
-
match_threshold?: number;
|
|
4003
|
-
max_num_results?: number;
|
|
4004
|
-
filters?: VectorizeVectorMetadataFilter;
|
|
4005
|
-
context_expansion?: number;
|
|
4006
|
-
[key: string]: unknown;
|
|
4007
|
-
};
|
|
4008
|
-
query_rewrite?: {
|
|
4009
|
-
enabled?: boolean;
|
|
4010
|
-
model?: string;
|
|
4011
|
-
rewrite_prompt?: string;
|
|
4012
|
-
[key: string]: unknown;
|
|
4013
|
-
};
|
|
4014
|
-
reranking?: {
|
|
4015
|
-
enabled?: boolean;
|
|
4016
|
-
model?: "@cf/baai/bge-reranker-base" | string;
|
|
4017
|
-
match_threshold?: number;
|
|
4018
|
-
[key: string]: unknown;
|
|
4019
|
-
};
|
|
4020
|
-
[key: string]: unknown;
|
|
4021
|
-
};
|
|
4077
|
+
ai_search_options?: AiSearchOptions;
|
|
4022
4078
|
[key: string]: unknown;
|
|
4023
4079
|
};
|
|
4080
|
+
// ============ AI Search Multi-Instance Types (Namespace-Scoped) ============
|
|
4081
|
+
/** `ai_search_options` shape for multi-instance requests — requires `instance_ids`. */
|
|
4082
|
+
type AiSearchMultiSearchOptions = AiSearchOptions & {
|
|
4083
|
+
/** Instance IDs to search across (1-10). */
|
|
4084
|
+
instance_ids: string[];
|
|
4085
|
+
};
|
|
4086
|
+
/**
|
|
4087
|
+
* Request for searching across multiple instances within a namespace.
|
|
4088
|
+
* `ai_search_options` is required and must include `instance_ids`.
|
|
4089
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
4090
|
+
*/
|
|
4091
|
+
type AiSearchMultiSearchRequest =
|
|
4092
|
+
| {
|
|
4093
|
+
/** Simple query string. */
|
|
4094
|
+
query: string;
|
|
4095
|
+
messages?: never;
|
|
4096
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4097
|
+
}
|
|
4098
|
+
| {
|
|
4099
|
+
query?: never;
|
|
4100
|
+
/** Conversation-style input. */
|
|
4101
|
+
messages: AiSearchMessage[];
|
|
4102
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4103
|
+
};
|
|
4104
|
+
/** A search result chunk tagged with the instance it originated from. */
|
|
4105
|
+
type AiSearchMultiSearchChunk = AiSearchSearchResponse["chunks"][number] & {
|
|
4106
|
+
instance_id: string;
|
|
4107
|
+
};
|
|
4108
|
+
/** Describes a per-instance error during a multi-instance operation. */
|
|
4109
|
+
type AiSearchMultiSearchError = {
|
|
4110
|
+
instance_id: string;
|
|
4111
|
+
message: string;
|
|
4112
|
+
};
|
|
4113
|
+
/** Response from a multi-instance search, with chunks tagged by instance and optional partial-failure errors. */
|
|
4114
|
+
type AiSearchMultiSearchResponse = {
|
|
4115
|
+
search_query: string;
|
|
4116
|
+
chunks: AiSearchMultiSearchChunk[];
|
|
4117
|
+
errors?: AiSearchMultiSearchError[];
|
|
4118
|
+
};
|
|
4119
|
+
/** Request for chat completions across multiple instances within a namespace. `ai_search_options` is required and must include `instance_ids`. */
|
|
4120
|
+
type AiSearchMultiChatCompletionsRequest = Omit<
|
|
4121
|
+
AiSearchChatCompletionsRequest,
|
|
4122
|
+
"ai_search_options"
|
|
4123
|
+
> & {
|
|
4124
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4125
|
+
};
|
|
4126
|
+
/** Response from multi-instance chat completions, with chunks tagged by instance and optional partial-failure errors. */
|
|
4127
|
+
type AiSearchMultiChatCompletionsResponse = Omit<
|
|
4128
|
+
AiSearchChatCompletionsResponse,
|
|
4129
|
+
"chunks"
|
|
4130
|
+
> & {
|
|
4131
|
+
chunks: AiSearchMultiSearchChunk[];
|
|
4132
|
+
errors?: AiSearchMultiSearchError[];
|
|
4133
|
+
};
|
|
4024
4134
|
// ============ AI Search Response Types ============
|
|
4025
4135
|
type AiSearchSearchResponse = {
|
|
4026
4136
|
search_query: string;
|
|
@@ -4040,6 +4150,14 @@ type AiSearchSearchResponse = {
|
|
|
4040
4150
|
keyword_score?: number;
|
|
4041
4151
|
/** Vector similarity score (0-1) */
|
|
4042
4152
|
vector_score?: number;
|
|
4153
|
+
/** Keyword rank position */
|
|
4154
|
+
keyword_rank?: number;
|
|
4155
|
+
/** Vector rank position */
|
|
4156
|
+
vector_rank?: number;
|
|
4157
|
+
/** Reranking model score */
|
|
4158
|
+
reranking_score?: number;
|
|
4159
|
+
/** Fusion method used to combine results */
|
|
4160
|
+
fusion_method?: "rrf" | "max";
|
|
4043
4161
|
[key: string]: unknown;
|
|
4044
4162
|
};
|
|
4045
4163
|
}>;
|
|
@@ -4068,19 +4186,88 @@ type AiSearchStatsResponse = {
|
|
|
4068
4186
|
skipped?: number;
|
|
4069
4187
|
outdated?: number;
|
|
4070
4188
|
last_activity?: string;
|
|
4189
|
+
/** Storage engine statistics. */
|
|
4190
|
+
engine?: {
|
|
4191
|
+
vectorize?: {
|
|
4192
|
+
vectorsCount: number;
|
|
4193
|
+
dimensions: number;
|
|
4194
|
+
};
|
|
4195
|
+
r2?: {
|
|
4196
|
+
payloadSizeBytes: number;
|
|
4197
|
+
metadataSizeBytes: number;
|
|
4198
|
+
objectCount: number;
|
|
4199
|
+
};
|
|
4200
|
+
};
|
|
4071
4201
|
};
|
|
4072
4202
|
// ============ AI Search Instance Info Types ============
|
|
4073
4203
|
type AiSearchInstanceInfo = {
|
|
4074
4204
|
id: string;
|
|
4075
4205
|
type?: "r2" | "web-crawler" | string;
|
|
4076
4206
|
source?: string;
|
|
4207
|
+
source_params?: unknown;
|
|
4077
4208
|
paused?: boolean;
|
|
4078
4209
|
status?: string;
|
|
4079
4210
|
namespace?: string;
|
|
4080
4211
|
created_at?: string;
|
|
4081
4212
|
modified_at?: string;
|
|
4213
|
+
token_id?: string;
|
|
4214
|
+
ai_gateway_id?: string;
|
|
4215
|
+
rewrite_query?: boolean;
|
|
4216
|
+
reranking?: boolean;
|
|
4217
|
+
embedding_model?: string;
|
|
4218
|
+
ai_search_model?: string;
|
|
4219
|
+
rewrite_model?: string;
|
|
4220
|
+
reranking_model?: string;
|
|
4221
|
+
/** @deprecated Use index_method instead. */
|
|
4222
|
+
hybrid_search_enabled?: boolean;
|
|
4223
|
+
/** Controls which storage backends are active. */
|
|
4224
|
+
index_method?: {
|
|
4225
|
+
vector?: boolean;
|
|
4226
|
+
keyword?: boolean;
|
|
4227
|
+
};
|
|
4228
|
+
/** Fusion method for combining vector and keyword results. */
|
|
4229
|
+
fusion_method?: "max" | "rrf";
|
|
4230
|
+
indexing_options?: {
|
|
4231
|
+
keyword_tokenizer?: "porter" | "trigram";
|
|
4232
|
+
} | null;
|
|
4233
|
+
retrieval_options?: {
|
|
4234
|
+
keyword_match_mode?: "and" | "or";
|
|
4235
|
+
boost_by?: Array<{
|
|
4236
|
+
field: string;
|
|
4237
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4238
|
+
}>;
|
|
4239
|
+
} | null;
|
|
4240
|
+
chunk?: boolean;
|
|
4241
|
+
chunk_size?: number;
|
|
4242
|
+
chunk_overlap?: number;
|
|
4243
|
+
score_threshold?: number;
|
|
4244
|
+
max_num_results?: number;
|
|
4245
|
+
cache?: boolean;
|
|
4246
|
+
cache_threshold?:
|
|
4247
|
+
| "super_strict_match"
|
|
4248
|
+
| "close_enough"
|
|
4249
|
+
| "flexible_friend"
|
|
4250
|
+
| "anything_goes";
|
|
4251
|
+
custom_metadata?: Array<{
|
|
4252
|
+
field_name: string;
|
|
4253
|
+
data_type: "text" | "number" | "boolean" | "datetime";
|
|
4254
|
+
}>;
|
|
4255
|
+
/** Sync interval in seconds. */
|
|
4256
|
+
sync_interval?: 3600 | 7200 | 14400 | 21600 | 43200 | 86400;
|
|
4257
|
+
metadata?: Record<string, unknown>;
|
|
4082
4258
|
[key: string]: unknown;
|
|
4083
4259
|
};
|
|
4260
|
+
/** Pagination, search, and ordering parameters for listing instances within a namespace. */
|
|
4261
|
+
type AiSearchListInstancesParams = {
|
|
4262
|
+
page?: number;
|
|
4263
|
+
per_page?: number;
|
|
4264
|
+
/** Search instances by ID. */
|
|
4265
|
+
search?: string;
|
|
4266
|
+
/** Field to sort by. */
|
|
4267
|
+
order_by?: "created_at";
|
|
4268
|
+
/** Sort direction. */
|
|
4269
|
+
order_by_direction?: "asc" | "desc";
|
|
4270
|
+
};
|
|
4084
4271
|
type AiSearchListResponse = {
|
|
4085
4272
|
result: AiSearchInstanceInfo[];
|
|
4086
4273
|
result_info?: {
|
|
@@ -4108,19 +4295,64 @@ type AiSearchConfig = {
|
|
|
4108
4295
|
reranking?: boolean;
|
|
4109
4296
|
embedding_model?: string;
|
|
4110
4297
|
ai_search_model?: string;
|
|
4298
|
+
rewrite_model?: string;
|
|
4299
|
+
reranking_model?: string;
|
|
4300
|
+
/** @deprecated Use index_method instead. */
|
|
4301
|
+
hybrid_search_enabled?: boolean;
|
|
4302
|
+
/** Controls which storage backends are used during indexing. Defaults to vector-only. */
|
|
4303
|
+
index_method?: {
|
|
4304
|
+
vector?: boolean;
|
|
4305
|
+
keyword?: boolean;
|
|
4306
|
+
};
|
|
4307
|
+
/** Fusion method for combining vector and keyword results. "rrf" = reciprocal rank fusion (default), "max" = maximum score. */
|
|
4308
|
+
fusion_method?: "max" | "rrf";
|
|
4309
|
+
indexing_options?: {
|
|
4310
|
+
keyword_tokenizer?: "porter" | "trigram";
|
|
4311
|
+
} | null;
|
|
4312
|
+
retrieval_options?: {
|
|
4313
|
+
keyword_match_mode?: "and" | "or";
|
|
4314
|
+
boost_by?: Array<{
|
|
4315
|
+
field: string;
|
|
4316
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4317
|
+
}>;
|
|
4318
|
+
} | null;
|
|
4319
|
+
chunk?: boolean;
|
|
4320
|
+
chunk_size?: number;
|
|
4321
|
+
chunk_overlap?: number;
|
|
4322
|
+
/** Minimum similarity score (0-1) for a result to be included. */
|
|
4323
|
+
score_threshold?: number;
|
|
4324
|
+
max_num_results?: number;
|
|
4325
|
+
cache?: boolean;
|
|
4326
|
+
/** Similarity threshold for cache hits. Stricter = fewer cache hits but higher relevance. */
|
|
4327
|
+
cache_threshold?:
|
|
4328
|
+
| "super_strict_match"
|
|
4329
|
+
| "close_enough"
|
|
4330
|
+
| "flexible_friend"
|
|
4331
|
+
| "anything_goes";
|
|
4332
|
+
custom_metadata?: Array<{
|
|
4333
|
+
field_name: string;
|
|
4334
|
+
data_type: "text" | "number" | "boolean" | "datetime";
|
|
4335
|
+
}>;
|
|
4336
|
+
namespace?: string;
|
|
4337
|
+
/** Sync interval in seconds. 3600=1h, 7200=2h, 14400=4h, 21600=6h, 43200=12h, 86400=24h. */
|
|
4338
|
+
sync_interval?: 3600 | 7200 | 14400 | 21600 | 43200 | 86400;
|
|
4339
|
+
metadata?: Record<string, unknown>;
|
|
4111
4340
|
[key: string]: unknown;
|
|
4112
4341
|
};
|
|
4113
4342
|
// ============ AI Search Item Types ============
|
|
4114
4343
|
type AiSearchItemInfo = {
|
|
4115
4344
|
id: string;
|
|
4116
4345
|
key: string;
|
|
4117
|
-
status:
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4346
|
+
status: "completed" | "error" | "skipped" | "queued" | "running" | "outdated";
|
|
4347
|
+
next_action?: "INDEX" | "DELETE" | null;
|
|
4348
|
+
error?: string;
|
|
4349
|
+
checksum?: string;
|
|
4350
|
+
namespace?: string;
|
|
4351
|
+
chunks_count?: number | null;
|
|
4352
|
+
file_size?: number | null;
|
|
4353
|
+
source_id?: string | null;
|
|
4354
|
+
last_seen_at?: string;
|
|
4355
|
+
created_at?: string;
|
|
4124
4356
|
metadata?: Record<string, unknown>;
|
|
4125
4357
|
[key: string]: unknown;
|
|
4126
4358
|
};
|
|
@@ -4136,6 +4368,22 @@ type AiSearchUploadItemOptions = {
|
|
|
4136
4368
|
type AiSearchListItemsParams = {
|
|
4137
4369
|
page?: number;
|
|
4138
4370
|
per_page?: number;
|
|
4371
|
+
/** Search items by key name. */
|
|
4372
|
+
search?: string;
|
|
4373
|
+
/** Sort order for results. */
|
|
4374
|
+
sort_by?: "status" | "modified_at";
|
|
4375
|
+
/** Filter items by processing status. */
|
|
4376
|
+
status?:
|
|
4377
|
+
| "queued"
|
|
4378
|
+
| "running"
|
|
4379
|
+
| "completed"
|
|
4380
|
+
| "error"
|
|
4381
|
+
| "skipped"
|
|
4382
|
+
| "outdated";
|
|
4383
|
+
/** Filter items by source (e.g. "builtin" or "web-crawler:https://example.com"). */
|
|
4384
|
+
source?: string;
|
|
4385
|
+
/** JSON-encoded Vectorize filter for metadata filtering. */
|
|
4386
|
+
metadata_filter?: string;
|
|
4139
4387
|
};
|
|
4140
4388
|
type AiSearchListItemsResponse = {
|
|
4141
4389
|
result: AiSearchItemInfo[];
|
|
@@ -4146,6 +4394,61 @@ type AiSearchListItemsResponse = {
|
|
|
4146
4394
|
total_count: number;
|
|
4147
4395
|
};
|
|
4148
4396
|
};
|
|
4397
|
+
// ============ AI Search Item Logs Types ============
|
|
4398
|
+
type AiSearchItemLogsParams = {
|
|
4399
|
+
/** Maximum number of log entries to return (1-100, default 50). */
|
|
4400
|
+
limit?: number;
|
|
4401
|
+
/** Opaque cursor for pagination. Pass the `cursor` value from a previous response. */
|
|
4402
|
+
cursor?: string;
|
|
4403
|
+
};
|
|
4404
|
+
type AiSearchItemLog = {
|
|
4405
|
+
timestamp: string;
|
|
4406
|
+
action: string;
|
|
4407
|
+
message: string;
|
|
4408
|
+
fileKey?: string;
|
|
4409
|
+
chunkCount?: number;
|
|
4410
|
+
processingTimeMs?: number;
|
|
4411
|
+
errorType?: string;
|
|
4412
|
+
};
|
|
4413
|
+
/** Paginated response for item processing logs (cursor-based). */
|
|
4414
|
+
type AiSearchItemLogsResponse = {
|
|
4415
|
+
result: AiSearchItemLog[];
|
|
4416
|
+
result_info: {
|
|
4417
|
+
count: number;
|
|
4418
|
+
per_page: number;
|
|
4419
|
+
cursor: string | null;
|
|
4420
|
+
truncated: boolean;
|
|
4421
|
+
};
|
|
4422
|
+
};
|
|
4423
|
+
// ============ AI Search Item Chunks Types ============
|
|
4424
|
+
type AiSearchItemChunksParams = {
|
|
4425
|
+
/** Maximum number of chunks to return (1-100, default 20). */
|
|
4426
|
+
limit?: number;
|
|
4427
|
+
/** Offset into the chunks list (default 0). */
|
|
4428
|
+
offset?: number;
|
|
4429
|
+
};
|
|
4430
|
+
/** A single indexed chunk belonging to an item, including its text content and byte range. */
|
|
4431
|
+
type AiSearchItemChunk = {
|
|
4432
|
+
id: string;
|
|
4433
|
+
text: string;
|
|
4434
|
+
start_byte: number;
|
|
4435
|
+
end_byte: number;
|
|
4436
|
+
item?: {
|
|
4437
|
+
timestamp?: number;
|
|
4438
|
+
key: string;
|
|
4439
|
+
metadata?: Record<string, unknown>;
|
|
4440
|
+
};
|
|
4441
|
+
};
|
|
4442
|
+
/** Paginated response for item chunks (offset-based). */
|
|
4443
|
+
type AiSearchItemChunksResponse = {
|
|
4444
|
+
result: AiSearchItemChunk[];
|
|
4445
|
+
result_info: {
|
|
4446
|
+
count: number;
|
|
4447
|
+
total: number;
|
|
4448
|
+
limit: number;
|
|
4449
|
+
offset: number;
|
|
4450
|
+
};
|
|
4451
|
+
};
|
|
4149
4452
|
// ============ AI Search Job Types ============
|
|
4150
4453
|
type AiSearchJobInfo = {
|
|
4151
4454
|
id: string;
|
|
@@ -4194,7 +4497,7 @@ type AiSearchJobLogsResponse = {
|
|
|
4194
4497
|
// ============ AI Search Sub-Service Classes ============
|
|
4195
4498
|
/**
|
|
4196
4499
|
* Single item service for an AI Search instance.
|
|
4197
|
-
* Provides info,
|
|
4500
|
+
* Provides info, download, sync, logs, and chunks operations on a specific item.
|
|
4198
4501
|
*/
|
|
4199
4502
|
declare abstract class AiSearchItem {
|
|
4200
4503
|
/** Get metadata about this item. */
|
|
@@ -4204,6 +4507,25 @@ declare abstract class AiSearchItem {
|
|
|
4204
4507
|
* @returns Object with body stream, content type, filename, and size.
|
|
4205
4508
|
*/
|
|
4206
4509
|
download(): Promise<AiSearchItemContentResult>;
|
|
4510
|
+
/**
|
|
4511
|
+
* Trigger re-indexing of this item.
|
|
4512
|
+
* @returns The updated item info.
|
|
4513
|
+
*/
|
|
4514
|
+
sync(): Promise<AiSearchItemInfo>;
|
|
4515
|
+
/**
|
|
4516
|
+
* Retrieve processing logs for this item (cursor-based pagination).
|
|
4517
|
+
* @param params Optional pagination parameters (limit, cursor).
|
|
4518
|
+
* @returns Paginated log entries for this item.
|
|
4519
|
+
*/
|
|
4520
|
+
logs(params?: AiSearchItemLogsParams): Promise<AiSearchItemLogsResponse>;
|
|
4521
|
+
/**
|
|
4522
|
+
* List indexed chunks for this item (offset-based pagination).
|
|
4523
|
+
* @param params Optional pagination parameters (limit, offset).
|
|
4524
|
+
* @returns Paginated chunk entries for this item.
|
|
4525
|
+
*/
|
|
4526
|
+
chunks(
|
|
4527
|
+
params?: AiSearchItemChunksParams,
|
|
4528
|
+
): Promise<AiSearchItemChunksResponse>;
|
|
4207
4529
|
}
|
|
4208
4530
|
/**
|
|
4209
4531
|
* Items collection service for an AI Search instance.
|
|
@@ -4213,49 +4535,64 @@ declare abstract class AiSearchItems {
|
|
|
4213
4535
|
/** List items in this instance. */
|
|
4214
4536
|
list(params?: AiSearchListItemsParams): Promise<AiSearchListItemsResponse>;
|
|
4215
4537
|
/**
|
|
4216
|
-
* Upload a file as an item.
|
|
4538
|
+
* Upload a file as an item. Behaves as an upsert: if an item with the same
|
|
4539
|
+
* filename already exists, it is overwritten and re-indexed.
|
|
4217
4540
|
* @param name Filename for the uploaded item.
|
|
4218
|
-
* @param content File content as a ReadableStream,
|
|
4541
|
+
* @param content File content as a ReadableStream, Blob, or string.
|
|
4219
4542
|
* @param options Optional metadata to attach to the item.
|
|
4220
4543
|
* @returns The created item info.
|
|
4221
4544
|
*/
|
|
4222
4545
|
upload(
|
|
4223
4546
|
name: string,
|
|
4224
|
-
content: ReadableStream |
|
|
4547
|
+
content: ReadableStream | Blob | string,
|
|
4225
4548
|
options?: AiSearchUploadItemOptions,
|
|
4226
4549
|
): Promise<AiSearchItemInfo>;
|
|
4227
4550
|
/**
|
|
4228
4551
|
* Upload a file and poll until processing completes.
|
|
4552
|
+
* Behaves as an upsert: if an item with the same filename already exists,
|
|
4553
|
+
* it is overwritten and re-indexed.
|
|
4229
4554
|
* @param name Filename for the uploaded item.
|
|
4230
|
-
* @param content File content as a ReadableStream,
|
|
4231
|
-
* @param options Optional metadata
|
|
4555
|
+
* @param content File content as a ReadableStream, Blob, or string.
|
|
4556
|
+
* @param options Optional metadata and polling configuration.
|
|
4232
4557
|
* @returns The item info after processing completes (or timeout).
|
|
4233
4558
|
*/
|
|
4234
4559
|
uploadAndPoll(
|
|
4235
4560
|
name: string,
|
|
4236
|
-
content: ReadableStream |
|
|
4237
|
-
options?: AiSearchUploadItemOptions
|
|
4561
|
+
content: ReadableStream | Blob | string,
|
|
4562
|
+
options?: AiSearchUploadItemOptions & {
|
|
4563
|
+
/** Polling interval in milliseconds (default 1000). */
|
|
4564
|
+
pollIntervalMs?: number;
|
|
4565
|
+
/** Maximum time to wait in milliseconds (default 30000). */
|
|
4566
|
+
timeoutMs?: number;
|
|
4567
|
+
},
|
|
4238
4568
|
): Promise<AiSearchItemInfo>;
|
|
4239
4569
|
/**
|
|
4240
4570
|
* Get an item by ID.
|
|
4241
4571
|
* @param itemId The item identifier.
|
|
4242
|
-
* @returns Item service for info,
|
|
4572
|
+
* @returns Item service for info, download, sync, logs, and chunks operations.
|
|
4243
4573
|
*/
|
|
4244
4574
|
get(itemId: string): AiSearchItem;
|
|
4245
|
-
/**
|
|
4575
|
+
/**
|
|
4576
|
+
* Delete an item from the instance.
|
|
4246
4577
|
* @param itemId The item identifier.
|
|
4247
4578
|
*/
|
|
4248
4579
|
delete(itemId: string): Promise<void>;
|
|
4249
4580
|
}
|
|
4250
4581
|
/**
|
|
4251
4582
|
* Single job service for an AI Search instance.
|
|
4252
|
-
* Provides info and
|
|
4583
|
+
* Provides info, logs, and cancel operations for a specific job.
|
|
4253
4584
|
*/
|
|
4254
4585
|
declare abstract class AiSearchJob {
|
|
4255
4586
|
/** Get metadata about this job. */
|
|
4256
4587
|
info(): Promise<AiSearchJobInfo>;
|
|
4257
4588
|
/** Get logs for this job. */
|
|
4258
4589
|
logs(params?: AiSearchJobLogsParams): Promise<AiSearchJobLogsResponse>;
|
|
4590
|
+
/**
|
|
4591
|
+
* Cancel a running job.
|
|
4592
|
+
* @returns The updated job info.
|
|
4593
|
+
* @throws AiSearchNotFoundError if the job does not exist.
|
|
4594
|
+
*/
|
|
4595
|
+
cancel(): Promise<AiSearchJobInfo>;
|
|
4259
4596
|
}
|
|
4260
4597
|
/**
|
|
4261
4598
|
* Jobs collection service for an AI Search instance.
|
|
@@ -4273,7 +4610,7 @@ declare abstract class AiSearchJobs {
|
|
|
4273
4610
|
/**
|
|
4274
4611
|
* Get a job by ID.
|
|
4275
4612
|
* @param jobId The job identifier.
|
|
4276
|
-
* @returns Job service for info and
|
|
4613
|
+
* @returns Job service for info, logs, and cancel operations.
|
|
4277
4614
|
*/
|
|
4278
4615
|
get(jobId: string): AiSearchJob;
|
|
4279
4616
|
}
|
|
@@ -4292,7 +4629,7 @@ declare abstract class AiSearchJobs {
|
|
|
4292
4629
|
* // Via namespace binding
|
|
4293
4630
|
* const instance = env.AI_SEARCH.get("blog");
|
|
4294
4631
|
* const results = await instance.search({
|
|
4295
|
-
*
|
|
4632
|
+
* query: "How does caching work?",
|
|
4296
4633
|
* });
|
|
4297
4634
|
*
|
|
4298
4635
|
* // Via single instance binding
|
|
@@ -4304,7 +4641,7 @@ declare abstract class AiSearchJobs {
|
|
|
4304
4641
|
declare abstract class AiSearchInstance {
|
|
4305
4642
|
/**
|
|
4306
4643
|
* Search the AI Search instance for relevant chunks.
|
|
4307
|
-
* @param params Search request with messages and optional AI search options.
|
|
4644
|
+
* @param params Search request with query or messages and optional AI search options.
|
|
4308
4645
|
* @returns Search response with matching chunks and search query.
|
|
4309
4646
|
*/
|
|
4310
4647
|
search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>;
|
|
@@ -4336,7 +4673,7 @@ declare abstract class AiSearchInstance {
|
|
|
4336
4673
|
info(): Promise<AiSearchInstanceInfo>;
|
|
4337
4674
|
/**
|
|
4338
4675
|
* Get instance statistics (item count, indexing status, etc.).
|
|
4339
|
-
* @returns Statistics with counts per status
|
|
4676
|
+
* @returns Statistics with counts per status, last activity time, and engine details.
|
|
4340
4677
|
*/
|
|
4341
4678
|
stats(): Promise<AiSearchStatsResponse>;
|
|
4342
4679
|
/** Items collection — list, upload, and manage items in this instance. */
|
|
@@ -4348,27 +4685,30 @@ declare abstract class AiSearchInstance {
|
|
|
4348
4685
|
* Namespace-level AI Search service.
|
|
4349
4686
|
*
|
|
4350
4687
|
* Used as the type of `env.AI_SEARCH` (namespace binding via `ai_search_namespaces`).
|
|
4351
|
-
* Scoped to a single namespace. Provides dynamic instance access, creation,
|
|
4688
|
+
* Scoped to a single namespace. Provides dynamic instance access, creation, deletion,
|
|
4689
|
+
* and multi-instance search/chat operations.
|
|
4352
4690
|
*
|
|
4353
4691
|
* @example
|
|
4354
4692
|
* ```ts
|
|
4355
4693
|
* // Access an instance within the namespace
|
|
4356
4694
|
* const blog = env.AI_SEARCH.get("blog");
|
|
4357
|
-
* const results = await blog.search({
|
|
4358
|
-
* messages: [{ role: "user", content: "How does caching work?" }],
|
|
4359
|
-
* });
|
|
4695
|
+
* const results = await blog.search({ query: "How does caching work?" });
|
|
4360
4696
|
*
|
|
4361
4697
|
* // List all instances in the namespace
|
|
4362
4698
|
* const instances = await env.AI_SEARCH.list();
|
|
4363
4699
|
*
|
|
4364
4700
|
* // Create a new instance with built-in storage
|
|
4365
|
-
* const tenant = await env.AI_SEARCH.create({
|
|
4366
|
-
* id: "tenant-123",
|
|
4367
|
-
* });
|
|
4701
|
+
* const tenant = await env.AI_SEARCH.create({ id: "tenant-123" });
|
|
4368
4702
|
*
|
|
4369
4703
|
* // Upload items into the instance
|
|
4370
4704
|
* await tenant.items.upload("doc.pdf", fileContent);
|
|
4371
4705
|
*
|
|
4706
|
+
* // Search across multiple instances
|
|
4707
|
+
* const multi = await env.AI_SEARCH.search({
|
|
4708
|
+
* query: "caching",
|
|
4709
|
+
* ai_search_options: { instance_ids: ["blog", "docs"] },
|
|
4710
|
+
* });
|
|
4711
|
+
*
|
|
4372
4712
|
* // Delete an instance
|
|
4373
4713
|
* await env.AI_SEARCH.delete("tenant-123");
|
|
4374
4714
|
* ```
|
|
@@ -4381,10 +4721,11 @@ declare abstract class AiSearchNamespace {
|
|
|
4381
4721
|
*/
|
|
4382
4722
|
get(name: string): AiSearchInstance;
|
|
4383
4723
|
/**
|
|
4384
|
-
* List
|
|
4385
|
-
* @
|
|
4724
|
+
* List instances in the bound namespace.
|
|
4725
|
+
* @param params Optional pagination, search, and ordering parameters.
|
|
4726
|
+
* @returns Array of instance metadata with pagination info.
|
|
4386
4727
|
*/
|
|
4387
|
-
list(): Promise<AiSearchListResponse>;
|
|
4728
|
+
list(params?: AiSearchListInstancesParams): Promise<AiSearchListResponse>;
|
|
4388
4729
|
/**
|
|
4389
4730
|
* Create a new instance within the bound namespace.
|
|
4390
4731
|
* @param config Instance configuration. Only `id` is required — omit `type` and `source` to create with built-in storage.
|
|
@@ -4409,6 +4750,35 @@ declare abstract class AiSearchNamespace {
|
|
|
4409
4750
|
* @param name Instance name to delete.
|
|
4410
4751
|
*/
|
|
4411
4752
|
delete(name: string): Promise<void>;
|
|
4753
|
+
/**
|
|
4754
|
+
* Search across multiple instances within the bound namespace.
|
|
4755
|
+
* Fans out to the specified instance_ids and merges results.
|
|
4756
|
+
* @param params Search request with required `ai_search_options.instance_ids`.
|
|
4757
|
+
* @returns Search response with chunks tagged by instance_id and optional partial-failure errors.
|
|
4758
|
+
*/
|
|
4759
|
+
search(
|
|
4760
|
+
params: AiSearchMultiSearchRequest,
|
|
4761
|
+
): Promise<AiSearchMultiSearchResponse>;
|
|
4762
|
+
/**
|
|
4763
|
+
* Generate chat completions across multiple instances within the bound namespace (streaming).
|
|
4764
|
+
* Fans out to the specified instance_ids, merges context, and generates a response.
|
|
4765
|
+
* @param params Chat completions request with stream: true and required `ai_search_options.instance_ids`.
|
|
4766
|
+
* @returns ReadableStream of server-sent events.
|
|
4767
|
+
*/
|
|
4768
|
+
chatCompletions(
|
|
4769
|
+
params: AiSearchMultiChatCompletionsRequest & {
|
|
4770
|
+
stream: true;
|
|
4771
|
+
},
|
|
4772
|
+
): Promise<ReadableStream>;
|
|
4773
|
+
/**
|
|
4774
|
+
* Generate chat completions across multiple instances within the bound namespace.
|
|
4775
|
+
* Fans out to the specified instance_ids, merges context, and generates a response.
|
|
4776
|
+
* @param params Chat completions request with required `ai_search_options.instance_ids`.
|
|
4777
|
+
* @returns Chat completion response with choices, chunks tagged by instance_id, and optional partial-failure errors.
|
|
4778
|
+
*/
|
|
4779
|
+
chatCompletions(
|
|
4780
|
+
params: AiSearchMultiChatCompletionsRequest,
|
|
4781
|
+
): Promise<AiSearchMultiChatCompletionsResponse>;
|
|
4412
4782
|
}
|
|
4413
4783
|
type AiImageClassificationInput = {
|
|
4414
4784
|
image: number[];
|
|
@@ -12060,8 +12430,8 @@ declare module "cloudflare:email" {
|
|
|
12060
12430
|
* Evaluation context for targeting rules.
|
|
12061
12431
|
* Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
|
|
12062
12432
|
*/
|
|
12063
|
-
type
|
|
12064
|
-
interface
|
|
12433
|
+
type FlagshipEvaluationContext = Record<string, string | number | boolean>;
|
|
12434
|
+
interface FlagshipEvaluationDetails<T> {
|
|
12065
12435
|
flagKey: string;
|
|
12066
12436
|
value: T;
|
|
12067
12437
|
variant?: string | undefined;
|
|
@@ -12069,7 +12439,7 @@ interface EvaluationDetails<T> {
|
|
|
12069
12439
|
errorCode?: string | undefined;
|
|
12070
12440
|
errorMessage?: string | undefined;
|
|
12071
12441
|
}
|
|
12072
|
-
interface
|
|
12442
|
+
interface FlagshipEvaluationError extends Error {}
|
|
12073
12443
|
/**
|
|
12074
12444
|
* Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
|
|
12075
12445
|
*
|
|
@@ -12089,7 +12459,7 @@ interface FlagEvaluationError extends Error {}
|
|
|
12089
12459
|
* console.log(details.variant, details.reason);
|
|
12090
12460
|
* ```
|
|
12091
12461
|
*/
|
|
12092
|
-
declare abstract class
|
|
12462
|
+
declare abstract class Flagship {
|
|
12093
12463
|
/**
|
|
12094
12464
|
* Get a flag value without type checking.
|
|
12095
12465
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12099,7 +12469,7 @@ declare abstract class Flags {
|
|
|
12099
12469
|
get(
|
|
12100
12470
|
flagKey: string,
|
|
12101
12471
|
defaultValue?: unknown,
|
|
12102
|
-
context?:
|
|
12472
|
+
context?: FlagshipEvaluationContext,
|
|
12103
12473
|
): Promise<unknown>;
|
|
12104
12474
|
/**
|
|
12105
12475
|
* Get a boolean flag value.
|
|
@@ -12110,7 +12480,7 @@ declare abstract class Flags {
|
|
|
12110
12480
|
getBooleanValue(
|
|
12111
12481
|
flagKey: string,
|
|
12112
12482
|
defaultValue: boolean,
|
|
12113
|
-
context?:
|
|
12483
|
+
context?: FlagshipEvaluationContext,
|
|
12114
12484
|
): Promise<boolean>;
|
|
12115
12485
|
/**
|
|
12116
12486
|
* Get a string flag value.
|
|
@@ -12121,7 +12491,7 @@ declare abstract class Flags {
|
|
|
12121
12491
|
getStringValue(
|
|
12122
12492
|
flagKey: string,
|
|
12123
12493
|
defaultValue: string,
|
|
12124
|
-
context?:
|
|
12494
|
+
context?: FlagshipEvaluationContext,
|
|
12125
12495
|
): Promise<string>;
|
|
12126
12496
|
/**
|
|
12127
12497
|
* Get a number flag value.
|
|
@@ -12132,7 +12502,7 @@ declare abstract class Flags {
|
|
|
12132
12502
|
getNumberValue(
|
|
12133
12503
|
flagKey: string,
|
|
12134
12504
|
defaultValue: number,
|
|
12135
|
-
context?:
|
|
12505
|
+
context?: FlagshipEvaluationContext,
|
|
12136
12506
|
): Promise<number>;
|
|
12137
12507
|
/**
|
|
12138
12508
|
* Get an object flag value.
|
|
@@ -12143,7 +12513,7 @@ declare abstract class Flags {
|
|
|
12143
12513
|
getObjectValue<T extends object>(
|
|
12144
12514
|
flagKey: string,
|
|
12145
12515
|
defaultValue: T,
|
|
12146
|
-
context?:
|
|
12516
|
+
context?: FlagshipEvaluationContext,
|
|
12147
12517
|
): Promise<T>;
|
|
12148
12518
|
/**
|
|
12149
12519
|
* Get a boolean flag value with full evaluation details.
|
|
@@ -12154,8 +12524,8 @@ declare abstract class Flags {
|
|
|
12154
12524
|
getBooleanDetails(
|
|
12155
12525
|
flagKey: string,
|
|
12156
12526
|
defaultValue: boolean,
|
|
12157
|
-
context?:
|
|
12158
|
-
): Promise<
|
|
12527
|
+
context?: FlagshipEvaluationContext,
|
|
12528
|
+
): Promise<FlagshipEvaluationDetails<boolean>>;
|
|
12159
12529
|
/**
|
|
12160
12530
|
* Get a string flag value with full evaluation details.
|
|
12161
12531
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12165,8 +12535,8 @@ declare abstract class Flags {
|
|
|
12165
12535
|
getStringDetails(
|
|
12166
12536
|
flagKey: string,
|
|
12167
12537
|
defaultValue: string,
|
|
12168
|
-
context?:
|
|
12169
|
-
): Promise<
|
|
12538
|
+
context?: FlagshipEvaluationContext,
|
|
12539
|
+
): Promise<FlagshipEvaluationDetails<string>>;
|
|
12170
12540
|
/**
|
|
12171
12541
|
* Get a number flag value with full evaluation details.
|
|
12172
12542
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12176,8 +12546,8 @@ declare abstract class Flags {
|
|
|
12176
12546
|
getNumberDetails(
|
|
12177
12547
|
flagKey: string,
|
|
12178
12548
|
defaultValue: number,
|
|
12179
|
-
context?:
|
|
12180
|
-
): Promise<
|
|
12549
|
+
context?: FlagshipEvaluationContext,
|
|
12550
|
+
): Promise<FlagshipEvaluationDetails<number>>;
|
|
12181
12551
|
/**
|
|
12182
12552
|
* Get an object flag value with full evaluation details.
|
|
12183
12553
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12187,8 +12557,8 @@ declare abstract class Flags {
|
|
|
12187
12557
|
getObjectDetails<T extends object>(
|
|
12188
12558
|
flagKey: string,
|
|
12189
12559
|
defaultValue: T,
|
|
12190
|
-
context?:
|
|
12191
|
-
): Promise<
|
|
12560
|
+
context?: FlagshipEvaluationContext,
|
|
12561
|
+
): Promise<FlagshipEvaluationDetails<T>>;
|
|
12192
12562
|
}
|
|
12193
12563
|
/**
|
|
12194
12564
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|