@daocloud-proto/skoala 0.4.1-148 → 0.4.1-150

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.
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import * as SkoalaApiGeneralV1alpha1Common from "../../general/v1alpha1/common.pb"
8
+ import * as SkoalaApiHostedV1alpha1Gatewayservice from "./gatewayservice.pb"
8
9
  import * as SkoalaApiHostedV1alpha1Http from "./http.pb"
9
10
 
10
11
  type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
@@ -33,20 +34,6 @@ export enum RedirectResponseCode {
33
34
  PERMANENT_REDIRECT = "PERMANENT_REDIRECT",
34
35
  }
35
36
 
36
- export enum RouteType {
37
- CLUSTRE_SERVER = "CLUSTRE_SERVER",
38
- DIRECT = "DIRECT",
39
- REDIRECT = "REDIRECT",
40
- EXTERNAL = "EXTERNAL",
41
- REGISTRY = "REGISTRY",
42
- UNKNOW = "UNKNOW",
43
- }
44
-
45
- export enum APIStatus {
46
- UP = "UP",
47
- DOWN = "DOWN",
48
- }
49
-
50
37
  export type CreateAPIReq = {
51
38
  workspaceId?: string
52
39
  gatewayName?: string
@@ -91,7 +78,7 @@ export type DeleteAPIReq = {
91
78
 
92
79
  export type GetAPIRes = {
93
80
  apiName?: string
94
- apiStatus?: APIStatus
81
+ apiStatus?: SkoalaApiHostedV1alpha1Http.APIStatus
95
82
  fqdn?: string
96
83
  matchRule?: MatchRule
97
84
  targetService?: TargetService
@@ -112,7 +99,7 @@ export type ServiceDetail = {
112
99
  weight?: string
113
100
  nacosNamespaceId?: string
114
101
  groupName?: string
115
- routeType?: RouteType
102
+ routeType?: SkoalaApiHostedV1alpha1Http.RouteType
116
103
  path?: string
117
104
  statusCode?: number
118
105
  }
@@ -166,52 +153,7 @@ type BaseRouteService = {
166
153
  }
167
154
 
168
155
  export type RouteService = BaseRouteService
169
- & OneOf<{ kubernetesService: KubernetesService; registryService: RegistryService; externalService: ExternalService }>
170
-
171
- export type KubernetesService = {
172
- clusterId?: string
173
- clusterName?: string
174
- namespaceName?: string
175
- serviceName?: string
176
- address?: string
177
- }
178
-
179
- export type ExternalService = {
180
- serviceName?: string
181
- address?: string
182
- }
183
-
184
-
185
- type BaseRegistryService = {
186
- registryId?: string
187
- }
188
-
189
- export type RegistryService = BaseRegistryService
190
- & OneOf<{ eurekaService: EurekaService; nacosService: NacosService; zookeeperService: ZookeeperService; kubernetesService: KubernetesService }>
191
-
192
- export type EurekaService = {
193
- address?: string
194
- serviceName?: string
195
- }
196
-
197
- export type NacosService = {
198
- address?: string
199
- serviceName?: string
200
- namespaceId?: string
201
- groupName?: string
202
- }
203
-
204
- export type ZookeeperService = {
205
- address?: string
206
- serviceName?: string
207
- }
208
-
209
- export type MeshService = {
210
- instanceId?: string
211
- }
212
-
213
- export type ApplicationService = {
214
- }
156
+ & OneOf<{ kubernetesService: SkoalaApiHostedV1alpha1Gatewayservice.KubernetesService; registryService: SkoalaApiHostedV1alpha1Gatewayservice.RegistryService; externalService: SkoalaApiHostedV1alpha1Gatewayservice.ExternalService }>
215
157
 
216
158
  export type RedirectAction = {
217
159
  hostname?: string
@@ -236,16 +178,6 @@ export type APIListReq = {
236
178
  }
237
179
 
238
180
  export type APIListRes = {
239
- api?: APIInfo[]
181
+ api?: SkoalaApiHostedV1alpha1Http.APIInfo[]
240
182
  pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
241
- }
242
-
243
- export type APIInfo = {
244
- apiName?: string
245
- fqdn?: string
246
- method?: SkoalaApiHostedV1alpha1Http.HttpMethod[]
247
- requestPath?: string
248
- routeType?: RouteType
249
- apiStatus?: APIStatus
250
- updatedAt?: string
251
183
  }
@@ -0,0 +1,170 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as SkoalaApiGeneralV1alpha1Common from "../../general/v1alpha1/common.pb"
8
+ import * as SkoalaApiHostedV1alpha1Http from "./http.pb"
9
+
10
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
11
+ type OneOf<T> =
12
+ | { [k in keyof T]?: undefined }
13
+ | (
14
+ keyof T extends infer K ?
15
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
16
+ : never)
17
+ : never);
18
+
19
+ export enum ServiceSource {
20
+ SOURCE_CLUSTER = "SOURCE_CLUSTER",
21
+ SOURCE_MESH = "SOURCE_MESH",
22
+ SOURCE_REGISTRY = "SOURCE_REGISTRY",
23
+ SOURCE_EXTERNAL = "SOURCE_EXTERNAL",
24
+ }
25
+
26
+ export enum SesameServiceType {
27
+ EXTERNAL_SERVICE = "EXTERNAL_SERVICE",
28
+ MANAGE_SERVICE = "MANAGE_SERVICE",
29
+ }
30
+
31
+ export type CreateExternalServiceReq = {
32
+ workspaceId?: string
33
+ gatewayName?: string
34
+ clusterName?: string
35
+ namespaceName?: string
36
+ externalServiceConf?: ExternalServiceConf
37
+ }
38
+
39
+ export type CreateExternalServiceRes = {
40
+ serviceName?: string
41
+ namespaceName?: string
42
+ }
43
+
44
+ export type GetGatewayServiceReq = {
45
+ workspaceId?: string
46
+ clusterName?: string
47
+ gatewayName?: string
48
+ namespaceName?: string
49
+ serviceName?: string
50
+ }
51
+
52
+ export type UpdateGatewayServiceReq = {
53
+ workspaceId?: string
54
+ clusterName?: string
55
+ gatewayName?: string
56
+ namespaceName?: string
57
+ serviceName?: string
58
+ externalServiceConf?: ExternalServiceConf
59
+ }
60
+
61
+ export type UpdateGatewayServiceRes = {
62
+ serviceName?: string
63
+ namespaceName?: string
64
+ }
65
+
66
+ export type DeleteGatewayServiceReq = {
67
+ workspaceId?: string
68
+ clusterName?: string
69
+ gatewayName?: string
70
+ namespaceName?: string
71
+ serviceName?: string
72
+ }
73
+
74
+ export type DeleteGatewayServiceRes = {
75
+ serviceName?: string
76
+ namespaceName?: string
77
+ }
78
+
79
+ export type GetGatewayServiceRes = {
80
+ serviceInfo?: ServiceInfo
81
+ api?: SkoalaApiHostedV1alpha1Http.APIInfo[]
82
+ }
83
+
84
+ export type ListGatewayServiceReq = {
85
+ workspaceId?: string
86
+ clusterName?: string
87
+ gatewayName?: string
88
+ namespaceName?: string
89
+ serviceName?: string
90
+ serviceType?: SesameServiceType
91
+ page?: number
92
+ pageSize?: number
93
+ }
94
+
95
+ export type ListGatewayServiceRes = {
96
+ serviceInfo?: ServiceInfo[]
97
+ pagination?: SkoalaApiGeneralV1alpha1Common.Pagination
98
+ }
99
+
100
+ export type ServiceInfo = {
101
+ serviceName?: string
102
+ address?: Address
103
+ apiCount?: number
104
+ sourceInfo?: ServiceSourceInfo
105
+ createAt?: string
106
+ serviceType?: SesameServiceType
107
+ sesameServiceName?: string
108
+ sesameServiceNamespace?: string
109
+ }
110
+
111
+ export type ServiceSourceInfo = {
112
+ serviceSource?: ServiceSource
113
+ clusterName?: string
114
+ k8SNamespaceName?: string
115
+ registrationId?: string
116
+ registrationType?: string
117
+ nacosNamespaceId?: string
118
+ groupName?: string
119
+ }
120
+
121
+
122
+ type BaseExternalServiceConf = {
123
+ }
124
+
125
+ export type ExternalServiceConf = BaseExternalServiceConf
126
+ & OneOf<{ kubernetesService: KubernetesService; registryService: RegistryService; externalService: ExternalService }>
127
+
128
+ export type KubernetesService = {
129
+ clusterId?: string
130
+ clusterName?: string
131
+ namespaceName?: string
132
+ serviceName?: string
133
+ address?: Address
134
+ }
135
+
136
+
137
+ type BaseRegistryService = {
138
+ registrationId?: string
139
+ }
140
+
141
+ export type RegistryService = BaseRegistryService
142
+ & OneOf<{ eurekaService: EurekaService; nacosService: NacosService; zookeeperService: ZookeeperService; kubernetesService: KubernetesService }>
143
+
144
+ export type EurekaService = {
145
+ address?: Address
146
+ serviceName?: string
147
+ }
148
+
149
+ export type NacosService = {
150
+ address?: Address
151
+ serviceName?: string
152
+ namespaceId?: string
153
+ groupName?: string
154
+ }
155
+
156
+ export type ZookeeperService = {
157
+ address?: Address
158
+ serviceName?: string
159
+ }
160
+
161
+ export type ExternalService = {
162
+ serviceName?: string
163
+ address?: Address
164
+ }
165
+
166
+ export type Address = {
167
+ protocol?: SkoalaApiHostedV1alpha1Http.Protocol
168
+ hostname?: string
169
+ port?: number
170
+ }
@@ -17,4 +17,28 @@ export enum HttpMethod {
17
17
  export enum Protocol {
18
18
  HTTP = "HTTP",
19
19
  HTTPS = "HTTPS",
20
+ }
21
+
22
+ export enum RouteType {
23
+ CLUSTRE_SERVER = "CLUSTRE_SERVER",
24
+ DIRECT = "DIRECT",
25
+ REDIRECT = "REDIRECT",
26
+ EXTERNAL = "EXTERNAL",
27
+ REGISTRY = "REGISTRY",
28
+ UNKNOW = "UNKNOW",
29
+ }
30
+
31
+ export enum APIStatus {
32
+ UP = "UP",
33
+ DOWN = "DOWN",
34
+ }
35
+
36
+ export type APIInfo = {
37
+ apiName?: string
38
+ fqdn?: string
39
+ method?: HttpMethod[]
40
+ requestPath?: string
41
+ routeType?: RouteType
42
+ apiStatus?: APIStatus
43
+ updatedAt?: string
20
44
  }
@@ -11,6 +11,7 @@ import * as SkoalaApiGeneralV1alpha1Version from "../../general/v1alpha1/version
11
11
  import * as SkoalaApiHostedV1alpha1Api from "../../hosted/v1alpha1/api.pb"
12
12
  import * as SkoalaApiHostedV1alpha1Apilog from "../../hosted/v1alpha1/apilog.pb"
13
13
  import * as SkoalaApiHostedV1alpha1Gateway from "../../hosted/v1alpha1/gateway.pb"
14
+ import * as SkoalaApiHostedV1alpha1Gatewayservice from "../../hosted/v1alpha1/gatewayservice.pb"
14
15
  import * as SkoalaApiHostedV1alpha1Nacos from "../../hosted/v1alpha1/nacos.pb"
15
16
  import * as SkoalaApiHostedV1alpha1Sentinel from "../../hosted/v1alpha1/sentinel.pb"
16
17
  import * as SkoalaApiHostedV1alpha1Virtualhost from "../../hosted/v1alpha1/virtualhost.pb"
@@ -166,6 +167,21 @@ export class Gateway {
166
167
  static QueryGatewayPodMetric(req: SkoalaApiHostedV1alpha1Gateway.QueryGatewayPodMetricReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gateway.QueryGatewayPodMetricRes> {
167
168
  return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.QueryGatewayPodMetricReq, SkoalaApiHostedV1alpha1Gateway.QueryGatewayPodMetricRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterId"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/metric/pods/${req["podName"]}/query?${fm.renderURLSearchParams(req, ["workspaceId", "clusterId", "namespaceName", "gatewayName", "podName"])}`, {...initReq, method: "GET"})
168
169
  }
170
+ static CreateService(req: SkoalaApiHostedV1alpha1Gatewayservice.CreateExternalServiceReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gatewayservice.CreateExternalServiceRes> {
171
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gatewayservice.CreateExternalServiceReq, SkoalaApiHostedV1alpha1Gatewayservice.CreateExternalServiceRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/services`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
172
+ }
173
+ static ListService(req: SkoalaApiHostedV1alpha1Gatewayservice.ListGatewayServiceReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gatewayservice.ListGatewayServiceRes> {
174
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gatewayservice.ListGatewayServiceReq, SkoalaApiHostedV1alpha1Gatewayservice.ListGatewayServiceRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/services?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "gatewayName"])}`, {...initReq, method: "GET"})
175
+ }
176
+ static GetService(req: SkoalaApiHostedV1alpha1Gatewayservice.GetGatewayServiceReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gatewayservice.GetGatewayServiceRes> {
177
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gatewayservice.GetGatewayServiceReq, SkoalaApiHostedV1alpha1Gatewayservice.GetGatewayServiceRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/services/${req["serviceName"]}?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "gatewayName", "serviceName"])}`, {...initReq, method: "GET"})
178
+ }
179
+ static UpdateService(req: SkoalaApiHostedV1alpha1Gatewayservice.UpdateGatewayServiceReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gatewayservice.UpdateGatewayServiceRes> {
180
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gatewayservice.UpdateGatewayServiceReq, SkoalaApiHostedV1alpha1Gatewayservice.UpdateGatewayServiceRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/services/${req["serviceName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
181
+ }
182
+ static DeleteService(req: SkoalaApiHostedV1alpha1Gatewayservice.DeleteGatewayServiceReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gatewayservice.DeleteGatewayServiceRes> {
183
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gatewayservice.DeleteGatewayServiceReq, SkoalaApiHostedV1alpha1Gatewayservice.DeleteGatewayServiceRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/services/${req["serviceName"]}`, {...initReq, method: "DELETE"})
184
+ }
169
185
  static CreateVirtualhost(req: SkoalaApiHostedV1alpha1Virtualhost.CreateVirtualhostReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Virtualhost.CreateVirtualhostRes> {
170
186
  return fm.fetchReq<SkoalaApiHostedV1alpha1Virtualhost.CreateVirtualhostReq, SkoalaApiHostedV1alpha1Virtualhost.CreateVirtualhostRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/virtualhosts`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
171
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/skoala",
3
- "version": "0.4.1-148",
3
+ "version": "0.4.1-150",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {