@@ -36,38 +36,36 @@ export abstract class AbstractCursor<T, TRaw extends SomeDoc = SomeDoc> {
36
36
buffered(): number ;
37
37
// @deprecated
38
38
bufferedCount: ' ERROR: `.bufferedCount()` has been renamed to be simply `.buffered()`' ;
39
- // (undocumented)
40
39
abstract clone(): this ;
41
40
close(): void ;
42
41
consumeBuffer(max ? : number ): TRaw [];
43
42
consumed(): number ;
43
+ // @internal (undocumented)
44
+ protected _currentPage? : {
45
+ result: TRaw [];
46
+ };
47
+ // Warning: (ae-forgotten-export) The symbol "TimeoutManager" needs to be exported by the entry point index.d.ts
48
+ //
49
+ // @internal (undocumented)
50
+ protected abstract _fetchNextPage(extra : Record <string , unknown >, tm : TimeoutManager | undefined ): Promise <[page : typeof AbstractCursor ._currentPage , isNextPage : boolean ]>;
44
51
forEach(consumer : ((doc : T ) => boolean | Promise <boolean >) | ((doc : T ) => void | Promise <void >)): Promise <void >;
45
52
hasNext(): Promise <boolean >;
46
- // (undocumented)
47
53
abstract map<R >(map : (doc : T ) => R ): AbstractCursor <R , TRaw >;
48
54
// @internal (undocumented)
49
55
readonly _mapping? : (doc : any ) => T ;
50
56
next(): Promise <T | null >;
51
57
// @internal (undocumented)
52
- protected _next(peek : true , method : string , tm ? : TimeoutManager ): Promise <boolean >;
53
- // @internal (undocumented)
54
- protected _next(peek : false , method : string , tm ? : TimeoutManager ): Promise <T | null >;
55
- // Warning: (ae-forgotten-export) The symbol "TimeoutManager" needs to be exported by the entry point index.d.ts
56
- //
57
- // @internal (undocumented)
58
- protected abstract _nextPage(extra : Record <string , unknown >, tm : TimeoutManager | undefined ): Promise <TRaw []>;
59
- // Warning: (ae-forgotten-export) The symbol "QueryState" needs to be exported by the entry point index.d.ts
60
- //
58
+ _next(peek : true , method : string , tm ? : TimeoutManager ): Promise <true | null >;
61
59
// @internal (undocumented)
62
- protected _nextPageState: QueryState <string >;
63
- // @internal (undocumented)
64
- readonly _options: WithTimeout <' generalMethodTimeoutMs' >;
60
+ _next(peek : false , method : string , tm ? : TimeoutManager ): Promise <T | null >;
65
61
// @deprecated
66
62
readBufferedDocuments: ' ERROR: `.readBufferedDocuments()` has been renamed to be `.consumeBuffer()`' ;
67
63
rewind(): void ;
68
64
get state(): CursorState ;
69
65
// @internal (undocumented)
70
66
protected _state: CursorState ;
67
+ // @internal (undocumented)
68
+ readonly _timeoutOptions: WithTimeout <' generalMethodTimeoutMs' >;
71
69
// Warning: (ae-forgotten-export) The symbol "Timeouts" needs to be exported by the entry point index.d.ts
72
70
//
73
71
// @internal (undocumented)
@@ -457,7 +455,7 @@ export class Collection<WSchema extends SomeDoc = SomeDoc, RSchema extends WithI
457
455
findOne<TRaw extends SomeDoc = WithSim <RSchema >>(filter : CollectionFilter <WSchema >, options ? : CollectionFindOneOptions ): Promise <TRaw | null >;
458
456
findOneAndDelete<TRaw extends SomeDoc = RSchema >(filter : CollectionFilter <WSchema >, options ? : CollectionFindOneAndDeleteOptions ): Promise <TRaw | null >;
459
457
findOneAndReplace<TRaw extends SomeDoc = RSchema >(filter : CollectionFilter <WSchema >, replacement : NoId <WSchema >, options ? : CollectionFindOneAndReplaceOptions ): Promise <TRaw | null >;
460
- findOneAndUpdate(filter : CollectionFilter <WSchema >, update : CollectionUpdateFilter <WSchema >, options ? : CollectionFindOneAndUpdateOptions ): Promise <RSchema | null >;
458
+ findOneAndUpdate< TRaw extends SomeDoc = RSchema > (filter : CollectionFilter <WSchema >, update : CollectionUpdateFilter <WSchema >, options ? : CollectionFindOneAndUpdateOptions ): Promise <TRaw | null >;
461
459
get _httpClient(): OpaqueHttpClient ;
462
460
insertMany(documents : readonly MaybeId <WSchema >[], options ? : CollectionInsertManyOptions ): Promise <CollectionInsertManyResult <RSchema >>;
463
461
insertOne(document : MaybeId <WSchema >, options ? : CollectionInsertOneOptions ): Promise <CollectionInsertOneResult <RSchema >>;
@@ -616,9 +614,7 @@ export type CollectionFilterOps<Elem> = {
616
614
export class CollectionFindAndRerankCursor <T , TRaw extends SomeDoc = SomeDoc > extends FindAndRerankCursor <T , TRaw > {
617
615
get dataSource(): Collection ;
618
616
filter(filter : CollectionFilter <TRaw >): this ;
619
- // (undocumented)
620
617
map: <R >(map : (doc : T ) => R ) => CollectionFindAndRerankCursor <R , TRaw >;
621
- // (undocumented)
622
618
project: <RRaw extends SomeDoc = Partial <TRaw >>(projection : Projection ) => CollectionFindAndRerankCursor <RerankedResult <RRaw >, RRaw >;
623
619
}
624
620
@@ -629,11 +625,8 @@ export type CollectionFindAndRerankOptions = GenericFindAndRerankOptions;
629
625
export class CollectionFindCursor <T , TRaw extends SomeDoc = SomeDoc > extends FindCursor <T , TRaw > {
630
626
get dataSource(): Collection ;
631
627
filter(filter : CollectionFilter <TRaw >): this ;
632
- // (undocumented)
633
628
includeSimilarity: (includeSimilarity ? : boolean ) => CollectionFindCursor <WithSim <TRaw >, WithSim <TRaw >>;
634
- // (undocumented)
635
629
map: <R >(map : (doc : T ) => R ) => CollectionFindCursor <R , TRaw >;
636
- // (undocumented)
637
630
project: <RRaw extends SomeDoc = Partial <TRaw >>(projection : Projection ) => CollectionFindCursor <RRaw , RRaw >;
638
631
}
639
632
@@ -1651,66 +1644,70 @@ export type Filter = Record<string, any>;
1651
1644
export abstract class FindAndRerankCursor <T , TRaw extends SomeDoc = SomeDoc > extends AbstractCursor <T , RerankedResult <TRaw >> {
1652
1645
// @internal
1653
1646
[$CustomInspect ](): string ;
1647
+ // Warning: (ae-forgotten-export) The symbol "SerDes" needs to be exported by the entry point index.d.ts
1648
+ // Warning: (ae-forgotten-export) The symbol "SerializedFilter" needs to be exported by the entry point index.d.ts
1649
+ //
1654
1650
// @internal
1655
- constructor (parent : Table <SomeRow > | Collection , serdes : SerDes , filter : SerializedFilter , options ? : GenericFindAndRerankOptions , mapping ? : (doc : TRaw ) => T );
1651
+ constructor (parent : Table <SomeRow > | Collection , serdes : SerDes , filter : SerializedFilter , options ? : GenericFindAndRerankOptions , mapping ? : (doc : TRaw ) => T , initialPage ? : FindAndRerankPage < RerankedResult < TRaw >> );
1656
1652
clone(): this ;
1653
+ // (undocumented)
1654
+ _currentPage? : FindAndRerankPage <RerankedResult <TRaw >>;
1657
1655
abstract get dataSource(): Table <SomeRow > | Collection ;
1658
- filter(filter : Filter ): this ;
1659
- // Warning: (ae-forgotten-export) The symbol "SerializedFilter" needs to be exported by the entry point index.d.ts
1660
- //
1656
+ fetchNextPage(): Promise <FindAndRerankPage <T >>;
1661
1657
// @internal (undocumented)
1662
- readonly _filter: SerializedFilter ;
1658
+ protected _fetchNextPage(extra : Record <string , unknown >, tm : TimeoutManager | undefined ): Promise <[FindAndRerankPage <RerankedResult <TRaw >>, boolean ]>;
1659
+ filter(filter : Filter ): this ;
1663
1660
getSortVector(): Promise <DataAPIVector | null >;
1664
1661
hybridLimits(hybridLimits : number | Record <string , number >): this ;
1665
1662
includeScores(includeScores ? : boolean ): this ;
1666
1663
includeSortVector(includeSortVector ? : boolean ): this ;
1664
+ initialPageState(initialPageState ? : string ): this ;
1665
+ // Warning: (ae-forgotten-export) The symbol "FLCInternal" needs to be exported by the entry point index.d.ts
1666
+ //
1667
+ // @internal (undocumented)
1668
+ readonly _internal: FLCInternal <RerankedResult <TRaw >, FindAndRerankPage <RerankedResult <TRaw >>, GenericFindAndRerankOptions >;
1667
1669
limit(limit : number ): this ;
1668
1670
map<R >(map : (doc : T ) => R ): FindAndRerankCursor <R , TRaw >;
1669
- // @internal (undocumented)
1670
- protected _nextPage(extra : Record <string , unknown >, tm : TimeoutManager | undefined ): Promise <RerankedResult <TRaw >[]>;
1671
- // @internal (undocumented)
1672
- readonly _options: GenericFindAndRerankOptions ;
1673
- // @internal (undocumented)
1674
- readonly _parent: Table <SomeRow > | Collection ;
1675
1671
project<RRaw extends SomeDoc = Partial <TRaw >>(projection : Projection ): FindAndRerankCursor <RerankedResult <RRaw >, RRaw >;
1676
1672
rerankOn(rerankOn : string ): this ;
1677
1673
rerankQuery(rerankQuery : string ): this ;
1678
- // Warning: (ae-forgotten-export) The symbol "SerDes" needs to be exported by the entry point index.d.ts
1679
- //
1680
- // @internal (undocumented)
1681
- readonly _serdes: SerDes ;
1682
1674
sort(sort : HybridSort ): this ;
1683
1675
// @internal (undocumented)
1684
1676
protected _tm(): Timeouts ;
1685
1677
}
1686
1678
1679
+ // @public
1680
+ export interface FindAndRerankPage <T > {
1681
+ nextPageState: string | null ;
1682
+ result: T [];
1683
+ sortVector? : DataAPIVector ;
1684
+ }
1685
+
1687
1686
// @public
1688
1687
export abstract class FindCursor <T , TRaw extends SomeDoc = SomeDoc > extends AbstractCursor <T , TRaw > {
1689
1688
// @internal
1690
1689
[$CustomInspect ](): string ;
1691
1690
// @internal
1692
- constructor (parent : Table <SomeRow > | Collection , serdes : SerDes , filter : SerializedFilter , options ? : GenericFindOptions , mapping ? : (doc : TRaw ) => T );
1691
+ constructor (parent : Table <SomeRow > | Collection , serdes : SerDes , filter : SerializedFilter , options ? : GenericFindOptions , mapping ? : (doc : TRaw ) => T , initialPage ? : FindPage < TRaw > );
1693
1692
clone(): this ;
1693
+ // @internal (undocumented)
1694
+ _currentPage? : FindPage <TRaw >;
1694
1695
abstract get dataSource(): Table <SomeRow > | Collection ;
1695
- filter( filter : Filter ): this ;
1696
+ fetchNextPage( ): Promise < FindPage < T >> ;
1696
1697
// @internal (undocumented)
1697
- readonly _filter: SerializedFilter ;
1698
+ protected _fetchNextPage(extra : Record <string , unknown >, tm : TimeoutManager | undefined ): Promise <[FindPage <TRaw >, boolean ]>;
1699
+ filter(filter ? : Filter ): this ;
1698
1700
getSortVector(): Promise <DataAPIVector | null >;
1699
1701
includeSimilarity(includeSimilarity ? : boolean ): FindCursor <WithSim <TRaw >, WithSim <TRaw >>;
1700
1702
includeSortVector(includeSortVector ? : boolean ): this ;
1701
- limit(limit : number ): this ;
1702
- map<R >(map : (doc : T ) => R ): FindCursor <R , TRaw >;
1703
- // @internal (undocumented)
1704
- protected _nextPage(extra : Record <string , unknown >, tm : TimeoutManager | undefined ): Promise <TRaw []>;
1703
+ initialPageState(initialPageState ? : string ): this ;
1705
1704
// @internal (undocumented)
1706
- readonly _options : GenericFindOptions ;
1707
- // @internal (undocumented)
1708
- readonly _parent : Table < SomeRow > | Collection ;
1705
+ readonly _internal : FLCInternal < TRaw , FindPage < TRaw >, GenericFindOptions > ;
1706
+ limit( limit ? : number ) : this ;
1707
+ map< R >( map : ( doc : T ) => R ) : FindCursor < R , TRaw > ;
1709
1708
project<RRaw extends SomeDoc = Partial <TRaw >>(projection : Projection ): FindCursor <RRaw , RRaw >;
1710
- // @internal (undocumented)
1711
- readonly _serdes: SerDes ;
1712
- skip(skip : number ): this ;
1713
- sort(sort : Sort ): this ;
1709
+ skip(skip ? : number ): this ;
1710
+ sort(sort ? : Sort ): this ;
1714
1711
// @internal (undocumented)
1715
1712
protected _tm(): Timeouts ;
1716
1713
}
@@ -1720,6 +1717,13 @@ export interface FindEmbeddingProvidersResult {
1720
1717
embeddingProviders: Record <string , EmbeddingProviderInfo >;
1721
1718
}
1722
1719
1720
+ // @public
1721
+ export interface FindPage <T > {
1722
+ nextPageState: string | null ;
1723
+ result: T [];
1724
+ sortVector? : DataAPIVector ;
1725
+ }
1726
+
1723
1727
// @public
1724
1728
export interface FindRerankingProvidersResult {
1725
1729
rerankingProviders: Record <string , any >;
@@ -1781,17 +1785,12 @@ export type GenericEstimatedCountOptions = WithTimeout<'generalMethodTimeoutMs'>
1781
1785
1782
1786
// @public
1783
1787
export interface GenericFindAndRerankOptions extends WithTimeout <' generalMethodTimeoutMs' > {
1784
- // (undocumented)
1785
1788
hybridLimits? : number | Record <string , number >;
1786
- // (undocumented)
1787
1789
includeScores? : boolean ;
1788
- // (undocumented)
1789
1790
includeSortVector? : boolean ;
1790
1791
limit? : number ;
1791
1792
projection? : Projection ;
1792
- // (undocumented)
1793
1793
rerankOn? : string ;
1794
- // (undocumented)
1795
1794
rerankQuery? : string ;
1796
1795
sort? : HybridSort ;
1797
1796
}
@@ -1845,6 +1844,7 @@ export interface GenericFindOneOptions extends WithTimeout<'generalMethodTimeout
1845
1844
export interface GenericFindOptions extends WithTimeout <' generalMethodTimeoutMs' > {
1846
1845
includeSimilarity? : boolean ;
1847
1846
includeSortVector? : boolean ;
1847
+ initialPageState? : string | null ;
1848
1848
limit? : number ;
1849
1849
projection? : Projection ;
1850
1850
skip? : number ;
@@ -1971,17 +1971,16 @@ export type HttpOptions = FetchH2HttpClientOptions | FetchHttpClientOptions | Cu
1971
1971
};
1972
1972
1973
1973
// @public (undocumented)
1974
- export type HybridSort = Record <string , SortDirection | string | number [] | DataAPIVector | HybridSortObject > & {
1974
+ export interface HybridSort {
1975
+ // (undocumented)
1975
1976
$hybrid: string | HybridSortObject ;
1976
- };
1977
+ }
1977
1978
1978
1979
// @public (undocumented)
1979
1980
export interface HybridSortObject {
1980
1981
// (undocumented)
1981
1982
$lexical? : string ;
1982
1983
// (undocumented)
1983
- $vector? : number [] | DataAPIVector ;
1984
- // (undocumented)
1985
1984
$vectorize? : string ;
1986
1985
// (undocumented)
1987
1986
[col : string ]: string | number [] | DataAPIVector | undefined ;
@@ -2049,7 +2048,7 @@ export interface LexicalDoc {
2049
2048
export const LIB_NAME = " astra-db-ts" ;
2050
2049
2051
2050
// @public
2052
- export const LIB_VERSION = " 2.0.0 " ;
2051
+ export const LIB_VERSION = " 2.0.1 " ;
2053
2052
2054
2053
// @public
2055
2054
export interface ListAstraDatabasesOptions extends WithTimeout <' databaseAdminTimeoutMs' > {
@@ -2582,11 +2581,8 @@ export type TableFindAndRerankOptions = GenericFindAndRerankOptions;
2582
2581
export class TableFindCursor <T , TRaw extends SomeRow = SomeRow > extends FindCursor <T , TRaw > {
2583
2582
get dataSource(): Table <SomeRow >;
2584
2583
filter(filter : TableFilter <TRaw >): this ;
2585
- // (undocumented)
2586
2584
includeSimilarity: (includeSimilarity ? : boolean ) => TableFindCursor <WithSim <TRaw >, WithSim <TRaw >>;
2587
- // (undocumented)
2588
2585
map: <R >(map : (doc : T ) => R ) => TableFindCursor <R , TRaw >;
2589
- // (undocumented)
2590
2586
project: <RRaw extends SomeRow = Partial <TRaw >>(projection : Projection ) => TableFindCursor <RRaw , RRaw >;
2591
2587
}
2592
2588
0 commit comments