@@ -115,8 +115,8 @@ export class AstraAdmin {
115
115
// @public
116
116
export class AstraDbAdmin extends DbAdmin {
117
117
// @internal
118
- constructor (db : Db , rootOpts : InternalRootClientOpts , adminOpts ? : AdminSpawnOptions );
119
- createNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
118
+ constructor (db : Db , rootOpts : InternalRootClientOpts , adminOpts : AdminSpawnOptions | undefined , dbToken : TokenProvider );
119
+ createNamespace(namespace : string , options ? : CreateNamespaceOptions ): Promise <void >;
120
120
db(): Db ;
121
121
drop(options ? : AdminBlockingOptions ): Promise <void >;
122
122
dropNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
@@ -125,6 +125,12 @@ export class AstraDbAdmin extends DbAdmin {
125
125
listNamespaces(options ? : WithTimeout ): Promise <string []>;
126
126
}
127
127
128
+ // @public
129
+ export class AWSEmbeddingHeadersProvider extends EmbeddingHeadersProvider {
130
+ constructor (accessKeyId : string , secretAccessKey : string );
131
+ getHeaders(): Record <string , string >;
132
+ }
133
+
128
134
// @public
129
135
export class BulkWriteError extends CumulativeDataAPIError {
130
136
name: string ;
@@ -230,8 +236,8 @@ export interface CollectionOptions<Schema extends SomeDoc> {
230
236
231
237
// @public
232
238
export interface CollectionSpawnOptions extends WithNamespace {
233
- defaultMaxTimeMS? : number ;
234
- embeddingApiKey? : string ;
239
+ defaultMaxTimeMS? : number | null ;
240
+ embeddingApiKey? : string | EmbeddingHeadersProvider | null ;
235
241
}
236
242
237
243
// @public
@@ -301,7 +307,7 @@ export type CreateDatabaseOptions = AdminBlockingOptions & {
301
307
302
308
// @public
303
309
export type CreateNamespaceOptions = AdminBlockingOptions & {
304
- replication ? : NamespaceReplicationOptions ;
310
+ updateDbNamespace ? : boolean ;
305
311
};
306
312
307
313
// @public
@@ -371,7 +377,7 @@ export type DataAPICommandEvents = {
371
377
export class DataAPIDbAdmin extends DbAdmin {
372
378
// @internal
373
379
constructor (db : Db , httpClient : DataAPIHttpClient , adminOpts ? : AdminSpawnOptions );
374
- createNamespace(namespace : string , options ? : CreateNamespaceOptions ): Promise <void >;
380
+ createNamespace(namespace : string , options ? : LocalCreateNamespaceOptions ): Promise <void >;
375
381
db(): Db ;
376
382
dropNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
377
383
listNamespaces(options ? : WithTimeout ): Promise <string []>;
@@ -526,12 +532,13 @@ export class Db {
526
532
listCollections(options ? : ListCollectionsOptions & {
527
533
nameOnly? : false ;
528
534
}): Promise <FullCollectionInfo []>;
529
- readonly namespace: string ;
535
+ get namespace(): string ;
536
+ useNamespace(namespace : string ): void ;
530
537
}
531
538
532
539
// @public
533
540
export abstract class DbAdmin {
534
- abstract createNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
541
+ abstract createNamespace(namespace : string , options ? : CreateNamespaceOptions ): Promise <void >;
535
542
abstract db(): Db ;
536
543
abstract dropNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
537
544
abstract listNamespaces(): Promise <string []>;
@@ -553,6 +560,12 @@ export interface DbSpawnOptions {
553
560
token? : string | TokenProvider | null ;
554
561
}
555
562
563
+ // @public
564
+ export class EmbeddingAPIKeyHeaderProvider extends EmbeddingHeadersProvider {
565
+ constructor (apiKey : string | nullish );
566
+ getHeaders(): Record <string , string >;
567
+ }
568
+
556
569
// @public
557
570
export interface DefaultHttpClientOptions {
558
571
client? : ' default' ;
@@ -641,6 +654,13 @@ export class DevOpsUnexpectedStateError extends DevOpsAPIError {
641
654
export interface DropCollectionOptions extends WithTimeout , WithNamespace {
642
655
}
643
656
657
+ // @public
658
+ export abstract class EmbeddingHeadersProvider {
659
+ abstract getHeaders(): Promise <Record <string , string >> | Record <string , string >;
660
+ // @internal
661
+ static parseHeaders(token : unknown ): EmbeddingHeadersProvider ;
662
+ }
663
+
644
664
// @public
645
665
export class FailedToLoadDefaultClientError extends Error {
646
666
// @internal
@@ -935,6 +955,11 @@ export interface ListDatabasesOptions extends WithTimeout {
935
955
skip? : number ;
936
956
}
937
957
958
+ // @public
959
+ export type LocalCreateNamespaceOptions = CreateNamespaceOptions & {
960
+ replication? : NamespaceReplicationOptions ;
961
+ };
962
+
938
963
// @public
939
964
export type MaybeId <T > = NoId <T > & {
940
965
_id? : IdOf <T >;
@@ -1076,7 +1101,7 @@ export type SortDirection = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending'
1076
1101
// @public
1077
1102
export class StaticTokenProvider extends TokenProvider {
1078
1103
constructor (token : string | nullish );
1079
- getToken(): Promise < string | nullish > ;
1104
+ getToken(): string | nullish ;
1080
1105
}
1081
1106
1082
1107
// @public
@@ -1168,7 +1193,7 @@ export type ToDotNotation<Schema extends SomeDoc> = Merge<_ToDotNotation<Schema,
1168
1193
1169
1194
// @public
1170
1195
export abstract class TokenProvider {
1171
- abstract getToken(): Promise <string | nullish >;
1196
+ abstract getToken(): string | nullish | Promise <string | nullish >;
1172
1197
// @internal
1173
1198
static parseToken(token : unknown ): TokenProvider ;
1174
1199
}
@@ -1256,7 +1281,7 @@ export interface UpsertedUpdateOptions<Schema extends SomeDoc> {
1256
1281
// @public
1257
1282
export class UsernamePasswordTokenProvider extends TokenProvider {
1258
1283
constructor (username : string , password : string );
1259
- getToken(): Promise < string > ;
1284
+ getToken(): string ;
1260
1285
}
1261
1286
1262
1287
// @public
0 commit comments