Skip to content

Commit 1a3136c

Browse files
committed
Pagination types
1 parent c7bafc4 commit 1a3136c

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

packages/types/src/rest-api-manager/common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ export type HealthCheckInfo = {
2222
[key: string]: boolean;
2323
};
2424
}
25+
26+
export type Pagination = {
27+
pagination: {
28+
total: number
29+
}
30+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import { GetInstanceResponse } from "../rest-api-sth";
2+
import { Pagination } from "./common";
23

3-
export type GetInstancesResponse = GetInstanceResponse[];
4+
export type GetInstancesResponse = Pagination & { data: GetInstanceResponse[]};
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import { ConnectedSTHInfoDetails } from "./common";
1+
import { ConnectedSTHInfoDetails, Pagination } from "./common";
22

3-
export type GetListResponse = {
4-
id: string,
5-
info: ConnectedSTHInfoDetails,
6-
healthy: boolean,
7-
selfHosted: boolean,
8-
isConnectionActive: boolean,
9-
description?: string,
10-
tags?: string[],
11-
disconnectReason?: string,
12-
topics : string[],
13-
sequences: string[],
14-
instances: string[],
15-
}[]
3+
export type GetListResponse = Pagination & {
4+
data: {
5+
id: string,
6+
info: ConnectedSTHInfoDetails,
7+
healthy: boolean,
8+
selfHosted: boolean,
9+
isConnectionActive: boolean,
10+
description?: string,
11+
tags?: string[],
12+
disconnectReason?: string,
13+
topics : string[],
14+
sequences: string[],
15+
instances: string[],
16+
}[]
17+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Pagination } from "./common";
12
import { GetSequenceResponse } from "./get-sequence";
23

3-
export type GetSequencesResponse = GetSequenceResponse[];
4+
export type GetSequencesResponse = Pagination & { data: GetSequenceResponse[]}

0 commit comments

Comments
 (0)