@nexo-labs/payload-typesense 1.4.4 → 1.5.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/dist/index.d.mts CHANGED
@@ -23,12 +23,12 @@
23
23
  /// <reference path="./server.d.ts" />
24
24
 
25
25
  /// <reference types="node" />
26
+ import { AdapterSearchResult, BaseCollectionSchema, BaseDocument, EmbeddingProviderConfig, EmbeddingProviderConfig as EmbeddingProviderConfig$1, FieldMapping, IndexDocument, IndexerAdapter, PayloadDocument, TableConfig, VectorSearchOptions } from "@nexo-labs/payload-indexer";
26
27
  import * as React$2 from "react";
27
28
  import React$1, { CSSProperties, Component as Component$1, ReactNode, cloneElement } from "react";
28
29
  import { URL as URL$1, URLSearchParams as URLSearchParams$1 } from "url";
29
30
  import GraphQL, { ExecutionArgs, ExecutionResult, GraphQLFormattedError, GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType, GraphQLSchema, ValidationRule } from "graphql";
30
31
  import { BusboyConfig } from "busboy";
31
- import { JSONSchema4 } from "json-schema";
32
32
  import { Agent } from "http";
33
33
  import { Agent as Agent$1 } from "https";
34
34
  import { ParsedUrlQuery } from "querystring";
@@ -1123,36 +1123,248 @@ type Primitive = string | number | boolean | bigint | symbol | undefined | null;
1123
1123
  type Builtin = Primitive | Function | Date | Error | RegExp;
1124
1124
  //#endregion
1125
1125
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/is-any/index.d.ts
1126
- type IsAny<Type$1> = 0 extends 1 & Type$1 ? true : false;
1126
+ type IsAny<Type> = 0 extends 1 & Type ? true : false;
1127
1127
  //#endregion
1128
1128
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/is-unknown/index.d.ts
1129
- type IsUnknown<Type$1> = IsAny<Type$1> extends true ? false : unknown extends Type$1 ? true : false;
1129
+ type IsUnknown<Type> = IsAny<Type> extends true ? false : unknown extends Type ? true : false;
1130
1130
  //#endregion
1131
1131
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/mark-optional/index.d.ts
1132
- type MarkOptional<Type$1, Keys$2 extends keyof Type$1> = Type$1 extends Type$1 ? Omit<Type$1, Keys$2> & Partial<Pick<Type$1, Keys$2>> : never;
1132
+ type MarkOptional<Type, Keys$2 extends keyof Type> = Type extends Type ? Omit<Type, Keys$2> & Partial<Pick<Type, Keys$2>> : never;
1133
1133
  //#endregion
1134
1134
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/mark-required/index.d.ts
1135
- type MarkRequired<Type$1, Keys$2 extends keyof Type$1> = Type$1 extends Type$1 ? Type$1 & Required<Pick<Type$1, Keys$2>> : never;
1135
+ type MarkRequired<Type, Keys$2 extends keyof Type> = Type extends Type ? Type & Required<Pick<Type, Keys$2>> : never;
1136
1136
  //#endregion
1137
1137
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/is-tuple/index.d.ts
1138
- type IsTuple<Type$1> = Type$1 extends readonly any[] ? (any[] extends Type$1 ? never : Type$1) : never;
1138
+ type IsTuple<Type> = Type extends readonly any[] ? (any[] extends Type ? never : Type) : never;
1139
1139
  //#endregion
1140
1140
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/deep-partial/index.d.ts
1141
- type DeepPartial<Type$1> = Type$1 extends Exclude<Builtin, Error> ? Type$1 : Type$1 extends Map<infer Keys, infer Values> ? Map<DeepPartial<Keys>, DeepPartial<Values>> : Type$1 extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<DeepPartial<Keys>, DeepPartial<Values>> : Type$1 extends WeakMap<infer Keys, infer Values> ? WeakMap<DeepPartial<Keys>, DeepPartial<Values>> : Type$1 extends Set<infer Values> ? Set<DeepPartial<Values>> : Type$1 extends ReadonlySet<infer Values> ? ReadonlySet<DeepPartial<Values>> : Type$1 extends WeakSet<infer Values> ? WeakSet<DeepPartial<Values>> : Type$1 extends ReadonlyArray<infer Values> ? Type$1 extends IsTuple<Type$1> ? { [Key in keyof Type$1]?: DeepPartial<Type$1[Key]> } : Type$1 extends Array<Values> ? Array<DeepPartial<Values> | undefined> : ReadonlyArray<DeepPartial<Values> | undefined> : Type$1 extends Promise<infer Value> ? Promise<DeepPartial<Value>> : Type$1 extends {} ? { [Key in keyof Type$1]?: DeepPartial<Type$1[Key]> } : IsUnknown<Type$1> extends true ? unknown : Partial<Type$1>;
1141
+ type DeepPartial<Type> = Type extends Exclude<Builtin, Error> ? Type : Type extends Map<infer Keys, infer Values> ? Map<DeepPartial<Keys>, DeepPartial<Values>> : Type extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<DeepPartial<Keys>, DeepPartial<Values>> : Type extends WeakMap<infer Keys, infer Values> ? WeakMap<DeepPartial<Keys>, DeepPartial<Values>> : Type extends Set<infer Values> ? Set<DeepPartial<Values>> : Type extends ReadonlySet<infer Values> ? ReadonlySet<DeepPartial<Values>> : Type extends WeakSet<infer Values> ? WeakSet<DeepPartial<Values>> : Type extends ReadonlyArray<infer Values> ? Type extends IsTuple<Type> ? { [Key in keyof Type]?: DeepPartial<Type[Key]> } : Type extends Array<Values> ? Array<DeepPartial<Values> | undefined> : ReadonlyArray<DeepPartial<Values> | undefined> : Type extends Promise<infer Value> ? Promise<DeepPartial<Value>> : Type extends {} ? { [Key in keyof Type]?: DeepPartial<Type[Key]> } : IsUnknown<Type> extends true ? unknown : Partial<Type>;
1142
1142
  //#endregion
1143
1143
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/deep-required/index.d.ts
1144
- type DeepRequired<Type$1> = Type$1 extends Error ? Required<Type$1> : Type$1 extends Builtin ? Type$1 : Type$1 extends Map<infer Keys, infer Values> ? Map<DeepRequired<Keys>, DeepRequired<Values>> : Type$1 extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<DeepRequired<Keys>, DeepRequired<Values>> : Type$1 extends WeakMap<infer Keys, infer Values> ? WeakMap<DeepRequired<Keys>, DeepRequired<Values>> : Type$1 extends Set<infer Values> ? Set<DeepRequired<Values>> : Type$1 extends ReadonlySet<infer Values> ? ReadonlySet<DeepRequired<Values>> : Type$1 extends WeakSet<infer Values> ? WeakSet<DeepRequired<Values>> : Type$1 extends Promise<infer Value> ? Promise<DeepRequired<Value>> : Type$1 extends ReadonlyArray<infer Values> ? Type$1 extends IsTuple<Type$1> ? { [Key in keyof Type$1]-?: DeepRequired<Type$1[Key]> } : Type$1 extends Array<Values> ? Array<Exclude<DeepRequired<Values>, undefined>> : ReadonlyArray<Exclude<DeepRequired<Values>, undefined>> : Type$1 extends {} ? { [Key in keyof Type$1]-?: DeepRequired<Type$1[Key]> } : Required<Type$1>;
1144
+ type DeepRequired<Type> = Type extends Error ? Required<Type> : Type extends Builtin ? Type : Type extends Map<infer Keys, infer Values> ? Map<DeepRequired<Keys>, DeepRequired<Values>> : Type extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<DeepRequired<Keys>, DeepRequired<Values>> : Type extends WeakMap<infer Keys, infer Values> ? WeakMap<DeepRequired<Keys>, DeepRequired<Values>> : Type extends Set<infer Values> ? Set<DeepRequired<Values>> : Type extends ReadonlySet<infer Values> ? ReadonlySet<DeepRequired<Values>> : Type extends WeakSet<infer Values> ? WeakSet<DeepRequired<Values>> : Type extends Promise<infer Value> ? Promise<DeepRequired<Value>> : Type extends ReadonlyArray<infer Values> ? Type extends IsTuple<Type> ? { [Key in keyof Type]-?: DeepRequired<Type[Key]> } : Type extends Array<Values> ? Array<Exclude<DeepRequired<Values>, undefined>> : ReadonlyArray<Exclude<DeepRequired<Values>, undefined>> : Type extends {} ? { [Key in keyof Type]-?: DeepRequired<Type[Key]> } : Required<Type>;
1145
1145
  //#endregion
1146
1146
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/deep-undefinable/index.d.ts
1147
- type DeepUndefinable<Type$1> = Type$1 extends Builtin ? Type$1 | undefined : Type$1 extends Map<infer Keys, infer Values> ? Map<DeepUndefinable<Keys>, DeepUndefinable<Values>> : Type$1 extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<DeepUndefinable<Keys>, DeepUndefinable<Values>> : Type$1 extends WeakMap<infer Keys, infer Values> ? DeepUndefinable<Keys> extends object ? WeakMap<DeepUndefinable<Keys>, DeepUndefinable<Values>> : never : Type$1 extends Set<infer Values> ? Set<DeepUndefinable<Values>> : Type$1 extends ReadonlySet<infer Values> ? ReadonlySet<DeepUndefinable<Values>> : Type$1 extends WeakSet<infer Values> ? DeepUndefinable<Values> extends object ? WeakSet<DeepUndefinable<Values>> : never : Type$1 extends ReadonlyArray<infer Values> ? Type$1 extends IsTuple<Type$1> ? { [Key in keyof Type$1]: DeepUndefinable<Type$1[Key]> | undefined } : Type$1 extends Array<Values> ? Array<DeepUndefinable<Values>> : ReadonlyArray<DeepUndefinable<Values>> : Type$1 extends Promise<infer Value> ? Promise<DeepUndefinable<Value>> : Type$1 extends {} ? { [Key in keyof Type$1]: DeepUndefinable<Type$1[Key]> } : Type$1 | undefined;
1147
+ type DeepUndefinable<Type> = Type extends Builtin ? Type | undefined : Type extends Map<infer Keys, infer Values> ? Map<DeepUndefinable<Keys>, DeepUndefinable<Values>> : Type extends ReadonlyMap<infer Keys, infer Values> ? ReadonlyMap<DeepUndefinable<Keys>, DeepUndefinable<Values>> : Type extends WeakMap<infer Keys, infer Values> ? DeepUndefinable<Keys> extends object ? WeakMap<DeepUndefinable<Keys>, DeepUndefinable<Values>> : never : Type extends Set<infer Values> ? Set<DeepUndefinable<Values>> : Type extends ReadonlySet<infer Values> ? ReadonlySet<DeepUndefinable<Values>> : Type extends WeakSet<infer Values> ? DeepUndefinable<Values> extends object ? WeakSet<DeepUndefinable<Values>> : never : Type extends ReadonlyArray<infer Values> ? Type extends IsTuple<Type> ? { [Key in keyof Type]: DeepUndefinable<Type[Key]> | undefined } : Type extends Array<Values> ? Array<DeepUndefinable<Values>> : ReadonlyArray<DeepUndefinable<Values>> : Type extends Promise<infer Value> ? Promise<DeepUndefinable<Value>> : Type extends {} ? { [Key in keyof Type]: DeepUndefinable<Type[Key]> } : Type | undefined;
1148
1148
  //#endregion
1149
1149
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/optional-keys/index.d.ts
1150
- type OptionalKeys<Type$1> = Type$1 extends object ? keyof { [Key in keyof Type$1 as Type$1 extends Required<Pick<Type$1, Key>> ? never : Key]: never } : never;
1150
+ type OptionalKeys<Type> = Type extends object ? keyof { [Key in keyof Type as Type extends Required<Pick<Type, Key>> ? never : Key]: never } : never;
1151
1151
  //#endregion
1152
1152
  //#region ../../node_modules/.pnpm/ts-essentials@10.0.3_typescript@5.7.3/node_modules/ts-essentials/dist/required-keys/index.d.ts
1153
- type RequiredKeys<Type$1> = Type$1 extends unknown ? Exclude<keyof Type$1, OptionalKeys<Type$1>> : never;
1153
+ type RequiredKeys<Type> = Type extends unknown ? Exclude<keyof Type, OptionalKeys<Type>> : never;
1154
1154
  //#endregion
1155
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/load-custom-routes.d.ts
1155
+ //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
1156
+ // ==================================================================================================
1157
+ // JSON Schema Draft 04
1158
+ // ==================================================================================================
1159
+
1160
+ /**
1161
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
1162
+ */
1163
+ type JSONSchema4TypeName = "string" //
1164
+ | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any";
1165
+ /**
1166
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
1167
+ */
1168
+ type JSONSchema4Type = string //
1169
+ | number | boolean | JSONSchema4Object | JSONSchema4Array | null;
1170
+ // Workaround for infinite type recursion
1171
+ interface JSONSchema4Object {
1172
+ [key: string]: JSONSchema4Type;
1173
+ }
1174
+ // Workaround for infinite type recursion
1175
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
1176
+ interface JSONSchema4Array extends Array<JSONSchema4Type> {}
1177
+ /**
1178
+ * Meta schema
1179
+ *
1180
+ * Recommended values:
1181
+ * - 'http://json-schema.org/schema#'
1182
+ * - 'http://json-schema.org/hyper-schema#'
1183
+ * - 'http://json-schema.org/draft-04/schema#'
1184
+ * - 'http://json-schema.org/draft-04/hyper-schema#'
1185
+ * - 'http://json-schema.org/draft-03/schema#'
1186
+ * - 'http://json-schema.org/draft-03/hyper-schema#'
1187
+ *
1188
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
1189
+ */
1190
+ type JSONSchema4Version = string;
1191
+ /**
1192
+ * JSON Schema V4
1193
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
1194
+ */
1195
+ interface JSONSchema4 {
1196
+ id?: string | undefined;
1197
+ $ref?: string | undefined;
1198
+ $schema?: JSONSchema4Version | undefined;
1199
+
1200
+ /**
1201
+ * This attribute is a string that provides a short description of the
1202
+ * instance property.
1203
+ *
1204
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
1205
+ */
1206
+ title?: string | undefined;
1207
+
1208
+ /**
1209
+ * This attribute is a string that provides a full description of the of
1210
+ * purpose the instance property.
1211
+ *
1212
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
1213
+ */
1214
+ description?: string | undefined;
1215
+ default?: JSONSchema4Type | undefined;
1216
+ multipleOf?: number | undefined;
1217
+ maximum?: number | undefined;
1218
+ exclusiveMaximum?: boolean | undefined;
1219
+ minimum?: number | undefined;
1220
+ exclusiveMinimum?: boolean | undefined;
1221
+ maxLength?: number | undefined;
1222
+ minLength?: number | undefined;
1223
+ pattern?: string | undefined;
1224
+
1225
+ /**
1226
+ * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
1227
+ *
1228
+ * This provides a definition for additional items in an array instance
1229
+ * when tuple definitions of the items is provided. This can be false
1230
+ * to indicate additional items in the array are not allowed, or it can
1231
+ * be a schema that defines the schema of the additional items.
1232
+ *
1233
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
1234
+ */
1235
+ additionalItems?: boolean | JSONSchema4 | undefined;
1236
+
1237
+ /**
1238
+ * This attribute defines the allowed items in an instance array, and
1239
+ * MUST be a schema or an array of schemas. The default value is an
1240
+ * empty schema which allows any value for items in the instance array.
1241
+ *
1242
+ * When this attribute value is a schema and the instance value is an
1243
+ * array, then all the items in the array MUST be valid according to the
1244
+ * schema.
1245
+ *
1246
+ * When this attribute value is an array of schemas and the instance
1247
+ * value is an array, each position in the instance array MUST conform
1248
+ * to the schema in the corresponding position for this array. This
1249
+ * called tuple typing. When tuple typing is used, additional items are
1250
+ * allowed, disallowed, or constrained by the "additionalItems"
1251
+ * (Section 5.6) attribute using the same rules as
1252
+ * "additionalProperties" (Section 5.4) for objects.
1253
+ *
1254
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
1255
+ */
1256
+ items?: JSONSchema4 | JSONSchema4[] | undefined;
1257
+ maxItems?: number | undefined;
1258
+ minItems?: number | undefined;
1259
+ uniqueItems?: boolean | undefined;
1260
+ maxProperties?: number | undefined;
1261
+ minProperties?: number | undefined;
1262
+
1263
+ /**
1264
+ * This attribute indicates if the instance must have a value, and not
1265
+ * be undefined. This is false by default, making the instance
1266
+ * optional.
1267
+ *
1268
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
1269
+ */
1270
+ required?: boolean | string[] | undefined;
1271
+
1272
+ /**
1273
+ * This attribute defines a schema for all properties that are not
1274
+ * explicitly defined in an object type definition. If specified, the
1275
+ * value MUST be a schema or a boolean. If false is provided, no
1276
+ * additional properties are allowed beyond the properties defined in
1277
+ * the schema. The default value is an empty schema which allows any
1278
+ * value for additional properties.
1279
+ *
1280
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
1281
+ */
1282
+ additionalProperties?: boolean | JSONSchema4 | undefined;
1283
+ definitions?: {
1284
+ [k: string]: JSONSchema4;
1285
+ } | undefined;
1286
+
1287
+ /**
1288
+ * This attribute is an object with property definitions that define the
1289
+ * valid values of instance object property values. When the instance
1290
+ * value is an object, the property values of the instance object MUST
1291
+ * conform to the property definitions in this object. In this object,
1292
+ * each property definition's value MUST be a schema, and the property's
1293
+ * name MUST be the name of the instance property that it defines. The
1294
+ * instance property value MUST be valid according to the schema from
1295
+ * the property definition. Properties are considered unordered, the
1296
+ * order of the instance properties MAY be in any order.
1297
+ *
1298
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
1299
+ */
1300
+ properties?: {
1301
+ [k: string]: JSONSchema4;
1302
+ } | undefined;
1303
+
1304
+ /**
1305
+ * This attribute is an object that defines the schema for a set of
1306
+ * property names of an object instance. The name of each property of
1307
+ * this attribute's object is a regular expression pattern in the ECMA
1308
+ * 262/Perl 5 format, while the value is a schema. If the pattern
1309
+ * matches the name of a property on the instance object, the value of
1310
+ * the instance's property MUST be valid against the pattern name's
1311
+ * schema value.
1312
+ *
1313
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
1314
+ */
1315
+ patternProperties?: {
1316
+ [k: string]: JSONSchema4;
1317
+ } | undefined;
1318
+ dependencies?: {
1319
+ [k: string]: JSONSchema4 | string[];
1320
+ } | undefined;
1321
+
1322
+ /**
1323
+ * This provides an enumeration of all possible values that are valid
1324
+ * for the instance property. This MUST be an array, and each item in
1325
+ * the array represents a possible value for the instance value. If
1326
+ * this attribute is defined, the instance value MUST be one of the
1327
+ * values in the array in order for the schema to be valid.
1328
+ *
1329
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
1330
+ */
1331
+ enum?: JSONSchema4Type[] | undefined;
1332
+
1333
+ /**
1334
+ * A single type, or a union of simple types
1335
+ */
1336
+ type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
1337
+ allOf?: JSONSchema4[] | undefined;
1338
+ anyOf?: JSONSchema4[] | undefined;
1339
+ oneOf?: JSONSchema4[] | undefined;
1340
+ not?: JSONSchema4 | undefined;
1341
+
1342
+ /**
1343
+ * The value of this property MUST be another schema which will provide
1344
+ * a base schema which the current schema will inherit from. The
1345
+ * inheritance rules are such that any instance that is valid according
1346
+ * to the current schema MUST be valid according to the referenced
1347
+ * schema. This MAY also be an array, in which case, the instance MUST
1348
+ * be valid for all the schemas in the array. A schema that extends
1349
+ * another schema MAY define additional attributes, constrain existing
1350
+ * attributes, or add other constraints.
1351
+ *
1352
+ * Conceptually, the behavior of extends can be seen as validating an
1353
+ * instance against all constraints in the extending schema as well as
1354
+ * the extended schema(s).
1355
+ *
1356
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
1357
+ */
1358
+ extends?: string | string[] | undefined;
1359
+
1360
+ /**
1361
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
1362
+ */
1363
+ [k: string]: any;
1364
+ format?: string | undefined;
1365
+ }
1366
+ //#endregion
1367
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/load-custom-routes.d.ts
1156
1368
  type RouteHas = {
1157
1369
  type: string;
1158
1370
  key: string;
@@ -1163,7 +1375,7 @@ type RouteHas = {
1163
1375
  value: string;
1164
1376
  };
1165
1377
  //#endregion
1166
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/build/analysis/get-page-static-info.d.ts
1378
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/build/analysis/get-page-static-info.d.ts
1167
1379
  type MiddlewareMatcher = {
1168
1380
  regexp: string;
1169
1381
  locale?: false;
@@ -1172,14 +1384,14 @@ type MiddlewareMatcher = {
1172
1384
  originalSource: string;
1173
1385
  };
1174
1386
  //#endregion
1175
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/shared/lib/constants.d.ts
1387
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/shared/lib/constants.d.ts
1176
1388
  declare const COMPILER_NAMES: {
1177
1389
  readonly client: "client";
1178
1390
  readonly server: "server";
1179
1391
  readonly edgeServer: "edge-server";
1180
1392
  };
1181
1393
  //#endregion
1182
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/client/route-loader.d.ts
1394
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/client/route-loader.d.ts
1183
1395
  declare global {
1184
1396
  interface Window {
1185
1397
  __BUILD_MANIFEST?: Record<string, string[]>;
@@ -1196,7 +1408,7 @@ declare global {
1196
1408
  }
1197
1409
  }
1198
1410
  //#endregion
1199
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/client/page-loader.d.ts
1411
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/client/page-loader.d.ts
1200
1412
  declare global {
1201
1413
  interface Window {
1202
1414
  __DEV_MIDDLEWARE_MATCHERS?: MiddlewareMatcher[];
@@ -1208,21 +1420,21 @@ declare global {
1208
1420
  }
1209
1421
  }
1210
1422
  //#endregion
1211
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/shared/lib/router/router.d.ts
1423
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/shared/lib/router/router.d.ts
1212
1424
  declare global {
1213
1425
  interface Window {
1214
1426
  __NEXT_DATA__: NEXT_DATA;
1215
1427
  }
1216
1428
  }
1217
1429
  //#endregion
1218
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/shared/lib/loadable.shared-runtime.d.ts
1430
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/shared/lib/loadable.shared-runtime.d.ts
1219
1431
  declare global {
1220
1432
  interface Window {
1221
1433
  __NEXT_PRELOADREADY?: (ids?: (string | number)[]) => Promise<void>;
1222
1434
  }
1223
1435
  }
1224
1436
  //#endregion
1225
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/metadata/types/alternative-urls-types.d.ts
1437
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/metadata/types/alternative-urls-types.d.ts
1226
1438
  type LangCode = 'aa' | 'ab' | 'ae' | 'af' | 'ak' | 'am' | 'an' | 'ar' | 'as' | 'av' | 'ay' | 'az' | 'ba' | 'be' | 'bg' | 'bh' | 'bi' | 'bm' | 'bn' | 'bo' | 'br' | 'bs' | 'ca' | 'ce' | 'ch' | 'co' | 'cr' | 'cs' | 'cu' | 'cv' | 'cy' | 'da' | 'de' | 'dv' | 'dz' | 'ee' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'ff' | 'fi' | 'fj' | 'fo' | 'fr' | 'fy' | 'ga' | 'gd' | 'gl' | 'gn' | 'gu' | 'gv' | 'ha' | 'he' | 'hi' | 'ho' | 'hr' | 'ht' | 'hu' | 'hy' | 'hz' | 'ia' | 'id' | 'ie' | 'ig' | 'ii' | 'ik' | 'io' | 'is' | 'it' | 'iu' | 'ja' | 'jv' | 'ka' | 'kg' | 'ki' | 'kj' | 'kk' | 'kl' | 'km' | 'kn' | 'ko' | 'kr' | 'ks' | 'ku' | 'kv' | 'kw' | 'ky' | 'la' | 'lb' | 'lg' | 'li' | 'ln' | 'lo' | 'lt' | 'lu' | 'lv' | 'mg' | 'mh' | 'mi' | 'mk' | 'ml' | 'mn' | 'mr' | 'ms' | 'mt' | 'my' | 'na' | 'nb' | 'nd' | 'ne' | 'ng' | 'nl' | 'nn' | 'no' | 'nr' | 'nv' | 'ny' | 'oc' | 'oj' | 'om' | 'or' | 'os' | 'pa' | 'pi' | 'pl' | 'ps' | 'pt' | 'qu' | 'rm' | 'rn' | 'ro' | 'ru' | 'rw' | 'sa' | 'sc' | 'sd' | 'se' | 'sg' | 'si' | 'sk' | 'sl' | 'sm' | 'sn' | 'so' | 'sq' | 'sr' | 'ss' | 'st' | 'su' | 'sv' | 'sw' | 'ta' | 'te' | 'tg' | 'th' | 'ti' | 'tk' | 'tl' | 'tn' | 'to' | 'tr' | 'ts' | 'tt' | 'tw' | 'ty' | 'ug' | 'uk' | 'ur' | 'uz' | 've' | 'vi' | 'vo' | 'wa' | 'wo' | 'xh' | 'yi' | 'yo' | 'za' | 'zh' | 'zu' | 'af-ZA' | 'am-ET' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'arn-CL' | 'ar-OM' | 'ar-QA' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'as-IN' | 'az-az' | 'az-Cyrl-AZ' | 'az-Latn-AZ' | 'ba-RU' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'bn-IN' | 'bo-CN' | 'br-FR' | 'bs-Cyrl-BA' | 'bs-Latn-BA' | 'ca-ES' | 'co-FR' | 'cs-CZ' | 'cy-GB' | 'da-DK' | 'de-AT' | 'de-CH' | 'de-DE' | 'de-LI' | 'de-LU' | 'dsb-DE' | 'dv-MV' | 'el-CY' | 'el-GR' | 'en-029' | 'en-AU' | 'en-BZ' | 'en-CA' | 'en-cb' | 'en-GB' | 'en-IE' | 'en-IN' | 'en-JM' | 'en-MT' | 'en-MY' | 'en-NZ' | 'en-PH' | 'en-SG' | 'en-TT' | 'en-US' | 'en-ZA' | 'en-ZW' | 'es-AR' | 'es-BO' | 'es-CL' | 'es-CO' | 'es-CR' | 'es-DO' | 'es-EC' | 'es-ES' | 'es-GT' | 'es-HN' | 'es-MX' | 'es-NI' | 'es-PA' | 'es-PE' | 'es-PR' | 'es-PY' | 'es-SV' | 'es-US' | 'es-UY' | 'es-VE' | 'et-EE' | 'eu-ES' | 'fa-IR' | 'fi-FI' | 'fil-PH' | 'fo-FO' | 'fr-BE' | 'fr-CA' | 'fr-CH' | 'fr-FR' | 'fr-LU' | 'fr-MC' | 'fy-NL' | 'ga-IE' | 'gd-GB' | 'gd-ie' | 'gl-ES' | 'gsw-FR' | 'gu-IN' | 'ha-Latn-NG' | 'he-IL' | 'hi-IN' | 'hr-BA' | 'hr-HR' | 'hsb-DE' | 'hu-HU' | 'hy-AM' | 'id-ID' | 'ig-NG' | 'ii-CN' | 'in-ID' | 'is-IS' | 'it-CH' | 'it-IT' | 'iu-Cans-CA' | 'iu-Latn-CA' | 'iw-IL' | 'ja-JP' | 'ka-GE' | 'kk-KZ' | 'kl-GL' | 'km-KH' | 'kn-IN' | 'kok-IN' | 'ko-KR' | 'ky-KG' | 'lb-LU' | 'lo-LA' | 'lt-LT' | 'lv-LV' | 'mi-NZ' | 'mk-MK' | 'ml-IN' | 'mn-MN' | 'mn-Mong-CN' | 'moh-CA' | 'mr-IN' | 'ms-BN' | 'ms-MY' | 'mt-MT' | 'nb-NO' | 'ne-NP' | 'nl-BE' | 'nl-NL' | 'nn-NO' | 'no-no' | 'nso-ZA' | 'oc-FR' | 'or-IN' | 'pa-IN' | 'pl-PL' | 'prs-AF' | 'ps-AF' | 'pt-BR' | 'pt-PT' | 'qut-GT' | 'quz-BO' | 'quz-EC' | 'quz-PE' | 'rm-CH' | 'ro-mo' | 'ro-RO' | 'ru-mo' | 'ru-RU' | 'rw-RW' | 'sah-RU' | 'sa-IN' | 'se-FI' | 'se-NO' | 'se-SE' | 'si-LK' | 'sk-SK' | 'sl-SI' | 'sma-NO' | 'sma-SE' | 'smj-NO' | 'smj-SE' | 'smn-FI' | 'sms-FI' | 'sq-AL' | 'sr-BA' | 'sr-CS' | 'sr-Cyrl-BA' | 'sr-Cyrl-CS' | 'sr-Cyrl-ME' | 'sr-Cyrl-RS' | 'sr-Latn-BA' | 'sr-Latn-CS' | 'sr-Latn-ME' | 'sr-Latn-RS' | 'sr-ME' | 'sr-RS' | 'sr-sp' | 'sv-FI' | 'sv-SE' | 'sw-KE' | 'syr-SY' | 'ta-IN' | 'te-IN' | 'tg-Cyrl-TJ' | 'th-TH' | 'tk-TM' | 'tlh-QS' | 'tn-ZA' | 'tr-TR' | 'tt-RU' | 'tzm-Latn-DZ' | 'ug-CN' | 'uk-UA' | 'ur-PK' | 'uz-Cyrl-UZ' | 'uz-Latn-UZ' | 'uz-uz' | 'vi-VN' | 'wo-SN' | 'xh-ZA' | 'yo-NG' | 'zh-CN' | 'zh-HK' | 'zh-MO' | 'zh-SG' | 'zh-TW' | 'zh-Hans' | 'zh-Hant' | 'zu-ZA' | `${Lowercase<string>}-${string}`;
1227
1439
  type UnmatchedLang = 'x-default';
1228
1440
  type HrefLang = LangCode | UnmatchedLang;
@@ -1242,7 +1454,7 @@ type AlternateURLs = {
1242
1454
  } | undefined;
1243
1455
  };
1244
1456
  //#endregion
1245
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/metadata/types/extra-types.d.ts
1457
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/metadata/types/extra-types.d.ts
1246
1458
  type AppLinks = {
1247
1459
  ios?: AppLinksApple | Array<AppLinksApple> | undefined;
1248
1460
  iphone?: AppLinksApple | Array<AppLinksApple> | undefined;
@@ -1319,7 +1531,7 @@ type FormatDetection = {
1319
1531
  url?: boolean | undefined;
1320
1532
  };
1321
1533
  //#endregion
1322
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/metadata/types/metadata-types.d.ts
1534
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/metadata/types/metadata-types.d.ts
1323
1535
  /**
1324
1536
  *
1325
1537
  * Metadata types
@@ -1420,7 +1632,7 @@ type ThemeColorDescriptor = {
1420
1632
  media?: string | undefined;
1421
1633
  };
1422
1634
  //#endregion
1423
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/metadata/types/opengraph-types.d.ts
1635
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/metadata/types/opengraph-types.d.ts
1424
1636
  type OpenGraph = OpenGraphWebsite | OpenGraphArticle | OpenGraphBook | OpenGraphProfile | OpenGraphMusicSong | OpenGraphMusicAlbum | OpenGraphMusicPlaylist | OpenGraphRadioStation | OpenGraphVideoMovie | OpenGraphVideoEpisode | OpenGraphVideoTVShow | OpenGraphVideoOther | OpenGraphMetadata;
1425
1637
  type Locale$3 = string;
1426
1638
  type OpenGraphMetadata = {
@@ -1550,7 +1762,7 @@ type OGActor = {
1550
1762
  role?: string | undefined;
1551
1763
  };
1552
1764
  //#endregion
1553
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/metadata/types/twitter-types.d.ts
1765
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/metadata/types/twitter-types.d.ts
1554
1766
  type Twitter = TwitterSummary | TwitterSummaryLargeImage | TwitterPlayer | TwitterApp | TwitterMetadata;
1555
1767
  type TwitterMetadata = {
1556
1768
  site?: string | undefined;
@@ -1604,7 +1816,7 @@ type TwitterPlayerDescriptor = {
1604
1816
  height: number;
1605
1817
  };
1606
1818
  //#endregion
1607
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/lib/metadata/types/metadata-interface.d.ts
1819
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/lib/metadata/types/metadata-interface.d.ts
1608
1820
  /**
1609
1821
  * Metadata interface to describe all the metadata fields that can be set in a document.
1610
1822
  *
@@ -2075,7 +2287,7 @@ interface Metadata$1 extends DeprecatedMetadataFields {
2075
2287
  * and relative URLs are composed with `metadataBase`.
2076
2288
  */
2077
2289
  //#endregion
2078
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/server/config-shared.d.ts
2290
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/server/config-shared.d.ts
2079
2291
  interface DomainLocale {
2080
2292
  defaultLocale: string;
2081
2293
  domain: string;
@@ -2083,7 +2295,7 @@ interface DomainLocale {
2083
2295
  locales?: readonly string[];
2084
2296
  }
2085
2297
  //#endregion
2086
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/shared/lib/utils.d.ts
2298
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/shared/lib/utils.d.ts
2087
2299
  type NEXT_DATA = {
2088
2300
  props: Record<string, any>;
2089
2301
  page: string;
@@ -2116,7 +2328,7 @@ type NEXT_DATA = {
2116
2328
  notFoundSrcPage?: string;
2117
2329
  };
2118
2330
  //#endregion
2119
- //#region ../../node_modules/.pnpm/next@15.4.8_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-p_1eda7325b4c551db31b014561614ff25/node_modules/next/dist/types.d.ts
2331
+ //#region ../../node_modules/.pnpm/next@15.4.10_@babel+core@7.27.7_@opentelemetry+api@1.9.0_@playwright+test@1.56.1_babel-_7611c050995f5fd562decbf9927e8c4b/node_modules/next/dist/types.d.ts
2120
2332
  declare module 'react' {
2121
2333
  interface HtmlHTMLAttributes<T> extends React$1.HTMLAttributes<T> {
2122
2334
  amp?: string;
@@ -16210,8 +16422,8 @@ type RootFoldersConfiguration = {
16210
16422
  collectionOverrides?: (({
16211
16423
  collection
16212
16424
  }: {
16213
- collection: Omit<CollectionConfig$1, 'trash'>;
16214
- }) => Omit<CollectionConfig$1, 'trash'> | Promise<Omit<CollectionConfig$1, 'trash'>>)[];
16425
+ collection: Omit<CollectionConfig, 'trash'>;
16426
+ }) => Omit<CollectionConfig, 'trash'> | Promise<Omit<CollectionConfig, 'trash'>>)[];
16215
16427
  /**
16216
16428
  * If true, you can scope folders to specific collections.
16217
16429
  *
@@ -16868,8 +17080,8 @@ type JobsConfig = {
16868
17080
  * a new collection.
16869
17081
  */
16870
17082
  jobsCollectionOverrides?: (args: {
16871
- defaultJobsCollection: CollectionConfig$1;
16872
- }) => CollectionConfig$1;
17083
+ defaultJobsCollection: CollectionConfig;
17084
+ }) => CollectionConfig;
16873
17085
  /**
16874
17086
  * Adjust the job processing order using a Payload sort string. This can be set globally or per queue.
16875
17087
  *
@@ -17816,7 +18028,7 @@ type Config = {
17816
18028
  *
17817
18029
  * @see https://payloadcms.com/docs/configuration/collections#collection-configs
17818
18030
  */
17819
- collections?: CollectionConfig$1[];
18031
+ collections?: CollectionConfig[];
17820
18032
  /**
17821
18033
  * Compatibility flags for prior Payload versions
17822
18034
  */
@@ -18041,7 +18253,7 @@ type Config = {
18041
18253
  update?: QueryPresetConstraints;
18042
18254
  };
18043
18255
  filterConstraints?: SelectField['filterOptions'];
18044
- labels?: CollectionConfig$1['labels'];
18256
+ labels?: CollectionConfig['labels'];
18045
18257
  };
18046
18258
  /**
18047
18259
  * Control the routing structure that Payload binds itself to.
@@ -21598,7 +21810,7 @@ type CollectionAdminOptions = {
21598
21810
  useAsTitle?: string;
21599
21811
  };
21600
21812
  /** Manage all aspects of a data collection */
21601
- type CollectionConfig$1<TSlug extends CollectionSlug = any> = {
21813
+ type CollectionConfig<TSlug extends CollectionSlug = any> = {
21602
21814
  /**
21603
21815
  * Do not set this property manually. This is set to true during sanitization, to avoid
21604
21816
  * sanitizing the same collection multiple times.
@@ -21814,7 +22026,7 @@ type SanitizedJoins = {
21814
22026
  * @todo remove the `DeepRequired` in v4.
21815
22027
  * We don't actually guarantee that all properties are set when sanitizing configs.
21816
22028
  */
21817
- interface SanitizedCollectionConfig extends Omit<DeepRequired<CollectionConfig$1>, 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'> {
22029
+ interface SanitizedCollectionConfig extends Omit<DeepRequired<CollectionConfig>, 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'> {
21818
22030
  admin: CollectionAdminOptions;
21819
22031
  auth: Auth;
21820
22032
  endpoints: Endpoint[] | false;
@@ -24037,7 +24249,7 @@ interface KVAdapterResult {
24037
24249
  payload: Payload;
24038
24250
  }): KVAdapter;
24039
24251
  /** Adapter can create additional collection if needed */
24040
- kvCollection?: CollectionConfig$1;
24252
+ kvCollection?: CollectionConfig;
24041
24253
  }
24042
24254
  //#endregion
24043
24255
  //#region ../../node_modules/.pnpm/payload@3.69.0_graphql@16.10.0_typescript@5.7.3/node_modules/payload/dist/auth/crypto.d.ts
@@ -25230,524 +25442,372 @@ interface CollectionAdminCustom extends Record<string, any> {}
25230
25442
  interface GlobalCustom extends Record<string, any> {}
25231
25443
  interface GlobalAdminCustom extends Record<string, any> {}
25232
25444
  //#endregion
25233
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Types.d.ts
25234
- type DropTokensMode = "right_to_left" | "left_to_right" | "both_sides:3";
25235
- type OperationMode = "off" | "always" | "fallback";
25236
- type CommaSeparated<T extends string, ToExtend, OriginalString extends string = T, Previous extends string[] = []> = T extends `${infer Start},${infer Rest}` ? TrimString<Start> extends ToExtend ? CommaSeparated<Rest, ToExtend, OriginalString, [...Previous, TrimString<Start>]> : {
25237
- error: "Invalid operation mode";
25238
- value: TrimString<Start>;
25239
- } : TrimString<T> extends ToExtend ? OriginalString : {
25240
- error: "Invalid operation mode";
25241
- value: TrimString<T>;
25242
- };
25243
- interface SearchParams$1<TDoc extends DocumentSchema, Infix extends string = string> {
25244
- q?: "*" | (string & {});
25245
- query_by?: string | string[];
25246
- query_by_weights?: string | number[];
25247
- prefix?: string | boolean | boolean[];
25248
- filter_by?: string;
25249
- max_filter_by_candidates?: number;
25250
- enable_synonyms?: boolean;
25251
- enable_analytics?: boolean;
25252
- filter_curated_hits?: boolean;
25253
- enable_lazy_filter?: boolean;
25254
- sort_by?: string | string[];
25255
- facet_by?: string | string[];
25256
- max_facet_values?: number;
25257
- facet_sample_threshold?: number;
25258
- facet_sample_percent?: number;
25259
- facet_query?: string;
25260
- facet_query_num_typos?: number;
25261
- facet_return_parent?: string;
25262
- facet_strategy?: "exhaustive" | "top_values" | "automatic";
25263
- page?: number;
25264
- per_page?: number;
25265
- group_by?: string | string[];
25266
- group_limit?: number;
25267
- group_missing_values?: boolean;
25268
- include_fields?: string | string[];
25269
- exclude_fields?: string | string[];
25270
- highlight_fields?: string | string[];
25271
- highlight_full_fields?: string | string[];
25272
- highlight_affix_num_tokens?: number;
25273
- highlight_start_tag?: string;
25274
- highlight_end_tag?: string;
25275
- enable_highlight_v1?: boolean;
25276
- snippet_threshold?: number;
25277
- nl_query?: boolean;
25278
- nl_model_id?: string;
25279
- nl_query_debug?: boolean;
25280
- nl_query_prompt_cache_ttl?: number;
25281
- num_typos?: string | number | number[];
25282
- min_len_1typo?: number;
25283
- min_len_2typo?: number;
25284
- split_join_tokens?: OperationMode;
25285
- exhaustive_search?: boolean;
25286
- drop_tokens_threshold?: number;
25287
- drop_tokens_mode?: DropTokensMode;
25288
- typo_tokens_threshold?: number;
25289
- pinned_hits?: string | string[];
25290
- hidden_hits?: string | string[];
25291
- limit_hits?: number;
25292
- pre_segmented_query?: boolean;
25293
- enable_overrides?: boolean;
25294
- override_tags?: string | string[];
25295
- prioritize_exact_match?: boolean;
25296
- prioritize_token_position?: boolean;
25297
- prioritize_num_matching_fields?: boolean;
25298
- search_cutoff_ms?: number;
25299
- use_cache?: boolean;
25300
- max_candidates?: number;
25301
- infix?: CommaSeparated<Infix, OperationMode> | OperationMode[] | OperationMode;
25302
- preset?: string;
25303
- text_match_type?: "max_score" | "max_weight" | "sum_score";
25304
- vector_query?: string;
25305
- "x-typesense-api-key"?: string;
25306
- "x-typesense-user-id"?: string;
25307
- offset?: number;
25308
- limit?: number;
25309
- stopwords?: string;
25310
- conversation?: boolean;
25311
- validate_field_names?: boolean;
25312
- conversation_stream?: boolean;
25313
- conversation_model_id?: string;
25314
- conversation_id?: string;
25315
- voice_query?: string;
25316
- streamConfig?: StreamConfig<TDoc>;
25317
- }
25318
- interface SearchResponseRequestParams {
25319
- collection_name?: string;
25320
- q?: string;
25321
- page?: number;
25322
- per_page?: number;
25323
- first_q?: string;
25324
- voice_query?: {
25325
- transcribed_query?: string;
25326
- };
25445
+ //#region src/shared/types/plugin-types.d.ts
25446
+ /**
25447
+ * Hybrid search configuration for combining semantic and keyword search
25448
+ */
25449
+ interface HybridSearchConfig {
25450
+ /** Weight between semantic (1.0) and keyword (0.0) search. Default: 0.9 (90% semantic, 10% keyword) */
25451
+ alpha?: number;
25452
+ /** Whether to rerank hybrid search results. Default: true */
25453
+ rerankMatches?: boolean;
25454
+ /** Fields to use for keyword search portion. Default: 'chunk_text,title' */
25455
+ queryFields?: string;
25327
25456
  }
25328
- interface SearchableDocuments<T extends DocumentSchema = DocumentSchema, Infix extends string = string> {
25329
- search(searchParameters: SearchParams$1<T, Infix> | SearchParamsWithPreset<T, Infix>, options: SearchOptions): Promise<SearchResponse$1<T>>;
25330
- clearCache(): void;
25457
+ /**
25458
+ * HNSW (Hierarchical Navigable Small World) optimization parameters
25459
+ * These optimize vector search performance and quality
25460
+ */
25461
+ interface HNSWConfig {
25462
+ /** Higher = better quality, slower indexing. Default: 200 */
25463
+ efConstruction?: number;
25464
+ /** Connections per node - balance memory/speed. Default: 16 */
25465
+ M?: number;
25466
+ /** Search quality - higher = better quality, slower search. Default: 100 */
25467
+ ef?: number;
25468
+ /** Maximum connections per element. Default: 64 */
25469
+ maxConnections?: number;
25470
+ /** Distance metric for vector similarity. Default: 'cosine' */
25471
+ distanceMetric?: 'cosine' | 'l2' | 'ip';
25331
25472
  }
25332
- interface WriteableDocuments<T> {
25333
- create(document: T, options: DocumentWriteParameters): Promise<T>;
25334
- upsert(document: T, options: DocumentWriteParameters): Promise<T>;
25335
- update(document: T, options: DocumentWriteParameters): Promise<T>;
25336
- delete(query: DeleteQuery): Promise<DeleteResponse>;
25337
- import(documents: T[] | string, options: DocumentWriteParameters): Promise<string | ImportResponse[]>;
25338
- export(options: DocumentsExportParameters): Promise<string>;
25473
+ /**
25474
+ * Advanced search parameters for better relevance
25475
+ */
25476
+ interface AdvancedSearchConfig {
25477
+ /** Minimum tokens before allowing typos. Default: 1 */
25478
+ typoTokensThreshold?: number;
25479
+ /** Number of typos to allow. Default: 2 */
25480
+ numTypos?: number;
25481
+ /** Enable prefix matching for partial queries. Default: true */
25482
+ prefix?: boolean;
25483
+ /** Minimum tokens before dropping tokens for partial matching. Default: 1 */
25484
+ dropTokensThreshold?: number;
25485
+ /** Enable stemming for better language matching. Default: true */
25486
+ enableStemming?: boolean;
25339
25487
  }
25340
- interface MultiSearchUnionStreamConfig<T extends DocumentSchema> extends BaseStreamConfig {
25341
- onComplete?: (data: UnionSearchResponse<T>) => void;
25488
+ /**
25489
+ * Source chunk information for citations
25490
+ */
25491
+ interface ChunkSource {
25492
+ /** Unique chunk ID */
25493
+ id: string;
25494
+ /** Parent document title */
25495
+ title: string;
25496
+ /** Parent document slug for URL construction */
25497
+ slug: string;
25498
+ /** Type of document */
25499
+ type: string;
25500
+ /** Chunk index within the document */
25501
+ chunkIndex: number;
25502
+ /** Relevance score (lower is better for vector distance) */
25503
+ relevanceScore: number;
25504
+ /** Full content of the chunk (markdown) */
25505
+ content: string;
25506
+ /** Optional excerpt from the chunk (first 200 chars) */
25507
+ excerpt?: string;
25342
25508
  }
25343
- interface MultiSearchResultsStreamConfig<T extends DocumentSchema[]> extends BaseStreamConfig {
25344
- onComplete?: (data: {
25345
- results: { [Index in keyof T]: SearchResponse$1<T[Index]> } & {
25346
- length: T["length"];
25347
- };
25348
- }) => void;
25509
+ /**
25510
+ * SSE event types
25511
+ */
25512
+ type SSEEventType = 'conversation_id' | 'token' | 'sources' | 'done' | 'error' | 'usage';
25513
+ /**
25514
+ * Usage info structure
25515
+ */
25516
+ interface UsageInfo {
25517
+ tokens_used: number;
25518
+ cost_usd: number;
25519
+ daily_limit: number;
25520
+ daily_used: number;
25521
+ daily_remaining: number;
25522
+ reset_at?: string;
25349
25523
  }
25350
- interface RequestParams<T extends DocumentSchema[]> {
25351
- path: string;
25352
- queryParams?: Record<string, unknown>;
25353
- body?: unknown;
25354
- headers?: Record<string, string>;
25355
- streamConfig?: StreamConfig<T[number]> | MultiSearchResultsStreamConfig<T> | MultiSearchUnionStreamConfig<T[number]>;
25356
- abortSignal?: AbortSignal | null;
25357
- responseType?: AxiosRequestConfig$2["responseType"] | undefined;
25358
- isStreamingRequest: boolean | undefined;
25359
- }
25360
- interface MultiSearchRequestsWithUnionSchema<T extends DocumentSchema, Infix extends string> extends SearchesMultiSearchesRequestSchema<T, Infix> {
25361
- union: true;
25362
- }
25363
- interface MultiSearchRequestsWithoutUnionSchema<T extends DocumentSchema, Infix extends string> extends SearchesMultiSearchesRequestSchema<T, Infix> {
25364
- union?: false | undefined;
25365
- }
25366
- type MultiSearchRequestsSchema<T extends DocumentSchema, Infix extends string> = MultiSearchRequestsWithUnionSchema<T, Infix> | MultiSearchRequestsWithoutUnionSchema<T, Infix>;
25367
- interface UnionSearchResponse<T extends DocumentSchema> extends Omit<SearchResponse$1<T>, "request_params"> {
25368
- union_request_params: SearchResponseRequestParams[];
25524
+ /**
25525
+ * Token usage breakdown
25526
+ */
25527
+ interface TokenUsage {
25528
+ input?: number;
25529
+ output?: number;
25530
+ total: number;
25369
25531
  }
25370
- interface MultiSearchUnionStreamConfig<T extends DocumentSchema> extends BaseStreamConfig {
25371
- onComplete?: (data: UnionSearchResponse<T>) => void;
25532
+ /**
25533
+ * Service types for spending tracking
25534
+ */
25535
+ type ServiceType = 'openai_embedding' | 'openai_llm';
25536
+ /**
25537
+ * Spending entry for tracking AI service costs
25538
+ */
25539
+ interface SpendingEntry {
25540
+ service: ServiceType;
25541
+ model: string;
25542
+ tokens: TokenUsage;
25543
+ cost_usd?: number;
25544
+ timestamp: string;
25372
25545
  }
25373
- interface MultiSearchResultsStreamConfig<T extends DocumentSchema[]> extends BaseStreamConfig {
25374
- onComplete?: (data: {
25375
- results: { [Index in keyof T]: SearchResponse$1<T[Index]> } & {
25376
- length: T["length"];
25377
- };
25378
- }) => void;
25546
+ /**
25547
+ * SSE event structure
25548
+ */
25549
+ interface SSEEvent {
25550
+ type: SSEEventType;
25551
+ data: string | ChunkSource[] | {
25552
+ error: string;
25553
+ } | UsageInfo;
25379
25554
  }
25380
- interface SearchesMultiSearchesRequestSchema<T extends DocumentSchema, Infix extends string> {
25381
- searches: (MultiSearchRequestSchema<T, Infix> | MultiSearchRequestWithPresetSchema<T, Infix>)[];
25555
+ /**
25556
+ * Typesense search hit document (chunk-specific)
25557
+ */
25558
+ interface TypesenseRAGChunkDocument {
25559
+ id: string;
25560
+ chunk_text: string;
25561
+ title?: string;
25562
+ slug?: string;
25563
+ parent_doc_id?: string;
25564
+ chunk_index?: number;
25565
+ [key: string]: unknown;
25382
25566
  }
25383
- interface BaseMultiSearchRequestSchema {
25384
- collection?: string;
25385
- rerank_hybrid_matches?: boolean;
25386
- "x-typesense-api-key"?: string;
25567
+ /**
25568
+ * Typesense search hit for RAG chunks
25569
+ */
25570
+ interface TypesenseRAGSearchHit {
25571
+ document: TypesenseRAGChunkDocument;
25572
+ vector_distance?: number;
25573
+ text_match?: number;
25574
+ [key: string]: unknown;
25387
25575
  }
25388
- type CommonMultiSearchParametersBase<T extends DocumentSchema, Infix extends string> = Partial<BaseMultiSearchRequestSchema & Omit<SearchParams$1<T, Infix>, "streamConfig">>;
25389
- type MultiSearchRequestSchema<T extends DocumentSchema, Infix extends string> = BaseMultiSearchRequestSchema & Omit<SearchParams$1<T, Infix>, "streamConfig">;
25390
- type MultiSearchRequestWithPresetSchema<T extends DocumentSchema, Infix extends string> = BaseMultiSearchRequestSchema & Omit<SearchParamsWithPreset<T, Infix>, "streamConfig">;
25391
- type MultiSearchUnionParameters<T extends DocumentSchema, Infix extends string> = CommonMultiSearchParametersBase<T, Infix> & {
25392
- streamConfig?: MultiSearchUnionStreamConfig<T>;
25393
- use_cache?: boolean;
25394
- };
25395
- type MultiSearchResultsParameters<T extends DocumentSchema[], Infix extends string> = CommonMultiSearchParametersBase<T[number], Infix> & {
25396
- streamConfig?: MultiSearchResultsStreamConfig<T>;
25397
- use_cache?: boolean;
25398
- };
25399
- type Whitespace = " " | "\n" | "\t";
25400
- type TrimString<S extends string> = S extends `${Whitespace}${infer S}` ? TrimString<S> : S extends `${infer S}${Whitespace}` ? TrimString<S> : S;
25401
- //#endregion
25402
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/RequestWithCache.d.ts
25403
- declare class RequestWithCache {
25404
- private responseCache;
25405
- private responsePromiseCache;
25406
- clearCache(): void;
25407
- perform<const TContext extends HttpClient, const TMethod extends keyof HttpClient, const TDoc extends DocumentSchema[], TResult>(requestContext: TContext, methodName: TMethod, requestParams: RequestParams<TDoc>, cacheOptions: CacheOptions$2 | undefined): Promise<TResult>;
25408
- private executeRequest;
25576
+ /**
25577
+ * Typesense search result for RAG queries
25578
+ */
25579
+ interface TypesenseRAGSearchResult {
25580
+ hits?: TypesenseRAGSearchHit[];
25581
+ request_params?: {
25582
+ collection_name?: string;
25583
+ [key: string]: unknown;
25584
+ };
25585
+ [key: string]: unknown;
25409
25586
  }
25410
- interface CacheOptions$2 {
25411
- cacheResponseForSeconds?: number;
25412
- maxSize?: number;
25587
+ /**
25588
+ * Configuration for building Typesense queries
25589
+ */
25590
+ interface TypesenseQueryConfig {
25591
+ /** User's message/query */
25592
+ userMessage: string;
25593
+ /** Query embedding vector */
25594
+ queryEmbedding: number[];
25595
+ /** Optional: Filter by selected document IDs */
25596
+ selectedDocuments?: string[];
25597
+ /** Optional: Conversation ID for follow-up */
25598
+ chatId?: string;
25599
+ /** Collections to search */
25600
+ searchCollections: string[];
25601
+ /** Number of results to retrieve */
25602
+ kResults?: number;
25603
+ /** Advanced search config */
25604
+ advancedConfig?: AdvancedSearchConfig;
25413
25605
  }
25414
- //#endregion
25415
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/SearchOnlyDocuments.d.ts
25416
- declare class SearchOnlyDocuments<T extends DocumentSchema> implements SearchableDocuments<T> {
25417
- protected collectionName: string;
25418
- protected apiCall: ApiCall;
25419
- protected configuration: Configuration;
25420
- protected requestWithCache: RequestWithCache;
25421
- constructor(collectionName: string, apiCall: ApiCall, configuration: Configuration);
25422
- clearCache(): void;
25423
- search<const Infix extends string>(searchParameters: SearchParams$1<T, Infix> | SearchParamsWithPreset<T, Infix>, {
25424
- cacheSearchResultsForSeconds,
25425
- abortSignal
25426
- }?: SearchOptions): Promise<SearchResponse$1<T>>;
25427
- protected endpointPath(operation?: string): string;
25428
- static get RESOURCEPATH(): string;
25606
+ /**
25607
+ * Embedding result with usage tracking
25608
+ */
25609
+ interface EmbeddingWithUsage {
25610
+ /** The embedding vector */
25611
+ embedding: number[];
25612
+ /** Usage information */
25613
+ usage: {
25614
+ /** Number of tokens used */
25615
+ promptTokens: number;
25616
+ /** Total tokens (same as prompt_tokens for embeddings) */
25617
+ totalTokens: number;
25618
+ };
25429
25619
  }
25430
- //#endregion
25431
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Documents.d.ts
25432
- type DeleteQuery = {
25433
- truncate?: true;
25434
- } | {
25435
- truncate?: never;
25436
- filter_by?: string;
25437
- batch_size?: number;
25438
- ignore_not_found?: boolean;
25439
- return_doc?: boolean;
25440
- return_id?: boolean;
25441
- };
25442
- interface DeleteResponse<T extends DocumentSchema = DocumentSchema> {
25443
- num_deleted: number;
25444
- documents?: T[];
25445
- ids?: string[];
25620
+ /**
25621
+ * Batch embedding result with usage tracking
25622
+ */
25623
+ interface BatchEmbeddingWithUsage {
25624
+ /** Array of embedding vectors */
25625
+ embeddings: number[][];
25626
+ /** Total usage information */
25627
+ usage: {
25628
+ /** Number of tokens used */
25629
+ promptTokens: number;
25630
+ /** Total tokens (same as prompt_tokens for embeddings) */
25631
+ totalTokens: number;
25632
+ };
25446
25633
  }
25447
- interface ImportResponseSuccess<T extends DocumentSchema = DocumentSchema> {
25448
- success: true;
25449
- error?: never;
25450
- document?: T;
25451
- id?: string;
25452
- code?: never;
25634
+ interface RAGCallbacks {
25635
+ /** Get Payload instance (required) */
25636
+ getPayload: () => Promise<Payload>;
25637
+ /** Check permissions function (required) */
25638
+ checkPermissions: (request: PayloadRequest) => Promise<boolean>;
25639
+ /** Check token limit function (optional) */
25640
+ checkTokenLimit?: (payload: Payload, userId: string | number, tokens: number) => Promise<{
25641
+ allowed: boolean;
25642
+ limit: number;
25643
+ used: number;
25644
+ remaining: number;
25645
+ reset_at?: string;
25646
+ }>;
25647
+ /** Get user usage stats function (optional) */
25648
+ getUserUsageStats?: (payload: Payload, userId: string | number) => Promise<{
25649
+ limit: number;
25650
+ used: number;
25651
+ remaining: number;
25652
+ reset_at?: string;
25653
+ }>;
25654
+ /** Save chat session function (optional) */
25655
+ saveChatSession?: (payload: Payload, userId: string | number, conversationId: string, userMessage: string, assistantMessage: string, sources: ChunkSource[], spending: SpendingEntry[], collectionName: CollectionSlug) => Promise<void>;
25656
+ /** Create embedding spending function (optional) */
25657
+ createEmbeddingSpending?: (model: string, tokens: number) => SpendingEntry;
25658
+ /** Estimate tokens from text function (optional) */
25659
+ estimateTokensFromText?: (text: string) => number;
25453
25660
  }
25454
- interface ImportResponseFail<T extends DocumentSchema = DocumentSchema> {
25455
- success: false;
25456
- error: string;
25457
- document?: T;
25458
- id?: string;
25459
- code: number;
25661
+ /**
25662
+ * Complete RAG configuration
25663
+ */
25664
+ interface RAGConfig {
25665
+ /** Hybrid search settings */
25666
+ hybrid?: HybridSearchConfig;
25667
+ /** HNSW optimization settings */
25668
+ hnsw?: HNSWConfig;
25669
+ /** Advanced search settings */
25670
+ advanced?: AdvancedSearchConfig;
25460
25671
  }
25461
- type ImportResponse<T extends DocumentSchema = DocumentSchema> = ImportResponseSuccess<T> | ImportResponseFail<T>;
25462
- type DocumentSchema = Record<string, any>;
25463
- interface SearchParamsWithPreset<T extends DocumentSchema, Infix extends string> extends Partial<SearchParams$1<T, Infix>> {
25464
- preset: string;
25672
+ interface RAGFeatureConfig extends RAGConfig {
25673
+ enabled: boolean;
25674
+ callbacks?: RAGCallbacks;
25675
+ agents: AgentConfig[];
25465
25676
  }
25466
- type SearchResponseHighlightObject = {
25467
- matched_tokens?: string[];
25468
- snippet?: string;
25469
- value?: string;
25677
+ type TypesenseProtocol = "http" | "https";
25678
+ type TypesenseNode = {
25679
+ host: string;
25680
+ port: number;
25681
+ protocol: TypesenseProtocol;
25682
+ path?: string;
25470
25683
  };
25471
- type SearchResponseHighlight<T> = T extends string | number ? SearchResponseHighlightObject : { [TAttribute in keyof T]?: SearchResponseHighlight<T[TAttribute]> };
25472
- interface SearchResponseHit<T extends DocumentSchema> {
25473
- curated?: true;
25474
- highlights?: [{
25475
- field: keyof T;
25476
- snippet?: string;
25477
- value?: string;
25478
- snippets?: string[];
25479
- indices?: number[];
25480
- matched_tokens: string[][] | string[];
25481
- }];
25482
- highlight: SearchResponseHighlight<T>;
25483
- document: T;
25484
- text_match: number;
25485
- text_match_info?: {
25486
- best_field_score: `${number}`;
25487
- best_field_weight: number;
25488
- fields_matched: number;
25489
- score: `${number}`;
25490
- tokens_matched: number;
25491
- };
25492
- geo_distance_meters?: {
25493
- location: number;
25494
- };
25495
- }
25496
- interface SearchResponseFacetCountSchema<T extends DocumentSchema> {
25497
- counts: {
25498
- count: number;
25499
- highlighted: string;
25500
- value: string;
25501
- parent?: Record<string, string | number | boolean>;
25502
- }[];
25503
- field_name: keyof T;
25504
- sampled: boolean;
25505
- stats: {
25506
- avg?: number;
25507
- max?: number;
25508
- min?: number;
25509
- sum?: number;
25510
- total_values?: number;
25511
- };
25512
- }
25513
- interface LLMResponse {
25514
- content: string;
25515
- extraction_method: string;
25516
- model: string;
25517
- }
25518
- interface SearchResponse$1<T extends DocumentSchema> {
25519
- facet_counts?: SearchResponseFacetCountSchema<T>[];
25520
- found: number;
25521
- found_docs?: number;
25522
- out_of: number;
25523
- page: number;
25524
- request_params: SearchResponseRequestParams;
25525
- search_time_ms: number;
25526
- search_cutoff?: boolean;
25527
- hits?: SearchResponseHit<T>[];
25528
- grouped_hits?: {
25529
- group_key: string[];
25530
- hits: SearchResponseHit<T>[];
25531
- found?: number;
25532
- }[];
25533
- parsed_nl_query?: {
25534
- parse_time_ms: number;
25535
- generated_params: SearchParams$1<T>;
25536
- augmented_params: SearchParams$1<T>;
25537
- llm_response?: LLMResponse;
25538
- };
25539
- conversation?: {
25540
- answer: string;
25541
- conversation_history: {
25542
- conversation: object[];
25543
- id: string;
25544
- last_updated: number;
25545
- ttl: number;
25546
- };
25547
- conversation_id: string;
25548
- query: string;
25549
- };
25550
- error?: string;
25551
- code?: number;
25552
- }
25553
- interface DocumentWriteParameters {
25554
- dirty_values?: "coerce_or_reject" | "coerce_or_drop" | "drop" | "reject";
25555
- action?: "create" | "update" | "upsert" | "emplace";
25556
- }
25557
- interface UpdateByFilterParameters {
25558
- filter_by?: string;
25559
- }
25560
- interface UpdateByFilterResponse {
25561
- num_updated: number;
25562
- }
25563
- interface DocumentImportParameters extends DocumentWriteParameters {
25564
- batch_size?: number;
25565
- remote_embedding_batch_size?: number;
25566
- remote_embedding_timeout_ms?: number;
25567
- remote_embedding_num_tries?: number;
25568
- return_doc?: boolean;
25569
- return_id?: boolean;
25570
- throwOnFail?: boolean;
25571
- }
25572
- interface DocumentsExportParameters {
25573
- filter_by?: string;
25574
- include_fields?: string;
25575
- exclude_fields?: string;
25576
- }
25577
- interface SearchOptions {
25578
- cacheSearchResultsForSeconds?: number;
25579
- abortSignal?: AbortSignal | null;
25580
- }
25581
- declare class Documents<T extends DocumentSchema = object> extends SearchOnlyDocuments<T> implements WriteableDocuments<T> {
25582
- constructor(collectionName: string, apiCall: ApiCall, configuration: Configuration);
25583
- create(document: T, options?: DocumentWriteParameters): Promise<T>;
25584
- upsert(document: T, options?: DocumentWriteParameters): Promise<T>;
25585
- update(document: T, options: UpdateByFilterParameters): Promise<UpdateByFilterResponse>;
25586
- update(document: T, options: DocumentWriteParameters): Promise<T>;
25587
- delete(query?: DeleteQuery): Promise<DeleteResponse<T>>;
25588
- createMany(documents: T[], options?: DocumentImportParameters): Promise<ImportResponse<T>[]>;
25684
+ /**
25685
+ * Configuration for Typesense connection
25686
+ */
25687
+ type TypesenseConnectionConfig = {
25688
+ apiKey: string;
25689
+ connectionTimeoutSeconds?: number;
25690
+ retryIntervalSeconds?: number;
25691
+ numRetries?: number;
25692
+ nodes: [TypesenseNode, ...Array<TypesenseNode>];
25693
+ };
25694
+ /**
25695
+ * Main plugin configuration
25696
+ */
25697
+ /**
25698
+ * Configuration for a single conversational agent
25699
+ */
25700
+ interface AgentConfig {
25589
25701
  /**
25590
- * Import a set of documents in a batch.
25591
- * @param {string|Array} documents - Can be a JSONL string of documents or an array of document objects.
25592
- * @param options
25593
- * @return {string|Array} Returns a JSONL string if the input was a JSONL string, otherwise it returns an array of results.
25702
+ * Unique identifier for the agent (used in API requests)
25594
25703
  */
25595
- import(documents: string, options?: DocumentImportParameters): Promise<string>;
25596
- import(documents: T[], options?: DocumentImportParameters): Promise<ImportResponse<T>[]>;
25704
+ slug: string;
25597
25705
  /**
25598
- * Imports documents from a NodeJS readable stream of JSONL.
25706
+ * Display name for the agent (shown in UI)
25707
+ * If not provided, slug will be used.
25599
25708
  */
25600
- importStream(readableStream: ReadStream, options?: DocumentImportParameters): Promise<ImportResponse<T>[]>;
25709
+ name?: string;
25601
25710
  /**
25602
- * Returns a JSONL string for all the documents in this collection
25711
+ * Optional API Key for the LLM provider.
25712
+ * If provided, this overrides the global embedding provider API key for this agent.
25603
25713
  */
25604
- export(options?: DocumentsExportParameters): Promise<string>;
25714
+ apiKey?: string;
25605
25715
  /**
25606
- * Returns a NodeJS readable stream of JSONL for all the documents in this collection.
25716
+ * System prompt that defines the agent's personality and constraints
25607
25717
  */
25608
- exportStream(options?: DocumentsExportParameters): Promise<ReadStream>;
25609
- }
25610
- //#endregion
25611
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Configuration.d.ts
25612
- interface NodeConfiguration {
25613
- host: string;
25614
- port: number;
25615
- protocol: string;
25616
- path?: string;
25617
- url?: string;
25618
- }
25619
- interface NodeConfigurationWithHostname {
25620
- host: string;
25621
- port: number;
25622
- protocol: string;
25623
- path?: string;
25624
- }
25625
- interface NodeConfigurationWithUrl {
25626
- url: string;
25627
- }
25628
- interface ConfigurationOptions {
25629
- apiKey: string;
25630
- nodes: NodeConfiguration[] | NodeConfigurationWithHostname[] | NodeConfigurationWithUrl[];
25631
- randomizeNodes?: boolean;
25718
+ systemPrompt: string;
25632
25719
  /**
25633
- * @deprecated
25634
- * masterNode is now consolidated to nodes, starting with Typesense Server v0.12'
25720
+ * LLM model to use (e.g., 'openai/gpt-4o-mini')
25635
25721
  */
25636
- masterNode?: NodeConfiguration | NodeConfigurationWithHostname | NodeConfigurationWithUrl;
25722
+ llmModel: string;
25637
25723
  /**
25638
- * @deprecated
25639
- * readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12'
25724
+ * Collections this agent is allowed to search in
25640
25725
  */
25641
- readReplicaNodes?: NodeConfiguration[] | NodeConfigurationWithHostname[] | NodeConfigurationWithUrl[];
25642
- nearestNode?: NodeConfiguration | NodeConfigurationWithHostname | NodeConfigurationWithUrl;
25643
- connectionTimeoutSeconds?: number;
25644
- timeoutSeconds?: number;
25645
- healthcheckIntervalSeconds?: number;
25646
- numRetries?: number;
25647
- retryIntervalSeconds?: number;
25648
- sendApiKeyAsQueryParam?: boolean | undefined;
25649
- useServerSideSearchCache?: boolean;
25650
- cacheSearchResultsForSeconds?: number;
25651
- additionalHeaders?: Record<string, string>;
25652
- logLevel?: LogLevelDesc;
25653
- logger?: Logger$1;
25726
+ searchCollections: string[];
25654
25727
  /**
25655
- * Set a custom HTTP Agent
25656
- *
25657
- * This is helpful for eg, to enable keepAlive which helps prevents ECONNRESET socket hang up errors
25658
- * Usage:
25659
- * const { Agent: HTTPAgent } = require("http");
25660
- * ...
25661
- * httpAgent: new HTTPAgent({ keepAlive: true }),
25662
- * @type {HTTPAgent}
25728
+ * Maximum context size in bytes. Default: 65536 (64KB)
25663
25729
  */
25664
- httpAgent?: Agent;
25730
+ maxContextBytes?: number;
25665
25731
  /**
25666
- * Set a custom HTTPS Agent
25667
- *
25668
- * This is helpful for eg, to enable keepAlive which helps prevents ECONNRESET socket hang up errors
25669
- * Usage:
25670
- * const { Agent: HTTPSAgent } = require("https");
25671
- * ...
25672
- * httpsAgent: new HTTPSAgent({ keepAlive: true }),
25673
- * @type {HTTPSAgent}
25732
+ * TTL for conversation history in seconds. Default: 86400 (24h)
25674
25733
  */
25675
- httpsAgent?: Agent$1;
25734
+ ttl?: number;
25676
25735
  /**
25677
- * Set a custom paramsSerializer
25678
- *
25679
- * See axios documentation for more information on how to use this parameter: https://axios-http.com/docs/req_config
25680
- * This is helpful for handling React Native issues like this: https://github.com/axios/axios/issues/6102#issuecomment-2085301397
25681
- * @type {any}
25736
+ * Name of the conversation history collection. Default: 'conversation_history'
25682
25737
  */
25683
- paramsSerializer?: any;
25738
+ historyCollection?: string;
25684
25739
  /**
25685
- * Set a custom axios adapter
25686
- *
25687
- * Useful for customizing the underlying HTTP client library used by Typesense.
25688
- *
25689
- * For example, you can use this to use a custom HTTP client library like `fetch`, in order for the library to work on the edge.
25690
- * Related GiHub issue: https://github.com/typesense/typesense-js/issues/161
25691
- *
25692
- * See axios documentation for more information on how to use this parameter: https://axios-http.com/docs/req_config
25740
+ * Number of chunks to retrieve for RAG context. Default: 10
25693
25741
  */
25694
- axiosAdapter?: AxiosRequestConfig$1["adapter"];
25742
+ kResults?: number;
25695
25743
  }
25744
+ //#endregion
25745
+ //#region src/plugin/rag-types.d.ts
25696
25746
  /**
25697
- * Configuration options for streaming responses
25747
+ * Search feature configuration for the Typesense RAG plugin
25698
25748
  */
25699
- interface BaseStreamConfig {
25700
- /**
25701
- * Callback function that will be called for each chunk of data received
25702
- * during streaming
25703
- */
25704
- onChunk?: (data: {
25705
- conversation_id: string;
25706
- message: string;
25707
- }) => void;
25708
- /**
25709
- * Callback function that will be called if there is an error during streaming
25710
- */
25711
- onError?: (error: Error) => void;
25749
+ interface TypesenseSearchConfig {
25750
+ /** Enable search endpoints */
25751
+ enabled: boolean;
25752
+ /** Default search settings */
25753
+ defaults?: {
25754
+ /** Search mode: 'semantic' | 'hybrid' | 'keyword' */
25755
+ mode?: 'semantic' | 'hybrid' | 'keyword';
25756
+ /** Results per page */
25757
+ perPage?: number;
25758
+ /** Tables to search by default */
25759
+ tables?: string[];
25760
+ };
25712
25761
  }
25713
25762
  /**
25714
- * Stream configuration for standard search responses
25715
- * For specialized responses like MultiSearch, extend BaseStreamConfig with the appropriate onComplete signature
25763
+ * Configuration for the Typesense RAG plugin
25764
+ *
25765
+ * This plugin handles all Typesense-specific functionality:
25766
+ * - Search endpoints
25767
+ * - RAG endpoints
25768
+ * - Schema synchronization
25769
+ * - Agent synchronization
25716
25770
  */
25717
- interface StreamConfig<T extends DocumentSchema> extends BaseStreamConfig {
25771
+ interface TypesenseRAGPluginConfig {
25772
+ /** Typesense connection configuration */
25773
+ typesense: TypesenseConnectionConfig;
25718
25774
  /**
25719
- * Callback function that will be called when the streaming is complete
25720
- */
25721
- onComplete?: (data: SearchResponse$1<T>) => void;
25722
- }
25723
- declare class Configuration {
25724
- readonly nodes: NodeConfiguration[] | NodeConfigurationWithHostname[] | NodeConfigurationWithUrl[];
25725
- readonly nearestNode?: NodeConfiguration | NodeConfigurationWithHostname | NodeConfigurationWithUrl;
25726
- readonly connectionTimeoutSeconds: number;
25727
- readonly healthcheckIntervalSeconds: number;
25728
- readonly numRetries: number;
25729
- readonly retryIntervalSeconds: number;
25730
- readonly apiKey: string;
25731
- readonly sendApiKeyAsQueryParam?: boolean;
25732
- readonly cacheSearchResultsForSeconds: number;
25733
- readonly useServerSideSearchCache: boolean;
25734
- readonly logger: Logger$1;
25735
- readonly logLevel: LogLevelDesc;
25736
- readonly additionalHeaders?: Record<string, string>;
25737
- readonly httpAgent?: Agent;
25738
- readonly httpsAgent?: Agent$1;
25739
- readonly paramsSerializer?: any;
25740
- readonly axiosAdapter?: AxiosRequestConfig$1["adapter"];
25741
- constructor(options: ConfigurationOptions);
25742
- validate(): boolean;
25743
- private validateNodes;
25744
- private isNodeMissingAnyParameters;
25745
- private setDefaultPathInNode;
25746
- private setDefaultPortInNode;
25747
- private showDeprecationWarnings;
25748
- private shuffleArray;
25775
+ * Embedding provider config (for RAG query embedding)
25776
+ * Note: The RAG handler creates its own provider instance to track usage/spending.
25777
+ * The EmbeddingService from createIndexerPlugin is used for document sync, not RAG queries.
25778
+ */
25779
+ embeddingConfig?: EmbeddingProviderConfig;
25780
+ /** Collection configurations (for schema sync) */
25781
+ collections?: Record<string, TableConfig[]>;
25782
+ /** Search configuration */
25783
+ search?: TypesenseSearchConfig;
25784
+ /** RAG agent configurations */
25785
+ agents?: AgentConfig[];
25786
+ /** Callback functions for permissions, session management, etc. */
25787
+ callbacks?: RAGCallbacks;
25788
+ /** Hybrid search configuration */
25789
+ hybrid?: HybridSearchConfig;
25790
+ /** HNSW optimization configuration */
25791
+ hnsw?: HNSWConfig;
25792
+ /** Advanced search configuration */
25793
+ advanced?: AdvancedSearchConfig;
25749
25794
  }
25750
25795
  //#endregion
25796
+ //#region src/plugin/create-rag-plugin.d.ts
25797
+ /**
25798
+ * Creates a composable Typesense RAG plugin for Payload CMS
25799
+ *
25800
+ * This plugin handles all Typesense-specific features:
25801
+ * - Search endpoints (semantic, hybrid, keyword)
25802
+ * - RAG endpoints (chat, session management)
25803
+ * - Schema synchronization
25804
+ * - Agent synchronization
25805
+ *
25806
+ * @param config - Typesense RAG plugin configuration
25807
+ * @returns Payload config modifier function
25808
+ */
25809
+ declare function createTypesenseRAGPlugin(config: TypesenseRAGPluginConfig): (payloadConfig: Config) => Config;
25810
+ //#endregion
25751
25811
  //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/TypesenseError.d.ts
25752
25812
  declare class TypesenseError extends Error {
25753
25813
  httpStatus?: number;
@@ -25756,7 +25816,7 @@ declare class TypesenseError extends Error {
25756
25816
  }
25757
25817
  //#endregion
25758
25818
  //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/ApiCall.d.ts
25759
- interface Node$1 extends NodeConfiguration {
25819
+ interface Node extends NodeConfiguration {
25760
25820
  isHealthy: boolean;
25761
25821
  index: string | number;
25762
25822
  }
@@ -25768,7 +25828,7 @@ interface HttpClient {
25768
25828
  isStreamingRequest
25769
25829
  }: {
25770
25830
  abortSignal?: AbortSignal | null;
25771
- responseType?: AxiosRequestConfig["responseType"] | undefined;
25831
+ responseType?: AxiosRequestConfig$2["responseType"] | undefined;
25772
25832
  streamConfig?: StreamConfig<T extends DocumentSchema ? T : DocumentSchema> | undefined;
25773
25833
  isStreamingRequest: boolean | undefined;
25774
25834
  }): Promise<T>;
@@ -25780,7 +25840,7 @@ interface HttpClient {
25780
25840
  isStreamingRequest
25781
25841
  }: {
25782
25842
  abortSignal?: AbortSignal | null;
25783
- responseType?: AxiosRequestConfig["responseType"] | undefined;
25843
+ responseType?: AxiosRequestConfig$2["responseType"] | undefined;
25784
25844
  streamConfig?: StreamConfig<T extends DocumentSchema ? T : DocumentSchema> | undefined;
25785
25845
  isStreamingRequest: boolean | undefined;
25786
25846
  }): Promise<T>;
@@ -25808,7 +25868,7 @@ declare class ApiCall implements HttpClient {
25808
25868
  isStreamingRequest
25809
25869
  }?: {
25810
25870
  abortSignal?: any;
25811
- responseType?: AxiosRequestConfig["responseType"] | undefined;
25871
+ responseType?: AxiosRequestConfig$2["responseType"] | undefined;
25812
25872
  streamConfig?: StreamConfig<T extends DocumentSchema ? T : DocumentSchema> | undefined;
25813
25873
  isStreamingRequest?: boolean | undefined;
25814
25874
  }): Promise<T>;
@@ -25820,7 +25880,7 @@ declare class ApiCall implements HttpClient {
25820
25880
  isStreamingRequest
25821
25881
  }?: {
25822
25882
  abortSignal?: AbortSignal | null;
25823
- responseType?: AxiosRequestConfig["responseType"] | undefined;
25883
+ responseType?: AxiosRequestConfig$2["responseType"] | undefined;
25824
25884
  streamConfig?: StreamConfig<T extends DocumentSchema ? T : DocumentSchema> | undefined;
25825
25885
  isStreamingRequest?: boolean | undefined;
25826
25886
  }): Promise<T>;
@@ -25842,7 +25902,7 @@ declare class ApiCall implements HttpClient {
25842
25902
  bodyParameters?: any;
25843
25903
  additionalHeaders?: any;
25844
25904
  abortSignal?: any;
25845
- responseType?: AxiosRequestConfig["responseType"] | undefined;
25905
+ responseType?: AxiosRequestConfig$2["responseType"] | undefined;
25846
25906
  skipConnectionTimeout?: boolean;
25847
25907
  enableKeepAlive?: boolean | undefined;
25848
25908
  streamConfig?: StreamConfig<T extends DocumentSchema ? T : DocumentSchema> | undefined;
@@ -25866,7 +25926,7 @@ declare class ApiCall implements HttpClient {
25866
25926
  private isChunkMessage;
25867
25927
  private combineMessageChunks;
25868
25928
  private isCompleteSearchResponse;
25869
- getNextNode(requestNumber?: number): Node$1;
25929
+ getNextNode(requestNumber?: number): Node;
25870
25930
  nodeDueForHealthcheck(node: any, requestNumber?: number): boolean;
25871
25931
  initializeMetadataForNodes(): void;
25872
25932
  setNodeHealthcheck(node: any, isHealthy: any): void;
@@ -25879,1060 +25939,727 @@ declare class ApiCall implements HttpClient {
25879
25939
  private invokeOnErrorCallback;
25880
25940
  }
25881
25941
  //#endregion
25882
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Override.d.ts
25883
- interface OverrideSchema extends OverrideCreateSchema {
25884
- id: string;
25942
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Types.d.ts
25943
+ type DropTokensMode = "right_to_left" | "left_to_right" | "both_sides:3";
25944
+ type OperationMode = "off" | "always" | "fallback";
25945
+ type CommaSeparated<T extends string, ToExtend, OriginalString extends string = T, Previous extends string[] = []> = T extends `${infer Start},${infer Rest}` ? TrimString<Start> extends ToExtend ? CommaSeparated<Rest, ToExtend, OriginalString, [...Previous, TrimString<Start>]> : {
25946
+ error: "Invalid operation mode";
25947
+ value: TrimString<Start>;
25948
+ } : TrimString<T> extends ToExtend ? OriginalString : {
25949
+ error: "Invalid operation mode";
25950
+ value: TrimString<T>;
25951
+ };
25952
+ interface SearchParams$1<TDoc extends DocumentSchema, Infix extends string = string> {
25953
+ q?: "*" | (string & {});
25954
+ query_by?: string | string[];
25955
+ query_by_weights?: string | number[];
25956
+ prefix?: string | boolean | boolean[];
25957
+ filter_by?: string;
25958
+ max_filter_by_candidates?: number;
25959
+ enable_synonyms?: boolean;
25960
+ enable_analytics?: boolean;
25961
+ filter_curated_hits?: boolean;
25962
+ enable_lazy_filter?: boolean;
25963
+ sort_by?: string | string[];
25964
+ facet_by?: string | string[];
25965
+ max_facet_values?: number;
25966
+ facet_sample_threshold?: number;
25967
+ facet_sample_percent?: number;
25968
+ facet_query?: string;
25969
+ facet_query_num_typos?: number;
25970
+ facet_return_parent?: string;
25971
+ facet_strategy?: "exhaustive" | "top_values" | "automatic";
25972
+ page?: number;
25973
+ per_page?: number;
25974
+ group_by?: string | string[];
25975
+ group_limit?: number;
25976
+ group_missing_values?: boolean;
25977
+ include_fields?: string | string[];
25978
+ exclude_fields?: string | string[];
25979
+ highlight_fields?: string | string[];
25980
+ highlight_full_fields?: string | string[];
25981
+ highlight_affix_num_tokens?: number;
25982
+ highlight_start_tag?: string;
25983
+ highlight_end_tag?: string;
25984
+ enable_highlight_v1?: boolean;
25985
+ snippet_threshold?: number;
25986
+ nl_query?: boolean;
25987
+ nl_model_id?: string;
25988
+ nl_query_debug?: boolean;
25989
+ nl_query_prompt_cache_ttl?: number;
25990
+ num_typos?: string | number | number[];
25991
+ min_len_1typo?: number;
25992
+ min_len_2typo?: number;
25993
+ split_join_tokens?: OperationMode;
25994
+ exhaustive_search?: boolean;
25995
+ drop_tokens_threshold?: number;
25996
+ drop_tokens_mode?: DropTokensMode;
25997
+ typo_tokens_threshold?: number;
25998
+ pinned_hits?: string | string[];
25999
+ hidden_hits?: string | string[];
26000
+ limit_hits?: number;
26001
+ pre_segmented_query?: boolean;
26002
+ enable_overrides?: boolean;
26003
+ override_tags?: string | string[];
26004
+ prioritize_exact_match?: boolean;
26005
+ prioritize_token_position?: boolean;
26006
+ prioritize_num_matching_fields?: boolean;
26007
+ search_cutoff_ms?: number;
26008
+ use_cache?: boolean;
26009
+ max_candidates?: number;
26010
+ infix?: CommaSeparated<Infix, OperationMode> | OperationMode[] | OperationMode;
26011
+ preset?: string;
26012
+ text_match_type?: "max_score" | "max_weight" | "sum_score";
26013
+ vector_query?: string;
26014
+ "x-typesense-api-key"?: string;
26015
+ "x-typesense-user-id"?: string;
26016
+ offset?: number;
26017
+ limit?: number;
26018
+ stopwords?: string;
26019
+ conversation?: boolean;
26020
+ validate_field_names?: boolean;
26021
+ conversation_stream?: boolean;
26022
+ conversation_model_id?: string;
26023
+ conversation_id?: string;
26024
+ voice_query?: string;
26025
+ streamConfig?: StreamConfig<TDoc>;
25885
26026
  }
25886
- interface OverrideDeleteSchema {
25887
- id: string;
26027
+ interface SearchResponseRequestParams {
26028
+ collection_name?: string;
26029
+ q?: string;
26030
+ page?: number;
26031
+ per_page?: number;
26032
+ first_q?: string;
26033
+ voice_query?: {
26034
+ transcribed_query?: string;
26035
+ };
25888
26036
  }
25889
- declare class Override {
25890
- private collectionName;
25891
- private overrideId;
25892
- private apiCall;
25893
- constructor(collectionName: string, overrideId: string, apiCall: ApiCall);
25894
- retrieve(): Promise<OverrideSchema>;
25895
- delete(): Promise<OverrideDeleteSchema>;
25896
- private endpointPath;
26037
+ interface SearchableDocuments<T extends DocumentSchema = DocumentSchema, Infix extends string = string> {
26038
+ search(searchParameters: SearchParams$1<T, Infix> | SearchParamsWithPreset<T, Infix>, options: SearchOptions): Promise<SearchResponse$1<T>>;
26039
+ clearCache(): void;
25897
26040
  }
25898
- //#endregion
25899
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Overrides.d.ts
25900
- interface OverrideRuleQuerySchema {
25901
- query?: string;
25902
- match?: "exact" | "contains";
26041
+ interface WriteableDocuments<T> {
26042
+ create(document: T, options: DocumentWriteParameters): Promise<T>;
26043
+ upsert(document: T, options: DocumentWriteParameters): Promise<T>;
26044
+ update(document: T, options: DocumentWriteParameters): Promise<T>;
26045
+ delete(query: DeleteQuery): Promise<DeleteResponse>;
26046
+ import(documents: T[] | string, options: DocumentWriteParameters): Promise<string | ImportResponse[]>;
26047
+ export(options: DocumentsExportParameters): Promise<string>;
25903
26048
  }
25904
- interface OverrideRuleFilterSchema {
25905
- filter_by?: string;
26049
+ interface MultiSearchUnionStreamConfig<T extends DocumentSchema> extends BaseStreamConfig {
26050
+ onComplete?: (data: UnionSearchResponse<T>) => void;
25906
26051
  }
25907
- interface OverrideRuleTagsSchema {
25908
- tags?: string[];
26052
+ interface MultiSearchResultsStreamConfig<T extends DocumentSchema[]> extends BaseStreamConfig {
26053
+ onComplete?: (data: {
26054
+ results: { [Index in keyof T]: SearchResponse$1<T[Index]> } & {
26055
+ length: T["length"];
26056
+ };
26057
+ }) => void;
25909
26058
  }
25910
- interface OverrideCreateSchema {
25911
- rule: OverrideRuleQuerySchema & OverrideRuleFilterSchema & OverrideRuleTagsSchema;
25912
- filter_by?: string;
25913
- sort_by?: string;
25914
- remove_matched_tokens?: boolean;
25915
- replace_query?: string;
25916
- includes?: Array<{
25917
- id: string;
25918
- position: number;
25919
- }>;
25920
- excludes?: Array<{
25921
- id: string;
25922
- }>;
25923
- filter_curated_hits?: boolean;
25924
- effective_from_ts?: number;
25925
- effective_to_ts?: number;
25926
- stop_processing?: boolean;
25927
- metadata?: object;
26059
+ interface RequestParams<T extends DocumentSchema[]> {
26060
+ path: string;
26061
+ queryParams?: Record<string, unknown>;
26062
+ body?: unknown;
26063
+ headers?: Record<string, string>;
26064
+ streamConfig?: StreamConfig<T[number]> | MultiSearchResultsStreamConfig<T> | MultiSearchUnionStreamConfig<T[number]>;
26065
+ abortSignal?: AbortSignal | null;
26066
+ responseType?: AxiosRequestConfig$1["responseType"] | undefined;
26067
+ isStreamingRequest: boolean | undefined;
25928
26068
  }
25929
- interface OverridesRetrieveSchema {
25930
- overrides: OverrideSchema[];
26069
+ interface MultiSearchRequestsWithUnionSchema<T extends DocumentSchema, Infix extends string> extends SearchesMultiSearchesRequestSchema<T, Infix> {
26070
+ union: true;
25931
26071
  }
25932
- declare class Overrides {
25933
- private collectionName;
25934
- private apiCall;
25935
- constructor(collectionName: string, apiCall: ApiCall);
25936
- upsert(overrideId: string, params: OverrideCreateSchema): Promise<OverrideSchema>;
25937
- retrieve(): Promise<OverridesRetrieveSchema>;
25938
- private endpointPath;
25939
- static get RESOURCEPATH(): string;
26072
+ interface MultiSearchRequestsWithoutUnionSchema<T extends DocumentSchema, Infix extends string> extends SearchesMultiSearchesRequestSchema<T, Infix> {
26073
+ union?: false | undefined;
25940
26074
  }
25941
- //#endregion
25942
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Synonym.d.ts
25943
- interface SynonymSchema extends SynonymCreateSchema {
25944
- id: string;
26075
+ type MultiSearchRequestsSchema<T extends DocumentSchema, Infix extends string> = MultiSearchRequestsWithUnionSchema<T, Infix> | MultiSearchRequestsWithoutUnionSchema<T, Infix>;
26076
+ interface UnionSearchResponse<T extends DocumentSchema> extends Omit<SearchResponse$1<T>, "request_params"> {
26077
+ union_request_params: SearchResponseRequestParams[];
25945
26078
  }
25946
- interface SynonymDeleteSchema {
25947
- id: string;
26079
+ interface MultiSearchUnionStreamConfig<T extends DocumentSchema> extends BaseStreamConfig {
26080
+ onComplete?: (data: UnionSearchResponse<T>) => void;
25948
26081
  }
25949
- declare class Synonym {
25950
- private collectionName;
25951
- private synonymId;
25952
- private apiCall;
25953
- constructor(collectionName: string, synonymId: string, apiCall: ApiCall);
25954
- retrieve(): Promise<SynonymSchema>;
25955
- delete(): Promise<SynonymDeleteSchema>;
25956
- private endpointPath;
26082
+ interface MultiSearchResultsStreamConfig<T extends DocumentSchema[]> extends BaseStreamConfig {
26083
+ onComplete?: (data: {
26084
+ results: { [Index in keyof T]: SearchResponse$1<T[Index]> } & {
26085
+ length: T["length"];
26086
+ };
26087
+ }) => void;
25957
26088
  }
25958
- //#endregion
25959
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Synonyms.d.ts
25960
- interface SynonymCreateSchema {
25961
- synonyms: string[];
25962
- root?: string;
25963
- locale?: string;
25964
- symbols_to_index?: string[];
26089
+ interface SearchesMultiSearchesRequestSchema<T extends DocumentSchema, Infix extends string> {
26090
+ searches: (MultiSearchRequestSchema<T, Infix> | MultiSearchRequestWithPresetSchema<T, Infix>)[];
25965
26091
  }
25966
- interface SynonymsRetrieveSchema {
25967
- synonyms: SynonymSchema[];
25968
- }
25969
- declare class Synonyms {
25970
- private collectionName;
25971
- private apiCall;
25972
- constructor(collectionName: string, apiCall: ApiCall);
25973
- upsert(synonymId: string, params: SynonymCreateSchema): Promise<SynonymSchema>;
25974
- retrieve(): Promise<SynonymsRetrieveSchema>;
25975
- private endpointPath;
25976
- static get RESOURCEPATH(): string;
26092
+ interface BaseMultiSearchRequestSchema {
26093
+ collection?: string;
26094
+ rerank_hybrid_matches?: boolean;
26095
+ "x-typesense-api-key"?: string;
25977
26096
  }
26097
+ type CommonMultiSearchParametersBase<T extends DocumentSchema, Infix extends string> = Partial<BaseMultiSearchRequestSchema & Omit<SearchParams$1<T, Infix>, "streamConfig">>;
26098
+ type MultiSearchRequestSchema<T extends DocumentSchema, Infix extends string> = BaseMultiSearchRequestSchema & Omit<SearchParams$1<T, Infix>, "streamConfig">;
26099
+ type MultiSearchRequestWithPresetSchema<T extends DocumentSchema, Infix extends string> = BaseMultiSearchRequestSchema & Omit<SearchParamsWithPreset<T, Infix>, "streamConfig">;
26100
+ type MultiSearchUnionParameters<T extends DocumentSchema, Infix extends string> = CommonMultiSearchParametersBase<T, Infix> & {
26101
+ streamConfig?: MultiSearchUnionStreamConfig<T>;
26102
+ use_cache?: boolean;
26103
+ };
26104
+ type MultiSearchResultsParameters<T extends DocumentSchema[], Infix extends string> = CommonMultiSearchParametersBase<T[number], Infix> & {
26105
+ streamConfig?: MultiSearchResultsStreamConfig<T>;
26106
+ use_cache?: boolean;
26107
+ };
26108
+ type Whitespace = " " | "\n" | "\t";
26109
+ type TrimString<S extends string> = S extends `${Whitespace}${infer S}` ? TrimString<S> : S extends `${infer S}${Whitespace}` ? TrimString<S> : S;
25978
26110
  //#endregion
25979
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Document.d.ts
25980
- declare class Document<T extends DocumentSchema = object> {
25981
- private collectionName;
25982
- private documentId;
25983
- private apiCall;
25984
- constructor(collectionName: string, documentId: string, apiCall: ApiCall);
25985
- retrieve(): Promise<T>;
25986
- delete(options?: DeleteQuery): Promise<T>;
25987
- update(partialDocument: Partial<T>, options?: DocumentWriteParameters): Promise<T>;
25988
- private endpointPath;
26111
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/RequestWithCache.d.ts
26112
+ declare class RequestWithCache {
26113
+ private responseCache;
26114
+ private responsePromiseCache;
26115
+ clearCache(): void;
26116
+ perform<const TContext extends HttpClient, const TMethod extends keyof HttpClient, const TDoc extends DocumentSchema[], TResult>(requestContext: TContext, methodName: TMethod, requestParams: RequestParams<TDoc>, cacheOptions: CacheOptions$2 | undefined): Promise<TResult>;
26117
+ private executeRequest;
26118
+ }
26119
+ interface CacheOptions$2 {
26120
+ cacheResponseForSeconds?: number;
26121
+ maxSize?: number;
25989
26122
  }
25990
26123
  //#endregion
25991
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Collection.d.ts
25992
- type FieldType = "string" | "int32" | "int64" | "float" | "bool" | "geopoint" | "geopolygon" | "geopoint[]" | "string[]" | "int32[]" | "int64[]" | "float[]" | "bool[]" | "object" | "object[]" | "auto" | "string*" | "image";
25993
- interface CollectionFieldSchema extends Partial<Pick<BaseCollectionCreateSchema, "token_separators" | "symbols_to_index">> {
25994
- name: string;
25995
- type: FieldType;
25996
- optional?: boolean;
25997
- facet?: boolean;
25998
- index?: boolean;
25999
- sort?: boolean;
26000
- locale?: string;
26001
- infix?: boolean;
26002
- stem?: boolean;
26003
- num_dim?: number;
26004
- store?: boolean;
26005
- range_index?: boolean;
26006
- [t: string]: unknown;
26124
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/SearchOnlyDocuments.d.ts
26125
+ declare class SearchOnlyDocuments<T extends DocumentSchema> implements SearchableDocuments<T> {
26126
+ protected collectionName: string;
26127
+ protected apiCall: ApiCall;
26128
+ protected configuration: Configuration;
26129
+ protected requestWithCache: RequestWithCache;
26130
+ constructor(collectionName: string, apiCall: ApiCall, configuration: Configuration);
26131
+ clearCache(): void;
26132
+ search<const Infix extends string>(searchParameters: SearchParams$1<T, Infix> | SearchParamsWithPreset<T, Infix>, {
26133
+ cacheSearchResultsForSeconds,
26134
+ abortSignal
26135
+ }?: SearchOptions): Promise<SearchResponse$1<T>>;
26136
+ protected endpointPath(operation?: string): string;
26137
+ static get RESOURCEPATH(): string;
26007
26138
  }
26008
- interface CollectionSchema extends CollectionCreateSchema {
26009
- created_at: number;
26010
- num_documents: number;
26011
- num_memory_shards: number;
26139
+ //#endregion
26140
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Documents.d.ts
26141
+ type DeleteQuery = {
26142
+ truncate?: true;
26143
+ } | {
26144
+ truncate?: never;
26145
+ filter_by?: string;
26146
+ batch_size?: number;
26147
+ ignore_not_found?: boolean;
26148
+ return_doc?: boolean;
26149
+ return_id?: boolean;
26150
+ };
26151
+ interface DeleteResponse<T extends DocumentSchema = DocumentSchema> {
26152
+ num_deleted: number;
26153
+ documents?: T[];
26154
+ ids?: string[];
26012
26155
  }
26013
- interface CollectionDropFieldSchema {
26014
- name: string;
26015
- drop: true;
26156
+ interface ImportResponseSuccess<T extends DocumentSchema = DocumentSchema> {
26157
+ success: true;
26158
+ error?: never;
26159
+ document?: T;
26160
+ id?: string;
26161
+ code?: never;
26016
26162
  }
26017
- interface CollectionUpdateSchema extends Partial<Omit<CollectionCreateSchema, "name" | "fields">> {
26018
- fields?: (CollectionFieldSchema | CollectionDropFieldSchema)[];
26163
+ interface ImportResponseFail<T extends DocumentSchema = DocumentSchema> {
26164
+ success: false;
26165
+ error: string;
26166
+ document?: T;
26167
+ id?: string;
26168
+ code: number;
26019
26169
  }
26020
- interface CollectionDeleteOptions {
26021
- compact_store?: boolean;
26170
+ type ImportResponse<T extends DocumentSchema = DocumentSchema> = ImportResponseSuccess<T> | ImportResponseFail<T>;
26171
+ type DocumentSchema = Record<string, any>;
26172
+ interface SearchParamsWithPreset<T extends DocumentSchema, Infix extends string> extends Partial<SearchParams$1<T, Infix>> {
26173
+ preset: string;
26022
26174
  }
26023
- declare class Collection<T extends DocumentSchema = object> {
26024
- private readonly name;
26025
- private readonly apiCall;
26026
- private readonly configuration;
26027
- private readonly _documents;
26028
- private individualDocuments;
26029
- private readonly _overrides;
26030
- private individualOverrides;
26031
- private readonly _synonyms;
26032
- private individualSynonyms;
26033
- constructor(name: string, apiCall: ApiCall, configuration: any);
26034
- retrieve(): Promise<CollectionSchema>;
26035
- update(schema: CollectionUpdateSchema): Promise<CollectionSchema>;
26036
- delete(options?: CollectionDeleteOptions): Promise<CollectionSchema>;
26037
- exists(): Promise<boolean>;
26038
- documents(): Documents<T>;
26039
- documents(documentId: string): Document<T>;
26040
- overrides(): Overrides;
26041
- overrides(overrideId: string): Override;
26042
- synonyms(): Synonyms;
26043
- synonyms(synonymId: string): Synonym;
26044
- private endpointPath;
26175
+ type SearchResponseHighlightObject = {
26176
+ matched_tokens?: string[];
26177
+ snippet?: string;
26178
+ value?: string;
26179
+ };
26180
+ type SearchResponseHighlight<T> = T extends string | number ? SearchResponseHighlightObject : { [TAttribute in keyof T]?: SearchResponseHighlight<T[TAttribute]> };
26181
+ interface SearchResponseHit<T extends DocumentSchema> {
26182
+ curated?: true;
26183
+ highlights?: [{
26184
+ field: keyof T;
26185
+ snippet?: string;
26186
+ value?: string;
26187
+ snippets?: string[];
26188
+ indices?: number[];
26189
+ matched_tokens: string[][] | string[];
26190
+ }];
26191
+ highlight: SearchResponseHighlight<T>;
26192
+ document: T;
26193
+ text_match: number;
26194
+ text_match_info?: {
26195
+ best_field_score: `${number}`;
26196
+ best_field_weight: number;
26197
+ fields_matched: number;
26198
+ score: `${number}`;
26199
+ tokens_matched: number;
26200
+ };
26201
+ geo_distance_meters?: {
26202
+ location: number;
26203
+ };
26045
26204
  }
26046
- //#endregion
26047
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Collections.d.ts
26048
- interface BaseCollectionCreateSchema {
26049
- name: string;
26050
- default_sorting_field?: string;
26051
- symbols_to_index?: string[];
26052
- token_separators?: string[];
26053
- enable_nested_fields?: boolean;
26054
- metadata?: object;
26055
- voice_query_model?: {
26056
- model_name?: string;
26205
+ interface SearchResponseFacetCountSchema<T extends DocumentSchema> {
26206
+ counts: {
26207
+ count: number;
26208
+ highlighted: string;
26209
+ value: string;
26210
+ parent?: Record<string, string | number | boolean>;
26211
+ }[];
26212
+ field_name: keyof T;
26213
+ sampled: boolean;
26214
+ stats: {
26215
+ avg?: number;
26216
+ max?: number;
26217
+ min?: number;
26218
+ sum?: number;
26219
+ total_values?: number;
26057
26220
  };
26058
26221
  }
26059
- interface CollectionCreateSchemaWithSrc extends Pick<BaseCollectionCreateSchema, "name"> {
26060
- fields?: CollectionFieldSchema[];
26222
+ interface LLMResponse {
26223
+ content: string;
26224
+ extraction_method: string;
26225
+ model: string;
26061
26226
  }
26062
- interface CollectionCreateSchemaWithoutSrc extends BaseCollectionCreateSchema {
26063
- fields: CollectionFieldSchema[];
26227
+ interface SearchResponse$1<T extends DocumentSchema> {
26228
+ facet_counts?: SearchResponseFacetCountSchema<T>[];
26229
+ found: number;
26230
+ found_docs?: number;
26231
+ out_of: number;
26232
+ page: number;
26233
+ request_params: SearchResponseRequestParams;
26234
+ search_time_ms: number;
26235
+ search_cutoff?: boolean;
26236
+ hits?: SearchResponseHit<T>[];
26237
+ grouped_hits?: {
26238
+ group_key: string[];
26239
+ hits: SearchResponseHit<T>[];
26240
+ found?: number;
26241
+ }[];
26242
+ parsed_nl_query?: {
26243
+ parse_time_ms: number;
26244
+ generated_params: SearchParams$1<T>;
26245
+ augmented_params: SearchParams$1<T>;
26246
+ llm_response?: LLMResponse;
26247
+ };
26248
+ conversation?: {
26249
+ answer: string;
26250
+ conversation_history: {
26251
+ conversation: object[];
26252
+ id: string;
26253
+ last_updated: number;
26254
+ ttl: number;
26255
+ };
26256
+ conversation_id: string;
26257
+ query: string;
26258
+ };
26259
+ error?: string;
26260
+ code?: number;
26064
26261
  }
26065
- /**
26066
- * Defines the schema for creating a collection in Typesense.
26067
- *
26068
- * If the `src_name` property in `Options` is a string, the `fields` prop is optional, and only used for embedding fields.
26069
- * Otherwise, `fields` will be required.
26070
- */
26071
- type CollectionCreateSchema<Options$20 extends CollectionCreateOptions = CollectionCreateOptions> = Options$20["src_name"] extends string ? CollectionCreateSchemaWithSrc : CollectionCreateSchemaWithoutSrc;
26072
- interface CollectionCreateOptions {
26073
- src_name?: string;
26262
+ interface DocumentWriteParameters {
26263
+ dirty_values?: "coerce_or_reject" | "coerce_or_drop" | "drop" | "reject";
26264
+ action?: "create" | "update" | "upsert" | "emplace";
26074
26265
  }
26075
- interface CollectionsRetrieveOptions {
26076
- exclude_fields?: string;
26266
+ interface UpdateByFilterParameters {
26267
+ filter_by?: string;
26077
26268
  }
26078
- declare class Collections {
26079
- private apiCall;
26080
- constructor(apiCall: ApiCall);
26081
- create<const Options$20 extends CollectionCreateOptions>(schema: CollectionCreateSchema<Options$20>, options?: Options$20): Promise<CollectionSchema>;
26082
- retrieve(options?: CollectionsRetrieveOptions): Promise<CollectionSchema[]>;
26083
- static get RESOURCEPATH(): string;
26269
+ interface UpdateByFilterResponse {
26270
+ num_updated: number;
26084
26271
  }
26085
- //#endregion
26086
- //#region src/shared/types/plugin-types.d.ts
26087
- /**
26088
- * Hybrid search configuration for combining semantic and keyword search
26089
- */
26090
- interface HybridSearchConfig {
26091
- /** Weight between semantic (1.0) and keyword (0.0) search. Default: 0.9 (90% semantic, 10% keyword) */
26092
- alpha?: number;
26093
- /** Whether to rerank hybrid search results. Default: true */
26094
- rerankMatches?: boolean;
26095
- /** Fields to use for keyword search portion. Default: 'chunk_text,title' */
26096
- queryFields?: string;
26272
+ interface DocumentImportParameters extends DocumentWriteParameters {
26273
+ batch_size?: number;
26274
+ remote_embedding_batch_size?: number;
26275
+ remote_embedding_timeout_ms?: number;
26276
+ remote_embedding_num_tries?: number;
26277
+ return_doc?: boolean;
26278
+ return_id?: boolean;
26279
+ throwOnFail?: boolean;
26097
26280
  }
26098
- /**
26099
- * HNSW (Hierarchical Navigable Small World) optimization parameters
26100
- * These optimize vector search performance and quality
26101
- */
26102
- interface HNSWConfig {
26103
- /** Higher = better quality, slower indexing. Default: 200 */
26104
- efConstruction?: number;
26105
- /** Connections per node - balance memory/speed. Default: 16 */
26106
- M?: number;
26107
- /** Search quality - higher = better quality, slower search. Default: 100 */
26108
- ef?: number;
26109
- /** Maximum connections per element. Default: 64 */
26110
- maxConnections?: number;
26111
- /** Distance metric for vector similarity. Default: 'cosine' */
26112
- distanceMetric?: 'cosine' | 'l2' | 'ip';
26281
+ interface DocumentsExportParameters {
26282
+ filter_by?: string;
26283
+ include_fields?: string;
26284
+ exclude_fields?: string;
26113
26285
  }
26114
- /**
26115
- * Advanced search parameters for better relevance
26116
- */
26117
- interface AdvancedSearchConfig {
26118
- /** Minimum tokens before allowing typos. Default: 1 */
26119
- typoTokensThreshold?: number;
26120
- /** Number of typos to allow. Default: 2 */
26121
- numTypos?: number;
26122
- /** Enable prefix matching for partial queries. Default: true */
26123
- prefix?: boolean;
26124
- /** Minimum tokens before dropping tokens for partial matching. Default: 1 */
26125
- dropTokensThreshold?: number;
26126
- /** Enable stemming for better language matching. Default: true */
26127
- enableStemming?: boolean;
26286
+ interface SearchOptions {
26287
+ cacheSearchResultsForSeconds?: number;
26288
+ abortSignal?: AbortSignal | null;
26128
26289
  }
26129
- /**
26130
- * Source chunk information for citations
26131
- */
26132
- interface ChunkSource {
26133
- /** Unique chunk ID */
26134
- id: string;
26135
- /** Parent document title */
26136
- title: string;
26137
- /** Parent document slug for URL construction */
26138
- slug: string;
26139
- /** Type of document */
26140
- type: string;
26141
- /** Chunk index within the document */
26142
- chunkIndex: number;
26143
- /** Relevance score (lower is better for vector distance) */
26144
- relevanceScore: number;
26145
- /** Full content of the chunk (markdown) */
26146
- content: string;
26147
- /** Optional excerpt from the chunk (first 200 chars) */
26148
- excerpt?: string;
26290
+ declare class Documents<T extends DocumentSchema = object> extends SearchOnlyDocuments<T> implements WriteableDocuments<T> {
26291
+ constructor(collectionName: string, apiCall: ApiCall, configuration: Configuration);
26292
+ create(document: T, options?: DocumentWriteParameters): Promise<T>;
26293
+ upsert(document: T, options?: DocumentWriteParameters): Promise<T>;
26294
+ update(document: T, options: UpdateByFilterParameters): Promise<UpdateByFilterResponse>;
26295
+ update(document: T, options: DocumentWriteParameters): Promise<T>;
26296
+ delete(query?: DeleteQuery): Promise<DeleteResponse<T>>;
26297
+ createMany(documents: T[], options?: DocumentImportParameters): Promise<ImportResponse<T>[]>;
26298
+ /**
26299
+ * Import a set of documents in a batch.
26300
+ * @param {string|Array} documents - Can be a JSONL string of documents or an array of document objects.
26301
+ * @param options
26302
+ * @return {string|Array} Returns a JSONL string if the input was a JSONL string, otherwise it returns an array of results.
26303
+ */
26304
+ import(documents: string, options?: DocumentImportParameters): Promise<string>;
26305
+ import(documents: T[], options?: DocumentImportParameters): Promise<ImportResponse<T>[]>;
26306
+ /**
26307
+ * Imports documents from a NodeJS readable stream of JSONL.
26308
+ */
26309
+ importStream(readableStream: ReadStream, options?: DocumentImportParameters): Promise<ImportResponse<T>[]>;
26310
+ /**
26311
+ * Returns a JSONL string for all the documents in this collection
26312
+ */
26313
+ export(options?: DocumentsExportParameters): Promise<string>;
26314
+ /**
26315
+ * Returns a NodeJS readable stream of JSONL for all the documents in this collection.
26316
+ */
26317
+ exportStream(options?: DocumentsExportParameters): Promise<ReadStream>;
26149
26318
  }
26150
- /**
26151
- * SSE event types
26152
- */
26153
- type SSEEventType = 'conversation_id' | 'token' | 'sources' | 'done' | 'error' | 'usage';
26154
- /**
26155
- * Usage info structure
26156
- */
26157
- interface UsageInfo {
26158
- tokens_used: number;
26159
- cost_usd: number;
26160
- daily_limit: number;
26161
- daily_used: number;
26162
- daily_remaining: number;
26163
- reset_at?: string;
26319
+ //#endregion
26320
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Configuration.d.ts
26321
+ interface NodeConfiguration {
26322
+ host: string;
26323
+ port: number;
26324
+ protocol: string;
26325
+ path?: string;
26326
+ url?: string;
26164
26327
  }
26165
- /**
26166
- * Token usage breakdown
26167
- */
26168
- interface TokenUsage {
26169
- input?: number;
26170
- output?: number;
26171
- total: number;
26328
+ interface NodeConfigurationWithHostname {
26329
+ host: string;
26330
+ port: number;
26331
+ protocol: string;
26332
+ path?: string;
26172
26333
  }
26173
- /**
26174
- * Service types for spending tracking
26175
- */
26176
- type ServiceType = 'openai_embedding' | 'openai_llm';
26177
- /**
26178
- * Spending entry for tracking AI service costs
26179
- */
26180
- interface SpendingEntry {
26181
- service: ServiceType;
26182
- model: string;
26183
- tokens: TokenUsage;
26184
- cost_usd?: number;
26185
- timestamp: string;
26334
+ interface NodeConfigurationWithUrl {
26335
+ url: string;
26186
26336
  }
26187
- /**
26188
- * SSE event structure
26189
- */
26190
- interface SSEEvent {
26191
- type: SSEEventType;
26192
- data: string | ChunkSource[] | {
26193
- error: string;
26194
- } | UsageInfo;
26337
+ interface ConfigurationOptions {
26338
+ apiKey: string;
26339
+ nodes: NodeConfiguration[] | NodeConfigurationWithHostname[] | NodeConfigurationWithUrl[];
26340
+ randomizeNodes?: boolean;
26341
+ /**
26342
+ * @deprecated
26343
+ * masterNode is now consolidated to nodes, starting with Typesense Server v0.12'
26344
+ */
26345
+ masterNode?: NodeConfiguration | NodeConfigurationWithHostname | NodeConfigurationWithUrl;
26346
+ /**
26347
+ * @deprecated
26348
+ * readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12'
26349
+ */
26350
+ readReplicaNodes?: NodeConfiguration[] | NodeConfigurationWithHostname[] | NodeConfigurationWithUrl[];
26351
+ nearestNode?: NodeConfiguration | NodeConfigurationWithHostname | NodeConfigurationWithUrl;
26352
+ connectionTimeoutSeconds?: number;
26353
+ timeoutSeconds?: number;
26354
+ healthcheckIntervalSeconds?: number;
26355
+ numRetries?: number;
26356
+ retryIntervalSeconds?: number;
26357
+ sendApiKeyAsQueryParam?: boolean | undefined;
26358
+ useServerSideSearchCache?: boolean;
26359
+ cacheSearchResultsForSeconds?: number;
26360
+ additionalHeaders?: Record<string, string>;
26361
+ logLevel?: LogLevelDesc;
26362
+ logger?: Logger$1;
26363
+ /**
26364
+ * Set a custom HTTP Agent
26365
+ *
26366
+ * This is helpful for eg, to enable keepAlive which helps prevents ECONNRESET socket hang up errors
26367
+ * Usage:
26368
+ * const { Agent: HTTPAgent } = require("http");
26369
+ * ...
26370
+ * httpAgent: new HTTPAgent({ keepAlive: true }),
26371
+ * @type {HTTPAgent}
26372
+ */
26373
+ httpAgent?: Agent;
26374
+ /**
26375
+ * Set a custom HTTPS Agent
26376
+ *
26377
+ * This is helpful for eg, to enable keepAlive which helps prevents ECONNRESET socket hang up errors
26378
+ * Usage:
26379
+ * const { Agent: HTTPSAgent } = require("https");
26380
+ * ...
26381
+ * httpsAgent: new HTTPSAgent({ keepAlive: true }),
26382
+ * @type {HTTPSAgent}
26383
+ */
26384
+ httpsAgent?: Agent$1;
26385
+ /**
26386
+ * Set a custom paramsSerializer
26387
+ *
26388
+ * See axios documentation for more information on how to use this parameter: https://axios-http.com/docs/req_config
26389
+ * This is helpful for handling React Native issues like this: https://github.com/axios/axios/issues/6102#issuecomment-2085301397
26390
+ * @type {any}
26391
+ */
26392
+ paramsSerializer?: any;
26393
+ /**
26394
+ * Set a custom axios adapter
26395
+ *
26396
+ * Useful for customizing the underlying HTTP client library used by Typesense.
26397
+ *
26398
+ * For example, you can use this to use a custom HTTP client library like `fetch`, in order for the library to work on the edge.
26399
+ * Related GiHub issue: https://github.com/typesense/typesense-js/issues/161
26400
+ *
26401
+ * See axios documentation for more information on how to use this parameter: https://axios-http.com/docs/req_config
26402
+ */
26403
+ axiosAdapter?: AxiosRequestConfig["adapter"];
26195
26404
  }
26196
26405
  /**
26197
- * Typesense search hit document (chunk-specific)
26406
+ * Configuration options for streaming responses
26198
26407
  */
26199
- interface TypesenseRAGChunkDocument {
26200
- id: string;
26201
- chunk_text: string;
26202
- title?: string;
26203
- slug?: string;
26204
- parent_doc_id?: string;
26205
- chunk_index?: number;
26206
- [key: string]: unknown;
26408
+ interface BaseStreamConfig {
26409
+ /**
26410
+ * Callback function that will be called for each chunk of data received
26411
+ * during streaming
26412
+ */
26413
+ onChunk?: (data: {
26414
+ conversation_id: string;
26415
+ message: string;
26416
+ }) => void;
26417
+ /**
26418
+ * Callback function that will be called if there is an error during streaming
26419
+ */
26420
+ onError?: (error: Error) => void;
26207
26421
  }
26208
26422
  /**
26209
- * Typesense search hit
26423
+ * Stream configuration for standard search responses
26424
+ * For specialized responses like MultiSearch, extend BaseStreamConfig with the appropriate onComplete signature
26210
26425
  */
26211
- interface TypesenseSearchHit {
26212
- document: TypesenseRAGChunkDocument;
26213
- vector_distance?: number;
26214
- text_match?: number;
26215
- [key: string]: unknown;
26216
- }
26217
- /**
26218
- * Typesense search result
26219
- */
26220
- interface TypesenseSearchResult {
26221
- hits?: TypesenseSearchHit[];
26222
- request_params?: {
26223
- collection_name?: string;
26224
- [key: string]: unknown;
26225
- };
26226
- [key: string]: unknown;
26227
- }
26228
- /**
26229
- * Configuration for building Typesense queries
26230
- */
26231
- interface TypesenseQueryConfig {
26232
- /** User's message/query */
26233
- userMessage: string;
26234
- /** Query embedding vector */
26235
- queryEmbedding: number[];
26236
- /** Optional: Filter by selected document IDs */
26237
- selectedDocuments?: string[];
26238
- /** Optional: Conversation ID for follow-up */
26239
- chatId?: string;
26240
- /** Collections to search */
26241
- searchCollections: string[];
26242
- /** Number of results to retrieve */
26243
- kResults?: number;
26244
- /** Advanced search config */
26245
- advancedConfig?: AdvancedSearchConfig;
26246
- }
26247
- interface RAGCallbacks {
26248
- /** Get Payload instance (required) */
26249
- getPayload: () => Promise<Payload>;
26250
- /** Check permissions function (required) */
26251
- checkPermissions: (request: PayloadRequest) => Promise<boolean>;
26252
- /** Check token limit function (optional) */
26253
- checkTokenLimit?: (payload: Payload, userId: string | number, tokens: number) => Promise<{
26254
- allowed: boolean;
26255
- limit: number;
26256
- used: number;
26257
- remaining: number;
26258
- reset_at?: string;
26259
- }>;
26260
- /** Get user usage stats function (optional) */
26261
- getUserUsageStats?: (payload: Payload, userId: string | number) => Promise<{
26262
- limit: number;
26263
- used: number;
26264
- remaining: number;
26265
- reset_at?: string;
26266
- }>;
26267
- /** Save chat session function (optional) */
26268
- saveChatSession?: (payload: Payload, userId: string | number, conversationId: string, userMessage: string, assistantMessage: string, sources: ChunkSource[], spending: SpendingEntry[], collectionName: CollectionSlug) => Promise<void>;
26269
- /** Create embedding spending function (optional) */
26270
- createEmbeddingSpending?: (model: string, tokens: number) => SpendingEntry;
26271
- /** Estimate tokens from text function (optional) */
26272
- estimateTokensFromText?: (text: string) => number;
26273
- }
26274
- /**
26275
- * Complete RAG configuration
26276
- */
26277
- interface RAGConfig {
26278
- /** Hybrid search settings */
26279
- hybrid?: HybridSearchConfig;
26280
- /** HNSW optimization settings */
26281
- hnsw?: HNSWConfig;
26282
- /** Advanced search settings */
26283
- advanced?: AdvancedSearchConfig;
26284
- }
26285
- interface RAGFeatureConfig extends RAGConfig {
26286
- enabled: boolean;
26287
- callbacks?: RAGCallbacks;
26288
- agents: AgentConfig[];
26289
- }
26290
- /**
26291
- * Modelos OpenAI
26292
- */
26293
- type OpenAIEmbeddingModel = "text-embedding-3-small" | "text-embedding-3-large" | "text-embedding-ada-002";
26294
- /**
26295
- * Modelos Gemini
26296
- */
26297
- type GeminiEmbeddingModel = "gemini-embedding-001" | "text-embedding-004";
26298
- /**
26299
- * Dimensiones por modelo
26300
- */
26301
- type OpenAIDimensionsByModel = {
26302
- "text-embedding-3-large": 3072;
26303
- "text-embedding-3-small": 1536;
26304
- "text-embedding-ada-002": 1536;
26305
- };
26306
- type GeminiDimensionsByModel = {
26307
- "gemini-embedding-001": number;
26308
- "text-embedding-004": 768;
26309
- };
26310
- /**
26311
- * Config por proveedor (Estructura anidada unificada)
26312
- */
26313
- type OpenAIProviderConfig = {
26314
- type: "openai";
26315
- model?: OpenAIEmbeddingModel;
26316
- dimensions?: OpenAIDimensionsByModel[OpenAIEmbeddingModel];
26317
- apiKey: string;
26318
- };
26319
- type GeminiProviderConfig = {
26320
- type: "gemini";
26321
- model?: GeminiEmbeddingModel;
26322
- dimensions?: GeminiDimensionsByModel[GeminiEmbeddingModel];
26323
- apiKey: string;
26324
- };
26325
- /**
26326
- * Config del proveedor (Union)
26327
- */
26328
- type EmbeddingProviderConfig = OpenAIProviderConfig | GeminiProviderConfig;
26329
- type TypesenseProtocol = "http" | "https";
26330
- type TypesenseNode = {
26331
- host: string;
26332
- port: number;
26333
- protocol: TypesenseProtocol;
26334
- path?: string;
26335
- };
26336
- /**
26337
- * Configuration for Typesense connection
26338
- */
26339
- type TypesenseConnectionConfig = {
26340
- apiKey: string;
26341
- connectionTimeoutSeconds?: number;
26342
- retryIntervalSeconds?: number;
26343
- nodes: [TypesenseNode, ...Array<TypesenseNode>];
26344
- };
26345
- /**
26346
- * Main plugin configuration
26347
- */
26348
- /**
26349
- * Configuration for a single conversational agent
26350
- */
26351
- interface AgentConfig {
26352
- /**
26353
- * Unique identifier for the agent (used in API requests)
26354
- */
26355
- slug: string;
26356
- /**
26357
- * Display name for the agent (shown in UI)
26358
- * If not provided, slug will be used.
26359
- */
26360
- name?: string;
26361
- /**
26362
- * Optional API Key for the LLM provider.
26363
- * If provided, this overrides the global embedding provider API key for this agent.
26364
- */
26365
- apiKey?: string;
26366
- /**
26367
- * System prompt that defines the agent's personality and constraints
26368
- */
26369
- systemPrompt: string;
26370
- /**
26371
- * LLM model to use (e.g., 'openai/gpt-4o-mini')
26372
- */
26373
- llmModel: string;
26374
- /**
26375
- * Collections this agent is allowed to search in
26376
- */
26377
- searchCollections: string[];
26378
- /**
26379
- * Maximum context size in bytes. Default: 65536 (64KB)
26380
- */
26381
- maxContextBytes?: number;
26382
- /**
26383
- * TTL for conversation history in seconds. Default: 86400 (24h)
26384
- */
26385
- ttl?: number;
26386
- /**
26387
- * Name of the conversation history collection. Default: 'conversation_history'
26388
- */
26389
- historyCollection?: string;
26390
- /**
26391
- * Number of chunks to retrieve for RAG context. Default: 10
26392
- */
26393
- kResults?: number;
26394
- }
26395
- //#endregion
26396
- //#region src/core/config/mapping-types.d.ts
26397
- /**
26398
- * Field mapping configuration
26399
- * Defines how a Payload field maps to a Typesense field
26400
- */
26401
- interface FieldMapping {
26402
- /**
26403
- * Name of the field in Typesense
26404
- */
26405
- name: string;
26406
- /**
26407
- * Path to the field in Payload (supports dot notation)
26408
- * If not provided, defaults to 'name'
26409
- */
26410
- payloadField?: string;
26411
- /**
26412
- * Type of the field in Typesense
26413
- */
26414
- type: "string" | "int32" | "int64" | "float" | "bool" | "string[]" | "float[]" | "object" | "auto";
26415
- /**
26416
- * Whether the field should be faceted
26417
- */
26418
- facet?: boolean;
26419
- /**
26420
- * Whether the field should be indexed (searchable)
26421
- */
26422
- index?: boolean;
26423
- /**
26424
- * Whether the field is optional
26425
- */
26426
- optional?: boolean;
26427
- /**
26428
- * Custom transformation function to convert Payload value to Typesense value
26429
- * Useful for handling relations, rich text, or any complex data type
26430
- *
26431
- * @param value - The raw value from Payload
26432
- * @returns The transformed value for Typesense
26433
- *
26434
- * @example
26435
- * // Convert relation array to string array of names
26436
- * transform: (value) => {
26437
- * if (Array.isArray(value)) {
26438
- * return value.map(item => item.name || item.title || String(item));
26439
- * }
26440
- * return [];
26441
- * }
26442
- */
26443
- transform?: (value: any) => any;
26444
- }
26445
- /**
26446
- * Base configuration for any table mapping
26447
- */
26448
- interface BaseTableConfig {
26449
- /**
26450
- * Name of the table in Typesense
26451
- * If not provided, generated from collection slug + suffix
26452
- */
26453
- tableName?: string;
26454
- /**
26455
- * Display name for UI
26456
- */
26457
- displayName?: string;
26458
- /**
26459
- * Whether this table sync is enabled
26460
- */
26461
- enabled: boolean;
26462
- /**
26463
- * Fields to map from Payload to Typesense
26464
- */
26465
- fields: FieldMapping[];
26466
- /**
26467
- * Optional callback to determine if a document should be indexed
26468
- *
26469
- * @param doc - The document being indexed
26470
- * @returns boolean | Promise<boolean> - true to index, false to skip
26471
- */
26472
- shouldIndex?: (doc: any) => boolean | Promise<boolean>;
26473
- }
26474
- /**
26475
- * Configuration for Table Mapping
26476
- */
26477
- interface TableConfig extends BaseTableConfig {
26478
- /**
26479
- * Embedding configuration
26480
- * Defines how to generate embeddings for this table
26481
- */
26482
- embedding?: {
26483
- /**
26484
- * Source fields to extract and transform for embedding generation
26485
- * These will be concatenated if multiple are provided
26486
- */
26487
- fields: (string | SourceField)[];
26488
- /**
26489
- * Optional chunking configuration
26490
- * If provided, the content will be chunked before embedding
26491
- */
26492
- chunking?: {
26493
- strategy: "markdown" | "text";
26494
- size?: number;
26495
- overlap?: number;
26496
- /**
26497
- * Callback to intercept and modify chunk results
26498
- * Allows adding extra metadata or modifying the chunk text before embedding
26499
- *
26500
- * @param chunkResultsWithMetadata - The generated chunks with their metadata
26501
- * @param payloadDocument - The original Payload document
26502
- * @returns The modified chunk text or object
26503
- */
26504
- interceptResult?: (chunkResultsWithMetadata: any, payloadDocument: any) => string;
26505
- };
26506
- };
26507
- }
26508
- /**
26509
- * Source field configuration for embedding/chunking
26510
- * Defines a field to extract and optionally transform
26511
- */
26512
- interface SourceField {
26513
- /**
26514
- * Name of the field in Payload
26515
- */
26516
- field: string;
26426
+ interface StreamConfig<T extends DocumentSchema> extends BaseStreamConfig {
26517
26427
  /**
26518
- * Optional transform function to convert the field value
26519
- * Useful for converting RichText to plain text/markdown
26520
- *
26521
- * @param value - The raw value from Payload
26522
- * @returns The transformed value
26428
+ * Callback function that will be called when the streaming is complete
26523
26429
  */
26524
- transform?: (value: any) => any | Promise<any>;
26430
+ onComplete?: (data: SearchResponse$1<T>) => void;
26525
26431
  }
26526
- /**
26527
- * Collection configuration
26528
- * Maps a Payload collection to one or more Typesense tables
26529
- */
26530
- interface CollectionConfig {
26531
- tables: TableConfig[];
26432
+ declare class Configuration {
26433
+ readonly nodes: NodeConfiguration[] | NodeConfigurationWithHostname[] | NodeConfigurationWithUrl[];
26434
+ readonly nearestNode?: NodeConfiguration | NodeConfigurationWithHostname | NodeConfigurationWithUrl;
26435
+ readonly connectionTimeoutSeconds: number;
26436
+ readonly healthcheckIntervalSeconds: number;
26437
+ readonly numRetries: number;
26438
+ readonly retryIntervalSeconds: number;
26439
+ readonly apiKey: string;
26440
+ readonly sendApiKeyAsQueryParam?: boolean;
26441
+ readonly cacheSearchResultsForSeconds: number;
26442
+ readonly useServerSideSearchCache: boolean;
26443
+ readonly logger: Logger$1;
26444
+ readonly logLevel: LogLevelDesc;
26445
+ readonly additionalHeaders?: Record<string, string>;
26446
+ readonly httpAgent?: Agent;
26447
+ readonly httpsAgent?: Agent$1;
26448
+ readonly paramsSerializer?: any;
26449
+ readonly axiosAdapter?: AxiosRequestConfig["adapter"];
26450
+ constructor(options: ConfigurationOptions);
26451
+ validate(): boolean;
26452
+ private validateNodes;
26453
+ private isNodeMissingAnyParameters;
26454
+ private setDefaultPathInNode;
26455
+ private setDefaultPortInNode;
26456
+ private showDeprecationWarnings;
26457
+ private shuffleArray;
26532
26458
  }
26533
26459
  //#endregion
26534
- //#region src/core/config/types.d.ts
26535
- type SearchMode = "semantic" | "keyword" | "hybrid";
26536
- interface SearchDefaults {
26537
- mode?: SearchMode;
26538
- perPage?: number;
26539
- tables?: string[];
26540
- }
26541
- interface SearchFeatureConfig {
26542
- enabled: boolean;
26543
- defaults?: SearchDefaults;
26544
- }
26545
- interface SyncFeatureConfig {
26546
- enabled: boolean;
26547
- autoSync?: boolean;
26548
- batchSize?: number;
26460
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Override.d.ts
26461
+ interface OverrideSchema extends OverrideCreateSchema {
26462
+ id: string;
26549
26463
  }
26550
- interface FeatureFlags {
26551
- embedding?: EmbeddingProviderConfig;
26552
- search?: SearchFeatureConfig;
26553
- rag?: RAGFeatureConfig;
26554
- sync?: SyncFeatureConfig;
26464
+ interface OverrideDeleteSchema {
26465
+ id: string;
26555
26466
  }
26556
- interface ModularPluginConfig {
26557
- typesense: TypesenseConnectionConfig;
26558
- features: FeatureFlags;
26559
- collections: Record<CollectionSlug | string, TableConfig[]>;
26467
+ declare class Override {
26468
+ private collectionName;
26469
+ private overrideId;
26470
+ private apiCall;
26471
+ constructor(collectionName: string, overrideId: string, apiCall: ApiCall);
26472
+ retrieve(): Promise<OverrideSchema>;
26473
+ delete(): Promise<OverrideDeleteSchema>;
26474
+ private endpointPath;
26560
26475
  }
26561
26476
  //#endregion
26562
- //#region src/plugin/main-plugin.d.ts
26563
- /**
26564
- * Typesense Search Plugin for Payload CMS
26565
- *
26566
- * Provides full-text search and vector search capabilities using Typesense,
26567
- * with optional RAG (Retrieval Augmented Generation) support.
26568
- *
26569
- * @param pluginOptions - Configuration options for the plugin
26570
- * @returns Payload config modifier function
26571
- */
26572
- declare const typesenseSearch: (pluginOptions: ModularPluginConfig) => (config: Config) => Config;
26573
- //#endregion
26574
- //#region src/shared/types/types.d.ts
26575
- /**
26576
- * Generic types for better type safety across the plugin
26577
- */
26578
- interface BaseDocument {
26579
- _status?: 'draft' | 'published';
26580
- createdAt: Date | string;
26581
- publishedAt: Date | string;
26582
- id: string;
26583
- slug?: string;
26584
- updatedAt: Date | string;
26585
- }
26586
- interface PayloadDocument extends BaseDocument {
26587
- [key: string]: unknown;
26477
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Overrides.d.ts
26478
+ interface OverrideRuleQuerySchema {
26479
+ query?: string;
26480
+ match?: "exact" | "contains";
26588
26481
  }
26589
- interface TypesenseDocument {
26590
- id: string;
26591
- slug?: string;
26592
- title?: string;
26593
- createdAt: number;
26594
- updatedAt: number;
26595
- embedding?: number[];
26596
- [key: string]: unknown;
26482
+ interface OverrideRuleFilterSchema {
26483
+ filter_by?: string;
26597
26484
  }
26598
- interface TypesenseChunkDocument {
26599
- id: string;
26600
- parent_doc_id: string;
26601
- slug: string;
26602
- title: string;
26603
- createdAt: number;
26604
- publishedAt?: number;
26605
- updatedAt: number;
26606
- chunk_index: number;
26607
- chunk_text: string;
26608
- is_chunk: boolean;
26609
- embedding: number[];
26485
+ interface OverrideRuleTagsSchema {
26486
+ tags?: string[];
26610
26487
  }
26611
- interface SearchResult<T = TypesenseDocument> {
26612
- collection?: string;
26613
- content?: string;
26614
- displayName?: string;
26615
- document: T;
26616
- highlight?: {
26617
- [field: string]: {
26618
- matched_tokens: string[];
26619
- snippet: string;
26620
- value: string;
26621
- };
26622
- };
26623
- highlights?: Array<{
26624
- field: string;
26625
- matched_tokens: string[];
26626
- snippet: string;
26627
- value: string;
26488
+ interface OverrideCreateSchema {
26489
+ rule: OverrideRuleQuerySchema & OverrideRuleFilterSchema & OverrideRuleTagsSchema;
26490
+ filter_by?: string;
26491
+ sort_by?: string;
26492
+ remove_matched_tokens?: boolean;
26493
+ replace_query?: string;
26494
+ includes?: Array<{
26495
+ id: string;
26496
+ position: number;
26628
26497
  }>;
26629
- icon?: string;
26630
- id: string;
26631
- text_match?: number;
26632
- text_match_info?: {
26633
- best_field_score: string;
26634
- best_field_weight: number;
26635
- fields_matched: number;
26636
- score: string;
26637
- tokens_matched: number;
26638
- };
26639
- vector_distance?: number;
26640
- title?: string;
26641
- updatedAt?: string;
26642
- }
26643
- interface SearchResponse<T = TypesenseDocument> {
26644
- collections?: Array<{
26645
- collection: string;
26646
- displayName: string;
26647
- error?: string;
26648
- found: number;
26649
- icon: string;
26498
+ excludes?: Array<{
26499
+ id: string;
26650
26500
  }>;
26651
- found: number;
26652
- hits: SearchResult<T>[];
26653
- page: number;
26654
- request_params: {
26655
- page?: number;
26656
- per_page: number;
26657
- q: string;
26658
- sort_by?: string;
26659
- };
26660
- search_cutoff: boolean;
26661
- search_time_ms: number;
26662
- }
26663
- interface SuggestResult<T = TypesenseDocument> {
26664
- collection?: string;
26665
- displayName?: string;
26666
- document: T;
26667
- highlight?: Record<string, string>;
26668
- icon?: string;
26669
- text_match?: number;
26501
+ filter_curated_hits?: boolean;
26502
+ effective_from_ts?: number;
26503
+ effective_to_ts?: number;
26504
+ stop_processing?: boolean;
26505
+ metadata?: object;
26670
26506
  }
26671
- interface SuggestResponse<T = TypesenseDocument> {
26672
- found: number;
26673
- hits: SuggestResult<T>[];
26674
- page: number;
26675
- request_params: {
26676
- per_page: number;
26677
- q: string;
26678
- };
26679
- search_cutoff: boolean;
26680
- search_time_ms: number;
26507
+ interface OverridesRetrieveSchema {
26508
+ overrides: OverrideSchema[];
26681
26509
  }
26682
- interface SearchParams {
26683
- facets?: string[];
26684
- filters?: Record<string, unknown>;
26685
- highlight_fields?: string[];
26686
- num_typos?: number;
26687
- page?: number;
26688
- per_page?: number;
26689
- q: string;
26690
- snippet_threshold?: number;
26691
- sort_by?: string;
26692
- typo_tokens_threshold?: number;
26510
+ declare class Overrides {
26511
+ private collectionName;
26512
+ private apiCall;
26513
+ constructor(collectionName: string, apiCall: ApiCall);
26514
+ upsert(overrideId: string, params: OverrideCreateSchema): Promise<OverrideSchema>;
26515
+ retrieve(): Promise<OverridesRetrieveSchema>;
26516
+ private endpointPath;
26517
+ static get RESOURCEPATH(): string;
26693
26518
  }
26694
- interface BaseSearchInputProps<T = TypesenseDocument> {
26695
- baseUrl: string;
26696
- className?: string;
26697
- collection?: string;
26698
- debounceMs?: number;
26699
- errorClassName?: string;
26700
- inputClassName?: string;
26701
- inputWrapperClassName?: string;
26702
- loadingClassName?: string;
26703
- maxResults?: number;
26704
- minQueryLength?: number;
26705
- noResultsClassName?: string;
26706
- onError?: (error: string) => void;
26707
- onLoading?: (loading: boolean) => void;
26708
- onResultClick?: (result: SearchResult<T>) => void;
26709
- onResults?: (results: SearchResponse<T>) => void;
26710
- onSearch?: (query: string, results: SearchResponse<T>) => void;
26711
- placeholder?: string;
26712
- resultsHeaderClassName?: string;
26713
- resultsListClassName?: string;
26519
+ //#endregion
26520
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Synonym.d.ts
26521
+ interface SynonymSchema extends SynonymCreateSchema {
26522
+ id: string;
26714
26523
  }
26715
- interface CacheEntry<T = unknown> {
26716
- data: T;
26717
- timestamp: number;
26718
- ttl: number;
26524
+ interface SynonymDeleteSchema {
26525
+ id: string;
26719
26526
  }
26720
- interface CacheOptions$1 {
26721
- maxSize?: number;
26722
- ttl?: number;
26527
+ declare class Synonym {
26528
+ private collectionName;
26529
+ private synonymId;
26530
+ private apiCall;
26531
+ constructor(collectionName: string, synonymId: string, apiCall: ApiCall);
26532
+ retrieve(): Promise<SynonymSchema>;
26533
+ delete(): Promise<SynonymDeleteSchema>;
26534
+ private endpointPath;
26723
26535
  }
26724
- interface HealthCheckResponse {
26725
- cache?: {
26726
- maxSize: number;
26727
- size: number;
26728
- };
26729
- collections?: string[];
26730
- error?: string;
26731
- lastSync?: number;
26732
- status: 'healthy' | 'unhealthy';
26733
- typesense?: {
26734
- ok: boolean;
26735
- version?: string;
26736
- };
26536
+ //#endregion
26537
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Synonyms.d.ts
26538
+ interface SynonymCreateSchema {
26539
+ synonyms: string[];
26540
+ root?: string;
26541
+ locale?: string;
26542
+ symbols_to_index?: string[];
26737
26543
  }
26738
- interface ErrorResponse {
26739
- code?: string;
26740
- details?: string;
26741
- error: string;
26742
- timestamp?: string;
26544
+ interface SynonymsRetrieveSchema {
26545
+ synonyms: SynonymSchema[];
26743
26546
  }
26744
- interface ApiResponse<T = unknown> {
26745
- data?: T;
26746
- error?: ErrorResponse;
26747
- meta?: {
26748
- cached?: boolean;
26749
- requestId?: string;
26750
- timestamp: string;
26751
- };
26752
- success: boolean;
26547
+ declare class Synonyms {
26548
+ private collectionName;
26549
+ private apiCall;
26550
+ constructor(collectionName: string, apiCall: ApiCall);
26551
+ upsert(synonymId: string, params: SynonymCreateSchema): Promise<SynonymSchema>;
26552
+ retrieve(): Promise<SynonymsRetrieveSchema>;
26553
+ private endpointPath;
26554
+ static get RESOURCEPATH(): string;
26753
26555
  }
26754
26556
  //#endregion
26755
- //#region src/features/embedding/embeddings.d.ts
26756
- /**
26757
- * Embedding result with usage tracking
26758
- */
26759
- interface EmbeddingWithUsage {
26760
- /** The embedding vector */
26761
- embedding: number[];
26762
- /** Usage information */
26763
- usage: {
26764
- /** Number of tokens used */
26765
- promptTokens: number;
26766
- /** Total tokens (same as prompt_tokens for embeddings) */
26767
- totalTokens: number;
26768
- };
26769
- }
26770
- /**
26771
- * Batch embedding result with usage tracking
26772
- */
26773
- interface BatchEmbeddingWithUsage {
26774
- /** Array of embedding vectors */
26775
- embeddings: number[][];
26776
- /** Total usage information */
26777
- usage: {
26778
- /** Number of tokens used */
26779
- promptTokens: number;
26780
- /** Total tokens (same as prompt_tokens for embeddings) */
26781
- totalTokens: number;
26782
- };
26557
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Document.d.ts
26558
+ declare class Document<T extends DocumentSchema = object> {
26559
+ private collectionName;
26560
+ private documentId;
26561
+ private apiCall;
26562
+ constructor(collectionName: string, documentId: string, apiCall: ApiCall);
26563
+ retrieve(): Promise<T>;
26564
+ delete(options?: DeleteQuery): Promise<T>;
26565
+ update(partialDocument: Partial<T>, options?: DocumentWriteParameters): Promise<T>;
26566
+ private endpointPath;
26783
26567
  }
26784
- /**
26785
- * Generates an embedding for the given text using OpenAI or Gemini API
26786
- * @param text - The text to generate an embedding for
26787
- * @param config - Optional embedding configuration (provider, model, dimensions, apiKey)
26788
- * @returns The embedding vector as an array of numbers, or null if generation fails
26789
- */
26790
- declare const generateEmbedding: (text: string, config?: EmbeddingProviderConfig) => Promise<number[] | null>;
26791
- /**
26792
- * Generate embedding with usage tracking
26793
- *
26794
- * This function returns both the embedding and usage information (tokens used)
26795
- *
26796
- * @param text - The text to generate an embedding for
26797
- * @param config - Optional embedding configuration
26798
- * @returns Embedding with usage information, or null if generation fails
26799
- */
26800
- declare const generateEmbeddingWithUsage: (text: string, config?: EmbeddingProviderConfig) => Promise<EmbeddingWithUsage | null>;
26801
- /**
26802
- * Generate embeddings for multiple texts with usage tracking (batch)
26803
- *
26804
- * @param texts - Array of texts to generate embeddings for
26805
- * @param config - Optional embedding configuration
26806
- * @returns Embeddings with total usage information, or null if generation fails
26807
- */
26808
- declare const generateEmbeddingsBatchWithUsage: (texts: string[], config?: EmbeddingProviderConfig) => Promise<BatchEmbeddingWithUsage | null>;
26809
26568
  //#endregion
26810
- //#region src/features/rag/query-builder.d.ts
26811
- /**
26812
- * Typesense search request object
26813
- */
26814
- interface TypesenseSearchRequest {
26815
- collection: string;
26816
- query_by: string;
26817
- vector_query: string;
26818
- exclude_fields: string;
26819
- filter_by?: string;
26820
- typo_tokens_threshold?: number;
26821
- num_typos?: number;
26822
- prefix?: boolean;
26823
- drop_tokens_threshold?: number;
26824
- enable_stemming?: boolean;
26569
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Collection.d.ts
26570
+ type FieldType = "string" | "int32" | "int64" | "float" | "bool" | "geopoint" | "geopolygon" | "geopoint[]" | "string[]" | "int32[]" | "int64[]" | "float[]" | "bool[]" | "object" | "object[]" | "auto" | "string*" | "image";
26571
+ interface CollectionFieldSchema extends Partial<Pick<BaseCollectionCreateSchema, "token_separators" | "symbols_to_index">> {
26572
+ name: string;
26573
+ type: FieldType;
26574
+ optional?: boolean;
26575
+ facet?: boolean;
26576
+ index?: boolean;
26577
+ sort?: boolean;
26578
+ locale?: string;
26579
+ infix?: boolean;
26580
+ stem?: boolean;
26581
+ num_dim?: number;
26582
+ store?: boolean;
26583
+ range_index?: boolean;
26584
+ [t: string]: unknown;
26585
+ }
26586
+ interface CollectionSchema extends CollectionCreateSchema {
26587
+ created_at: number;
26588
+ num_documents: number;
26589
+ num_memory_shards: number;
26590
+ }
26591
+ interface CollectionDropFieldSchema {
26592
+ name: string;
26593
+ drop: true;
26594
+ }
26595
+ interface CollectionUpdateSchema extends Partial<Omit<CollectionCreateSchema, "name" | "fields">> {
26596
+ fields?: (CollectionFieldSchema | CollectionDropFieldSchema)[];
26597
+ }
26598
+ interface CollectionDeleteOptions {
26599
+ compact_store?: boolean;
26600
+ }
26601
+ declare class Collection<T extends DocumentSchema = object> {
26602
+ private readonly name;
26603
+ private readonly apiCall;
26604
+ private readonly configuration;
26605
+ private readonly _documents;
26606
+ private individualDocuments;
26607
+ private readonly _overrides;
26608
+ private individualOverrides;
26609
+ private readonly _synonyms;
26610
+ private individualSynonyms;
26611
+ constructor(name: string, apiCall: ApiCall, configuration: any);
26612
+ retrieve(): Promise<CollectionSchema>;
26613
+ update(schema: CollectionUpdateSchema): Promise<CollectionSchema>;
26614
+ delete(options?: CollectionDeleteOptions): Promise<CollectionSchema>;
26615
+ exists(): Promise<boolean>;
26616
+ documents(): Documents<T>;
26617
+ documents(documentId: string): Document<T>;
26618
+ overrides(): Overrides;
26619
+ overrides(overrideId: string): Override;
26620
+ synonyms(): Synonyms;
26621
+ synonyms(synonymId: string): Synonym;
26622
+ private endpointPath;
26825
26623
  }
26826
- /**
26827
- * Build the Typesense conversational search URL with all necessary parameters
26828
- *
26829
- * @param config - Query configuration
26830
- * @param config.userMessage - The user's message/query
26831
- * @param config.chatId - Optional conversation ID for follow-up questions
26832
- * @param conversationModelId - The conversation model ID in Typesense
26833
- * @param typesenseConfig - Typesense connection config
26834
- * @returns URL for the Typesense multi_search endpoint with conversation parameters
26835
- */
26836
- declare function buildConversationalUrl(config: {
26837
- userMessage: string;
26838
- chatId?: string;
26839
- }, conversationModelId: string, typesenseConfig: TypesenseConnectionConfig): URL;
26840
- /**
26841
- * Build multi-search requests for Typesense with hybrid search configuration
26842
- *
26843
- * @param config - Query configuration including embedding, collections, and filters
26844
- * @returns Array of search requests for Typesense multi_search
26845
- */
26846
- declare function buildMultiSearchRequests(config: TypesenseQueryConfig): TypesenseSearchRequest[];
26847
- /**
26848
- * Build the complete Typesense request body for multi-search
26849
- *
26850
- * @param config - Query configuration
26851
- * @returns Request body for Typesense multi_search endpoint
26852
- */
26853
- declare function buildMultiSearchRequestBody(config: TypesenseQueryConfig): {
26854
- searches: TypesenseSearchRequest[];
26855
- };
26856
- /**
26857
- * Build hybrid search parameters for combining semantic and keyword search
26858
- *
26859
- * @param alpha - Weight between semantic (1.0) and keyword (0.0) search
26860
- * @param rerankMatches - Whether to rerank hybrid search results
26861
- * @param queryFields - Fields to use for keyword search
26862
- * @returns Object with hybrid search parameters
26863
- */
26864
- declare function buildHybridSearchParams(alpha?: number, rerankMatches?: boolean, queryFields?: string): {
26865
- alpha: number;
26866
- rerank_hybrid_matches: boolean;
26867
- query_fields: string;
26868
- };
26869
26624
  //#endregion
26870
- //#region src/features/rag/stream-handler.d.ts
26871
- /**
26872
- * Parsed conversation event from Typesense SSE stream
26873
- */
26874
- interface ConversationEvent {
26875
- /** Conversation ID */
26876
- conversationId?: string;
26877
- /** Message token/chunk */
26878
- message?: string;
26879
- /** Search results (only in first event) */
26880
- results?: TypesenseSearchResult[];
26881
- /** Raw parsed data */
26882
- raw?: unknown;
26625
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Collections.d.ts
26626
+ interface BaseCollectionCreateSchema {
26627
+ name: string;
26628
+ default_sorting_field?: string;
26629
+ symbols_to_index?: string[];
26630
+ token_separators?: string[];
26631
+ enable_nested_fields?: boolean;
26632
+ metadata?: object;
26633
+ voice_query_model?: {
26634
+ model_name?: string;
26635
+ };
26883
26636
  }
26884
- /**
26885
- * Stream processing result
26886
- */
26887
- interface StreamProcessingResult {
26888
- /** Full assistant message */
26889
- fullMessage: string;
26890
- /** Conversation ID */
26891
- conversationId: string | null;
26892
- /** Extracted sources */
26893
- sources: ChunkSource[];
26894
- /** Context text (for token estimation) */
26895
- contextText: string;
26637
+ interface CollectionCreateSchemaWithSrc extends Pick<BaseCollectionCreateSchema, "name"> {
26638
+ fields?: CollectionFieldSchema[];
26639
+ }
26640
+ interface CollectionCreateSchemaWithoutSrc extends BaseCollectionCreateSchema {
26641
+ fields: CollectionFieldSchema[];
26896
26642
  }
26897
26643
  /**
26898
- * Parse a single SSE event from Typesense conversation stream
26899
- *
26900
- * @param line - Raw SSE event line
26901
- * @returns Parsed conversation event or null if not parseable
26902
- */
26903
- declare function parseConversationEvent(line: string): ConversationEvent | null;
26904
- /**
26905
- * Extract sources from Typesense search results
26906
- *
26907
- * @param results - Typesense multi-search results array
26908
- * @param documentTypeResolver - Optional function to resolve document type from collection name
26909
- * @returns Array of chunk sources with metadata
26910
- */
26911
- declare function extractSourcesFromResults(results: TypesenseSearchResult[], documentTypeResolver?: (collectionName: string) => string): ChunkSource[];
26912
- /**
26913
- * Build context text from results (useful for token estimation)
26914
- *
26915
- * @param results - Typesense multi-search results array
26916
- * @returns Combined context text from all chunks
26917
- */
26918
- declare function buildContextText(results: TypesenseSearchResult[]): string;
26919
- /**
26920
- * Process a Typesense conversation stream
26921
- *
26922
- * @param response - Fetch Response with SSE stream
26923
- * @param onEvent - Callback for each parsed event
26924
- * @param documentTypeResolver - Optional function to resolve document type
26925
- * @returns Processing result with full message, ID, and sources
26926
- */
26927
- declare function processConversationStream(response: Response, onEvent?: (event: ConversationEvent) => void, documentTypeResolver?: (collectionName: string) => string): Promise<StreamProcessingResult>;
26928
- /**
26929
- * Create a ReadableStream that forwards SSE events
26644
+ * Defines the schema for creating a collection in Typesense.
26930
26645
  *
26931
- * @param response - Fetch Response with SSE stream
26932
- * @param onData - Callback for processing each event before forwarding
26933
- * @returns ReadableStream for SSE events
26646
+ * If the `src_name` property in `Options` is a string, the `fields` prop is optional, and only used for embedding fields.
26647
+ * Otherwise, `fields` will be required.
26934
26648
  */
26935
- declare function createSSEForwardStream(response: Response, onData?: (event: ConversationEvent) => void): ReadableStream<Uint8Array>;
26649
+ type CollectionCreateSchema<Options$20 extends CollectionCreateOptions = CollectionCreateOptions> = Options$20["src_name"] extends string ? CollectionCreateSchemaWithSrc : CollectionCreateSchemaWithoutSrc;
26650
+ interface CollectionCreateOptions {
26651
+ src_name?: string;
26652
+ }
26653
+ interface CollectionsRetrieveOptions {
26654
+ exclude_fields?: string;
26655
+ }
26656
+ declare class Collections {
26657
+ private apiCall;
26658
+ constructor(apiCall: ApiCall);
26659
+ create<const Options$20 extends CollectionCreateOptions>(schema: CollectionCreateSchema<Options$20>, options?: Options$20): Promise<CollectionSchema>;
26660
+ retrieve(options?: CollectionsRetrieveOptions): Promise<CollectionSchema[]>;
26661
+ static get RESOURCEPATH(): string;
26662
+ }
26936
26663
  //#endregion
26937
26664
  //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Aliases.d.ts
26938
26665
  interface CollectionAliasCreateSchema {
@@ -27289,257 +27016,761 @@ declare class ConversationModel {
27289
27016
  private endpointPath;
27290
27017
  }
27291
27018
  //#endregion
27292
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/ConversationModels.d.ts
27293
- declare class ConversationModels {
27019
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/ConversationModels.d.ts
27020
+ declare class ConversationModels {
27021
+ private readonly apiCall;
27022
+ constructor(apiCall: ApiCall);
27023
+ create(params: ConversationModelCreateSchema): Promise<ConversationModelCreateSchema>;
27024
+ retrieve(): Promise<ConversationModelSchema[]>;
27025
+ private endpointPath;
27026
+ static get RESOURCEPATH(): string;
27027
+ }
27028
+ //#endregion
27029
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Conversation.d.ts
27030
+ interface ConversationDeleteSchema {
27031
+ id: number;
27032
+ }
27033
+ interface ConversationUpdateSchema {
27034
+ ttl: number;
27035
+ }
27036
+ interface ConversationSchema {
27037
+ id: number;
27038
+ conversation: object[];
27039
+ last_updated: number;
27040
+ ttl: number;
27041
+ }
27042
+ declare class Conversation {
27043
+ private id;
27044
+ private apiCall;
27045
+ constructor(id: string, apiCall: ApiCall);
27046
+ retrieve(): Promise<ConversationSchema[]>;
27047
+ update(params: ConversationUpdateSchema): Promise<ConversationUpdateSchema>;
27048
+ delete(): Promise<ConversationDeleteSchema>;
27049
+ private endpointPath;
27050
+ }
27051
+ //#endregion
27052
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Conversations.d.ts
27053
+ interface ConversationsRetrieveSchema {
27054
+ conversations: ConversationSchema[];
27055
+ }
27056
+ declare class Conversations {
27057
+ private readonly apiCall;
27058
+ private readonly _conversationsModels;
27059
+ private readonly individualConversationModels;
27060
+ constructor(apiCall: ApiCall);
27061
+ retrieve(): Promise<ConversationsRetrieveSchema>;
27062
+ models(): ConversationModels;
27063
+ models(id: string): ConversationModel;
27064
+ static get RESOURCEPATH(): string;
27065
+ }
27066
+ //#endregion
27067
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/StemmingDictionary.d.ts
27068
+ interface StemmingDictionaryCreateSchema {
27069
+ root: string;
27070
+ word: string;
27071
+ }
27072
+ interface StemmingDictionarySchema {
27073
+ id: string;
27074
+ words: StemmingDictionaryCreateSchema[];
27075
+ }
27076
+ declare class StemmingDictionary {
27077
+ private id;
27078
+ private apiCall;
27079
+ constructor(id: string, apiCall: ApiCall);
27080
+ retrieve(): Promise<StemmingDictionarySchema>;
27081
+ private endpointPath;
27082
+ }
27083
+ //#endregion
27084
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/StemmingDictionaries.d.ts
27085
+ interface StemmingDictionariesRetrieveSchema {
27086
+ dictionaries: string[];
27087
+ }
27088
+ declare class StemmingDictionaries {
27089
+ private readonly apiCall;
27090
+ constructor(apiCall: ApiCall);
27091
+ upsert(id: string, wordRootCombinations: StemmingDictionaryCreateSchema[] | string): Promise<StemmingDictionaryCreateSchema[] | string>;
27092
+ retrieve(): Promise<StemmingDictionariesRetrieveSchema>;
27093
+ private endpointPath;
27094
+ static get RESOURCEPATH(): string;
27095
+ }
27096
+ //#endregion
27097
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Stemming.d.ts
27098
+ declare class Stemming {
27099
+ private readonly apiCall;
27100
+ private readonly _stemmingDictionaries;
27101
+ private readonly individualStemmingDictionaries;
27102
+ constructor(apiCall: ApiCall);
27103
+ dictionaries(): StemmingDictionaries;
27104
+ dictionaries(id: string): StemmingDictionary;
27105
+ static get RESOURCEPATH(): string;
27106
+ }
27107
+ //#endregion
27108
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/NLSearchModels.d.ts
27109
+ interface NLSearchModelBase {
27110
+ model_name: string;
27111
+ api_key?: string;
27112
+ api_url?: string;
27113
+ max_bytes?: number;
27114
+ temperature?: number;
27115
+ system_prompt?: string;
27116
+ top_p?: number;
27117
+ top_k?: number;
27118
+ stop_sequences?: string[];
27119
+ api_version?: string;
27120
+ project_id?: string;
27121
+ access_token?: string;
27122
+ refresh_token?: string;
27123
+ client_id?: string;
27124
+ client_secret?: string;
27125
+ region?: string;
27126
+ max_output_tokens?: number;
27127
+ account_id?: string;
27128
+ }
27129
+ interface NLSearchModelCreateSchema extends NLSearchModelBase {
27130
+ id?: string;
27131
+ }
27132
+ interface NLSearchModelSchema extends NLSearchModelBase {
27133
+ id: string;
27134
+ }
27135
+ type NLSearchModelsRetrieveSchema = NLSearchModelSchema[];
27136
+ declare class NLSearchModels {
27137
+ private apiCall;
27138
+ constructor(apiCall: ApiCall);
27139
+ create(schema: NLSearchModelCreateSchema): Promise<NLSearchModelSchema>;
27140
+ retrieve(): Promise<NLSearchModelsRetrieveSchema>;
27141
+ private endpointPath;
27142
+ static get RESOURCEPATH(): string;
27143
+ }
27144
+ //#endregion
27145
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/NLSearchModel.d.ts
27146
+ type NLSearchModelUpdateSchema = NLSearchModelBase;
27147
+ interface NLSearchModelDeleteSchema {
27148
+ id: string;
27149
+ }
27150
+ declare class NLSearchModel {
27151
+ private id;
27152
+ private apiCall;
27153
+ constructor(id: string, apiCall: ApiCall);
27154
+ retrieve(): Promise<NLSearchModelSchema>;
27155
+ update(schema: NLSearchModelUpdateSchema): Promise<NLSearchModelSchema>;
27156
+ delete(): Promise<NLSearchModelDeleteSchema>;
27157
+ private endpointPath;
27158
+ }
27159
+ //#endregion
27160
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Client.d.ts
27161
+ declare class Client {
27162
+ configuration: Configuration;
27163
+ apiCall: ApiCall;
27164
+ debug: Debug;
27165
+ metrics: Metrics;
27166
+ stats: Metrics$1;
27167
+ health: Health;
27168
+ operations: Operations;
27169
+ multiSearch: MultiSearch;
27170
+ analytics: Analytics;
27171
+ stemming: Stemming;
27172
+ private readonly _collections;
27173
+ private readonly individualCollections;
27174
+ private readonly _aliases;
27175
+ private readonly individualAliases;
27176
+ private readonly _keys;
27177
+ private readonly individualKeys;
27178
+ private readonly _presets;
27179
+ private readonly individualPresets;
27180
+ private readonly _stopwords;
27181
+ private readonly individualStopwords;
27182
+ private readonly _conversations;
27183
+ private readonly individualConversations;
27184
+ private readonly _nlSearchModels;
27185
+ private readonly individualNLSearchModels;
27186
+ constructor(options: ConfigurationOptions);
27187
+ collections(): Collections;
27188
+ collections<T extends Record<string, any> = object>(collectionName: string): Collection<T>;
27189
+ aliases(): Aliases;
27190
+ aliases(aliasName: string): Alias;
27191
+ keys(): Keys$1;
27192
+ keys(id: number): Key$1;
27193
+ presets(): Presets;
27194
+ presets(id: string): Preset;
27195
+ stopwords(): Stopwords;
27196
+ stopwords(id: string): Stopword;
27197
+ conversations(): Conversations;
27198
+ conversations(id: string): Conversation;
27199
+ nlSearchModels(): NLSearchModels;
27200
+ nlSearchModels(id: string): NLSearchModel;
27201
+ }
27202
+ //#endregion
27203
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/SearchOnlyCollection.d.ts
27204
+ declare class SearchOnlyCollection<T extends DocumentSchema> {
27205
+ private readonly name;
27294
27206
  private readonly apiCall;
27295
- constructor(apiCall: ApiCall);
27296
- create(params: ConversationModelCreateSchema): Promise<ConversationModelCreateSchema>;
27297
- retrieve(): Promise<ConversationModelSchema[]>;
27298
- private endpointPath;
27299
- static get RESOURCEPATH(): string;
27207
+ private readonly configuration;
27208
+ private readonly _documents;
27209
+ constructor(name: string, apiCall: ApiCall, configuration: any);
27210
+ documents(): SearchableDocuments<T>;
27300
27211
  }
27301
27212
  //#endregion
27302
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Conversation.d.ts
27303
- interface ConversationDeleteSchema {
27304
- id: number;
27213
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/SearchClient.d.ts
27214
+ declare class SearchClient {
27215
+ readonly multiSearch: MultiSearch;
27216
+ private readonly configuration;
27217
+ private readonly apiCall;
27218
+ private readonly individualCollections;
27219
+ constructor(options: ConfigurationOptions);
27220
+ clearCache(): void;
27221
+ collections<TDocumentSchema extends DocumentSchema>(collectionName: string): SearchOnlyCollection<TDocumentSchema>;
27305
27222
  }
27306
- interface ConversationUpdateSchema {
27307
- ttl: number;
27223
+ //#endregion
27224
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/HTTPError.d.ts
27225
+ declare class HTTPError extends TypesenseError {}
27226
+ //#endregion
27227
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/MissingConfigurationError.d.ts
27228
+ declare class MissingConfigurationError extends TypesenseError {}
27229
+ //#endregion
27230
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ObjectAlreadyExists.d.ts
27231
+ declare class ObjectAlreadyExists extends TypesenseError {}
27232
+ //#endregion
27233
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ObjectNotFound.d.ts
27234
+ declare class ObjectNotFound extends TypesenseError {}
27235
+ //#endregion
27236
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ObjectUnprocessable.d.ts
27237
+ declare class ObjectUnprocessable extends TypesenseError {}
27238
+ //#endregion
27239
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/RequestMalformed.d.ts
27240
+ declare class RequestMalformed extends TypesenseError {}
27241
+ //#endregion
27242
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/RequestUnauthorized.d.ts
27243
+ declare class RequestUnauthorized extends TypesenseError {}
27244
+ //#endregion
27245
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ServerError.d.ts
27246
+ declare class ServerError extends TypesenseError {}
27247
+ //#endregion
27248
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ImportError.d.ts
27249
+ interface ImportErrorPayload {
27250
+ documentsInJSONLFormat: string | ReadStream$1;
27251
+ options: DocumentImportParameters;
27252
+ failedItems: ImportResponse[];
27253
+ successCount: number;
27308
27254
  }
27309
- interface ConversationSchema {
27310
- id: number;
27311
- conversation: object[];
27312
- last_updated: number;
27313
- ttl: number;
27255
+ declare class ImportError extends TypesenseError {
27256
+ payload: ImportErrorPayload;
27257
+ importResults: ImportResponse[];
27258
+ constructor(message: string, importResults: ImportResponse[], payload: ImportErrorPayload);
27314
27259
  }
27315
- declare class Conversation {
27316
- private id;
27317
- private apiCall;
27318
- constructor(id: string, apiCall: ApiCall);
27319
- retrieve(): Promise<ConversationSchema[]>;
27320
- update(params: ConversationUpdateSchema): Promise<ConversationUpdateSchema>;
27321
- delete(): Promise<ConversationDeleteSchema>;
27322
- private endpointPath;
27260
+ declare namespace index_d_exports$1 {
27261
+ export { HTTPError, ImportError, MissingConfigurationError, ObjectAlreadyExists, ObjectNotFound, ObjectUnprocessable, RequestMalformed, RequestUnauthorized, ServerError, TypesenseError };
27323
27262
  }
27324
27263
  //#endregion
27325
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Conversations.d.ts
27326
- interface ConversationsRetrieveSchema {
27327
- conversations: ConversationSchema[];
27264
+ //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense.d.ts
27265
+ declare const _default: {
27266
+ Client: typeof Client;
27267
+ SearchClient: typeof SearchClient;
27268
+ Errors: typeof index_d_exports$1;
27269
+ };
27270
+ //#endregion
27271
+ //#region src/adapter/types.d.ts
27272
+ /**
27273
+ * All valid Typesense field types
27274
+ * @see https://typesense.org/docs/latest/api/collections.html#schema-parameters
27275
+ */
27276
+ type TypesenseFieldType = "string" | "int32" | "int64" | "float" | "bool" | "string[]" | "float[]" | "int32[]" | "int64[]" | "bool[]" | "object" | "object[]" | "geopoint" | "geopoint[]" | "auto";
27277
+ /**
27278
+ * Typesense-specific field mapping
27279
+ * Extends the base FieldMapping with Typesense-specific properties
27280
+ *
27281
+ * @example
27282
+ * ```typescript
27283
+ * const fields: TypesenseFieldMapping[] = [
27284
+ * { name: 'title', type: 'string', index: true },
27285
+ * { name: 'views', type: 'int64' },
27286
+ * { name: 'tags', type: 'string[]', facet: true },
27287
+ * { name: 'category', payloadField: 'category.name', type: 'string', facet: true },
27288
+ * ];
27289
+ * ```
27290
+ */
27291
+ interface TypesenseFieldMapping extends FieldMapping {
27292
+ /**
27293
+ * Typesense field type
27294
+ */
27295
+ type: TypesenseFieldType;
27296
+ /**
27297
+ * Whether the field should be faceted (filterable in Typesense UI)
27298
+ */
27299
+ facet?: boolean;
27300
+ /**
27301
+ * Whether the field should be indexed (searchable)
27302
+ * @default true
27303
+ */
27304
+ index?: boolean;
27305
+ /**
27306
+ * Whether the field is optional (can be missing from documents)
27307
+ */
27308
+ optional?: boolean;
27328
27309
  }
27329
- declare class Conversations {
27330
- private readonly apiCall;
27331
- private readonly _conversationsModels;
27332
- private readonly individualConversationModels;
27333
- constructor(apiCall: ApiCall);
27334
- retrieve(): Promise<ConversationsRetrieveSchema>;
27335
- models(): ConversationModels;
27336
- models(id: string): ConversationModel;
27337
- static get RESOURCEPATH(): string;
27310
+ /**
27311
+ * Typesense field schema for collection creation
27312
+ * Used internally when creating/updating collections
27313
+ */
27314
+ interface TypesenseFieldSchema {
27315
+ name: string;
27316
+ type: TypesenseFieldType;
27317
+ facet?: boolean;
27318
+ index?: boolean;
27319
+ optional?: boolean;
27320
+ /** Number of dimensions for vector fields (float[]) */
27321
+ vectorDimensions?: number;
27322
+ /** Allow additional properties for compatibility with BaseCollectionSchema */
27323
+ [key: string]: unknown;
27324
+ }
27325
+ /**
27326
+ * Typesense collection schema for creation/update
27327
+ * Extends BaseCollectionSchema with Typesense-specific options
27328
+ */
27329
+ interface TypesenseCollectionSchema extends BaseCollectionSchema {
27330
+ fields: TypesenseFieldSchema[];
27331
+ /** Default sorting field (must be a numeric field) */
27332
+ defaultSortingField?: string;
27338
27333
  }
27339
27334
  //#endregion
27340
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/StemmingDictionary.d.ts
27341
- interface StemmingDictionaryCreateSchema {
27342
- root: string;
27343
- word: string;
27335
+ //#region src/adapter/typesense-adapter.d.ts
27336
+ /**
27337
+ * Typesense implementation of the IndexerAdapter interface
27338
+ *
27339
+ * This adapter provides type-safe field definitions for Typesense.
27340
+ * When used with createIndexerPlugin, TypeScript will validate that
27341
+ * all field mappings in your collection config are valid TypesenseFieldMapping.
27342
+ *
27343
+ * @example
27344
+ * ```typescript
27345
+ * const adapter = createTypesenseAdapter(config);
27346
+ *
27347
+ * // TypeScript infers TFieldMapping = TypesenseFieldMapping
27348
+ * const { plugin } = createIndexerPlugin({
27349
+ * adapter,
27350
+ * collections: {
27351
+ * posts: [{
27352
+ * enabled: true,
27353
+ * fields: [
27354
+ * { name: 'title', type: 'string' }, // ✅ Valid
27355
+ * { name: 'views', type: 'int64' }, // ✅ Valid
27356
+ * { name: 'tags', type: 'string[]', facet: true }, // ✅ With faceting
27357
+ * ]
27358
+ * }]
27359
+ * }
27360
+ * });
27361
+ * ```
27362
+ */
27363
+ declare class TypesenseAdapter implements IndexerAdapter<TypesenseFieldMapping, TypesenseCollectionSchema> {
27364
+ private client;
27365
+ readonly name = "typesense";
27366
+ constructor(client: Client);
27367
+ /**
27368
+ * Test connection to Typesense
27369
+ */
27370
+ testConnection(): Promise<boolean>;
27371
+ /**
27372
+ * Create or update a collection schema
27373
+ */
27374
+ ensureCollection(schema: TypesenseCollectionSchema): Promise<void>;
27375
+ /**
27376
+ * Check if a collection exists
27377
+ */
27378
+ collectionExists(collectionName: string): Promise<boolean>;
27379
+ /**
27380
+ * Delete a collection
27381
+ */
27382
+ deleteCollection(collectionName: string): Promise<void>;
27383
+ /**
27384
+ * Upsert a single document
27385
+ */
27386
+ upsertDocument(collectionName: string, document: IndexDocument): Promise<void>;
27387
+ /**
27388
+ * Upsert multiple documents (batch)
27389
+ */
27390
+ upsertDocuments(collectionName: string, documents: IndexDocument[]): Promise<void>;
27391
+ /**
27392
+ * Delete a document by ID
27393
+ */
27394
+ deleteDocument(collectionName: string, documentId: string): Promise<void>;
27395
+ /**
27396
+ * Delete documents matching a filter
27397
+ * Returns the number of deleted documents
27398
+ */
27399
+ deleteDocumentsByFilter(collectionName: string, filter: Record<string, unknown>): Promise<number>;
27400
+ /**
27401
+ * Perform a vector search
27402
+ * @typeParam TDoc - The document type to return in results
27403
+ */
27404
+ vectorSearch<TDoc = Record<string, unknown>>(collectionName: string, vector: number[], options?: VectorSearchOptions): Promise<AdapterSearchResult<TDoc>[]>;
27405
+ /**
27406
+ * Convert generic schema to Typesense-specific schema
27407
+ */
27408
+ private convertToTypesenseSchema;
27409
+ /**
27410
+ * Convert a single field schema to Typesense format
27411
+ */
27412
+ private convertField;
27413
+ /**
27414
+ * Update collection with new fields if needed
27415
+ */
27416
+ private updateCollectionIfNeeded;
27417
+ /**
27418
+ * Build a Typesense filter string from a filter object
27419
+ */
27420
+ private buildFilterString;
27344
27421
  }
27345
- interface StemmingDictionarySchema {
27422
+ //#endregion
27423
+ //#region src/adapter/create-adapter.d.ts
27424
+ /**
27425
+ * Creates a TypesenseAdapter instance with the provided configuration
27426
+ *
27427
+ * @param config - Typesense connection configuration
27428
+ * @returns A configured TypesenseAdapter instance
27429
+ *
27430
+ * @example
27431
+ * ```typescript
27432
+ * import { createTypesenseAdapter } from '@nexo-labs/payload-typesense';
27433
+ *
27434
+ * const adapter = createTypesenseAdapter({
27435
+ * apiKey: process.env.TYPESENSE_API_KEY!,
27436
+ * nodes: [{
27437
+ * host: 'localhost',
27438
+ * port: 8108,
27439
+ * protocol: 'http'
27440
+ * }]
27441
+ * });
27442
+ * ```
27443
+ */
27444
+ declare function createTypesenseAdapter(config: TypesenseConnectionConfig): TypesenseAdapter;
27445
+ /**
27446
+ * Creates a TypesenseAdapter from an existing Typesense Client
27447
+ * Useful when you already have a configured client instance
27448
+ *
27449
+ * @param client - Existing Typesense Client instance
27450
+ * @returns A TypesenseAdapter instance wrapping the provided client
27451
+ */
27452
+ declare function createTypesenseAdapterFromClient(client: Client): TypesenseAdapter;
27453
+ //#endregion
27454
+ //#region src/shared/types/types.d.ts
27455
+ interface TypesenseDocument {
27346
27456
  id: string;
27347
- words: StemmingDictionaryCreateSchema[];
27348
- }
27349
- declare class StemmingDictionary {
27350
- private id;
27351
- private apiCall;
27352
- constructor(id: string, apiCall: ApiCall);
27353
- retrieve(): Promise<StemmingDictionarySchema>;
27354
- private endpointPath;
27457
+ slug?: string;
27458
+ title?: string;
27459
+ createdAt: number;
27460
+ updatedAt: number;
27461
+ embedding?: number[];
27462
+ [key: string]: unknown;
27355
27463
  }
27356
- //#endregion
27357
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/StemmingDictionaries.d.ts
27358
- interface StemmingDictionariesRetrieveSchema {
27359
- dictionaries: string[];
27464
+ interface TypesenseChunkDocument {
27465
+ id: string;
27466
+ parent_doc_id: string;
27467
+ slug: string;
27468
+ title: string;
27469
+ createdAt: number;
27470
+ publishedAt?: number;
27471
+ updatedAt: number;
27472
+ chunk_index: number;
27473
+ chunk_text: string;
27474
+ is_chunk: boolean;
27475
+ embedding: number[];
27360
27476
  }
27361
- declare class StemmingDictionaries {
27362
- private readonly apiCall;
27363
- constructor(apiCall: ApiCall);
27364
- upsert(id: string, wordRootCombinations: StemmingDictionaryCreateSchema[] | string): Promise<StemmingDictionaryCreateSchema[] | string>;
27365
- retrieve(): Promise<StemmingDictionariesRetrieveSchema>;
27366
- private endpointPath;
27367
- static get RESOURCEPATH(): string;
27477
+ interface SearchResult<T = TypesenseDocument> {
27478
+ collection?: string;
27479
+ content?: string;
27480
+ displayName?: string;
27481
+ document: T;
27482
+ highlight?: {
27483
+ [field: string]: {
27484
+ matched_tokens: string[];
27485
+ snippet: string;
27486
+ value: string;
27487
+ };
27488
+ };
27489
+ highlights?: Array<{
27490
+ field: string;
27491
+ matched_tokens: string[];
27492
+ snippet: string;
27493
+ value: string;
27494
+ }>;
27495
+ icon?: string;
27496
+ id: string;
27497
+ text_match?: number;
27498
+ text_match_info?: {
27499
+ best_field_score: string;
27500
+ best_field_weight: number;
27501
+ fields_matched: number;
27502
+ score: string;
27503
+ tokens_matched: number;
27504
+ };
27505
+ vector_distance?: number;
27506
+ title?: string;
27507
+ updatedAt?: string;
27368
27508
  }
27369
- //#endregion
27370
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Stemming.d.ts
27371
- declare class Stemming {
27372
- private readonly apiCall;
27373
- private readonly _stemmingDictionaries;
27374
- private readonly individualStemmingDictionaries;
27375
- constructor(apiCall: ApiCall);
27376
- dictionaries(): StemmingDictionaries;
27377
- dictionaries(id: string): StemmingDictionary;
27378
- static get RESOURCEPATH(): string;
27509
+ interface SearchResponse<T = TypesenseDocument> {
27510
+ collections?: Array<{
27511
+ collection: string;
27512
+ displayName: string;
27513
+ error?: string;
27514
+ found: number;
27515
+ icon: string;
27516
+ }>;
27517
+ found: number;
27518
+ hits: SearchResult<T>[];
27519
+ page: number;
27520
+ request_params: {
27521
+ page?: number;
27522
+ per_page: number;
27523
+ q: string;
27524
+ sort_by?: string;
27525
+ };
27526
+ search_cutoff: boolean;
27527
+ search_time_ms: number;
27379
27528
  }
27380
- //#endregion
27381
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/NLSearchModels.d.ts
27382
- interface NLSearchModelBase {
27383
- model_name: string;
27384
- api_key?: string;
27385
- api_url?: string;
27386
- max_bytes?: number;
27387
- temperature?: number;
27388
- system_prompt?: string;
27389
- top_p?: number;
27390
- top_k?: number;
27391
- stop_sequences?: string[];
27392
- api_version?: string;
27393
- project_id?: string;
27394
- access_token?: string;
27395
- refresh_token?: string;
27396
- client_id?: string;
27397
- client_secret?: string;
27398
- region?: string;
27399
- max_output_tokens?: number;
27400
- account_id?: string;
27529
+ interface SuggestResult<T = TypesenseDocument> {
27530
+ collection?: string;
27531
+ displayName?: string;
27532
+ document: T;
27533
+ highlight?: Record<string, string>;
27534
+ icon?: string;
27535
+ text_match?: number;
27401
27536
  }
27402
- interface NLSearchModelCreateSchema extends NLSearchModelBase {
27403
- id?: string;
27537
+ interface SuggestResponse<T = TypesenseDocument> {
27538
+ found: number;
27539
+ hits: SuggestResult<T>[];
27540
+ page: number;
27541
+ request_params: {
27542
+ per_page: number;
27543
+ q: string;
27544
+ };
27545
+ search_cutoff: boolean;
27546
+ search_time_ms: number;
27404
27547
  }
27405
- interface NLSearchModelSchema extends NLSearchModelBase {
27406
- id: string;
27548
+ interface SearchParams {
27549
+ facets?: string[];
27550
+ filters?: Record<string, unknown>;
27551
+ highlight_fields?: string[];
27552
+ num_typos?: number;
27553
+ page?: number;
27554
+ per_page?: number;
27555
+ q: string;
27556
+ snippet_threshold?: number;
27557
+ sort_by?: string;
27558
+ typo_tokens_threshold?: number;
27407
27559
  }
27408
- type NLSearchModelsRetrieveSchema = NLSearchModelSchema[];
27409
- declare class NLSearchModels {
27410
- private apiCall;
27411
- constructor(apiCall: ApiCall);
27412
- create(schema: NLSearchModelCreateSchema): Promise<NLSearchModelSchema>;
27413
- retrieve(): Promise<NLSearchModelsRetrieveSchema>;
27414
- private endpointPath;
27415
- static get RESOURCEPATH(): string;
27560
+ interface BaseSearchInputProps<T = TypesenseDocument> {
27561
+ baseUrl: string;
27562
+ className?: string;
27563
+ collection?: string;
27564
+ debounceMs?: number;
27565
+ errorClassName?: string;
27566
+ inputClassName?: string;
27567
+ inputWrapperClassName?: string;
27568
+ loadingClassName?: string;
27569
+ maxResults?: number;
27570
+ minQueryLength?: number;
27571
+ noResultsClassName?: string;
27572
+ onError?: (error: string) => void;
27573
+ onLoading?: (loading: boolean) => void;
27574
+ onResultClick?: (result: SearchResult<T>) => void;
27575
+ onResults?: (results: SearchResponse<T>) => void;
27576
+ onSearch?: (query: string, results: SearchResponse<T>) => void;
27577
+ placeholder?: string;
27578
+ resultsHeaderClassName?: string;
27579
+ resultsListClassName?: string;
27416
27580
  }
27417
- //#endregion
27418
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/NLSearchModel.d.ts
27419
- type NLSearchModelUpdateSchema = NLSearchModelBase;
27420
- interface NLSearchModelDeleteSchema {
27421
- id: string;
27581
+ interface CacheEntry<T = unknown> {
27582
+ data: T;
27583
+ timestamp: number;
27584
+ ttl: number;
27422
27585
  }
27423
- declare class NLSearchModel {
27424
- private id;
27425
- private apiCall;
27426
- constructor(id: string, apiCall: ApiCall);
27427
- retrieve(): Promise<NLSearchModelSchema>;
27428
- update(schema: NLSearchModelUpdateSchema): Promise<NLSearchModelSchema>;
27429
- delete(): Promise<NLSearchModelDeleteSchema>;
27430
- private endpointPath;
27586
+ interface CacheOptions$1 {
27587
+ maxSize?: number;
27588
+ ttl?: number;
27431
27589
  }
27432
- //#endregion
27433
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Client.d.ts
27434
- declare class Client {
27435
- configuration: Configuration;
27436
- apiCall: ApiCall;
27437
- debug: Debug;
27438
- metrics: Metrics;
27439
- stats: Metrics$1;
27440
- health: Health;
27441
- operations: Operations;
27442
- multiSearch: MultiSearch;
27443
- analytics: Analytics;
27444
- stemming: Stemming;
27445
- private readonly _collections;
27446
- private readonly individualCollections;
27447
- private readonly _aliases;
27448
- private readonly individualAliases;
27449
- private readonly _keys;
27450
- private readonly individualKeys;
27451
- private readonly _presets;
27452
- private readonly individualPresets;
27453
- private readonly _stopwords;
27454
- private readonly individualStopwords;
27455
- private readonly _conversations;
27456
- private readonly individualConversations;
27457
- private readonly _nlSearchModels;
27458
- private readonly individualNLSearchModels;
27459
- constructor(options: ConfigurationOptions);
27460
- collections(): Collections;
27461
- collections<T extends Record<string, any> = object>(collectionName: string): Collection<T>;
27462
- aliases(): Aliases;
27463
- aliases(aliasName: string): Alias;
27464
- keys(): Keys$1;
27465
- keys(id: number): Key$1;
27466
- presets(): Presets;
27467
- presets(id: string): Preset;
27468
- stopwords(): Stopwords;
27469
- stopwords(id: string): Stopword;
27470
- conversations(): Conversations;
27471
- conversations(id: string): Conversation;
27472
- nlSearchModels(): NLSearchModels;
27473
- nlSearchModels(id: string): NLSearchModel;
27590
+ interface HealthCheckResponse {
27591
+ cache?: {
27592
+ maxSize: number;
27593
+ size: number;
27594
+ };
27595
+ collections?: string[];
27596
+ error?: string;
27597
+ lastSync?: number;
27598
+ status: 'healthy' | 'unhealthy';
27599
+ typesense?: {
27600
+ ok: boolean;
27601
+ version?: string;
27602
+ };
27474
27603
  }
27475
- //#endregion
27476
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/SearchOnlyCollection.d.ts
27477
- declare class SearchOnlyCollection<T extends DocumentSchema> {
27478
- private readonly name;
27479
- private readonly apiCall;
27480
- private readonly configuration;
27481
- private readonly _documents;
27482
- constructor(name: string, apiCall: ApiCall, configuration: any);
27483
- documents(): SearchableDocuments<T>;
27604
+ interface ErrorResponse {
27605
+ code?: string;
27606
+ details?: string;
27607
+ error: string;
27608
+ timestamp?: string;
27484
27609
  }
27485
- //#endregion
27486
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/SearchClient.d.ts
27487
- declare class SearchClient {
27488
- readonly multiSearch: MultiSearch;
27489
- private readonly configuration;
27490
- private readonly apiCall;
27491
- private readonly individualCollections;
27492
- constructor(options: ConfigurationOptions);
27493
- clearCache(): void;
27494
- collections<TDocumentSchema extends DocumentSchema>(collectionName: string): SearchOnlyCollection<TDocumentSchema>;
27610
+ interface ApiResponse<T = unknown> {
27611
+ data?: T;
27612
+ error?: ErrorResponse;
27613
+ meta?: {
27614
+ cached?: boolean;
27615
+ requestId?: string;
27616
+ timestamp: string;
27617
+ };
27618
+ success: boolean;
27495
27619
  }
27496
27620
  //#endregion
27497
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/HTTPError.d.ts
27498
- declare class HTTPError extends TypesenseError {}
27499
- //#endregion
27500
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/MissingConfigurationError.d.ts
27501
- declare class MissingConfigurationError extends TypesenseError {}
27502
- //#endregion
27503
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ObjectAlreadyExists.d.ts
27504
- declare class ObjectAlreadyExists extends TypesenseError {}
27505
- //#endregion
27506
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ObjectNotFound.d.ts
27507
- declare class ObjectNotFound extends TypesenseError {}
27508
- //#endregion
27509
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ObjectUnprocessable.d.ts
27510
- declare class ObjectUnprocessable extends TypesenseError {}
27511
- //#endregion
27512
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/RequestMalformed.d.ts
27513
- declare class RequestMalformed extends TypesenseError {}
27514
- //#endregion
27515
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/RequestUnauthorized.d.ts
27516
- declare class RequestUnauthorized extends TypesenseError {}
27517
- //#endregion
27518
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ServerError.d.ts
27519
- declare class ServerError extends TypesenseError {}
27520
- //#endregion
27521
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense/Errors/ImportError.d.ts
27522
- interface ImportErrorPayload {
27523
- documentsInJSONLFormat: string | ReadStream$1;
27524
- options: DocumentImportParameters;
27525
- failedItems: ImportResponse[];
27526
- successCount: number;
27621
+ //#region src/features/embedding/embeddings.d.ts
27622
+ /**
27623
+ * Generates an embedding for the given text using OpenAI or Gemini API
27624
+ * @param text - The text to generate an embedding for
27625
+ * @param config - Optional embedding configuration (provider, model, dimensions, apiKey)
27626
+ * @returns The embedding vector as an array of numbers, or null if generation fails
27627
+ */
27628
+ declare const generateEmbedding: (text: string, config?: EmbeddingProviderConfig$1) => Promise<number[] | null>;
27629
+ /**
27630
+ * Generate embedding with usage tracking
27631
+ *
27632
+ * This function returns both the embedding and usage information (tokens used)
27633
+ *
27634
+ * @param text - The text to generate an embedding for
27635
+ * @param config - Optional embedding configuration
27636
+ * @returns Embedding with usage information, or null if generation fails
27637
+ */
27638
+ declare const generateEmbeddingWithUsage: (text: string, config?: EmbeddingProviderConfig$1) => Promise<EmbeddingWithUsage | null>;
27639
+ /**
27640
+ * Generate embeddings for multiple texts with usage tracking (batch)
27641
+ *
27642
+ * @param texts - Array of texts to generate embeddings for
27643
+ * @param config - Optional embedding configuration
27644
+ * @returns Embeddings with total usage information, or null if generation fails
27645
+ */
27646
+ declare const generateEmbeddingsBatchWithUsage: (texts: string[], config?: EmbeddingProviderConfig$1) => Promise<BatchEmbeddingWithUsage | null>;
27647
+ //#endregion
27648
+ //#region src/features/rag/query-builder.d.ts
27649
+ /**
27650
+ * Typesense search request object
27651
+ */
27652
+ interface TypesenseSearchRequest {
27653
+ collection: string;
27654
+ query_by: string;
27655
+ vector_query: string;
27656
+ exclude_fields: string;
27657
+ filter_by?: string;
27658
+ typo_tokens_threshold?: number;
27659
+ num_typos?: number;
27660
+ prefix?: boolean;
27661
+ drop_tokens_threshold?: number;
27662
+ enable_stemming?: boolean;
27527
27663
  }
27528
- declare class ImportError extends TypesenseError {
27529
- payload: ImportErrorPayload;
27530
- importResults: ImportResponse[];
27531
- constructor(message: string, importResults: ImportResponse[], payload: ImportErrorPayload);
27664
+ /**
27665
+ * Build the Typesense conversational search URL with all necessary parameters
27666
+ *
27667
+ * @param config - Query configuration
27668
+ * @param config.userMessage - The user's message/query
27669
+ * @param config.chatId - Optional conversation ID for follow-up questions
27670
+ * @param conversationModelId - The conversation model ID in Typesense
27671
+ * @param typesenseConfig - Typesense connection config
27672
+ * @returns URL for the Typesense multi_search endpoint with conversation parameters
27673
+ */
27674
+ declare function buildConversationalUrl(config: {
27675
+ userMessage: string;
27676
+ chatId?: string;
27677
+ }, conversationModelId: string, typesenseConfig: TypesenseConnectionConfig): URL;
27678
+ /**
27679
+ * Build multi-search requests for Typesense with hybrid search configuration
27680
+ *
27681
+ * @param config - Query configuration including embedding, collections, and filters
27682
+ * @returns Array of search requests for Typesense multi_search
27683
+ */
27684
+ declare function buildMultiSearchRequests(config: TypesenseQueryConfig): TypesenseSearchRequest[];
27685
+ /**
27686
+ * Build the complete Typesense request body for multi-search
27687
+ *
27688
+ * @param config - Query configuration
27689
+ * @returns Request body for Typesense multi_search endpoint
27690
+ */
27691
+ declare function buildMultiSearchRequestBody(config: TypesenseQueryConfig): {
27692
+ searches: TypesenseSearchRequest[];
27693
+ };
27694
+ /**
27695
+ * Build hybrid search parameters for combining semantic and keyword search
27696
+ *
27697
+ * @param alpha - Weight between semantic (1.0) and keyword (0.0) search
27698
+ * @param rerankMatches - Whether to rerank hybrid search results
27699
+ * @param queryFields - Fields to use for keyword search
27700
+ * @returns Object with hybrid search parameters
27701
+ */
27702
+ declare function buildHybridSearchParams(alpha?: number, rerankMatches?: boolean, queryFields?: string): {
27703
+ alpha: number;
27704
+ rerank_hybrid_matches: boolean;
27705
+ query_fields: string;
27706
+ };
27707
+ //#endregion
27708
+ //#region src/features/rag/stream-handler.d.ts
27709
+ /**
27710
+ * Parsed conversation event from Typesense SSE stream
27711
+ */
27712
+ interface ConversationEvent {
27713
+ /** Conversation ID */
27714
+ conversationId?: string;
27715
+ /** Message token/chunk */
27716
+ message?: string;
27717
+ /** Search results (only in first event) */
27718
+ results?: TypesenseRAGSearchResult[];
27719
+ /** Raw parsed data */
27720
+ raw?: unknown;
27532
27721
  }
27533
- declare namespace index_d_exports {
27534
- export { HTTPError, ImportError, MissingConfigurationError, ObjectAlreadyExists, ObjectNotFound, ObjectUnprocessable, RequestMalformed, RequestUnauthorized, ServerError, TypesenseError };
27722
+ /**
27723
+ * Stream processing result
27724
+ */
27725
+ interface StreamProcessingResult {
27726
+ /** Full assistant message */
27727
+ fullMessage: string;
27728
+ /** Conversation ID */
27729
+ conversationId: string | null;
27730
+ /** Extracted sources */
27731
+ sources: ChunkSource[];
27732
+ /** Context text (for token estimation) */
27733
+ contextText: string;
27535
27734
  }
27536
- //#endregion
27537
- //#region ../../node_modules/.pnpm/typesense@2.1.0_@babel+runtime@7.27.0/node_modules/typesense/lib/Typesense.d.ts
27538
- declare const _default: {
27539
- Client: typeof Client;
27540
- SearchClient: typeof SearchClient;
27541
- Errors: typeof index_d_exports;
27542
- };
27735
+ /**
27736
+ * Parse a single SSE event from Typesense conversation stream
27737
+ *
27738
+ * @param line - Raw SSE event line
27739
+ * @returns Parsed conversation event or null if not parseable
27740
+ */
27741
+ declare function parseConversationEvent(line: string): ConversationEvent | null;
27742
+ /**
27743
+ * Extract sources from Typesense search results
27744
+ *
27745
+ * @param results - Typesense multi-search results array
27746
+ * @param documentTypeResolver - Optional function to resolve document type from collection name
27747
+ * @returns Array of chunk sources with metadata
27748
+ */
27749
+ declare function extractSourcesFromResults(results: TypesenseRAGSearchResult[], documentTypeResolver?: (collectionName: string) => string): ChunkSource[];
27750
+ /**
27751
+ * Build context text from results (useful for token estimation)
27752
+ *
27753
+ * @param results - Typesense multi-search results array
27754
+ * @returns Combined context text from all chunks
27755
+ */
27756
+ declare function buildContextText(results: TypesenseRAGSearchResult[]): string;
27757
+ /**
27758
+ * Process a Typesense conversation stream
27759
+ *
27760
+ * @param response - Fetch Response with SSE stream
27761
+ * @param onEvent - Callback for each parsed event
27762
+ * @param documentTypeResolver - Optional function to resolve document type
27763
+ * @returns Processing result with full message, ID, and sources
27764
+ */
27765
+ declare function processConversationStream(response: Response, onEvent?: (event: ConversationEvent) => void, documentTypeResolver?: (collectionName: string) => string): Promise<StreamProcessingResult>;
27766
+ /**
27767
+ * Create a ReadableStream that forwards SSE events
27768
+ *
27769
+ * @param response - Fetch Response with SSE stream
27770
+ * @param onData - Callback for processing each event before forwarding
27771
+ * @returns ReadableStream for SSE events
27772
+ */
27773
+ declare function createSSEForwardStream(response: Response, onData?: (event: ConversationEvent) => void): ReadableStream<Uint8Array>;
27543
27774
  //#endregion
27544
27775
  //#region src/features/rag/setup.d.ts
27545
27776
  /**
@@ -27785,81 +28016,38 @@ type AuthenticateMethod = (options?: {
27785
28016
  */
27786
28017
  declare const jsonResponse: (data: any, options?: ResponseInit) => Response;
27787
28018
  //#endregion
28019
+ //#region src/core/config/types.d.ts
28020
+ type SearchMode = "semantic" | "keyword" | "hybrid";
28021
+ interface SearchDefaults {
28022
+ mode?: SearchMode;
28023
+ perPage?: number;
28024
+ tables?: string[];
28025
+ }
28026
+ interface SearchFeatureConfig {
28027
+ enabled: boolean;
28028
+ defaults?: SearchDefaults;
28029
+ }
28030
+ interface SyncFeatureConfig {
28031
+ enabled: boolean;
28032
+ autoSync?: boolean;
28033
+ batchSize?: number;
28034
+ }
28035
+ interface FeatureFlags {
28036
+ embedding?: EmbeddingProviderConfig$1;
28037
+ search?: SearchFeatureConfig;
28038
+ rag?: RAGFeatureConfig;
28039
+ sync?: SyncFeatureConfig;
28040
+ }
28041
+ interface ModularPluginConfig {
28042
+ typesense: TypesenseConnectionConfig;
28043
+ features: FeatureFlags;
28044
+ collections: Record<CollectionSlug | string, TableConfig[]>;
28045
+ }
28046
+ //#endregion
27788
28047
  //#region src/core/client/typesense-client.d.ts
27789
28048
  declare const createTypesenseClient: (typesenseConfig: TypesenseConnectionConfig) => _default.Client;
27790
28049
  declare const testTypesenseConnection: (client: Client) => Promise<boolean>;
27791
28050
  //#endregion
27792
- //#region src/core/utils/chunk-format-utils.d.ts
27793
- /**
27794
- * Utilities for formatting chunk text with header metadata
27795
- */
27796
- /**
27797
- * Separator used between chunk content and header metadata
27798
- */
27799
- declare const CHUNK_HEADER_SEPARATOR = ".________________________________________.";
27800
- /**
27801
- * Header metadata structure embedded in chunk_text
27802
- */
27803
- interface ChunkHeaderMetadata {
27804
- /** Current section (last header in hierarchy) */
27805
- section: string;
27806
- /** Full hierarchical path */
27807
- path: string;
27808
- }
27809
- /**
27810
- * Parsed chunk with separated headers and content
27811
- */
27812
- interface ParsedChunk {
27813
- /** Header metadata (if present) */
27814
- metadata?: ChunkHeaderMetadata;
27815
- /** The actual chunk content */
27816
- content: string;
27817
- }
27818
- /**
27819
- * Formats chunk text with header metadata at the end
27820
- *
27821
- * @param content - The chunk content
27822
- * @param headers - Hierarchical array of headers (e.g., ['Introduction', 'Introduction > Getting Started'])
27823
- * @returns Formatted chunk text with content + separator + key-value metadata
27824
- *
27825
- * @example
27826
- * const formatted = formatChunkWithHeaders(
27827
- * 'To install the package...',
27828
- * ['Introduction', 'Introduction > Getting Started', 'Introduction > Getting Started > Installation']
27829
- * );
27830
- * // Result:
27831
- * // To install the package...
27832
- * // ._________________________________________.
27833
- * // section: Installation | path: Introduction > Getting Started > Installation
27834
- */
27835
- declare const formatChunkWithHeaders: (content: string, headers: string[]) => string;
27836
- /**
27837
- * Parses chunk text to extract header metadata and content separately
27838
- *
27839
- * @param chunkText - The formatted chunk text
27840
- * @returns Object with separated metadata and content
27841
- *
27842
- * @example
27843
- * const parsed = parseChunkText('Content here\\n._________________________________________.\\nsection: Installation | path: Introduction > Getting Started > Installation');
27844
- * console.log(parsed.metadata.section); // "Installation"
27845
- * console.log(parsed.content); // "Content here"
27846
- */
27847
- declare const parseChunkText: (chunkText: string) => ParsedChunk;
27848
- /**
27849
- * Extracts only the content from a formatted chunk (removes header metadata)
27850
- *
27851
- * @param chunkText - The formatted chunk text
27852
- * @returns Just the content without header metadata
27853
- */
27854
- declare const extractContentOnly: (chunkText: string) => string;
27855
- /**
27856
- * Extracts only the header metadata from a formatted chunk
27857
- *
27858
- * @param chunkText - The formatted chunk text
27859
- * @returns Header metadata or undefined if not present
27860
- */
27861
- declare const extractHeaderMetadata: (chunkText: string) => ChunkHeaderMetadata | undefined;
27862
- //#endregion
27863
28051
  //#region src/features/sync/services/document-delete.d.ts
27864
28052
  /**
27865
28053
  * Deletes a document from Typesense
@@ -27867,153 +28055,26 @@ declare const extractHeaderMetadata: (chunkText: string) => ChunkHeaderMetadata
27867
28055
  */
27868
28056
  declare const deleteDocumentFromTypesense: (typesenseClient: Client, collectionSlug: string, docId: string, tableConfig: TableConfig) => Promise<void>;
27869
28057
  //#endregion
27870
- //#region ../../node_modules/.pnpm/lexical@0.35.0/node_modules/lexical/nodes/LexicalElementNode.d.ts
27871
- type SerializedElementNode<T extends SerializedLexicalNode = SerializedLexicalNode> = Spread<{
27872
- children: Array<T>;
27873
- direction: 'ltr' | 'rtl' | null;
27874
- format: ElementFormatType;
27875
- indent: number;
27876
- textFormat?: number;
27877
- textStyle?: string;
27878
- }, SerializedLexicalNode>;
27879
- type ElementFormatType = 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
27880
- //#endregion
27881
- //#region ../../node_modules/.pnpm/lexical@0.35.0/node_modules/lexical/nodes/LexicalRootNode.d.ts
27882
- type SerializedRootNode<T extends SerializedLexicalNode = SerializedLexicalNode> = SerializedElementNode<T>;
27883
- //#endregion
27884
- //#region ../../node_modules/.pnpm/lexical@0.35.0/node_modules/lexical/LexicalEditorState.d.ts
27885
- interface SerializedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> {
27886
- root: SerializedRootNode<T>;
27887
- }
27888
- //#endregion
27889
- //#region ../../node_modules/.pnpm/lexical@0.35.0/node_modules/lexical/LexicalConstants.d.ts
27890
- declare const NODE_STATE_KEY = "$";
27891
- //#endregion
27892
- //#region ../../node_modules/.pnpm/lexical@0.35.0/node_modules/lexical/LexicalEditor.d.ts
27893
- type Spread<T1, T2> = Omit<T2, keyof T1> & T1;
27894
- //#endregion
27895
- //#region ../../node_modules/.pnpm/lexical@0.35.0/node_modules/lexical/LexicalNode.d.ts
27896
- /**
27897
- * The base type for all serialized nodes
27898
- */
27899
- type SerializedLexicalNode = {
27900
- /** The type string used by the Node class */
27901
- type: string;
27902
- /** A numeric version for this schema, defaulting to 1, but not generally recommended for use */
27903
- version: number;
27904
- /**
27905
- * Any state persisted with the NodeState API that is not
27906
- * configured for flat storage
27907
- */
27908
- [NODE_STATE_KEY]?: Record<string, unknown>;
27909
- };
27910
- //#endregion
27911
- //#region src/core/utils/transforms.d.ts
27912
- /**
27913
- * Transforms Lexical editor state to Markdown
27914
- * @param value - The serialized editor state
27915
- * @param config - Optional Payload config. If provided, it will be used to generate the editor config.
27916
- */
27917
- declare const transformLexicalToMarkdown: (value?: SerializedEditorState | null, config?: SanitizedConfig) => Promise<string>;
28058
+ //#region src/features/search/endpoints.d.ts
28059
+ declare const createSearchEndpoints: (typesenseClient: Client, pluginOptions: ModularPluginConfig) => {
28060
+ handler: PayloadHandler;
28061
+ method: "get";
28062
+ path: string;
28063
+ }[];
27918
28064
  //#endregion
27919
- //#region src/core/logging/logger.d.ts
27920
- /**
27921
- * Professional logging system for payload-typesense
27922
- * Provides structured logging with levels and context
27923
- */
27924
- type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
27925
- interface LogContext {
27926
- [key: string]: unknown;
27927
- }
27928
- interface LoggerConfig {
27929
- /** Minimum log level to output (default: 'info') */
27930
- level?: LogLevel;
27931
- /** Prefix for all log messages (default: '[payload-typesense]') */
27932
- prefix?: string;
27933
- /** Enable/disable logging (default: true) */
27934
- enabled?: boolean;
27935
- }
27936
- declare class Logger {
27937
- private level;
27938
- private prefix;
27939
- private enabled;
27940
- constructor(config?: LoggerConfig);
27941
- /**
27942
- * Update logger configuration
27943
- */
27944
- configure(config: Partial<LoggerConfig>): void;
27945
- /**
27946
- * Check if a log level should be output
27947
- */
27948
- private shouldLog;
27949
- /**
27950
- * Format log message with context
27951
- */
27952
- private formatMessage;
27953
- /**
27954
- * Debug level logging - detailed information for debugging
27955
- */
27956
- debug(message: string, context?: LogContext): void;
27957
- /**
27958
- * Info level logging - general informational messages
27959
- */
27960
- info(message: string, context?: LogContext): void;
27961
- /**
27962
- * Warning level logging - warning messages
27963
- */
27964
- warn(message: string, context?: LogContext): void;
27965
- /**
27966
- * Error level logging - error messages
27967
- */
27968
- error(message: string, error?: Error | unknown, context?: LogContext): void;
27969
- /**
27970
- * Get current log level
27971
- */
27972
- getLevel(): LogLevel;
27973
- /**
27974
- * Check if logger is enabled
27975
- */
27976
- isEnabled(): boolean;
27977
- }
27978
- /**
27979
- * Configure the default logger
27980
- */
27981
- declare const configureLogger: (config: LoggerConfig) => void;
28065
+ //#region src/features/rag/endpoints.d.ts
27982
28066
  /**
27983
- * Create a new logger instance with custom configuration
28067
+ * Creates Payload handlers for RAG endpoints
28068
+ *
28069
+ * @param config - RAG plugin configuration (composable, doesn't depend on ModularPluginConfig)
27984
28070
  */
27985
- declare const createLogger: (config?: LoggerConfig) => Logger;
27986
- declare const logger: {
27987
- debug: (message: string, context?: LogContext) => void;
27988
- info: (message: string, context?: LogContext) => void;
27989
- warn: (message: string, context?: LogContext) => void;
27990
- error: (message: string, error?: Error | unknown, context?: LogContext) => void;
27991
- configure: (config: LoggerConfig) => void;
27992
- getLevel: () => LogLevel;
27993
- isEnabled: () => boolean;
27994
- };
28071
+ declare function createRAGPayloadHandlers(config: TypesenseRAGPluginConfig): Array<{
28072
+ path: string;
28073
+ method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put';
28074
+ handler: PayloadHandler;
28075
+ }>;
27995
28076
  //#endregion
27996
28077
  //#region src/core/config/constants.d.ts
27997
- /**
27998
- * Constants for payload-typesense plugin
27999
- * Centralizes all magic numbers and configuration defaults
28000
- */
28001
- /**
28002
- * Default dimensions for OpenAI text-embedding-3-large model
28003
- */
28004
- declare const DEFAULT_EMBEDDING_DIMENSIONS = 3072;
28005
- /**
28006
- * Default OpenAI embedding model
28007
- */
28008
- declare const DEFAULT_EMBEDDING_MODEL = "text-embedding-3-large";
28009
- /**
28010
- * Default chunk size for text splitting (in characters)
28011
- */
28012
- declare const DEFAULT_CHUNK_SIZE = 1000;
28013
- /**
28014
- * Default overlap between chunks (in characters)
28015
- */
28016
- declare const DEFAULT_CHUNK_OVERLAP = 200;
28017
28078
  /**
28018
28079
  * Default alpha value for hybrid search (0 = pure semantic, 1 = pure keyword)
28019
28080
  */
@@ -28042,31 +28103,6 @@ declare const DEFAULT_SESSION_TTL_SEC: number;
28042
28103
  * Default OpenAI model for RAG chat
28043
28104
  */
28044
28105
  declare const DEFAULT_RAG_LLM_MODEL = "gpt-4o-mini";
28045
- /**
28046
- * Error codes for structured error handling
28047
- */
28048
- declare const ErrorCodes: {
28049
- readonly INVALID_CONFIG: "ERR_1001";
28050
- readonly MISSING_API_KEY: "ERR_1002";
28051
- readonly INVALID_EMBEDDING_CONFIG: "ERR_1003";
28052
- readonly INVALID_RAG_CONFIG: "ERR_1004";
28053
- readonly TYPESENSE_CONNECTION_FAILED: "ERR_2001";
28054
- readonly TYPESENSE_COLLECTION_NOT_FOUND: "ERR_2002";
28055
- readonly TYPESENSE_SEARCH_FAILED: "ERR_2003";
28056
- readonly TYPESENSE_SYNC_FAILED: "ERR_2004";
28057
- readonly TYPESENSE_DELETE_FAILED: "ERR_2005";
28058
- readonly EMBEDDING_GENERATION_FAILED: "ERR_3001";
28059
- readonly INVALID_EMBEDDING_DIMENSIONS: "ERR_3002";
28060
- readonly OPENAI_API_ERROR: "ERR_3003";
28061
- readonly RAG_SEARCH_FAILED: "ERR_4001";
28062
- readonly RAG_SESSION_NOT_FOUND: "ERR_4002";
28063
- readonly RAG_CONVERSATION_FAILED: "ERR_4003";
28064
- readonly RAG_TOKEN_LIMIT_EXCEEDED: "ERR_4004";
28065
- readonly CHUNKING_FAILED: "ERR_5001";
28066
- readonly INVALID_CHUNK_SIZE: "ERR_5002";
28067
- readonly UNKNOWN_ERROR: "ERR_9001";
28068
- readonly VALIDATION_ERROR: "ERR_9002";
28069
- };
28070
- //#endregion
28071
- export { type ApiContext, type ApiResponse, type AuthenticateMethod, type BaseDocument, type BaseSearchInputProps, CHUNK_HEADER_SEPARATOR, type CacheEntry, type CacheOptions$1 as CacheOptions, type ChatMessageWithSources, type ChatSessionData, type ChunkFetchConfig, type ChunkFetchResult, type ChunkHeaderMetadata, type CollectionConfig, type ConversationEvent, DEFAULT_CACHE_TTL_MS, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_EMBEDDING_DIMENSIONS, DEFAULT_EMBEDDING_MODEL, DEFAULT_HYBRID_SEARCH_ALPHA, DEFAULT_RAG_CONTEXT_LIMIT, DEFAULT_RAG_LLM_MODEL, DEFAULT_RAG_MAX_TOKENS, DEFAULT_SEARCH_LIMIT, DEFAULT_SESSION_TTL_SEC, ErrorCodes, type ErrorResponse, type FieldMapping, type HealthCheckResponse, type ModularPluginConfig, type ParsedChunk, type PayloadDocument, type RAGChatRequest, type RAGSearchConfig, type RAGSearchResult, type SearchFeatureConfig, type SearchParams, type SearchResponse, type SearchResult, type SessionConfig, type SourceField, type StreamProcessingResult, type SuggestResponse, type SuggestResult, type SyncFeatureConfig, type TableConfig, type TypesenseChunkDocument, type TypesenseConnectionConfig, type TypesenseDocument, buildContextText, buildConversationalUrl, buildHybridSearchParams, buildMultiSearchRequestBody, buildMultiSearchRequests, closeSession, configureLogger, createLogger, createSSEForwardStream, createTypesenseClient, deleteDocumentFromTypesense, ensureConversationCollection, executeRAGSearch, extractContentOnly, extractHeaderMetadata, extractSourcesFromResults, fetchChunkById, formatChunkWithHeaders, formatSSEEvent, generateEmbedding, generateEmbeddingWithUsage, generateEmbeddingsBatchWithUsage, getActiveSession, getDefaultRAGConfig, getSessionByConversationId, jsonResponse, logger, mergeRAGConfigWithDefaults, parseChunkText, parseConversationEvent, processConversationStream, saveChatSession, sendSSEEvent, testTypesenseConnection, transformLexicalToMarkdown, typesenseSearch };
28106
+ //#endregion
28107
+ export { type ApiContext, type ApiResponse, type AuthenticateMethod, type BaseDocument, type BaseSearchInputProps, type CacheEntry, type CacheOptions$1 as CacheOptions, type ChatMessageWithSources, type ChatSessionData, type ChunkFetchConfig, type ChunkFetchResult, type ConversationEvent, DEFAULT_CACHE_TTL_MS, DEFAULT_HYBRID_SEARCH_ALPHA, DEFAULT_RAG_CONTEXT_LIMIT, DEFAULT_RAG_LLM_MODEL, DEFAULT_RAG_MAX_TOKENS, DEFAULT_SEARCH_LIMIT, DEFAULT_SESSION_TTL_SEC, type ErrorResponse, type HealthCheckResponse, type ModularPluginConfig, type PayloadDocument, type RAGChatRequest, type RAGSearchConfig, type RAGSearchResult, type SearchFeatureConfig, type SearchParams, type SearchResponse, type SearchResult, type SessionConfig, type StreamProcessingResult, type SuggestResponse, type SuggestResult, type SyncFeatureConfig, TypesenseAdapter, type TypesenseChunkDocument, type TypesenseConnectionConfig, type TypesenseDocument, type TypesenseFieldMapping, type TypesenseFieldType, type TypesenseRAGPluginConfig, type TypesenseSearchConfig, buildContextText, buildConversationalUrl, buildHybridSearchParams, buildMultiSearchRequestBody, buildMultiSearchRequests, closeSession, createRAGPayloadHandlers, createSSEForwardStream, createSearchEndpoints, createTypesenseAdapter, createTypesenseAdapterFromClient, createTypesenseClient, createTypesenseRAGPlugin, deleteDocumentFromTypesense, ensureConversationCollection, executeRAGSearch, extractSourcesFromResults, fetchChunkById, formatSSEEvent, generateEmbedding, generateEmbeddingWithUsage, generateEmbeddingsBatchWithUsage, getActiveSession, getDefaultRAGConfig, getSessionByConversationId, jsonResponse, mergeRAGConfigWithDefaults, parseConversationEvent, processConversationStream, saveChatSession, sendSSEEvent, testTypesenseConnection };
28072
28108
  //# sourceMappingURL=index.d.mts.map