diff --git a/src/commands/client/upsert/index.ts b/src/commands/client/upsert/index.ts index ee28e0a..8929b8e 100644 --- a/src/commands/client/upsert/index.ts +++ b/src/commands/client/upsert/index.ts @@ -1,9 +1,11 @@ import { Command } from "@commands/command"; +type NoInfer = T extends infer U ? U : never + type UpsertCommandPayload = { id: number | string; vector: number[]; - metadata?: TMetadata; + metadata?: NoInfer; }; export class UpsertCommand extends Command { diff --git a/src/vector.ts b/src/vector.ts index 466b1c4..a273ab1 100644 --- a/src/vector.ts +++ b/src/vector.ts @@ -64,7 +64,7 @@ export class Index = Record( + query = = TIndexMetadata>( args: CommandArgs ) => new QueryCommand(args).exec(this.client); @@ -90,7 +90,7 @@ export class Index = Record( + upsert = = TIndexMetadata>( args: CommandArgs> ) => new UpsertCommand(args).exec(this.client); @@ -114,7 +114,7 @@ export class Index = Record[]>} A promise that resolves with an array of fetched items or null if not found, after the command is executed. */ - fetch = ( + fetch = = TIndexMetadata>( ...args: CommandArgs ) => new FetchCommand(args).exec(this.client); @@ -154,7 +154,7 @@ export class Index = Record>} A promise that resolves with the response containing the next cursor and an array of vectors, after the command is executed. */ - range = ( + range = = TIndexMetadata>( args: CommandArgs ) => new RangeCommand(args).exec(this.client);