@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.ts
CHANGED
|
@@ -2322,11 +2322,34 @@ export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
2324
2324
|
export interface Queue<Body = unknown> {
|
|
2325
|
-
|
|
2325
|
+
metrics(): Promise<QueueMetrics>;
|
|
2326
|
+
send(message: Body, options?: QueueSendOptions): Promise<QueueSendResponse>;
|
|
2326
2327
|
sendBatch(
|
|
2327
2328
|
messages: Iterable<MessageSendRequest<Body>>,
|
|
2328
2329
|
options?: QueueSendBatchOptions,
|
|
2329
|
-
): Promise<
|
|
2330
|
+
): Promise<QueueSendBatchResponse>;
|
|
2331
|
+
}
|
|
2332
|
+
export interface QueueSendMetrics {
|
|
2333
|
+
backlogCount: number;
|
|
2334
|
+
backlogBytes: number;
|
|
2335
|
+
oldestMessageTimestamp?: Date;
|
|
2336
|
+
}
|
|
2337
|
+
export interface QueueSendMetadata {
|
|
2338
|
+
metrics: QueueSendMetrics;
|
|
2339
|
+
}
|
|
2340
|
+
export interface QueueSendResponse {
|
|
2341
|
+
metadata: QueueSendMetadata;
|
|
2342
|
+
}
|
|
2343
|
+
export interface QueueSendBatchMetrics {
|
|
2344
|
+
backlogCount: number;
|
|
2345
|
+
backlogBytes: number;
|
|
2346
|
+
oldestMessageTimestamp?: Date;
|
|
2347
|
+
}
|
|
2348
|
+
export interface QueueSendBatchMetadata {
|
|
2349
|
+
metrics: QueueSendBatchMetrics;
|
|
2350
|
+
}
|
|
2351
|
+
export interface QueueSendBatchResponse {
|
|
2352
|
+
metadata: QueueSendBatchMetadata;
|
|
2330
2353
|
}
|
|
2331
2354
|
export interface QueueSendOptions {
|
|
2332
2355
|
contentType?: QueueContentType;
|
|
@@ -2340,6 +2363,19 @@ export interface MessageSendRequest<Body = unknown> {
|
|
|
2340
2363
|
contentType?: QueueContentType;
|
|
2341
2364
|
delaySeconds?: number;
|
|
2342
2365
|
}
|
|
2366
|
+
export interface QueueMetrics {
|
|
2367
|
+
backlogCount: number;
|
|
2368
|
+
backlogBytes: number;
|
|
2369
|
+
oldestMessageTimestamp?: Date;
|
|
2370
|
+
}
|
|
2371
|
+
export interface MessageBatchMetrics {
|
|
2372
|
+
backlogCount: number;
|
|
2373
|
+
backlogBytes: number;
|
|
2374
|
+
oldestMessageTimestamp?: Date;
|
|
2375
|
+
}
|
|
2376
|
+
export interface MessageBatchMetadata {
|
|
2377
|
+
metrics: MessageBatchMetrics;
|
|
2378
|
+
}
|
|
2343
2379
|
export interface QueueRetryOptions {
|
|
2344
2380
|
delaySeconds?: number;
|
|
2345
2381
|
}
|
|
@@ -2354,12 +2390,14 @@ export interface Message<Body = unknown> {
|
|
|
2354
2390
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
2355
2391
|
readonly messages: readonly Message<Body>[];
|
|
2356
2392
|
readonly queue: string;
|
|
2393
|
+
readonly metadata: MessageBatchMetadata;
|
|
2357
2394
|
retryAll(options?: QueueRetryOptions): void;
|
|
2358
2395
|
ackAll(): void;
|
|
2359
2396
|
}
|
|
2360
2397
|
export interface MessageBatch<Body = unknown> {
|
|
2361
2398
|
readonly messages: readonly Message<Body>[];
|
|
2362
2399
|
readonly queue: string;
|
|
2400
|
+
readonly metadata: MessageBatchMetadata;
|
|
2363
2401
|
retryAll(options?: QueueRetryOptions): void;
|
|
2364
2402
|
ackAll(): void;
|
|
2365
2403
|
}
|
|
@@ -3960,72 +3998,145 @@ export declare abstract class Performance {
|
|
|
3960
3998
|
// ============ AI Search Error Interfaces ============
|
|
3961
3999
|
export interface AiSearchInternalError extends Error {}
|
|
3962
4000
|
export interface AiSearchNotFoundError extends Error {}
|
|
3963
|
-
// ============ AI Search
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
4001
|
+
// ============ AI Search Common Types ============
|
|
4002
|
+
/** A single message in a conversation-style search or chat request. */
|
|
4003
|
+
export type AiSearchMessage = {
|
|
4004
|
+
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
4005
|
+
content: string | null;
|
|
4006
|
+
};
|
|
4007
|
+
/**
|
|
4008
|
+
* Common shape for `ai_search_options` used by both single-instance and multi-instance requests.
|
|
4009
|
+
* Contains retrieval, query rewrite, reranking, and cache sub-options.
|
|
4010
|
+
*/
|
|
4011
|
+
export type AiSearchOptions = {
|
|
4012
|
+
retrieval?: {
|
|
4013
|
+
/** Which retrieval backend to use. Defaults to the instance's configured index_method. */
|
|
4014
|
+
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4015
|
+
/** Fusion method for combining vector + keyword results. */
|
|
4016
|
+
fusion_method?: "max" | "rrf";
|
|
4017
|
+
/** How keyword terms are combined: "and" = all terms must match, "or" = any term matches. */
|
|
4018
|
+
keyword_match_mode?: "and" | "or";
|
|
4019
|
+
/** Minimum similarity score (0-1) for a result to be included. Default 0.4. */
|
|
4020
|
+
match_threshold?: number;
|
|
4021
|
+
/** Maximum number of results to return (1-50). Default 10. */
|
|
4022
|
+
max_num_results?: number;
|
|
4023
|
+
/** Vectorize metadata filters applied to the search. */
|
|
4024
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
4025
|
+
/** Number of surrounding chunks to include for context (0-3). Default 0. */
|
|
4026
|
+
context_expansion?: number;
|
|
4027
|
+
/** If true, return only item metadata without chunk text. */
|
|
4028
|
+
metadata_only?: boolean;
|
|
4029
|
+
/** If true (default), return empty results on retrieval failure instead of throwing. */
|
|
4030
|
+
return_on_failure?: boolean;
|
|
4031
|
+
/** Boost results by metadata field values. Max 3 entries. */
|
|
4032
|
+
boost_by?: Array<{
|
|
4033
|
+
field: string;
|
|
4034
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4035
|
+
}>;
|
|
4036
|
+
[key: string]: unknown;
|
|
4037
|
+
};
|
|
4038
|
+
query_rewrite?: {
|
|
4039
|
+
enabled?: boolean;
|
|
4040
|
+
model?: string;
|
|
4041
|
+
rewrite_prompt?: string;
|
|
4042
|
+
[key: string]: unknown;
|
|
4043
|
+
};
|
|
4044
|
+
reranking?: {
|
|
4045
|
+
enabled?: boolean;
|
|
4046
|
+
model?: string;
|
|
4047
|
+
/** Match threshold (0-1, default 0.4) */
|
|
4048
|
+
match_threshold?: number;
|
|
3994
4049
|
[key: string]: unknown;
|
|
3995
4050
|
};
|
|
4051
|
+
cache?: {
|
|
4052
|
+
enabled?: boolean;
|
|
4053
|
+
cache_threshold?:
|
|
4054
|
+
| "super_strict_match"
|
|
4055
|
+
| "close_enough"
|
|
4056
|
+
| "flexible_friend"
|
|
4057
|
+
| "anything_goes";
|
|
4058
|
+
};
|
|
4059
|
+
[key: string]: unknown;
|
|
3996
4060
|
};
|
|
4061
|
+
// ============ AI Search Request Types ============
|
|
4062
|
+
/**
|
|
4063
|
+
* Request body for single-instance search.
|
|
4064
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
4065
|
+
*/
|
|
4066
|
+
export type AiSearchSearchRequest =
|
|
4067
|
+
| {
|
|
4068
|
+
/** Simple query string. */
|
|
4069
|
+
query: string;
|
|
4070
|
+
messages?: never;
|
|
4071
|
+
ai_search_options?: AiSearchOptions;
|
|
4072
|
+
}
|
|
4073
|
+
| {
|
|
4074
|
+
query?: never;
|
|
4075
|
+
/** Conversation-style input. At least one user message with non-empty content is required. */
|
|
4076
|
+
messages: AiSearchMessage[];
|
|
4077
|
+
ai_search_options?: AiSearchOptions;
|
|
4078
|
+
};
|
|
3997
4079
|
export type AiSearchChatCompletionsRequest = {
|
|
3998
|
-
messages:
|
|
3999
|
-
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
4000
|
-
content: string | null;
|
|
4001
|
-
[key: string]: unknown;
|
|
4002
|
-
}>;
|
|
4080
|
+
messages: AiSearchMessage[];
|
|
4003
4081
|
model?: string;
|
|
4004
4082
|
stream?: boolean;
|
|
4005
|
-
ai_search_options?:
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4083
|
+
ai_search_options?: AiSearchOptions;
|
|
4084
|
+
[key: string]: unknown;
|
|
4085
|
+
};
|
|
4086
|
+
// ============ AI Search Multi-Instance Types (Namespace-Scoped) ============
|
|
4087
|
+
/** `ai_search_options` shape for multi-instance requests — requires `instance_ids`. */
|
|
4088
|
+
export type AiSearchMultiSearchOptions = AiSearchOptions & {
|
|
4089
|
+
/** Instance IDs to search across (1-10). */
|
|
4090
|
+
instance_ids: string[];
|
|
4091
|
+
};
|
|
4092
|
+
/**
|
|
4093
|
+
* Request for searching across multiple instances within a namespace.
|
|
4094
|
+
* `ai_search_options` is required and must include `instance_ids`.
|
|
4095
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
4096
|
+
*/
|
|
4097
|
+
export type AiSearchMultiSearchRequest =
|
|
4098
|
+
| {
|
|
4099
|
+
/** Simple query string. */
|
|
4100
|
+
query: string;
|
|
4101
|
+
messages?: never;
|
|
4102
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4103
|
+
}
|
|
4104
|
+
| {
|
|
4105
|
+
query?: never;
|
|
4106
|
+
/** Conversation-style input. */
|
|
4107
|
+
messages: AiSearchMessage[];
|
|
4108
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4025
4109
|
};
|
|
4026
|
-
|
|
4110
|
+
/** A search result chunk tagged with the instance it originated from. */
|
|
4111
|
+
export type AiSearchMultiSearchChunk =
|
|
4112
|
+
AiSearchSearchResponse["chunks"][number] & {
|
|
4113
|
+
instance_id: string;
|
|
4027
4114
|
};
|
|
4028
|
-
|
|
4115
|
+
/** Describes a per-instance error during a multi-instance operation. */
|
|
4116
|
+
export type AiSearchMultiSearchError = {
|
|
4117
|
+
instance_id: string;
|
|
4118
|
+
message: string;
|
|
4119
|
+
};
|
|
4120
|
+
/** Response from a multi-instance search, with chunks tagged by instance and optional partial-failure errors. */
|
|
4121
|
+
export type AiSearchMultiSearchResponse = {
|
|
4122
|
+
search_query: string;
|
|
4123
|
+
chunks: AiSearchMultiSearchChunk[];
|
|
4124
|
+
errors?: AiSearchMultiSearchError[];
|
|
4125
|
+
};
|
|
4126
|
+
/** Request for chat completions across multiple instances within a namespace. `ai_search_options` is required and must include `instance_ids`. */
|
|
4127
|
+
export type AiSearchMultiChatCompletionsRequest = Omit<
|
|
4128
|
+
AiSearchChatCompletionsRequest,
|
|
4129
|
+
"ai_search_options"
|
|
4130
|
+
> & {
|
|
4131
|
+
ai_search_options: AiSearchMultiSearchOptions;
|
|
4132
|
+
};
|
|
4133
|
+
/** Response from multi-instance chat completions, with chunks tagged by instance and optional partial-failure errors. */
|
|
4134
|
+
export type AiSearchMultiChatCompletionsResponse = Omit<
|
|
4135
|
+
AiSearchChatCompletionsResponse,
|
|
4136
|
+
"chunks"
|
|
4137
|
+
> & {
|
|
4138
|
+
chunks: AiSearchMultiSearchChunk[];
|
|
4139
|
+
errors?: AiSearchMultiSearchError[];
|
|
4029
4140
|
};
|
|
4030
4141
|
// ============ AI Search Response Types ============
|
|
4031
4142
|
export type AiSearchSearchResponse = {
|
|
@@ -4046,6 +4157,14 @@ export type AiSearchSearchResponse = {
|
|
|
4046
4157
|
keyword_score?: number;
|
|
4047
4158
|
/** Vector similarity score (0-1) */
|
|
4048
4159
|
vector_score?: number;
|
|
4160
|
+
/** Keyword rank position */
|
|
4161
|
+
keyword_rank?: number;
|
|
4162
|
+
/** Vector rank position */
|
|
4163
|
+
vector_rank?: number;
|
|
4164
|
+
/** Reranking model score */
|
|
4165
|
+
reranking_score?: number;
|
|
4166
|
+
/** Fusion method used to combine results */
|
|
4167
|
+
fusion_method?: "rrf" | "max";
|
|
4049
4168
|
[key: string]: unknown;
|
|
4050
4169
|
};
|
|
4051
4170
|
}>;
|
|
@@ -4074,19 +4193,88 @@ export type AiSearchStatsResponse = {
|
|
|
4074
4193
|
skipped?: number;
|
|
4075
4194
|
outdated?: number;
|
|
4076
4195
|
last_activity?: string;
|
|
4196
|
+
/** Storage engine statistics. */
|
|
4197
|
+
engine?: {
|
|
4198
|
+
vectorize?: {
|
|
4199
|
+
vectorsCount: number;
|
|
4200
|
+
dimensions: number;
|
|
4201
|
+
};
|
|
4202
|
+
r2?: {
|
|
4203
|
+
payloadSizeBytes: number;
|
|
4204
|
+
metadataSizeBytes: number;
|
|
4205
|
+
objectCount: number;
|
|
4206
|
+
};
|
|
4207
|
+
};
|
|
4077
4208
|
};
|
|
4078
4209
|
// ============ AI Search Instance Info Types ============
|
|
4079
4210
|
export type AiSearchInstanceInfo = {
|
|
4080
4211
|
id: string;
|
|
4081
4212
|
type?: "r2" | "web-crawler" | string;
|
|
4082
4213
|
source?: string;
|
|
4214
|
+
source_params?: unknown;
|
|
4083
4215
|
paused?: boolean;
|
|
4084
4216
|
status?: string;
|
|
4085
4217
|
namespace?: string;
|
|
4086
4218
|
created_at?: string;
|
|
4087
4219
|
modified_at?: string;
|
|
4220
|
+
token_id?: string;
|
|
4221
|
+
ai_gateway_id?: string;
|
|
4222
|
+
rewrite_query?: boolean;
|
|
4223
|
+
reranking?: boolean;
|
|
4224
|
+
embedding_model?: string;
|
|
4225
|
+
ai_search_model?: string;
|
|
4226
|
+
rewrite_model?: string;
|
|
4227
|
+
reranking_model?: string;
|
|
4228
|
+
/** @deprecated Use index_method instead. */
|
|
4229
|
+
hybrid_search_enabled?: boolean;
|
|
4230
|
+
/** Controls which storage backends are active. */
|
|
4231
|
+
index_method?: {
|
|
4232
|
+
vector?: boolean;
|
|
4233
|
+
keyword?: boolean;
|
|
4234
|
+
};
|
|
4235
|
+
/** Fusion method for combining vector and keyword results. */
|
|
4236
|
+
fusion_method?: "max" | "rrf";
|
|
4237
|
+
indexing_options?: {
|
|
4238
|
+
keyword_tokenizer?: "porter" | "trigram";
|
|
4239
|
+
} | null;
|
|
4240
|
+
retrieval_options?: {
|
|
4241
|
+
keyword_match_mode?: "and" | "or";
|
|
4242
|
+
boost_by?: Array<{
|
|
4243
|
+
field: string;
|
|
4244
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4245
|
+
}>;
|
|
4246
|
+
} | null;
|
|
4247
|
+
chunk?: boolean;
|
|
4248
|
+
chunk_size?: number;
|
|
4249
|
+
chunk_overlap?: number;
|
|
4250
|
+
score_threshold?: number;
|
|
4251
|
+
max_num_results?: number;
|
|
4252
|
+
cache?: boolean;
|
|
4253
|
+
cache_threshold?:
|
|
4254
|
+
| "super_strict_match"
|
|
4255
|
+
| "close_enough"
|
|
4256
|
+
| "flexible_friend"
|
|
4257
|
+
| "anything_goes";
|
|
4258
|
+
custom_metadata?: Array<{
|
|
4259
|
+
field_name: string;
|
|
4260
|
+
data_type: "text" | "number" | "boolean" | "datetime";
|
|
4261
|
+
}>;
|
|
4262
|
+
/** Sync interval in seconds. */
|
|
4263
|
+
sync_interval?: 3600 | 7200 | 14400 | 21600 | 43200 | 86400;
|
|
4264
|
+
metadata?: Record<string, unknown>;
|
|
4088
4265
|
[key: string]: unknown;
|
|
4089
4266
|
};
|
|
4267
|
+
/** Pagination, search, and ordering parameters for listing instances within a namespace. */
|
|
4268
|
+
export type AiSearchListInstancesParams = {
|
|
4269
|
+
page?: number;
|
|
4270
|
+
per_page?: number;
|
|
4271
|
+
/** Search instances by ID. */
|
|
4272
|
+
search?: string;
|
|
4273
|
+
/** Field to sort by. */
|
|
4274
|
+
order_by?: "created_at";
|
|
4275
|
+
/** Sort direction. */
|
|
4276
|
+
order_by_direction?: "asc" | "desc";
|
|
4277
|
+
};
|
|
4090
4278
|
export type AiSearchListResponse = {
|
|
4091
4279
|
result: AiSearchInstanceInfo[];
|
|
4092
4280
|
result_info?: {
|
|
@@ -4114,19 +4302,64 @@ export type AiSearchConfig = {
|
|
|
4114
4302
|
reranking?: boolean;
|
|
4115
4303
|
embedding_model?: string;
|
|
4116
4304
|
ai_search_model?: string;
|
|
4305
|
+
rewrite_model?: string;
|
|
4306
|
+
reranking_model?: string;
|
|
4307
|
+
/** @deprecated Use index_method instead. */
|
|
4308
|
+
hybrid_search_enabled?: boolean;
|
|
4309
|
+
/** Controls which storage backends are used during indexing. Defaults to vector-only. */
|
|
4310
|
+
index_method?: {
|
|
4311
|
+
vector?: boolean;
|
|
4312
|
+
keyword?: boolean;
|
|
4313
|
+
};
|
|
4314
|
+
/** Fusion method for combining vector and keyword results. "rrf" = reciprocal rank fusion (default), "max" = maximum score. */
|
|
4315
|
+
fusion_method?: "max" | "rrf";
|
|
4316
|
+
indexing_options?: {
|
|
4317
|
+
keyword_tokenizer?: "porter" | "trigram";
|
|
4318
|
+
} | null;
|
|
4319
|
+
retrieval_options?: {
|
|
4320
|
+
keyword_match_mode?: "and" | "or";
|
|
4321
|
+
boost_by?: Array<{
|
|
4322
|
+
field: string;
|
|
4323
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4324
|
+
}>;
|
|
4325
|
+
} | null;
|
|
4326
|
+
chunk?: boolean;
|
|
4327
|
+
chunk_size?: number;
|
|
4328
|
+
chunk_overlap?: number;
|
|
4329
|
+
/** Minimum similarity score (0-1) for a result to be included. */
|
|
4330
|
+
score_threshold?: number;
|
|
4331
|
+
max_num_results?: number;
|
|
4332
|
+
cache?: boolean;
|
|
4333
|
+
/** Similarity threshold for cache hits. Stricter = fewer cache hits but higher relevance. */
|
|
4334
|
+
cache_threshold?:
|
|
4335
|
+
| "super_strict_match"
|
|
4336
|
+
| "close_enough"
|
|
4337
|
+
| "flexible_friend"
|
|
4338
|
+
| "anything_goes";
|
|
4339
|
+
custom_metadata?: Array<{
|
|
4340
|
+
field_name: string;
|
|
4341
|
+
data_type: "text" | "number" | "boolean" | "datetime";
|
|
4342
|
+
}>;
|
|
4343
|
+
namespace?: string;
|
|
4344
|
+
/** Sync interval in seconds. 3600=1h, 7200=2h, 14400=4h, 21600=6h, 43200=12h, 86400=24h. */
|
|
4345
|
+
sync_interval?: 3600 | 7200 | 14400 | 21600 | 43200 | 86400;
|
|
4346
|
+
metadata?: Record<string, unknown>;
|
|
4117
4347
|
[key: string]: unknown;
|
|
4118
4348
|
};
|
|
4119
4349
|
// ============ AI Search Item Types ============
|
|
4120
4350
|
export type AiSearchItemInfo = {
|
|
4121
4351
|
id: string;
|
|
4122
4352
|
key: string;
|
|
4123
|
-
status:
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4353
|
+
status: "completed" | "error" | "skipped" | "queued" | "running" | "outdated";
|
|
4354
|
+
next_action?: "INDEX" | "DELETE" | null;
|
|
4355
|
+
error?: string;
|
|
4356
|
+
checksum?: string;
|
|
4357
|
+
namespace?: string;
|
|
4358
|
+
chunks_count?: number | null;
|
|
4359
|
+
file_size?: number | null;
|
|
4360
|
+
source_id?: string | null;
|
|
4361
|
+
last_seen_at?: string;
|
|
4362
|
+
created_at?: string;
|
|
4130
4363
|
metadata?: Record<string, unknown>;
|
|
4131
4364
|
[key: string]: unknown;
|
|
4132
4365
|
};
|
|
@@ -4142,6 +4375,22 @@ export type AiSearchUploadItemOptions = {
|
|
|
4142
4375
|
export type AiSearchListItemsParams = {
|
|
4143
4376
|
page?: number;
|
|
4144
4377
|
per_page?: number;
|
|
4378
|
+
/** Search items by key name. */
|
|
4379
|
+
search?: string;
|
|
4380
|
+
/** Sort order for results. */
|
|
4381
|
+
sort_by?: "status" | "modified_at";
|
|
4382
|
+
/** Filter items by processing status. */
|
|
4383
|
+
status?:
|
|
4384
|
+
| "queued"
|
|
4385
|
+
| "running"
|
|
4386
|
+
| "completed"
|
|
4387
|
+
| "error"
|
|
4388
|
+
| "skipped"
|
|
4389
|
+
| "outdated";
|
|
4390
|
+
/** Filter items by source (e.g. "builtin" or "web-crawler:https://example.com"). */
|
|
4391
|
+
source?: string;
|
|
4392
|
+
/** JSON-encoded Vectorize filter for metadata filtering. */
|
|
4393
|
+
metadata_filter?: string;
|
|
4145
4394
|
};
|
|
4146
4395
|
export type AiSearchListItemsResponse = {
|
|
4147
4396
|
result: AiSearchItemInfo[];
|
|
@@ -4152,6 +4401,61 @@ export type AiSearchListItemsResponse = {
|
|
|
4152
4401
|
total_count: number;
|
|
4153
4402
|
};
|
|
4154
4403
|
};
|
|
4404
|
+
// ============ AI Search Item Logs Types ============
|
|
4405
|
+
export type AiSearchItemLogsParams = {
|
|
4406
|
+
/** Maximum number of log entries to return (1-100, default 50). */
|
|
4407
|
+
limit?: number;
|
|
4408
|
+
/** Opaque cursor for pagination. Pass the `cursor` value from a previous response. */
|
|
4409
|
+
cursor?: string;
|
|
4410
|
+
};
|
|
4411
|
+
export type AiSearchItemLog = {
|
|
4412
|
+
timestamp: string;
|
|
4413
|
+
action: string;
|
|
4414
|
+
message: string;
|
|
4415
|
+
fileKey?: string;
|
|
4416
|
+
chunkCount?: number;
|
|
4417
|
+
processingTimeMs?: number;
|
|
4418
|
+
errorType?: string;
|
|
4419
|
+
};
|
|
4420
|
+
/** Paginated response for item processing logs (cursor-based). */
|
|
4421
|
+
export type AiSearchItemLogsResponse = {
|
|
4422
|
+
result: AiSearchItemLog[];
|
|
4423
|
+
result_info: {
|
|
4424
|
+
count: number;
|
|
4425
|
+
per_page: number;
|
|
4426
|
+
cursor: string | null;
|
|
4427
|
+
truncated: boolean;
|
|
4428
|
+
};
|
|
4429
|
+
};
|
|
4430
|
+
// ============ AI Search Item Chunks Types ============
|
|
4431
|
+
export type AiSearchItemChunksParams = {
|
|
4432
|
+
/** Maximum number of chunks to return (1-100, default 20). */
|
|
4433
|
+
limit?: number;
|
|
4434
|
+
/** Offset into the chunks list (default 0). */
|
|
4435
|
+
offset?: number;
|
|
4436
|
+
};
|
|
4437
|
+
/** A single indexed chunk belonging to an item, including its text content and byte range. */
|
|
4438
|
+
export type AiSearchItemChunk = {
|
|
4439
|
+
id: string;
|
|
4440
|
+
text: string;
|
|
4441
|
+
start_byte: number;
|
|
4442
|
+
end_byte: number;
|
|
4443
|
+
item?: {
|
|
4444
|
+
timestamp?: number;
|
|
4445
|
+
key: string;
|
|
4446
|
+
metadata?: Record<string, unknown>;
|
|
4447
|
+
};
|
|
4448
|
+
};
|
|
4449
|
+
/** Paginated response for item chunks (offset-based). */
|
|
4450
|
+
export type AiSearchItemChunksResponse = {
|
|
4451
|
+
result: AiSearchItemChunk[];
|
|
4452
|
+
result_info: {
|
|
4453
|
+
count: number;
|
|
4454
|
+
total: number;
|
|
4455
|
+
limit: number;
|
|
4456
|
+
offset: number;
|
|
4457
|
+
};
|
|
4458
|
+
};
|
|
4155
4459
|
// ============ AI Search Job Types ============
|
|
4156
4460
|
export type AiSearchJobInfo = {
|
|
4157
4461
|
id: string;
|
|
@@ -4200,7 +4504,7 @@ export type AiSearchJobLogsResponse = {
|
|
|
4200
4504
|
// ============ AI Search Sub-Service Classes ============
|
|
4201
4505
|
/**
|
|
4202
4506
|
* Single item service for an AI Search instance.
|
|
4203
|
-
* Provides info,
|
|
4507
|
+
* Provides info, download, sync, logs, and chunks operations on a specific item.
|
|
4204
4508
|
*/
|
|
4205
4509
|
export declare abstract class AiSearchItem {
|
|
4206
4510
|
/** Get metadata about this item. */
|
|
@@ -4210,6 +4514,25 @@ export declare abstract class AiSearchItem {
|
|
|
4210
4514
|
* @returns Object with body stream, content type, filename, and size.
|
|
4211
4515
|
*/
|
|
4212
4516
|
download(): Promise<AiSearchItemContentResult>;
|
|
4517
|
+
/**
|
|
4518
|
+
* Trigger re-indexing of this item.
|
|
4519
|
+
* @returns The updated item info.
|
|
4520
|
+
*/
|
|
4521
|
+
sync(): Promise<AiSearchItemInfo>;
|
|
4522
|
+
/**
|
|
4523
|
+
* Retrieve processing logs for this item (cursor-based pagination).
|
|
4524
|
+
* @param params Optional pagination parameters (limit, cursor).
|
|
4525
|
+
* @returns Paginated log entries for this item.
|
|
4526
|
+
*/
|
|
4527
|
+
logs(params?: AiSearchItemLogsParams): Promise<AiSearchItemLogsResponse>;
|
|
4528
|
+
/**
|
|
4529
|
+
* List indexed chunks for this item (offset-based pagination).
|
|
4530
|
+
* @param params Optional pagination parameters (limit, offset).
|
|
4531
|
+
* @returns Paginated chunk entries for this item.
|
|
4532
|
+
*/
|
|
4533
|
+
chunks(
|
|
4534
|
+
params?: AiSearchItemChunksParams,
|
|
4535
|
+
): Promise<AiSearchItemChunksResponse>;
|
|
4213
4536
|
}
|
|
4214
4537
|
/**
|
|
4215
4538
|
* Items collection service for an AI Search instance.
|
|
@@ -4219,49 +4542,64 @@ export declare abstract class AiSearchItems {
|
|
|
4219
4542
|
/** List items in this instance. */
|
|
4220
4543
|
list(params?: AiSearchListItemsParams): Promise<AiSearchListItemsResponse>;
|
|
4221
4544
|
/**
|
|
4222
|
-
* Upload a file as an item.
|
|
4545
|
+
* Upload a file as an item. Behaves as an upsert: if an item with the same
|
|
4546
|
+
* filename already exists, it is overwritten and re-indexed.
|
|
4223
4547
|
* @param name Filename for the uploaded item.
|
|
4224
|
-
* @param content File content as a ReadableStream,
|
|
4548
|
+
* @param content File content as a ReadableStream, Blob, or string.
|
|
4225
4549
|
* @param options Optional metadata to attach to the item.
|
|
4226
4550
|
* @returns The created item info.
|
|
4227
4551
|
*/
|
|
4228
4552
|
upload(
|
|
4229
4553
|
name: string,
|
|
4230
|
-
content: ReadableStream |
|
|
4554
|
+
content: ReadableStream | Blob | string,
|
|
4231
4555
|
options?: AiSearchUploadItemOptions,
|
|
4232
4556
|
): Promise<AiSearchItemInfo>;
|
|
4233
4557
|
/**
|
|
4234
4558
|
* Upload a file and poll until processing completes.
|
|
4559
|
+
* Behaves as an upsert: if an item with the same filename already exists,
|
|
4560
|
+
* it is overwritten and re-indexed.
|
|
4235
4561
|
* @param name Filename for the uploaded item.
|
|
4236
|
-
* @param content File content as a ReadableStream,
|
|
4237
|
-
* @param options Optional metadata
|
|
4562
|
+
* @param content File content as a ReadableStream, Blob, or string.
|
|
4563
|
+
* @param options Optional metadata and polling configuration.
|
|
4238
4564
|
* @returns The item info after processing completes (or timeout).
|
|
4239
4565
|
*/
|
|
4240
4566
|
uploadAndPoll(
|
|
4241
4567
|
name: string,
|
|
4242
|
-
content: ReadableStream |
|
|
4243
|
-
options?: AiSearchUploadItemOptions
|
|
4568
|
+
content: ReadableStream | Blob | string,
|
|
4569
|
+
options?: AiSearchUploadItemOptions & {
|
|
4570
|
+
/** Polling interval in milliseconds (default 1000). */
|
|
4571
|
+
pollIntervalMs?: number;
|
|
4572
|
+
/** Maximum time to wait in milliseconds (default 30000). */
|
|
4573
|
+
timeoutMs?: number;
|
|
4574
|
+
},
|
|
4244
4575
|
): Promise<AiSearchItemInfo>;
|
|
4245
4576
|
/**
|
|
4246
4577
|
* Get an item by ID.
|
|
4247
4578
|
* @param itemId The item identifier.
|
|
4248
|
-
* @returns Item service for info,
|
|
4579
|
+
* @returns Item service for info, download, sync, logs, and chunks operations.
|
|
4249
4580
|
*/
|
|
4250
4581
|
get(itemId: string): AiSearchItem;
|
|
4251
|
-
/**
|
|
4582
|
+
/**
|
|
4583
|
+
* Delete an item from the instance.
|
|
4252
4584
|
* @param itemId The item identifier.
|
|
4253
4585
|
*/
|
|
4254
4586
|
delete(itemId: string): Promise<void>;
|
|
4255
4587
|
}
|
|
4256
4588
|
/**
|
|
4257
4589
|
* Single job service for an AI Search instance.
|
|
4258
|
-
* Provides info and
|
|
4590
|
+
* Provides info, logs, and cancel operations for a specific job.
|
|
4259
4591
|
*/
|
|
4260
4592
|
export declare abstract class AiSearchJob {
|
|
4261
4593
|
/** Get metadata about this job. */
|
|
4262
4594
|
info(): Promise<AiSearchJobInfo>;
|
|
4263
4595
|
/** Get logs for this job. */
|
|
4264
4596
|
logs(params?: AiSearchJobLogsParams): Promise<AiSearchJobLogsResponse>;
|
|
4597
|
+
/**
|
|
4598
|
+
* Cancel a running job.
|
|
4599
|
+
* @returns The updated job info.
|
|
4600
|
+
* @throws AiSearchNotFoundError if the job does not exist.
|
|
4601
|
+
*/
|
|
4602
|
+
cancel(): Promise<AiSearchJobInfo>;
|
|
4265
4603
|
}
|
|
4266
4604
|
/**
|
|
4267
4605
|
* Jobs collection service for an AI Search instance.
|
|
@@ -4279,7 +4617,7 @@ export declare abstract class AiSearchJobs {
|
|
|
4279
4617
|
/**
|
|
4280
4618
|
* Get a job by ID.
|
|
4281
4619
|
* @param jobId The job identifier.
|
|
4282
|
-
* @returns Job service for info and
|
|
4620
|
+
* @returns Job service for info, logs, and cancel operations.
|
|
4283
4621
|
*/
|
|
4284
4622
|
get(jobId: string): AiSearchJob;
|
|
4285
4623
|
}
|
|
@@ -4298,7 +4636,7 @@ export declare abstract class AiSearchJobs {
|
|
|
4298
4636
|
* // Via namespace binding
|
|
4299
4637
|
* const instance = env.AI_SEARCH.get("blog");
|
|
4300
4638
|
* const results = await instance.search({
|
|
4301
|
-
*
|
|
4639
|
+
* query: "How does caching work?",
|
|
4302
4640
|
* });
|
|
4303
4641
|
*
|
|
4304
4642
|
* // Via single instance binding
|
|
@@ -4310,7 +4648,7 @@ export declare abstract class AiSearchJobs {
|
|
|
4310
4648
|
export declare abstract class AiSearchInstance {
|
|
4311
4649
|
/**
|
|
4312
4650
|
* Search the AI Search instance for relevant chunks.
|
|
4313
|
-
* @param params Search request with messages and optional AI search options.
|
|
4651
|
+
* @param params Search request with query or messages and optional AI search options.
|
|
4314
4652
|
* @returns Search response with matching chunks and search query.
|
|
4315
4653
|
*/
|
|
4316
4654
|
search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>;
|
|
@@ -4342,7 +4680,7 @@ export declare abstract class AiSearchInstance {
|
|
|
4342
4680
|
info(): Promise<AiSearchInstanceInfo>;
|
|
4343
4681
|
/**
|
|
4344
4682
|
* Get instance statistics (item count, indexing status, etc.).
|
|
4345
|
-
* @returns Statistics with counts per status
|
|
4683
|
+
* @returns Statistics with counts per status, last activity time, and engine details.
|
|
4346
4684
|
*/
|
|
4347
4685
|
stats(): Promise<AiSearchStatsResponse>;
|
|
4348
4686
|
/** Items collection — list, upload, and manage items in this instance. */
|
|
@@ -4354,27 +4692,30 @@ export declare abstract class AiSearchInstance {
|
|
|
4354
4692
|
* Namespace-level AI Search service.
|
|
4355
4693
|
*
|
|
4356
4694
|
* Used as the type of `env.AI_SEARCH` (namespace binding via `ai_search_namespaces`).
|
|
4357
|
-
* Scoped to a single namespace. Provides dynamic instance access, creation,
|
|
4695
|
+
* Scoped to a single namespace. Provides dynamic instance access, creation, deletion,
|
|
4696
|
+
* and multi-instance search/chat operations.
|
|
4358
4697
|
*
|
|
4359
4698
|
* @example
|
|
4360
4699
|
* ```ts
|
|
4361
4700
|
* // Access an instance within the namespace
|
|
4362
4701
|
* const blog = env.AI_SEARCH.get("blog");
|
|
4363
|
-
* const results = await blog.search({
|
|
4364
|
-
* messages: [{ role: "user", content: "How does caching work?" }],
|
|
4365
|
-
* });
|
|
4702
|
+
* const results = await blog.search({ query: "How does caching work?" });
|
|
4366
4703
|
*
|
|
4367
4704
|
* // List all instances in the namespace
|
|
4368
4705
|
* const instances = await env.AI_SEARCH.list();
|
|
4369
4706
|
*
|
|
4370
4707
|
* // Create a new instance with built-in storage
|
|
4371
|
-
* const tenant = await env.AI_SEARCH.create({
|
|
4372
|
-
* id: "tenant-123",
|
|
4373
|
-
* });
|
|
4708
|
+
* const tenant = await env.AI_SEARCH.create({ id: "tenant-123" });
|
|
4374
4709
|
*
|
|
4375
4710
|
* // Upload items into the instance
|
|
4376
4711
|
* await tenant.items.upload("doc.pdf", fileContent);
|
|
4377
4712
|
*
|
|
4713
|
+
* // Search across multiple instances
|
|
4714
|
+
* const multi = await env.AI_SEARCH.search({
|
|
4715
|
+
* query: "caching",
|
|
4716
|
+
* ai_search_options: { instance_ids: ["blog", "docs"] },
|
|
4717
|
+
* });
|
|
4718
|
+
*
|
|
4378
4719
|
* // Delete an instance
|
|
4379
4720
|
* await env.AI_SEARCH.delete("tenant-123");
|
|
4380
4721
|
* ```
|
|
@@ -4387,10 +4728,11 @@ export declare abstract class AiSearchNamespace {
|
|
|
4387
4728
|
*/
|
|
4388
4729
|
get(name: string): AiSearchInstance;
|
|
4389
4730
|
/**
|
|
4390
|
-
* List
|
|
4391
|
-
* @
|
|
4731
|
+
* List instances in the bound namespace.
|
|
4732
|
+
* @param params Optional pagination, search, and ordering parameters.
|
|
4733
|
+
* @returns Array of instance metadata with pagination info.
|
|
4392
4734
|
*/
|
|
4393
|
-
list(): Promise<AiSearchListResponse>;
|
|
4735
|
+
list(params?: AiSearchListInstancesParams): Promise<AiSearchListResponse>;
|
|
4394
4736
|
/**
|
|
4395
4737
|
* Create a new instance within the bound namespace.
|
|
4396
4738
|
* @param config Instance configuration. Only `id` is required — omit `type` and `source` to create with built-in storage.
|
|
@@ -4415,6 +4757,35 @@ export declare abstract class AiSearchNamespace {
|
|
|
4415
4757
|
* @param name Instance name to delete.
|
|
4416
4758
|
*/
|
|
4417
4759
|
delete(name: string): Promise<void>;
|
|
4760
|
+
/**
|
|
4761
|
+
* Search across multiple instances within the bound namespace.
|
|
4762
|
+
* Fans out to the specified instance_ids and merges results.
|
|
4763
|
+
* @param params Search request with required `ai_search_options.instance_ids`.
|
|
4764
|
+
* @returns Search response with chunks tagged by instance_id and optional partial-failure errors.
|
|
4765
|
+
*/
|
|
4766
|
+
search(
|
|
4767
|
+
params: AiSearchMultiSearchRequest,
|
|
4768
|
+
): Promise<AiSearchMultiSearchResponse>;
|
|
4769
|
+
/**
|
|
4770
|
+
* Generate chat completions across multiple instances within the bound namespace (streaming).
|
|
4771
|
+
* Fans out to the specified instance_ids, merges context, and generates a response.
|
|
4772
|
+
* @param params Chat completions request with stream: true and required `ai_search_options.instance_ids`.
|
|
4773
|
+
* @returns ReadableStream of server-sent events.
|
|
4774
|
+
*/
|
|
4775
|
+
chatCompletions(
|
|
4776
|
+
params: AiSearchMultiChatCompletionsRequest & {
|
|
4777
|
+
stream: true;
|
|
4778
|
+
},
|
|
4779
|
+
): Promise<ReadableStream>;
|
|
4780
|
+
/**
|
|
4781
|
+
* Generate chat completions across multiple instances within the bound namespace.
|
|
4782
|
+
* Fans out to the specified instance_ids, merges context, and generates a response.
|
|
4783
|
+
* @param params Chat completions request with required `ai_search_options.instance_ids`.
|
|
4784
|
+
* @returns Chat completion response with choices, chunks tagged by instance_id, and optional partial-failure errors.
|
|
4785
|
+
*/
|
|
4786
|
+
chatCompletions(
|
|
4787
|
+
params: AiSearchMultiChatCompletionsRequest,
|
|
4788
|
+
): Promise<AiSearchMultiChatCompletionsResponse>;
|
|
4418
4789
|
}
|
|
4419
4790
|
export type AiImageClassificationInput = {
|
|
4420
4791
|
image: number[];
|
|
@@ -12076,8 +12447,11 @@ export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
|
12076
12447
|
* Evaluation context for targeting rules.
|
|
12077
12448
|
* Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
|
|
12078
12449
|
*/
|
|
12079
|
-
export type
|
|
12080
|
-
|
|
12450
|
+
export type FlagshipEvaluationContext = Record<
|
|
12451
|
+
string,
|
|
12452
|
+
string | number | boolean
|
|
12453
|
+
>;
|
|
12454
|
+
export interface FlagshipEvaluationDetails<T> {
|
|
12081
12455
|
flagKey: string;
|
|
12082
12456
|
value: T;
|
|
12083
12457
|
variant?: string | undefined;
|
|
@@ -12085,7 +12459,7 @@ export interface EvaluationDetails<T> {
|
|
|
12085
12459
|
errorCode?: string | undefined;
|
|
12086
12460
|
errorMessage?: string | undefined;
|
|
12087
12461
|
}
|
|
12088
|
-
export interface
|
|
12462
|
+
export interface FlagshipEvaluationError extends Error {}
|
|
12089
12463
|
/**
|
|
12090
12464
|
* Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
|
|
12091
12465
|
*
|
|
@@ -12105,7 +12479,7 @@ export interface FlagEvaluationError extends Error {}
|
|
|
12105
12479
|
* console.log(details.variant, details.reason);
|
|
12106
12480
|
* ```
|
|
12107
12481
|
*/
|
|
12108
|
-
export declare abstract class
|
|
12482
|
+
export declare abstract class Flagship {
|
|
12109
12483
|
/**
|
|
12110
12484
|
* Get a flag value without type checking.
|
|
12111
12485
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12115,7 +12489,7 @@ export declare abstract class Flags {
|
|
|
12115
12489
|
get(
|
|
12116
12490
|
flagKey: string,
|
|
12117
12491
|
defaultValue?: unknown,
|
|
12118
|
-
context?:
|
|
12492
|
+
context?: FlagshipEvaluationContext,
|
|
12119
12493
|
): Promise<unknown>;
|
|
12120
12494
|
/**
|
|
12121
12495
|
* Get a boolean flag value.
|
|
@@ -12126,7 +12500,7 @@ export declare abstract class Flags {
|
|
|
12126
12500
|
getBooleanValue(
|
|
12127
12501
|
flagKey: string,
|
|
12128
12502
|
defaultValue: boolean,
|
|
12129
|
-
context?:
|
|
12503
|
+
context?: FlagshipEvaluationContext,
|
|
12130
12504
|
): Promise<boolean>;
|
|
12131
12505
|
/**
|
|
12132
12506
|
* Get a string flag value.
|
|
@@ -12137,7 +12511,7 @@ export declare abstract class Flags {
|
|
|
12137
12511
|
getStringValue(
|
|
12138
12512
|
flagKey: string,
|
|
12139
12513
|
defaultValue: string,
|
|
12140
|
-
context?:
|
|
12514
|
+
context?: FlagshipEvaluationContext,
|
|
12141
12515
|
): Promise<string>;
|
|
12142
12516
|
/**
|
|
12143
12517
|
* Get a number flag value.
|
|
@@ -12148,7 +12522,7 @@ export declare abstract class Flags {
|
|
|
12148
12522
|
getNumberValue(
|
|
12149
12523
|
flagKey: string,
|
|
12150
12524
|
defaultValue: number,
|
|
12151
|
-
context?:
|
|
12525
|
+
context?: FlagshipEvaluationContext,
|
|
12152
12526
|
): Promise<number>;
|
|
12153
12527
|
/**
|
|
12154
12528
|
* Get an object flag value.
|
|
@@ -12159,7 +12533,7 @@ export declare abstract class Flags {
|
|
|
12159
12533
|
getObjectValue<T extends object>(
|
|
12160
12534
|
flagKey: string,
|
|
12161
12535
|
defaultValue: T,
|
|
12162
|
-
context?:
|
|
12536
|
+
context?: FlagshipEvaluationContext,
|
|
12163
12537
|
): Promise<T>;
|
|
12164
12538
|
/**
|
|
12165
12539
|
* Get a boolean flag value with full evaluation details.
|
|
@@ -12170,8 +12544,8 @@ export declare abstract class Flags {
|
|
|
12170
12544
|
getBooleanDetails(
|
|
12171
12545
|
flagKey: string,
|
|
12172
12546
|
defaultValue: boolean,
|
|
12173
|
-
context?:
|
|
12174
|
-
): Promise<
|
|
12547
|
+
context?: FlagshipEvaluationContext,
|
|
12548
|
+
): Promise<FlagshipEvaluationDetails<boolean>>;
|
|
12175
12549
|
/**
|
|
12176
12550
|
* Get a string flag value with full evaluation details.
|
|
12177
12551
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12181,8 +12555,8 @@ export declare abstract class Flags {
|
|
|
12181
12555
|
getStringDetails(
|
|
12182
12556
|
flagKey: string,
|
|
12183
12557
|
defaultValue: string,
|
|
12184
|
-
context?:
|
|
12185
|
-
): Promise<
|
|
12558
|
+
context?: FlagshipEvaluationContext,
|
|
12559
|
+
): Promise<FlagshipEvaluationDetails<string>>;
|
|
12186
12560
|
/**
|
|
12187
12561
|
* Get a number flag value with full evaluation details.
|
|
12188
12562
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12192,8 +12566,8 @@ export declare abstract class Flags {
|
|
|
12192
12566
|
getNumberDetails(
|
|
12193
12567
|
flagKey: string,
|
|
12194
12568
|
defaultValue: number,
|
|
12195
|
-
context?:
|
|
12196
|
-
): Promise<
|
|
12569
|
+
context?: FlagshipEvaluationContext,
|
|
12570
|
+
): Promise<FlagshipEvaluationDetails<number>>;
|
|
12197
12571
|
/**
|
|
12198
12572
|
* Get an object flag value with full evaluation details.
|
|
12199
12573
|
* @param flagKey The key of the flag to evaluate.
|
|
@@ -12203,8 +12577,8 @@ export declare abstract class Flags {
|
|
|
12203
12577
|
getObjectDetails<T extends object>(
|
|
12204
12578
|
flagKey: string,
|
|
12205
12579
|
defaultValue: T,
|
|
12206
|
-
context?:
|
|
12207
|
-
): Promise<
|
|
12580
|
+
context?: FlagshipEvaluationContext,
|
|
12581
|
+
): Promise<FlagshipEvaluationDetails<T>>;
|
|
12208
12582
|
}
|
|
12209
12583
|
/**
|
|
12210
12584
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|