1 | import { ServiceType } from './generaltypes';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export declare enum EndpointState {
|
8 | |
9 |
|
10 |
|
11 | Disconnected = 0,
|
12 | |
13 |
|
14 |
|
15 | Connecting = 1,
|
16 | |
17 |
|
18 |
|
19 | Connected = 2,
|
20 | |
21 |
|
22 |
|
23 | Disconnecting = 3
|
24 | }
|
25 |
|
26 |
|
27 |
|
28 | export declare enum PingState {
|
29 | |
30 |
|
31 |
|
32 | Ok = 0,
|
33 | |
34 |
|
35 |
|
36 | Timeout = 1,
|
37 | |
38 |
|
39 |
|
40 | Error = 2
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | export interface JsonPingReport {
|
49 | version: number;
|
50 | id: string;
|
51 | sdk: string;
|
52 | services: {
|
53 | [serviceType: string]: {
|
54 | latency_us: number;
|
55 | remote: string;
|
56 | local: string;
|
57 | id: string;
|
58 | state: string;
|
59 | namespace?: string;
|
60 | error?: string;
|
61 | }[];
|
62 | };
|
63 | }
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | export interface JsonDiagnosticsReport {
|
71 | version: number;
|
72 | id: string;
|
73 | sdk: string;
|
74 | services: {
|
75 | [serviceType: string]: {
|
76 | last_activity_us?: number;
|
77 | remote: string;
|
78 | local: string;
|
79 | id: string;
|
80 | state: string;
|
81 | namespace?: string;
|
82 | details?: string;
|
83 | }[];
|
84 | };
|
85 | }
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | export declare class PingEndpoint {
|
92 | |
93 |
|
94 |
|
95 | constructor(data: PingEndpoint);
|
96 | /**
|
97 | * The type of service this endpoint refers to.
|
98 | */
|
99 | type: ServiceType;
|
100 | /**
|
101 | * The unique identifier for this endpoint.
|
102 | */
|
103 | id: string;
|
104 | /**
|
105 | * The remote address of this endpoint.
|
106 | */
|
107 | remote: string;
|
108 | /**
|
109 | * The local address of this endpoint.
|
110 | */
|
111 | local: string;
|
112 | /**
|
113 | * The latency of the ping to the endpoint.
|
114 | */
|
115 | latency: number;
|
116 | /**
|
117 | * The current state of this endpoint.
|
118 | */
|
119 | state: PingState;
|
120 | /**
|
121 | * The bucket this endpoint is connected to.
|
122 | */
|
123 | bucket?: string;
|
124 | /**
|
125 | * Information about errors that occured during pinging.
|
126 | */
|
127 | error?: any;
|
128 | }
|
129 | /**
|
130 | * PingResult represents the output of a ping operation.
|
131 | *
|
132 | * @category Diagnostics
|
133 | */
|
134 | export declare class PingResult {
|
135 | |
136 |
|
137 |
|
138 | constructor(data: {
|
139 | version: number;
|
140 | id: string;
|
141 | sdk: string;
|
142 | services: {
|
143 | [serviceType: string]: PingEndpoint[];
|
144 | };
|
145 | });
|
146 | /**
|
147 | * The version number of this report.
|
148 | */
|
149 | version: number;
|
150 | /**
|
151 | * The unique identifier for this report.
|
152 | */
|
153 | id: string;
|
154 | /**
|
155 | * The name of the SDK which generated this report.
|
156 | */
|
157 | sdk: string;
|
158 | /**
|
159 | * A list of service endpoints and their ping results.
|
160 | */
|
161 | services: {
|
162 | [serviceType: string]: PingEndpoint[];
|
163 | };
|
164 | |
165 |
|
166 |
|
167 | toJSON(): JsonPingReport;
|
168 | }
|
169 |
|
170 |
|
171 |
|
172 | export interface PingOptions {
|
173 | |
174 |
|
175 |
|
176 | reportId?: string;
|
177 | |
178 |
|
179 |
|
180 | serviceTypes?: ServiceType[];
|
181 | |
182 |
|
183 |
|
184 | bucket?: string;
|
185 | |
186 |
|
187 |
|
188 | timeout?: number;
|
189 | }
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 | export declare class DiagnosticsEndpoint {
|
197 | |
198 |
|
199 |
|
200 | constructor(data: DiagnosticsEndpoint);
|
201 | /**
|
202 | * The type of service this entry represents.
|
203 | */
|
204 | type: ServiceType;
|
205 | /**
|
206 | * The unique identifier for this endpoint.
|
207 | */
|
208 | id: string;
|
209 | /**
|
210 | * The local address of this endpoint.
|
211 | */
|
212 | local: string;
|
213 | /**
|
214 | * The remote address of this endpoint.
|
215 | */
|
216 | remote: string;
|
217 | /**
|
218 | * The time in milliseconds since the last activity.
|
219 | */
|
220 | lastActivity: number;
|
221 | /**
|
222 | * The current state of this endpoint.
|
223 | */
|
224 | state: EndpointState;
|
225 | /**
|
226 | * The name of the bucket this endpoint is connected to.
|
227 | */
|
228 | bucket?: string;
|
229 | /**
|
230 | * Various additional details about the endpoint.
|
231 | */
|
232 | details?: any;
|
233 | }
|
234 | /**
|
235 | * DiagnosticsResult represents the output of a operation result.
|
236 | *
|
237 | * @category Diagnostics
|
238 | */
|
239 | export declare class DiagnosticsResult {
|
240 | |
241 |
|
242 |
|
243 | constructor(data: {
|
244 | version: number;
|
245 | id: string;
|
246 | sdk: string;
|
247 | services: {
|
248 | [serviceType: string]: DiagnosticsEndpoint[];
|
249 | };
|
250 | });
|
251 | /**
|
252 | * The version number of this report.
|
253 | */
|
254 | version: number;
|
255 | /**
|
256 | * The unique identifier for this report.
|
257 | */
|
258 | id: string;
|
259 | /**
|
260 | * The name of the SDK which generated this report.
|
261 | */
|
262 | sdk: string;
|
263 | /**
|
264 | * A list of service endpoints and their diagnostic status.
|
265 | */
|
266 | services: {
|
267 | [serviceType: string]: DiagnosticsEndpoint[];
|
268 | };
|
269 | |
270 |
|
271 |
|
272 | toJSON(): JsonDiagnosticsReport;
|
273 | }
|
274 |
|
275 |
|
276 |
|
277 | export interface DiagnosticsOptions {
|
278 | |
279 |
|
280 |
|
281 | reportId?: string;
|
282 | }
|