@@ -4,13 +4,13 @@ The `ServiceRegistryClient` manages service registrations and circuit breakers.
44
55## Constructor
66
7- ### ` new ServiceRegistryClient(client: ConductorClient ) `
7+ ### ` new ServiceRegistryClient(client: Client ) `
88
99Creates a new ` ServiceRegistryClient ` .
1010
1111** Parameters:**
1212
13- - ` client ` (` ConductorClient ` ): An instance of ` ConductorClient ` .
13+ - ` client ` (` Client ` ): An instance of ` Client ` .
1414
1515---
1616
@@ -22,7 +22,7 @@ Retrieves all registered services.
2222
2323** Returns:**
2424
25- - ` Promise<ServiceRegistry[]> ` : An array of all registered services.
25+ - ` Promise<ServiceRegistry[]> ` : An array of all registered services.
2626
2727---
2828
@@ -32,11 +32,11 @@ Removes a service by name.
3232
3333** Parameters:**
3434
35- - ` name ` (` string ` ): The name of the service to remove.
35+ - ` name ` (` string ` ): The name of the service to remove.
3636
3737** Returns:**
3838
39- - ` Promise<void> `
39+ - ` Promise<void> `
4040
4141---
4242
@@ -46,11 +46,11 @@ Gets a service by name.
4646
4747** Parameters:**
4848
49- - ` name ` (` string ` ): The name of the service to retrieve.
49+ - ` name ` (` string ` ): The name of the service to retrieve.
5050
5151** Returns:**
5252
53- - ` Promise<ServiceRegistry> ` : The requested service registry.
53+ - ` Promise<ServiceRegistry> ` : The requested service registry.
5454
5555---
5656
@@ -60,11 +60,11 @@ Opens the circuit breaker for a service.
6060
6161** Parameters:**
6262
63- - ` name ` (` string ` ): The name of the service.
63+ - ` name ` (` string ` ): The name of the service.
6464
6565** Returns:**
6666
67- - ` Promise<CircuitBreakerTransitionResponse> ` : A response with the circuit breaker status.
67+ - ` Promise<CircuitBreakerTransitionResponse> ` : A response with the circuit breaker status.
6868
6969---
7070
@@ -74,11 +74,11 @@ Closes the circuit breaker for a service.
7474
7575** Parameters:**
7676
77- - ` name ` (` string ` ): The name of the service.
77+ - ` name ` (` string ` ): The name of the service.
7878
7979** Returns:**
8080
81- - ` Promise<CircuitBreakerTransitionResponse> ` : A response with the circuit breaker status.
81+ - ` Promise<CircuitBreakerTransitionResponse> ` : A response with the circuit breaker status.
8282
8383---
8484
@@ -88,11 +88,11 @@ Gets the circuit breaker status for a service.
8888
8989** Parameters:**
9090
91- - ` name ` (` string ` ): The name of the service.
91+ - ` name ` (` string ` ): The name of the service.
9292
9393** Returns:**
9494
95- - ` Promise<CircuitBreakerTransitionResponse> ` : A response with the circuit breaker status.
95+ - ` Promise<CircuitBreakerTransitionResponse> ` : A response with the circuit breaker status.
9696
9797---
9898
@@ -102,11 +102,11 @@ Adds or updates a service registry.
102102
103103** Parameters:**
104104
105- - ` serviceRegistry ` (` ServiceRegistry ` ): The service registry to add or update.
105+ - ` serviceRegistry ` (` ServiceRegistry ` ): The service registry to add or update.
106106
107107** Returns:**
108108
109- - ` Promise<void> `
109+ - ` Promise<void> `
110110
111111---
112112
@@ -116,12 +116,12 @@ Adds or updates a service method.
116116
117117** Parameters:**
118118
119- - ` registryName ` (` string ` ): The name of the registry.
120- - ` method ` (` ServiceMethod ` ): The service method to add or update.
119+ - ` registryName ` (` string ` ): The name of the registry.
120+ - ` method ` (` ServiceMethod ` ): The service method to add or update.
121121
122122** Returns:**
123123
124- - ` Promise<void> `
124+ - ` Promise<void> `
125125
126126---
127127
@@ -131,14 +131,14 @@ Removes a service method.
131131
132132** Parameters:**
133133
134- - ` registryName ` (` string ` ): The name of the registry.
135- - ` serviceName ` (` string ` ): The name of the service.
136- - ` method ` (` string ` ): The name of the method.
137- - ` methodType ` (` string ` ): The type of the method.
134+ - ` registryName ` (` string ` ): The name of the registry.
135+ - ` serviceName ` (` string ` ): The name of the service.
136+ - ` method ` (` string ` ): The name of the method.
137+ - ` methodType ` (` string ` ): The type of the method.
138138
139139** Returns:**
140140
141- - ` Promise<void> `
141+ - ` Promise<void> `
142142
143143---
144144
@@ -148,12 +148,12 @@ Gets proto data.
148148
149149** Parameters:**
150150
151- - ` registryName ` (` string ` ): The name of the registry.
152- - ` filename ` (` string ` ): The name of the proto file.
151+ - ` registryName ` (` string ` ): The name of the registry.
152+ - ` filename ` (` string ` ): The name of the proto file.
153153
154154** Returns:**
155155
156- - ` Promise<Blob> ` : The proto file data as a ` Blob ` .
156+ - ` Promise<Blob> ` : The proto file data as a ` Blob ` .
157157
158158---
159159
@@ -163,13 +163,13 @@ Sets proto data.
163163
164164** Parameters:**
165165
166- - ` registryName ` (` string ` ): The name of the registry.
167- - ` filename ` (` string ` ): The name of the proto file.
168- - ` data ` (` Blob ` ): The proto file data.
166+ - ` registryName ` (` string ` ): The name of the registry.
167+ - ` filename ` (` string ` ): The name of the proto file.
168+ - ` data ` (` Blob ` ): The proto file data.
169169
170170** Returns:**
171171
172- - ` Promise<void> `
172+ - ` Promise<void> `
173173
174174---
175175
@@ -179,12 +179,12 @@ Deletes a proto file.
179179
180180** Parameters:**
181181
182- - ` registryName ` (` string ` ): The name of the registry.
183- - ` filename ` (` string ` ): The name of the proto file.
182+ - ` registryName ` (` string ` ): The name of the registry.
183+ - ` filename ` (` string ` ): The name of the proto file.
184184
185185** Returns:**
186186
187- - ` Promise<void> `
187+ - ` Promise<void> `
188188
189189---
190190
@@ -194,11 +194,11 @@ Gets all proto files for a registry.
194194
195195** Parameters:**
196196
197- - ` registryName ` (` string ` ): The name of the registry.
197+ - ` registryName ` (` string ` ): The name of the registry.
198198
199199** Returns:**
200200
201- - ` Promise<ProtoRegistryEntry[]> ` : A list of proto registry entries.
201+ - ` Promise<ProtoRegistryEntry[]> ` : A list of proto registry entries.
202202
203203---
204204
@@ -208,86 +208,123 @@ Discovers service methods.
208208
209209** Parameters:**
210210
211- - ` name ` (` string ` ): The name of the service.
212- - ` create ` (` boolean ` , optional): Whether to create the discovered methods. Defaults to ` false ` .
211+ - ` name ` (` string ` ): The name of the service.
212+ - ` create ` (` boolean ` , optional): Whether to create the discovered methods. Defaults to ` false ` .
213213
214214** Returns:**
215215
216- - ` Promise<ServiceMethod[]> ` : The discovered service methods.
216+ - ` Promise<ServiceMethod[]> ` : The discovered service methods.
217217
218218---
219219
220220## Type Definitions
221221
222+ ### ` ServiceType `
223+
224+ ``` typescript
225+ export enum ServiceType {
226+ HTTP = " HTTP" ,
227+ MCP_REMOTE = " MCP_REMOTE" ,
228+ gRPC = " gRPC" ,
229+ }
230+ ```
231+
222232### ` ServiceRegistry `
223- | Property | Type | Description |
224- | --- | --- | --- |
225- | ` name ` | ` string ` | The name of the service. |
226- | ` type ` | ` ServiceType ` | The type of the service. |
227- | ` serviceURI ` | ` string ` | The URI of the service. |
228- | ` methods ` | ` ServiceMethod[] ` | The methods of the service. |
229- | ` requestParams ` | ` RequestParam[] ` | The request parameters of the service. |
230- | ` config ` | ` ServiceRegistryConfig ` | The configuration of the service. |
231233
232- ### ` ServiceType `
233- ` ServiceType ` is an enum that can be one of the following values: ` 'HTTP' ` , ` 'gRPC' ` .
234+ ``` typescript
235+ export type ServiceRegistry = {
236+ circuitBreakerEnabled? : boolean ;
237+ config? : Config ;
238+ methods? : ServiceMethod [];
239+ name? : string ;
240+ requestParams? : RequestParam [];
241+ serviceURI? : string ;
242+ type? : " HTTP" | " gRPC" | " MCP_REMOTE" ;
243+ };
244+ ```
234245
235246### ` ServiceMethod `
236- | Property | Type | Description |
237- | --- | --- | --- |
238- | ` id ` | ` number ` | The ID of the method. |
239- | ` operationName ` | ` string ` | The name of the operation. |
240- | ` methodName ` | ` string ` | The name of the method. |
241- | ` methodType ` | ` string ` | The type of the method. |
242- | ` inputType ` | ` string ` | The input type of the method. |
243- | ` outputType ` | ` string ` | The output type of the method. |
244- | ` requestParams ` | ` RequestParam[] ` | The request parameters of the method. |
245- | ` exampleInput ` | ` Record<string, any> ` | An example input for the method. |
246247
247- ### ` RequestParam `
248- | Property | Type | Description |
249- | --- | --- | --- |
250- | ` name ` | ` string ` | The name of the parameter. |
251- | ` type ` | ` string ` | The type of the parameter. |
252- | ` required ` | ` boolean ` | Whether the parameter is required. |
253- | ` schema ` | ` RequestParamSchema ` | The schema of the parameter. |
254-
255- ### ` RequestParamSchema `
256- | Property | Type | Description |
257- | --- | --- | --- |
258- | ` type ` | ` string ` | The type of the schema. |
259- | ` format ` | ` string ` | The format of the schema. |
260- | ` defaultValue ` | ` any ` | The default value of the schema. |
261-
262- ### ` ServiceRegistryConfig `
263- | Property | Type | Description |
264- | --- | --- | --- |
265- | ` circuitBreakerConfig ` | ` OrkesCircuitBreakerConfig ` | The circuit breaker configuration. |
266-
267- ### ` OrkesCircuitBreakerConfig `
268- | Property | Type | Description |
269- | --- | --- | --- |
270- | ` failureRateThreshold ` | ` number ` | The failure rate threshold. |
271- | ` slidingWindowSize ` | ` number ` | The sliding window size. |
272- | ` minimumNumberOfCalls ` | ` number ` | The minimum number of calls. |
273- | ` waitDurationInOpenState ` | ` number ` | The wait duration in the open state. |
274- | ` permittedNumberOfCallsInHalfOpenState ` | ` number ` | The permitted number of calls in the half-open state. |
275- | ` slowCallRateThreshold ` | ` number ` | The slow call rate threshold. |
276- | ` slowCallDurationThreshold ` | ` number ` | The slow call duration threshold. |
277- | ` automaticTransitionFromOpenToHalfOpenEnabled ` | ` boolean ` | Whether automatic transition from open to half-open is enabled. |
278- | ` maxWaitDurationInHalfOpenState ` | ` number ` | The maximum wait duration in the half-open state. |
248+ ``` typescript
249+ export type ServiceMethod = {
250+ exampleInput? : {
251+ [key : string ]: unknown ;
252+ };
253+ id? : number ;
254+ inputType? : string ;
255+ methodName? : string ;
256+ methodType? : string ;
257+ operationName? : string ;
258+ outputType? : string ;
259+ requestParams? : RequestParam [];
260+ };
261+ ```
279262
280263### ` CircuitBreakerTransitionResponse `
281- | Property | Type | Description |
282- | --- | --- | --- |
283- | ` service ` | ` string ` | The name of the service. |
284- | ` previousState ` | ` string ` | The previous state of the circuit breaker. |
285- | ` currentState ` | ` string ` | The current state of the circuit breaker. |
286- | ` transitionTimestamp ` | ` number ` | The timestamp of the transition. |
287- | ` message ` | ` string ` | The transition message. |
264+
265+ ``` typescript
266+ export type CircuitBreakerTransitionResponse = {
267+ currentState? : string ;
268+ message? : string ;
269+ previousState? : string ;
270+ service? : string ;
271+ transitionTimestamp? : number ;
272+ };
273+ ```
288274
289275### ` ProtoRegistryEntry `
290- | Property | Type | Description |
291- | --- | --- | --- |
292- | ` filename ` | ` string ` | The name of the proto file. |
293- | ` lastUpdated ` | ` number ` | The last update time of the proto file. |
276+
277+ ``` typescript
278+ export type ProtoRegistryEntry = {
279+ data? : string ;
280+ filename? : string ;
281+ serviceName? : string ;
282+ };
283+ ```
284+
285+ ### ` Config `
286+
287+ ``` typescript
288+ export type Config = {
289+ circuitBreakerConfig? : OrkesCircuitBreakerConfig ;
290+ };
291+ ```
292+
293+ ### ` OrkesCircuitBreakerConfig `
294+
295+ ``` typescript
296+ export type OrkesCircuitBreakerConfig = {
297+ automaticTransitionFromOpenToHalfOpenEnabled? : boolean ;
298+ failureRateThreshold? : number ;
299+ maxWaitDurationInHalfOpenState? : number ;
300+ minimumNumberOfCalls? : number ;
301+ permittedNumberOfCallsInHalfOpenState? : number ;
302+ slidingWindowSize? : number ;
303+ slowCallDurationThreshold? : number ;
304+ slowCallRateThreshold? : number ;
305+ waitDurationInOpenState? : number ;
306+ };
307+ ```
308+
309+ ### ` RequestParam `
310+
311+ ``` typescript
312+ export type RequestParam = {
313+ name? : string ;
314+ required? : boolean ;
315+ schema? : Schema ;
316+ type? : string ;
317+ };
318+ ```
319+
320+ ### ` Schema `
321+
322+ ``` typescript
323+ export type Schema = {
324+ defaultValue? : {
325+ [key : string ]: unknown ;
326+ };
327+ format? : string ;
328+ type? : string ;
329+ };
330+ ```
0 commit comments