@@ -116,13 +116,19 @@ export class AstraAdmin {
116
116
export class AstraDbAdmin extends DbAdmin {
117
117
// @internal
118
118
constructor (db : Db , rootOpts : InternalRootClientOpts , adminOpts : AdminSpawnOptions | undefined , dbToken : TokenProvider , endpoint : string );
119
- createNamespace(namespace : string , options ? : CreateNamespaceOptions ): Promise <void >;
119
+ createKeyspace(keyspace : string , options ? : CreateKeyspaceOptions ): Promise <void >;
120
+ // @deprecated
121
+ createNamespace(keyspace : string , options ? : CreateNamespaceOptions ): Promise <void >;
120
122
db(): Db ;
121
123
drop(options ? : AdminBlockingOptions ): Promise <void >;
122
- dropNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
124
+ dropKeyspace(keyspace : string , options ? : AdminBlockingOptions ): Promise <void >;
125
+ // @deprecated
126
+ dropNamespace(keyspace : string , options ? : AdminBlockingOptions ): Promise <void >;
123
127
findEmbeddingProviders(options ? : WithTimeout ): Promise <FindEmbeddingProvidersResult >;
124
128
get id(): string ;
125
129
info(options ? : WithTimeout ): Promise <FullDatabaseInfo >;
130
+ listKeyspaces(options ? : WithTimeout ): Promise <string []>;
131
+ // @deprecated
126
132
listNamespaces(options ? : WithTimeout ): Promise <string []>;
127
133
}
128
134
@@ -213,6 +219,8 @@ export class Collection<Schema extends SomeDoc = SomeDoc> {
213
219
}): Promise <WithId <Schema > | null >;
214
220
insertMany(documents : MaybeId <Schema >[], options ? : InsertManyOptions ): Promise <InsertManyResult <Schema >>;
215
221
insertOne(document : MaybeId <Schema >, options ? : InsertOneOptions ): Promise <InsertOneResult <Schema >>;
222
+ readonly keyspace: string ;
223
+ // @deprecated
216
224
readonly namespace: string ;
217
225
options(options ? : WithTimeout ): Promise <CollectionOptions <SomeDoc >>;
218
226
replaceOne(filter : Filter <Schema >, replacement : NoId <Schema >, options ? : ReplaceOneOptions ): Promise <ReplaceOneResult <Schema >>;
@@ -223,16 +231,20 @@ export class Collection<Schema extends SomeDoc = SomeDoc> {
223
231
// @public
224
232
export class CollectionAlreadyExistsError extends DataAPIError {
225
233
// @internal
226
- constructor (namespace : string , collectionName : string );
234
+ constructor (keyspace : string , collectionName : string );
227
235
readonly collectionName: string ;
236
+ readonly keyspace: string ;
237
+ // @deprecated
228
238
readonly namespace: string ;
229
239
}
230
240
231
241
// @public
232
242
export class CollectionNotFoundError extends DataAPIError {
233
243
// @internal
234
- constructor (namespace : string , collectionName : string );
244
+ constructor (keyspace : string , collectionName : string );
235
245
readonly collectionName: string ;
246
+ readonly keyspace: string ;
247
+ // @deprecated
236
248
readonly namespace: string ;
237
249
}
238
250
@@ -244,7 +256,7 @@ export interface CollectionOptions<Schema extends SomeDoc> {
244
256
}
245
257
246
258
// @public
247
- export interface CollectionSpawnOptions extends WithNamespace {
259
+ export interface CollectionSpawnOptions extends WithKeyspace {
248
260
defaultMaxTimeMS? : number | null ;
249
261
embeddingApiKey? : string | EmbeddingHeadersProvider | null ;
250
262
}
@@ -258,6 +270,8 @@ export abstract class CommandEvent {
258
270
readonly collection? : string ;
259
271
readonly command: Record <string , any >;
260
272
readonly commandName: string ;
273
+ readonly keyspace: string ;
274
+ // @deprecated
261
275
readonly namespace: string ;
262
276
readonly url: string ;
263
277
}
@@ -315,6 +329,11 @@ export type CreateDatabaseOptions = AdminBlockingOptions & {
315
329
};
316
330
317
331
// @public
332
+ export type CreateKeyspaceOptions = AdminBlockingOptions & {
333
+ updateDbKeyspace? : boolean ;
334
+ };
335
+
336
+ // @public @deprecated
318
337
export type CreateNamespaceOptions = AdminBlockingOptions & {
319
338
updateDbNamespace? : boolean ;
320
339
};
@@ -386,10 +405,16 @@ export type DataAPICommandEvents = {
386
405
export class DataAPIDbAdmin extends DbAdmin {
387
406
// @internal
388
407
constructor (db : Db , httpClient : DataAPIHttpClient , adminOpts ? : AdminSpawnOptions );
389
- createNamespace(namespace : string , options ? : LocalCreateNamespaceOptions ): Promise <void >;
408
+ createKeyspace(keyspace : string , options ? : LocalCreateKeyspaceOptions ): Promise <void >;
409
+ // @deprecated
410
+ createNamespace(keyspace : string , options ? : LocalCreateNamespaceOptions ): Promise <void >;
390
411
db(): Db ;
391
- dropNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
412
+ dropKeyspace(keyspace : string , options ? : AdminBlockingOptions ): Promise <void >;
413
+ // @deprecated
414
+ dropNamespace(keyspace : string , options ? : AdminBlockingOptions ): Promise <void >;
392
415
findEmbeddingProviders(options ? : WithTimeout ): Promise <FindEmbeddingProvidersResult >;
416
+ listKeyspaces(options ? : WithTimeout ): Promise <string []>;
417
+ // @deprecated
393
418
listNamespaces(options ? : WithTimeout ): Promise <string []>;
394
419
}
395
420
@@ -457,7 +482,9 @@ export type DatabaseCloudProviderFilter = DatabaseCloudProvider | 'ALL';
457
482
// @public
458
483
export interface DatabaseConfig {
459
484
cloudProvider? : DatabaseCloudProvider ;
485
+ keyspace? : string ;
460
486
name: string ;
487
+ // @deprecated
461
488
namespace? : string ;
462
489
region: string ;
463
490
}
@@ -479,7 +506,7 @@ export interface DatabaseInfo {
479
506
}
480
507
481
508
// @public
482
- export type DatabaseStatus = ' ACTIVE' | ' PENDING ' | ' PREPARING ' | ' PREPARED ' | ' INITIALIZING' | ' PARKED' | ' PARKING' | ' UNPARKING ' | ' TERMINATED ' | ' TERMINATING ' | ' RESIZING' | ' ERROR ' | ' MAINTENANCE ' | ' SUSPENDED ' | ' UNKNOWN' ;
509
+ export type DatabaseStatus = ' ACTIVE' | ' ERROR ' | ' DECOMMISSIONING ' | ' DEGRADED ' | ' HIBERNATED ' | ' HIBERNATING ' | ' INITIALIZING' | ' MAINTENANCE ' | ' PARKED' | ' PARKING' | ' PENDING ' | ' PREPARED ' | ' PREPARING ' | ' RESIZING' | ' RESUMING ' | ' TERMINATED ' | ' TERMINATING ' | ' UNKNOWN' | ' UNPARKING ' | ' SYNCHRONIZING ' ;
483
510
484
511
// @public
485
512
export type DatabaseStatusFilter = DatabaseStatus | ' ALL' | ' NONTERMINATED' ;
@@ -539,28 +566,38 @@ export class Db {
539
566
environment: Exclude <DataAPIEnvironment , ' astra' >;
540
567
}): DataAPIDbAdmin ;
541
568
collection<Schema extends SomeDoc = SomeDoc >(name : string , options ? : CollectionSpawnOptions ): Collection <Schema >;
542
- collections(options ? : WithNamespace & WithTimeout ): Promise <Collection []>;
569
+ collections(options ? : WithKeyspace & WithTimeout ): Promise <Collection []>;
543
570
command(command : Record <string , any >, options ? : RunCommandOptions ): Promise <RawDataAPIResponse >;
544
571
createCollection<Schema extends SomeDoc = SomeDoc >(collectionName : string , options ? : CreateCollectionOptions <Schema >): Promise <Collection <Schema >>;
545
572
dropCollection(name : string , options ? : DropCollectionOptions ): Promise <boolean >;
546
573
get id(): string ;
547
574
info(options ? : WithTimeout ): Promise <DatabaseInfo >;
575
+ get keyspace(): string ;
548
576
listCollections(options : ListCollectionsOptions & {
549
577
nameOnly: true ;
550
578
}): Promise <string []>;
551
579
listCollections(options ? : ListCollectionsOptions & {
552
580
nameOnly? : false ;
553
581
}): Promise <FullCollectionInfo []>;
582
+ // @deprecated
554
583
get namespace(): string ;
555
- useNamespace(namespace : string ): void ;
584
+ useKeyspace(keyspace : string ): void ;
585
+ // @deprecated
586
+ useNamespace(keyspace : string ): void ;
556
587
}
557
588
558
589
// @public
559
590
export abstract class DbAdmin {
560
- abstract createNamespace(namespace : string , options ? : CreateNamespaceOptions ): Promise <void >;
591
+ abstract createKeyspace(keyspace : string , options ? : CreateKeyspaceOptions ): Promise <void >;
592
+ // @deprecated
593
+ abstract createNamespace(keyspace : string , options ? : CreateNamespaceOptions ): Promise <void >;
561
594
abstract db(): Db ;
562
- abstract dropNamespace(namespace : string , options ? : AdminBlockingOptions ): Promise <void >;
595
+ abstract dropKeyspace(keyspace : string , options ? : AdminBlockingOptions ): Promise <void >;
596
+ // @deprecated
597
+ abstract dropNamespace(keyspace : string , options ? : AdminBlockingOptions ): Promise <void >;
563
598
abstract findEmbeddingProviders(options ? : WithTimeout ): Promise <FindEmbeddingProvidersResult >;
599
+ abstract listKeyspaces(): Promise <string []>;
600
+ // @deprecated
564
601
abstract listNamespaces(): Promise <string []>;
565
602
}
566
603
@@ -575,7 +612,9 @@ export interface DbMetricsInfo {
575
612
// @public
576
613
export interface DbSpawnOptions {
577
614
dataApiPath? : string ;
615
+ keyspace? : string ;
578
616
monitorCommands? : boolean ;
617
+ // @deprecated
579
618
namespace? : string ;
580
619
token? : string | TokenProvider | null ;
581
620
}
@@ -665,7 +704,7 @@ export class DevOpsUnexpectedStateError extends DevOpsAPIError {
665
704
}
666
705
667
706
// @public
668
- export interface DropCollectionOptions extends WithTimeout , WithNamespace {
707
+ export interface DropCollectionOptions extends WithTimeout , WithKeyspace {
669
708
}
670
709
671
710
// @public
@@ -797,7 +836,7 @@ export type FilterOps<Elem> = {
797
836
export class FindCursor <T , TRaw extends SomeDoc = SomeDoc > {
798
837
[Symbol .asyncIterator ](): AsyncGenerator <T , void , void >;
799
838
// @internal
800
- constructor (namespace : string , httpClient : DataAPIHttpClient , filter : Filter <SomeDoc >, options ? : FindOptions );
839
+ constructor (keyspace : string , httpClient : DataAPIHttpClient , filter : Filter <SomeDoc >, options ? : FindOptions );
801
840
bufferedCount(): number ;
802
841
clone(): FindCursor <TRaw , TRaw >;
803
842
close(): void ;
@@ -809,8 +848,10 @@ export class FindCursor<T, TRaw extends SomeDoc = SomeDoc> {
809
848
hasNext(): Promise <boolean >;
810
849
includeSimilarity(includeSimilarity ? : boolean ): this ;
811
850
includeSortVector(includeSortVector ? : boolean ): this ;
851
+ get keyspace(): string ;
812
852
limit(limit : number ): this ;
813
853
map<R >(mapping : (doc : T ) => R ): FindCursor <R , TRaw >;
854
+ // @deprecated
814
855
get namespace(): string ;
815
856
next(): Promise <T | null >;
816
857
project<R = any , RRaw extends SomeDoc = SomeDoc >(projection : Projection ): FindCursor <R , RRaw >;
@@ -954,17 +995,8 @@ export type IndexingOptions<Schema extends SomeDoc> = {
954
995
allow? : never ;
955
996
};
956
997
957
- // @public
958
- export interface InsertManyDocumentResponse <Schema extends SomeDoc > {
959
- error? : DataAPIErrorDescriptor ;
960
- _id: IdOf <Schema >;
961
- status: ' OK' | ' ERROR' | ' SKIPPED' ;
962
- }
963
-
964
998
// @public
965
999
export class InsertManyError extends CumulativeDataAPIError {
966
- readonly documentResponses: InsertManyDocumentResponse <SomeDoc >[];
967
- readonly failedCount: number ;
968
1000
name: string ;
969
1001
readonly partialResult: InsertManyResult <SomeDoc >;
970
1002
}
@@ -1021,7 +1053,16 @@ export interface InsertOneResult<Schema> {
1021
1053
export type InternalUpdateResult <Schema extends SomeDoc , N extends number > = (GuaranteedUpdateOptions <N > & UpsertedUpdateOptions <Schema >) | (GuaranteedUpdateOptions <N > & NoUpsertUpdateOptions );
1022
1054
1023
1055
// @public
1024
- export interface ListCollectionsOptions extends WithTimeout , WithNamespace {
1056
+ export type KeyspaceReplicationOptions = {
1057
+ class: ' SimpleStrategy' ;
1058
+ replicationFactor: number ;
1059
+ } | {
1060
+ class: ' NetworkTopologyStrategy' ;
1061
+ [datacenter : string ]: number | ' NetworkTopologyStrategy' ;
1062
+ };
1063
+
1064
+ // @public
1065
+ export interface ListCollectionsOptions extends WithTimeout , WithKeyspace {
1025
1066
nameOnly? : boolean ;
1026
1067
}
1027
1068
@@ -1034,8 +1075,13 @@ export interface ListDatabasesOptions extends WithTimeout {
1034
1075
}
1035
1076
1036
1077
// @public
1078
+ export type LocalCreateKeyspaceOptions = CreateKeyspaceOptions & {
1079
+ replication? : KeyspaceReplicationOptions ;
1080
+ };
1081
+
1082
+ // @public @deprecated
1037
1083
export type LocalCreateNamespaceOptions = CreateNamespaceOptions & {
1038
- replication? : NamespaceReplicationOptions ;
1084
+ replication? : KeyspaceReplicationOptions ;
1039
1085
};
1040
1086
1041
1087
// @public
@@ -1049,15 +1095,6 @@ export interface ModifyResult<Schema extends SomeDoc> {
1049
1095
value: WithId <Schema > | null ;
1050
1096
}
1051
1097
1052
- // @public
1053
- export type NamespaceReplicationOptions = {
1054
- class: ' SimpleStrategy' ;
1055
- replicationFactor: number ;
1056
- } | {
1057
- class: ' NetworkTopologyStrategy' ;
1058
- [datacenter : string ]: number | ' NetworkTopologyStrategy' ;
1059
- };
1060
-
1061
1098
// @public
1062
1099
export interface NoBlockingOptions extends WithTimeout {
1063
1100
blocking: false ;
@@ -1157,6 +1194,8 @@ export type ReplaceOneResult<Schema extends SomeDoc> = InternalUpdateResult<Sche
1157
1194
// @public
1158
1195
export interface RunCommandOptions extends WithTimeout {
1159
1196
collection? : string ;
1197
+ keyspace? : string | null ;
1198
+ // @deprecated
1160
1199
namespace? : string | null ;
1161
1200
}
1162
1201
@@ -1408,10 +1447,15 @@ export type WithId<T> = NoId<T> & {
1408
1447
};
1409
1448
1410
1449
// @public
1411
- export interface WithNamespace {
1450
+ export interface WithKeyspace {
1451
+ keyspace? : string ;
1452
+ // @deprecated
1412
1453
namespace? : string ;
1413
1454
}
1414
1455
1456
+ // @public @deprecated
1457
+ export type WithNamespace = WithKeyspace ;
1458
+
1415
1459
// @public
1416
1460
export interface WithTimeout {
1417
1461
maxTimeMS? : number ;
0 commit comments