@daocloud-proto/skoala 0.5.1-6 → 0.5.1-60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,12 @@ export enum ListNamespaceReqGatewayStatus {
12
12
  Unavailable = "Unavailable",
13
13
  }
14
14
 
15
+ export enum ListServiceReqServiceType {
16
+ ALL = "ALL",
17
+ SESAME = "SESAME",
18
+ K8S = "K8S",
19
+ }
20
+
15
21
  export type ListWorkspaceReq = {
16
22
  page?: number
17
23
  pageSize?: number
@@ -49,6 +55,30 @@ export type ListNamespaceReq = {
49
55
  pageSize?: number
50
56
  }
51
57
 
58
+ export type ListServiceReq = {
59
+ workspaceId?: string
60
+ clusterName?: string
61
+ namespaceName?: string[]
62
+ serviceType?: ListServiceReqServiceType
63
+ serviceName?: string
64
+ page?: number
65
+ pageSize?: number
66
+ }
67
+
68
+ export type ListServiceRes = {
69
+ items?: ListServiceInfo[]
70
+ pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
71
+ }
72
+
73
+ export type ListServiceInfo = {
74
+ serviceName?: string
75
+ namespaceName?: string
76
+ labels?: {[key: string]: string}
77
+ createdAt?: string
78
+ sesameServiceName?: string
79
+ sesameNamespaceName?: string
80
+ }
81
+
52
82
  export type ListNamespaceRes = {
53
83
  namespaceNames?: string[]
54
84
  pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
@@ -5,7 +5,6 @@
5
5
  */
6
6
 
7
7
  import * as SkoalaApiGeneralV1alpha1Common from "../../general/v1alpha1/common.pb"
8
- import * as SkoalaApiHostedV1alpha1Gatewayservice from "./gatewayservice.pb"
9
8
  import * as SkoalaApiHostedV1alpha1Http from "./http.pb"
10
9
 
11
10
  type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
@@ -17,6 +16,25 @@ type OneOf<T> =
17
16
  : never)
18
17
  : never);
19
18
 
19
+ export enum HttpRetryOnEnum {
20
+ five_xx = "five_xx",
21
+ gateway_error = "gateway_error",
22
+ reset = "reset",
23
+ connect_failure = "connect_failure",
24
+ retriable_4xx = "retriable_4xx",
25
+ refused_stream = "refused_stream",
26
+ retriable_status_codes = "retriable_status_codes",
27
+ retriable_headers = "retriable_headers",
28
+ }
29
+
30
+ export enum GrpcRetryOnEnum {
31
+ cancelled = "cancelled",
32
+ deadline_exceeded = "deadline_exceeded",
33
+ internal = "internal",
34
+ resource_exhausted = "resource_exhausted",
35
+ unavailable = "unavailable",
36
+ }
37
+
20
38
  export enum ValueMatchType {
21
39
  CONTAIN = "CONTAIN",
22
40
  EXACT = "EXACT",
@@ -48,6 +66,7 @@ export type CreateAPIReq = {
48
66
  clusterName?: string
49
67
  namespaceName?: string
50
68
  apiConfig?: APIConfig
69
+ advancedApiConfig?: AdvancedAPIConfig
51
70
  }
52
71
 
53
72
  export type AdvancedAPIReq = {
@@ -76,6 +95,23 @@ export type AdvancedAPIConfig = {
76
95
  loadBalancePolicy?: LoadBalancePolicy
77
96
  timeoutPolicy?: TimeoutPolicy
78
97
  pathRewritePolicy?: PathRewritePolicy
98
+ retryPolicy?: RetryPolicy
99
+ }
100
+
101
+ export type RetryPolicy = {
102
+ count?: string
103
+ perTryTimeout?: string
104
+ retriablesStatusCode?: number[]
105
+ httpRetryOn?: HttpRetryOn
106
+ grpcRetryOn?: GrpcRetryOn
107
+ }
108
+
109
+ export type HttpRetryOn = {
110
+ httpRetryOn?: HttpRetryOnEnum[]
111
+ }
112
+
113
+ export type GrpcRetryOn = {
114
+ grpcRetryOn?: GrpcRetryOnEnum[]
79
115
  }
80
116
 
81
117
  export type LoadBalancePolicy = {
@@ -130,15 +166,18 @@ export type DeleteAPIReq = {
130
166
  namespaceName?: string
131
167
  }
132
168
 
133
- export type GetAPIRes = {
169
+
170
+ type BaseGetAPIRes = {
134
171
  apiName?: string
135
- apiStatus?: SkoalaApiHostedV1alpha1Http.APIStatus
172
+ enabled?: boolean
136
173
  fqdn?: string
137
174
  matchRule?: MatchRule
138
- targetService?: TargetService
139
175
  advancedPolicy?: AdvancedAPIConfig
140
176
  }
141
177
 
178
+ export type GetAPIRes = BaseGetAPIRes
179
+ & OneOf<{ route: RouteAction; redirect: RedirectAction; directResponse: DirectResponse }>
180
+
142
181
  export type TargetService = {
143
182
  serviceList?: ServiceDetail[]
144
183
  }
@@ -162,7 +201,7 @@ export type ServiceDetail = {
162
201
 
163
202
  type BaseAPIConfig = {
164
203
  apiName?: string
165
- virtualhost?: Virtualhost
204
+ fqdn?: string
166
205
  matchRule?: MatchRule
167
206
  enabled?: boolean
168
207
  }
@@ -200,16 +239,15 @@ export type RouteAction = {
200
239
  routeService?: RouteService[]
201
240
  }
202
241
 
203
-
204
- type BaseRouteService = {
242
+ export type RouteService = {
205
243
  protocol?: SkoalaApiHostedV1alpha1Http.Protocol
244
+ enableGrpc?: boolean
245
+ serviceName?: string
246
+ namespaceName?: string
206
247
  port?: number
207
248
  weight?: number
208
249
  }
209
250
 
210
- export type RouteService = BaseRouteService
211
- & OneOf<{ kubernetesService: SkoalaApiHostedV1alpha1Gatewayservice.KubernetesService; registryService: SkoalaApiHostedV1alpha1Gatewayservice.RegistryService; externalService: SkoalaApiHostedV1alpha1Gatewayservice.ExternalService }>
212
-
213
251
  export type RedirectAction = {
214
252
  hostname?: string
215
253
  path?: string
@@ -228,11 +266,12 @@ export type APIListReq = {
228
266
  clusterName?: string
229
267
  gatewayName?: string
230
268
  namespaceName?: string
269
+ apiName?: string
231
270
  page?: number
232
271
  pageSize?: number
233
272
  }
234
273
 
235
274
  export type APIListRes = {
236
- api?: SkoalaApiHostedV1alpha1Http.APIInfo[]
275
+ items?: SkoalaApiHostedV1alpha1Http.APIInfo[]
237
276
  pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
238
277
  }
@@ -5,7 +5,17 @@
5
5
  */
6
6
 
7
7
  import * as SkoalaApiGeneralV1alpha1Common from "../../general/v1alpha1/common.pb"
8
- export type SearchLogReq = {
8
+
9
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
+ type OneOf<T> =
11
+ | { [k in keyof T]?: undefined }
12
+ | (
13
+ keyof T extends infer K ?
14
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
15
+ : never)
16
+ : never);
17
+
18
+ type BaseSearchLogReq = {
9
19
  workspaceId?: string
10
20
  gatewayName?: string
11
21
  clusterName?: string
@@ -13,9 +23,7 @@ export type SearchLogReq = {
13
23
  requestId?: string
14
24
  fqdn?: string
15
25
  requestPath?: string
16
- statusCode?: string[]
17
26
  requestMethod?: string[]
18
- message?: string
19
27
  startTime?: string
20
28
  endTime?: string
21
29
  sortOrder?: SortOrder[]
@@ -23,25 +31,43 @@ export type SearchLogReq = {
23
31
  pageSize?: number
24
32
  }
25
33
 
34
+ export type SearchLogReq = BaseSearchLogReq
35
+ & OneOf<{ httpCode: string; grpcCode: string }>
36
+
26
37
  export type SortOrder = {
27
38
  orderBy?: SkoalaApiGeneralV1alpha1Common.OrderBy
28
39
  sortBy?: string
29
40
  }
30
41
 
31
42
  export type SearchLogRes = {
32
- logResult?: LogResult[]
43
+ items?: LogResult[]
33
44
  pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
34
45
  }
35
46
 
36
47
  export type LogResult = {
37
48
  authority?: string
38
- userAgent?: string
39
- gatewayName?: string
40
49
  method?: string
41
- xForwardedFor?: string
42
- requestId?: string
43
- path?: string
50
+ requestStartTime?: string
51
+ duration?: string
44
52
  upstreamServiceTime?: string
45
- requestTime?: string
53
+ path?: string
54
+ requestId?: string
55
+ bytesReceived?: string
56
+ bytesSent?: string
57
+ downstreamDirectRemoteAddress?: string
58
+ hostname?: string
59
+ userAgent?: string
60
+ xForwardedFor?: string
61
+ responseFlags?: string
62
+ upstreamCluster?: string
63
+ upstreamHost?: string
64
+ upstreamLocalAddress?: string
65
+ upstreamRequestAttemptCount?: number
66
+ protocol?: string
67
+ upstreamProtocol?: string
68
+ status?: string
69
+ gatewayName?: string
70
+ gatewayNamespaceName?: string
71
+ responseEndTime?: string
46
72
  json?: string
47
73
  }
@@ -93,7 +93,7 @@ export type ListGatewayServiceReq = {
93
93
  }
94
94
 
95
95
  export type ListGatewayServiceRes = {
96
- serviceInfo?: ServiceInfo[]
96
+ items?: ServiceInfo[]
97
97
  pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
98
98
  }
99
99
 
@@ -39,6 +39,7 @@ export type APIInfo = {
39
39
  method?: HttpMethod[]
40
40
  requestPath?: string
41
41
  routeType?: RouteType
42
+ enabled?: boolean
42
43
  apiStatus?: APIStatus
43
44
  updatedAt?: string
44
45
  }
@@ -26,6 +26,7 @@ export type ListNacosReq = {
26
26
  workspaceId?: string
27
27
  clusterName?: string
28
28
  namespaceName?: string
29
+ nacosName?: string
29
30
  page?: number
30
31
  pageSize?: number
31
32
  }
@@ -42,11 +43,13 @@ export type Nacos = {
42
43
  namespaceName?: string
43
44
  type?: NacosConfigType
44
45
  serviceType?: SkoalaApiGeneralV1alpha1Service.ServiceType
45
- nodePort?: number
46
+ nodePort?: string
46
47
  status?: NacosStatus
47
48
  replicas?: number
48
49
  image?: string
49
50
  version?: string
51
+ nodeCount?: number
52
+ healthNodeCount?: number
50
53
  database?: NacosDatabase
51
54
  resources?: SkoalaApiGeneralV1alpha1Resource.ResourceRequirements
52
55
  condition?: NacosCondition[]
@@ -120,8 +123,7 @@ export type NacosConfig = {
120
123
  type?: NacosConfigType
121
124
  version?: string
122
125
  replicas?: number
123
- cpu?: string
124
- memory?: string
126
+ resources?: SkoalaApiGeneralV1alpha1Resource.ResourceRequirements
125
127
  serviceType?: SkoalaApiGeneralV1alpha1Service.ServiceType
126
128
  nodePort?: string
127
129
  databaseEnabled?: boolean
@@ -38,7 +38,7 @@ export type VirtualhostInfo = {
38
38
  }
39
39
 
40
40
  export type ListVirtualhostRes = {
41
- virtualhost?: VirtualhostInfo[]
41
+ items?: VirtualhostInfo[]
42
42
  pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
43
43
  }
44
44
 
@@ -38,6 +38,9 @@ export class Skoala {
38
38
  static ListClusterNamespace(req: SkoalaApiGeneralV1alpha1Skoala.ListNamespaceReq, initReq?: fm.InitReq): Promise<SkoalaApiGeneralV1alpha1Skoala.ListNamespaceRes> {
39
39
  return fm.fetchReq<SkoalaApiGeneralV1alpha1Skoala.ListNamespaceReq, SkoalaApiGeneralV1alpha1Skoala.ListNamespaceRes>(`/apis/skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName"])}`, {...initReq, method: "GET"})
40
40
  }
41
+ static ListClusterNamespaceService(req: SkoalaApiGeneralV1alpha1Skoala.ListServiceReq, initReq?: fm.InitReq): Promise<SkoalaApiGeneralV1alpha1Skoala.ListServiceRes> {
42
+ return fm.fetchReq<SkoalaApiGeneralV1alpha1Skoala.ListServiceReq, SkoalaApiGeneralV1alpha1Skoala.ListServiceRes>(`/apis/skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/services?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName"])}`, {...initReq, method: "GET"})
43
+ }
41
44
  static ListWorkspace(req: SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceReq, initReq?: fm.InitReq): Promise<SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceRes> {
42
45
  return fm.fetchReq<SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceReq, SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceRes>(`/apis/skoala.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
43
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/skoala",
3
- "version": "0.5.1-6",
3
+ "version": "0.5.1-60",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {