Skip to content

Commit 4e99ac4

Browse files
committed
chore: actualize typings
1 parent 2e24157 commit 4e99ac4

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ export class BrightClient {
248248
// Ingress (Data Ingestion)
249249

250250
async listIngresses(indexId: string): Promise<IngressConfig[]> {
251-
return this.request<IngressConfig[]>(`/indexes/${indexId}/ingresses`);
251+
const response = await this.request<{ ingresses: IngressConfig[] }>(`/indexes/${indexId}/ingresses`);
252+
return response.ingresses;
252253
}
253254

254255
async createIngress(

src/ingress.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,22 @@ export interface PostgresIngressConfig {
3333
auto_triggers?: boolean;
3434
}
3535

36-
// Base ingress fields shared by all ingress types
36+
// Ingress statistics from the server
37+
export interface IngressStatistics {
38+
last_sync_at?: string;
39+
documents_synced: number;
40+
documents_deleted: number;
41+
full_sync_complete: boolean;
42+
last_error?: string;
43+
error_count: number;
44+
}
3745

46+
// Base ingress fields shared by all ingress types
3847
interface IngressBase {
3948
id: string;
4049
index_id: string;
4150
status: IngressStatus;
42-
last_sync?: string;
43-
documents_synced?: number;
44-
errors?: number;
51+
statistics: IngressStatistics;
4552
}
4653

4754
// Typed ingress configs (discriminated union)
@@ -63,11 +70,13 @@ export type IngressConfig = PostgresIngressResponse | GenericIngressResponse;
6370
// Create params
6471

6572
export interface CreateIngressParams {
73+
id: string;
6674
type: string;
6775
config: Record<string, unknown>;
6876
}
6977

7078
export interface CreatePostgresIngressParams {
79+
id: string;
7180
type: 'postgres';
7281
config: PostgresIngressConfig;
7382
}

0 commit comments

Comments
 (0)