Skip to content

Commit f3e5f75

Browse files
committed
ragstack check + internal http session management overhaul
1 parent 8d447ab commit f3e5f75

31 files changed

+582
-720
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ ASTRA_RUN_LONG_TESTS`=
1212

1313
# Set this to some value to enable running admin tests
1414
ASTRA_RUN_ADMIN_TESTS=
15+
16+
# Set this to run tests on HTTP1 by default
17+
ASTRA_USE_HTTP1=

etc/astra-db-ts.api.md

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
```ts
66

7-
import type { AxiosError } from 'axios';
8-
import { AxiosResponse } from 'axios';
7+
import { context as context_2 } from 'fetch-h2';
8+
import { Headers as Headers_2 } from 'fetch-h2/dist/lib/headers';
99
import TypedEmitter from 'typed-emitter';
1010

1111
// @public
@@ -57,8 +57,10 @@ export class AdminCommandStartedEvent extends AdminCommandEvent {
5757

5858
// @public
5959
export class AdminCommandSucceededEvent extends AdminCommandEvent {
60+
// Warning: (ae-forgotten-export) The symbol "GuaranteedAPIResponse" needs to be exported by the entry point index.d.ts
61+
//
6062
// @internal
61-
constructor(info: DevOpsAPIRequestInfo, longRunning: boolean, resp: AxiosResponse, started: number);
63+
constructor(info: DevOpsAPIRequestInfo, longRunning: boolean, resp: GuaranteedAPIResponse, started: number);
6264
readonly duration: number;
6365
readonly resBody?: Record<string, any>;
6466
}
@@ -115,10 +117,10 @@ export class AstraAdmin {
115117

116118
// @public
117119
export class AstraDbAdmin extends DbAdmin {
118-
// Warning: (ae-forgotten-export) The symbol "HttpClient" needs to be exported by the entry point index.d.ts
120+
// Warning: (ae-forgotten-export) The symbol "InternalRootClientOpts" needs to be exported by the entry point index.d.ts
119121
//
120122
// @internal
121-
constructor(_db: Db, httpClient: HttpClient, options: InternalRootClientOpts['adminOptions']);
123+
constructor(_db: Db, options: InternalRootClientOpts);
122124
createNamespace(namespace: string, options?: AdminBlockingOptions): Promise<void>;
123125
db(): Db;
124126
drop(options?: AdminBlockingOptions): Promise<void>;
@@ -294,6 +296,7 @@ export class CursorIsStartedError extends DataAPIError {
294296
export class DataAPIClient extends DataAPIClientEventEmitterBase {
295297
constructor(token: string, options?: DataAPIClientOptions | null);
296298
admin(options?: AdminSpawnOptions): AstraAdmin;
299+
close(): Promise<void>;
297300
db(endpoint: string, options?: DbSpawnOptions): Db;
298301
db(id: string, region: string, options?: DbSpawnOptions): Db;
299302
}
@@ -309,6 +312,8 @@ export interface DataAPIClientOptions {
309312
adminOptions?: AdminSpawnOptions;
310313
caller?: Caller | Caller[];
311314
dbOptions?: DbSpawnOptions;
315+
// (undocumented)
316+
preferHttp2?: boolean;
312317
}
313318

314319
// @public
@@ -416,22 +421,17 @@ export type DateUpdate<Schema> = {
416421
};
417422

418423
// @public
419-
export class Db implements Disposable {
420-
[Symbol.dispose](): void;
424+
export class Db {
421425
// @internal
422426
constructor(endpoint: string, options: InternalRootClientOpts);
423427
admin(options?: AdminSpawnOptions): AstraDbAdmin;
424-
close(): void;
425428
collection<Schema extends SomeDoc = SomeDoc>(name: string, options?: WithNamespace): Collection<Schema>;
426429
collections(options?: WithNamespace & WithTimeout): Promise<Collection[]>;
427430
command(command: Record<string, any>, options?: RunCommandOptions): Promise<RawDataAPIResponse>;
428431
createCollection<Schema extends SomeDoc = SomeDoc>(collectionName: string, options?: CreateCollectionOptions<Schema>): Promise<Collection<Schema>>;
429432
dropCollection(name: string, options?: DropCollectionOptions): Promise<boolean>;
430-
// (undocumented)
431-
httpStrategy(): 'http1' | 'http2';
432433
get id(): string;
433434
info(options?: WithTimeout): Promise<DatabaseInfo>;
434-
isClosed(): boolean | undefined;
435435
listCollections(options: ListCollectionsOptions & {
436436
nameOnly: true;
437437
}): Promise<string[]>;
@@ -458,7 +458,6 @@ export interface DbSpawnOptions {
458458
monitorCommands?: boolean;
459459
namespace?: string;
460460
token?: string;
461-
useHttp2?: boolean;
462461
}
463462

464463
// @public
@@ -513,7 +512,7 @@ export interface DevOpsAPIErrorDescriptor {
513512
// @public
514513
export class DevOpsAPIResponseError extends DevOpsAPIError {
515514
// @internal
516-
constructor(error: AxiosError);
515+
constructor(resp: GuaranteedAPIResponse);
517516
readonly errors: DevOpsAPIErrorDescriptor[];
518517
readonly status?: number;
519518
}
@@ -529,7 +528,7 @@ export class DevOpsAPITimeout extends DevOpsAPIError {
529528
// @public
530529
export class DevOpsUnexpectedStateError extends DevOpsAPIError {
531530
// @internal
532-
constructor(message: string, raw?: AxiosResponse);
531+
constructor(message: string, raw?: GuaranteedAPIResponse);
533532
readonly dbInfo?: FullDatabaseInfo;
534533
readonly status?: number;
535534
}
@@ -755,24 +754,6 @@ export interface InsertOneResult<Schema> {
755754
insertedId: IdOf<Schema>;
756755
}
757756

758-
// @public (undocumented)
759-
export interface InternalRootClientOpts {
760-
// (undocumented)
761-
adminOptions: AdminSpawnOptions & {
762-
adminToken: string;
763-
monitorCommands: boolean;
764-
};
765-
// (undocumented)
766-
caller?: Caller | Caller[];
767-
// (undocumented)
768-
dbOptions: DbSpawnOptions & {
769-
token: string;
770-
monitorCommands: boolean;
771-
};
772-
// (undocumented)
773-
emitter: TypedEmitter<DataAPIClientEvents>;
774-
}
775-
776757
// @public
777758
export type InternalUpdateResult<Schema extends SomeDoc, N extends number> = (GuaranteedUpdateOptions<N> & UpsertedUpdateOptions<Schema>) | (GuaranteedUpdateOptions<N> & NoUpsertUpdateOptions);
778759

0 commit comments

Comments
 (0)