@daocloud-proto/mcamel-mongodb 0.0.1-42

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.
@@ -0,0 +1,78 @@
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 GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
8
+ import * as CommonCommon from "./common.pb"
9
+ import * as fm from "./fetch.pb"
10
+
11
+ export enum CreateCloudShellRequestType {
12
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
13
+ bash = "bash",
14
+ exec = "exec",
15
+ logs = "logs",
16
+ upload = "upload",
17
+ download = "download",
18
+ }
19
+
20
+ export type ObjectMeta = {
21
+ name?: string
22
+ namespace?: string
23
+ uid?: string
24
+ resourceVersion?: string
25
+ creationTimestamp?: string
26
+ deletionTimestamp?: string
27
+ labels?: {[key: string]: string}
28
+ annotations?: {[key: string]: string}
29
+ ownerReferences?: CommonCommon.OwnerReference[]
30
+ cluster?: string
31
+ workspaceAlias?: string
32
+ }
33
+
34
+ export type CloudShell = {
35
+ metadata?: ObjectMeta
36
+ spec?: CloudShellSpec
37
+ status?: CloudShellStatus
38
+ }
39
+
40
+ export type CloudShellSpec = {
41
+ configMapName?: string
42
+ once?: boolean
43
+ commandAction?: string
44
+ ttl?: number
45
+ cleanup?: boolean
46
+ }
47
+
48
+ export type CloudShellStatus = {
49
+ phase?: string
50
+ accessUrl?: string
51
+ }
52
+
53
+ export type CreateCloudShellRequest = {
54
+ type?: CreateCloudShellRequestType
55
+ cluster?: string
56
+ namespace?: string
57
+ podName?: string
58
+ filePath?: string
59
+ container?: string
60
+ logCount?: number
61
+ data?: CloudShell
62
+ }
63
+
64
+ export type GetorDeleteCloudShellRequest = {
65
+ name?: string
66
+ }
67
+
68
+ export class CloudShellService {
69
+ static CreateCloudShell(req: CreateCloudShellRequest, initReq?: fm.InitReq): Promise<CloudShell> {
70
+ return fm.fetchReq<CreateCloudShellRequest, CloudShell>(`/apis/mcamel.io/mongodb/v1alpha1/cloudshells`, {...initReq, method: "POST", body: JSON.stringify(req)})
71
+ }
72
+ static GetCloudShell(req: GetorDeleteCloudShellRequest, initReq?: fm.InitReq): Promise<CloudShell> {
73
+ return fm.fetchReq<GetorDeleteCloudShellRequest, CloudShell>(`/apis/mcamel.io/mongodb/v1alpha1/cloudshells/${req["name"]}?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
74
+ }
75
+ static DeleteCloudShell(req: GetorDeleteCloudShellRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
76
+ return fm.fetchReq<GetorDeleteCloudShellRequest, GoogleProtobufEmpty.Empty>(`/apis/mcamel.io/mongodb/v1alpha1/cloudshells/${req["name"]}`, {...initReq, method: "DELETE"})
77
+ }
78
+ }
package/cluster.pb.ts ADDED
@@ -0,0 +1,251 @@
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 CommonCommon from "./common.pb"
8
+ import * as fm from "./fetch.pb"
9
+
10
+ export enum EventType {
11
+ EVENT_TYPE_UNSPECIFIED = "EVENT_TYPE_UNSPECIFIED",
12
+ Normal = "Normal",
13
+ Warning = "Warning",
14
+ }
15
+
16
+ export enum GetAllEventListReqSortDir {
17
+ ASC = "ASC",
18
+ DESC = "DESC",
19
+ }
20
+
21
+ export enum GetEventListReqKind {
22
+ KIND_UNSPECIFIED = "KIND_UNSPECIFIED",
23
+ Pod = "Pod",
24
+ }
25
+
26
+ export enum GetWorkspaceListReqSortDir {
27
+ ASC = "ASC",
28
+ DESC = "DESC",
29
+ }
30
+
31
+ export enum GetInsightAgentStatusRespInsightAgentStatus {
32
+ NotInstall = "NotInstall",
33
+ Install = "Install",
34
+ }
35
+
36
+ export type GetAllEventKindsListResp = {
37
+ data?: string[]
38
+ }
39
+
40
+ export type GetAllEventKindsListReq = {
41
+ cluster?: string
42
+ }
43
+
44
+ export type GetAllEventListReq = {
45
+ page?: number
46
+ pageSize?: number
47
+ sortDir?: GetAllEventListReqSortDir
48
+ sortBy?: string
49
+ searchKey?: string
50
+ cluster?: string
51
+ namespace?: string
52
+ name?: string
53
+ eventType?: EventType
54
+ kindName?: string
55
+ }
56
+
57
+ export type GetAllEventListRespItemsSource = {
58
+ component?: string
59
+ }
60
+
61
+ export type GetAllEventListRespItemsMetadata = {
62
+ uid?: string
63
+ name?: string
64
+ namespace?: string
65
+ annotations?: {[key: string]: string}
66
+ resourceVersion?: string
67
+ creationTimestamp?: string
68
+ }
69
+
70
+ export type GetAllEventListRespItemsInvolvedObject = {
71
+ uid?: string
72
+ kind?: string
73
+ name?: string
74
+ namespace?: string
75
+ apiVersion?: string
76
+ resourceVersion?: string
77
+ }
78
+
79
+ export type GetAllEventListRespItems = {
80
+ kind?: string
81
+ type?: string
82
+ count?: number
83
+ reason?: string
84
+ source?: GetAllEventListRespItemsSource
85
+ message?: string
86
+ metadata?: GetAllEventListRespItemsMetadata
87
+ apiVersion?: string
88
+ lastTimestamp?: string
89
+ firstTimestamp?: string
90
+ involvedObject?: GetAllEventListRespItemsInvolvedObject
91
+ reportingInstance?: string
92
+ reportingComponent?: string
93
+ }
94
+
95
+ export type GetAllEventListResp = {
96
+ items?: GetAllEventListRespItems[]
97
+ pagination?: CommonCommon.Pagination
98
+ }
99
+
100
+ export type GetClusterNodeLabelListReq = {
101
+ cluster?: string
102
+ }
103
+
104
+ export type GetClusterNodeLabelListRespLabel = {
105
+ key?: string
106
+ value?: string[]
107
+ }
108
+
109
+ export type GetClusterNodeLabelListResp = {
110
+ items?: GetClusterNodeLabelListRespLabel[]
111
+ pagination?: CommonCommon.Pagination
112
+ }
113
+
114
+ export type GetClusterNodePortListReq = {
115
+ cluster?: string
116
+ }
117
+
118
+ export type GetClusterNodePortListResp = {
119
+ items?: string[]
120
+ pagination?: CommonCommon.Pagination
121
+ }
122
+
123
+ export type EventSource = {
124
+ component?: string
125
+ host?: string
126
+ }
127
+
128
+ export type GetMetallbIPAddressPoolsListReq = {
129
+ cluster?: string
130
+ }
131
+
132
+ export type GetMetallbIPAddressPoolsListRespItem = {
133
+ name?: string
134
+ addresses?: string[]
135
+ autoAssign?: boolean
136
+ avoidBuggyIPs?: boolean
137
+ }
138
+
139
+ export type GetMetallbIPAddressPoolsListResp = {
140
+ items?: GetMetallbIPAddressPoolsListRespItem[]
141
+ isSupportLb?: boolean
142
+ externalTrafficPolicy?: CommonCommon.ExternalTrafficPolicy[]
143
+ lbTyp?: CommonCommon.LBTyp[]
144
+ }
145
+
146
+ export type GetEventListReq = {
147
+ cluster?: string
148
+ namespace?: string
149
+ kind?: GetEventListReqKind
150
+ kindName?: string
151
+ page?: number
152
+ pageSize?: number
153
+ type?: EventType[]
154
+ }
155
+
156
+ export type ObjectReference = {
157
+ kind?: string
158
+ name?: string
159
+ }
160
+
161
+ export type GetEventListRespItem = {
162
+ involvedObject?: ObjectReference
163
+ reason?: string
164
+ message?: string
165
+ source?: EventSource
166
+ lastTimestamp?: string
167
+ type?: EventType
168
+ }
169
+
170
+ export type GetEventListResp = {
171
+ items?: GetEventListRespItem[]
172
+ pagination?: CommonCommon.Pagination
173
+ }
174
+
175
+ export type GetWorkspaceListReq = {
176
+ page?: number
177
+ pageSize?: number
178
+ sortDir?: GetWorkspaceListReqSortDir
179
+ sortBy?: string
180
+ searchKey?: string
181
+ }
182
+
183
+ export type GetWorkspaceListRespItem = {
184
+ workspaceId?: number
185
+ alias?: string
186
+ }
187
+
188
+ export type GetWorkspaceListResp = {
189
+ items?: GetWorkspaceListRespItem[]
190
+ pagination?: CommonCommon.Pagination
191
+ }
192
+
193
+ export type GetClusterListReq = {
194
+ workspaceId?: number
195
+ }
196
+
197
+ export type GetClusterListResp = {
198
+ items?: string[]
199
+ pagination?: CommonCommon.Pagination
200
+ }
201
+
202
+ export type GetClusterNamespaceListReq = {
203
+ workspaceId?: number
204
+ cluster?: string
205
+ }
206
+
207
+ export type GetClusterNamespaceListResp = {
208
+ items?: string[]
209
+ pagination?: CommonCommon.Pagination
210
+ }
211
+
212
+ export type GetInsightAgentStatusReq = {
213
+ cluster?: string
214
+ }
215
+
216
+ export type GetInsightAgentStatusResp = {
217
+ status?: GetInsightAgentStatusRespInsightAgentStatus
218
+ }
219
+
220
+ export class Cluster {
221
+ static GetClusterList(req: GetClusterListReq, initReq?: fm.InitReq): Promise<GetClusterListResp> {
222
+ return fm.fetchReq<GetClusterListReq, GetClusterListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["workspaceId"]}/clusters?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
223
+ }
224
+ static GetClusterNamespaceList(req: GetClusterNamespaceListReq, initReq?: fm.InitReq): Promise<GetClusterNamespaceListResp> {
225
+ return fm.fetchReq<GetClusterNamespaceListReq, GetClusterNamespaceListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["workspaceId"]}/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["workspaceId", "cluster"])}`, {...initReq, method: "GET"})
226
+ }
227
+ static GetClusterNodePortList(req: GetClusterNodePortListReq, initReq?: fm.InitReq): Promise<GetClusterNodePortListResp> {
228
+ return fm.fetchReq<GetClusterNodePortListReq, GetClusterNodePortListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/nodeports?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
229
+ }
230
+ static GetClusterNodeLabelList(req: GetClusterNodeLabelListReq, initReq?: fm.InitReq): Promise<GetClusterNodeLabelListResp> {
231
+ return fm.fetchReq<GetClusterNodeLabelListReq, GetClusterNodeLabelListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/nodelabels?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
232
+ }
233
+ static GetWorkspaceList(req: GetWorkspaceListReq, initReq?: fm.InitReq): Promise<GetWorkspaceListResp> {
234
+ return fm.fetchReq<GetWorkspaceListReq, GetWorkspaceListResp>(`/apis/mcamel.io/mongodb/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
235
+ }
236
+ static GetInsightAgentStatus(req: GetInsightAgentStatusReq, initReq?: fm.InitReq): Promise<GetInsightAgentStatusResp> {
237
+ return fm.fetchReq<GetInsightAgentStatusReq, GetInsightAgentStatusResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/insight/status?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
238
+ }
239
+ static GetEventList(req: GetEventListReq, initReq?: fm.InitReq): Promise<GetEventListResp> {
240
+ return fm.fetchReq<GetEventListReq, GetEventListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/${req["namespace"]}/events?${fm.renderURLSearchParams(req, ["cluster", "namespace"])}`, {...initReq, method: "GET"})
241
+ }
242
+ static GetAllEventList(req: GetAllEventListReq, initReq?: fm.InitReq): Promise<GetAllEventListResp> {
243
+ return fm.fetchReq<GetAllEventListReq, GetAllEventListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/${req["namespace"]}/${req["name"]}/all-events?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
244
+ }
245
+ static GetAllEventKindsList(req: GetAllEventKindsListReq, initReq?: fm.InitReq): Promise<GetAllEventKindsListResp> {
246
+ return fm.fetchReq<GetAllEventKindsListReq, GetAllEventKindsListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/all-events-kinds?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
247
+ }
248
+ static GetMetallbIPAddressPoolsList(req: GetMetallbIPAddressPoolsListReq, initReq?: fm.InitReq): Promise<GetMetallbIPAddressPoolsListResp> {
249
+ return fm.fetchReq<GetMetallbIPAddressPoolsListReq, GetMetallbIPAddressPoolsListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/lbaddress/pools?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
250
+ }
251
+ }
package/common.pb.ts ADDED
@@ -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
+ export enum ExternalTrafficPolicy {
8
+ Cluster = "Cluster",
9
+ Local = "Local",
10
+ }
11
+
12
+ export enum LBTyp {
13
+ MetalLB = "MetalLB",
14
+ Others = "Others",
15
+ }
16
+
17
+ export enum ServiceType {
18
+ ClusterIP = "ClusterIP",
19
+ NodePort = "NodePort",
20
+ LoadBalancer = "LoadBalancer",
21
+ }
22
+
23
+ export enum PageInfoReqSortDir {
24
+ ASC = "ASC",
25
+ DESC = "DESC",
26
+ }
27
+
28
+ export enum PodCommonPodPhase {
29
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
30
+ Unknown = "Unknown",
31
+ Pending = "Pending",
32
+ Running = "Running",
33
+ Succeeded = "Succeeded",
34
+ Failed = "Failed",
35
+ }
36
+
37
+ export enum PodCommonConditionStatus {
38
+ PodConditionStatusUnknown = "PodConditionStatusUnknown",
39
+ PodConditionStatusTrue = "PodConditionStatusTrue",
40
+ PodConditionStatusFalse = "PodConditionStatusFalse",
41
+ }
42
+
43
+ export type Affinity = {
44
+ nodeAffinity?: NodeAffinity
45
+ podAffinity?: PodAffinity
46
+ podAntiAffinity?: PodAntiAffinity
47
+ }
48
+
49
+ export type PodAntiAffinity = {
50
+ requiredDuringSchedulingIgnoredDuringExecution?: PodAffinityTerm[]
51
+ preferredDuringSchedulingIgnoredDuringExecution?: WeightedPodAffinityTerm[]
52
+ }
53
+
54
+ export type NodeAffinity = {
55
+ requiredDuringSchedulingIgnoredDuringExecution?: NodeSelector
56
+ preferredDuringSchedulingIgnoredDuringExecution?: PreferredSchedulingTerm[]
57
+ }
58
+
59
+ export type NodeSelector = {
60
+ nodeSelectorTerms?: NodeSelectorTerm[]
61
+ }
62
+
63
+ export type NodeSelectorTerm = {
64
+ matchExpressions?: NodeSelectorRequirement[]
65
+ matchFields?: NodeSelectorRequirement[]
66
+ }
67
+
68
+ export type NodeSelectorRequirement = {
69
+ key?: string
70
+ values?: string[]
71
+ operator?: string
72
+ }
73
+
74
+ export type PreferredSchedulingTerm = {
75
+ weight?: number
76
+ preference?: NodeSelectorTerm
77
+ }
78
+
79
+ export type PodAffinity = {
80
+ requiredDuringSchedulingIgnoredDuringExecution?: PodAffinityTerm[]
81
+ preferredDuringSchedulingIgnoredDuringExecution?: WeightedPodAffinityTerm[]
82
+ }
83
+
84
+ export type WeightedPodAffinityTerm = {
85
+ weight?: number
86
+ podAffinityTerm?: PodAffinityTerm
87
+ }
88
+
89
+ export type PodAffinityTerm = {
90
+ labelSelector?: LabelSelector
91
+ namespaces?: string[]
92
+ topologyKey?: string
93
+ namespaceSelector?: LabelSelector
94
+ }
95
+
96
+ export type LabelSelector = {
97
+ matchLabels?: {[key: string]: string}
98
+ matchExpressions?: LabelSelectorRequirement[]
99
+ }
100
+
101
+ export type LabelSelectorRequirement = {
102
+ key?: string
103
+ values?: string[]
104
+ operator?: string
105
+ }
106
+
107
+ export type Toleration = {
108
+ key?: string
109
+ operator?: string
110
+ value?: string
111
+ effect?: string
112
+ tolerationSeconds?: string
113
+ }
114
+
115
+ export type Pagination = {
116
+ total?: number
117
+ page?: number
118
+ pageSize?: number
119
+ pages?: number
120
+ }
121
+
122
+ export type PageInfoReq = {
123
+ page?: number
124
+ pageSize?: number
125
+ sortDir?: PageInfoReqSortDir
126
+ sortBy?: string
127
+ }
128
+
129
+ export type PodCommonCondition = {
130
+ lastTransitionTime?: string
131
+ lastUpdateTime?: string
132
+ message?: string
133
+ reason?: string
134
+ status?: PodCommonConditionStatus
135
+ type?: string
136
+ }
137
+
138
+ export type PodCommon = {
139
+ name?: string
140
+ phase?: PodCommonPodPhase
141
+ ip?: string
142
+ restartCount?: number
143
+ createTimestamp?: string
144
+ cpuUsage?: number
145
+ cpuLimit?: number
146
+ memoryUsage?: number
147
+ memoryLimit?: number
148
+ pvUsedInGb?: number
149
+ pvAllocatedInGb?: number
150
+ conditions?: PodCommonCondition[]
151
+ containersName?: string[]
152
+ ownerReference?: OwnerReference[]
153
+ initContainersName?: string[]
154
+ }
155
+
156
+ export type OwnerReference = {
157
+ uid?: string
158
+ controller?: boolean
159
+ name?: string
160
+ kind?: string
161
+ }
162
+
163
+ export type CommonItemStatus = {
164
+ serviceAddresses?: string[]
165
+ webManagerAddress?: string
166
+ webLogAddress?: string
167
+ isHwameistorSc?: boolean
168
+ avgPvAllocatedInGb?: number
169
+ avgPvUsedInGb?: number
170
+ }
package/fetch.pb.ts ADDED
@@ -0,0 +1,232 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export interface InitReq extends RequestInit {
8
+ pathPrefix?: string
9
+ }
10
+
11
+ export function fetchReq<I, O>(path: string, init?: InitReq): Promise<O> {
12
+ const {pathPrefix, ...req} = init || {}
13
+
14
+ const url = pathPrefix ? `${pathPrefix}${path}` : path
15
+
16
+ return fetch(url, req).then(r => r.json().then((body: O) => {
17
+ if (!r.ok) { throw body; }
18
+ return body;
19
+ })) as Promise<O>
20
+ }
21
+
22
+ // NotifyStreamEntityArrival is a callback that will be called on streaming entity arrival
23
+ export type NotifyStreamEntityArrival<T> = (resp: T) => void
24
+
25
+ /**
26
+ * fetchStreamingRequest is able to handle grpc-gateway server side streaming call
27
+ * it takes NotifyStreamEntityArrival that lets users respond to entity arrival during the call
28
+ * all entities will be returned as an array after the call finishes.
29
+ **/
30
+ export async function fetchStreamingRequest<S, R>(path: string, callback?: NotifyStreamEntityArrival<R>, init?: InitReq) {
31
+ const {pathPrefix, ...req} = init || {}
32
+ const url = pathPrefix ?`${pathPrefix}${path}` : path
33
+ const result = await fetch(url, req)
34
+ // needs to use the .ok to check the status of HTTP status code
35
+ // http other than 200 will not throw an error, instead the .ok will become false.
36
+ // see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#
37
+ if (!result.ok) {
38
+ const resp = await result.json()
39
+ const errMsg = resp.error && resp.error.message ? resp.error.message : ""
40
+ throw new Error(errMsg)
41
+ }
42
+
43
+ if (!result.body) {
44
+ throw new Error("response doesnt have a body")
45
+ }
46
+
47
+ await result.body
48
+ .pipeThrough(new TextDecoderStream())
49
+ .pipeThrough<R>(getNewLineDelimitedJSONDecodingStream<R>())
50
+ .pipeTo(getNotifyEntityArrivalSink((e: R) => {
51
+ if (callback) {
52
+ callback(e)
53
+ }
54
+ }))
55
+
56
+ // wait for the streaming to finish and return the success respond
57
+ return
58
+ }
59
+
60
+ /**
61
+ * JSONStringStreamController represents the transform controller that's able to transform the incoming
62
+ * new line delimited json content stream into entities and able to push the entity to the down stream
63
+ */
64
+ interface JSONStringStreamController<T> extends TransformStreamDefaultController {
65
+ buf?: string
66
+ pos?: number
67
+ enqueue: (s: T) => void
68
+ }
69
+
70
+ /**
71
+ * getNewLineDelimitedJSONDecodingStream returns a TransformStream that's able to handle new line delimited json stream content into parsed entities
72
+ */
73
+ function getNewLineDelimitedJSONDecodingStream<T>(): TransformStream<string, T> {
74
+ return new TransformStream({
75
+ start(controller: JSONStringStreamController<T>) {
76
+ controller.buf = ''
77
+ controller.pos = 0
78
+ },
79
+
80
+ transform(chunk: string, controller: JSONStringStreamController<T>) {
81
+ if (controller.buf === undefined) {
82
+ controller.buf = ''
83
+ }
84
+ if (controller.pos === undefined) {
85
+ controller.pos = 0
86
+ }
87
+ controller.buf += chunk
88
+ while (controller.pos < controller.buf.length) {
89
+ if (controller.buf[controller.pos] === '\n') {
90
+ const line = controller.buf.substring(0, controller.pos)
91
+ const response = JSON.parse(line)
92
+ controller.enqueue(response.result)
93
+ controller.buf = controller.buf.substring(controller.pos + 1)
94
+ controller.pos = 0
95
+ } else {
96
+ ++controller.pos
97
+ }
98
+ }
99
+ }
100
+ })
101
+
102
+ }
103
+
104
+ /**
105
+ * getNotifyEntityArrivalSink takes the NotifyStreamEntityArrival callback and return
106
+ * a sink that will call the callback on entity arrival
107
+ * @param notifyCallback
108
+ */
109
+ function getNotifyEntityArrivalSink<T>(notifyCallback: NotifyStreamEntityArrival<T>) {
110
+ return new WritableStream<T>({
111
+ write(entity: T) {
112
+ notifyCallback(entity)
113
+ }
114
+ })
115
+ }
116
+
117
+ type Primitive = string | boolean | number;
118
+ type RequestPayload = Record<string, unknown>;
119
+ type FlattenedRequestPayload = Record<string, Primitive | Array<Primitive>>;
120
+
121
+ /**
122
+ * Checks if given value is a plain object
123
+ * Logic copied and adapted from below source:
124
+ * https://github.com/char0n/ramda-adjunct/blob/master/src/isPlainObj.js
125
+ * @param {unknown} value
126
+ * @return {boolean}
127
+ */
128
+ function isPlainObject(value: unknown): boolean {
129
+ const isObject =
130
+ Object.prototype.toString.call(value).slice(8, -1) === "Object";
131
+ const isObjLike = value !== null && isObject;
132
+
133
+ if (!isObjLike || !isObject) {
134
+ return false;
135
+ }
136
+
137
+ const proto = Object.getPrototypeOf(value);
138
+
139
+ const hasObjectConstructor =
140
+ typeof proto === "object" &&
141
+ proto.constructor === Object.prototype.constructor;
142
+
143
+ return hasObjectConstructor;
144
+ }
145
+
146
+ /**
147
+ * Checks if given value is of a primitive type
148
+ * @param {unknown} value
149
+ * @return {boolean}
150
+ */
151
+ function isPrimitive(value: unknown): boolean {
152
+ return ["string", "number", "boolean"].some(t => typeof value === t);
153
+ }
154
+
155
+ /**
156
+ * Checks if given primitive is zero-value
157
+ * @param {Primitive} value
158
+ * @return {boolean}
159
+ */
160
+ function isZeroValuePrimitive(value: Primitive): boolean {
161
+ return value === false || value === 0 || value === "";
162
+ }
163
+
164
+ /**
165
+ * Flattens a deeply nested request payload and returns an object
166
+ * with only primitive values and non-empty array of primitive values
167
+ * as per https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
168
+ * @param {RequestPayload} requestPayload
169
+ * @param {String} path
170
+ * @return {FlattenedRequestPayload>}
171
+ */
172
+ function flattenRequestPayload<T extends RequestPayload>(
173
+ requestPayload: T,
174
+ path: string = ""
175
+ ): FlattenedRequestPayload {
176
+ return Object.keys(requestPayload).reduce(
177
+ (acc: T, key: string): T => {
178
+ const value = requestPayload[key];
179
+ const newPath = path ? [path, key].join(".") : key;
180
+
181
+ const isNonEmptyPrimitiveArray =
182
+ Array.isArray(value) &&
183
+ value.every(v => isPrimitive(v)) &&
184
+ value.length > 0;
185
+
186
+ const isNonZeroValuePrimitive =
187
+ isPrimitive(value) && !isZeroValuePrimitive(value as Primitive);
188
+
189
+ let objectToMerge = {};
190
+
191
+ if (isPlainObject(value)) {
192
+ objectToMerge = flattenRequestPayload(value as RequestPayload, newPath);
193
+ } else if (isNonZeroValuePrimitive || isNonEmptyPrimitiveArray) {
194
+ objectToMerge = { [newPath]: value };
195
+ }
196
+
197
+ return { ...acc, ...objectToMerge };
198
+ },
199
+ {} as T
200
+ ) as FlattenedRequestPayload;
201
+ }
202
+
203
+ /**
204
+ * Renders a deeply nested request payload into a string of URL search
205
+ * parameters by first flattening the request payload and then removing keys
206
+ * which are already present in the URL path.
207
+ * @param {RequestPayload} requestPayload
208
+ * @param {string[]} urlPathParams
209
+ * @return {string}
210
+ */
211
+ export function renderURLSearchParams<T extends RequestPayload>(
212
+ requestPayload: T,
213
+ urlPathParams: string[] = []
214
+ ): string {
215
+ const flattenedRequestPayload = flattenRequestPayload(requestPayload);
216
+
217
+ const urlSearchParams = Object.keys(flattenedRequestPayload).reduce(
218
+ (acc: string[][], key: string): string[][] => {
219
+ // key should not be present in the url path as a parameter
220
+ const value = flattenedRequestPayload[key];
221
+ if (urlPathParams.find(f => f === key)) {
222
+ return acc;
223
+ }
224
+ return Array.isArray(value)
225
+ ? [...acc, ...value.map(m => [key, m.toString()])]
226
+ : (acc = [...acc, [key, value.toString()]]);
227
+ },
228
+ [] as string[][]
229
+ );
230
+
231
+ return new URLSearchParams(urlSearchParams).toString();
232
+ }
package/insight.pb.ts ADDED
@@ -0,0 +1,42 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export enum Severity {
8
+ SEVERITY_UNSPECIFIED = "SEVERITY_UNSPECIFIED",
9
+ CRITICAL = "CRITICAL",
10
+ WARNING = "WARNING",
11
+ INFO = "INFO",
12
+ }
13
+
14
+ export enum TargetType {
15
+ TARGET_TYPE_UNSPECIFIED = "TARGET_TYPE_UNSPECIFIED",
16
+ GLOBAL = "GLOBAL",
17
+ CLUSTER = "CLUSTER",
18
+ NAMESPACE = "NAMESPACE",
19
+ NODE = "NODE",
20
+ DEPLOYMENT = "DEPLOYMENT",
21
+ STATEFULSET = "STATEFULSET",
22
+ DAEMONSET = "DAEMONSET",
23
+ POD = "POD",
24
+ }
25
+
26
+ export type AlertSummary = {
27
+ id?: string
28
+ groupName?: string
29
+ groupId?: string
30
+ ruleName?: string
31
+ ruleId?: string
32
+ clusterName?: string
33
+ namespace?: string
34
+ targetType?: TargetType
35
+ target?: string
36
+ severity?: Severity
37
+ value?: string
38
+ notifyResponse?: string
39
+ description?: string
40
+ startAt?: string
41
+ updateAt?: string
42
+ }
package/metric.pb.ts ADDED
@@ -0,0 +1,25 @@
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 CommonCommon from "./common.pb"
8
+ import * as fm from "./fetch.pb"
9
+ import * as InsightIoApiInsightV1alpha1Insight from "./insight.pb"
10
+ export type GetAlertsListReq = {
11
+ cluster?: string
12
+ namespace?: string
13
+ name?: string
14
+ }
15
+
16
+ export type GetAlertsListResp = {
17
+ items?: InsightIoApiInsightV1alpha1Insight.AlertSummary[]
18
+ pagination?: CommonCommon.Pagination
19
+ }
20
+
21
+ export class Metric {
22
+ static GetAlertsList(req: GetAlertsListReq, initReq?: fm.InitReq): Promise<GetAlertsListResp> {
23
+ return fm.fetchReq<GetAlertsListReq, GetAlertsListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["cluster"]}/${req["namespace"]}/${req["name"]}/alerts?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
24
+ }
25
+ }
package/mongodb.pb.ts ADDED
@@ -0,0 +1,373 @@
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 CommonCommon from "./common.pb"
8
+ import * as fm from "./fetch.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 Status {
20
+ Failed = "Failed",
21
+ Running = "Running",
22
+ Creating = "Creating",
23
+ }
24
+
25
+ export enum GetMongodbListReqSortDir {
26
+ ASC = "ASC",
27
+ DESC = "DESC",
28
+ }
29
+
30
+ export enum GetMongodbConfReqSortDir {
31
+ ASC = "ASC",
32
+ DESC = "DESC",
33
+ }
34
+
35
+ export enum CreateMongodbReqMode {
36
+ REPLICASET = "REPLICASET",
37
+ }
38
+
39
+ export enum GetMongodbParamRespSelectSelectType {
40
+ Single = "Single",
41
+ Multiple = "Multiple",
42
+ }
43
+
44
+ export enum GetMongodbPodListReqSortDir {
45
+ ASC = "ASC",
46
+ DESC = "DESC",
47
+ }
48
+
49
+ export enum GetMongodbPodListRespPodStatus {
50
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
51
+ Unknown = "Unknown",
52
+ Pending = "Pending",
53
+ Running = "Running",
54
+ Succeeded = "Succeeded",
55
+ Failed = "Failed",
56
+ }
57
+
58
+ export enum GetMongodbPodListRespPodType {
59
+ PodTypeUnknown = "PodTypeUnknown",
60
+ PodTypePrimary = "PodTypePrimary",
61
+ PodTypeSecondary = "PodTypeSecondary",
62
+ }
63
+
64
+ export enum GetMongodbConfRespItemsParamType {
65
+ conf = "conf",
66
+ }
67
+
68
+ export type GetMongodbUsersReq = {
69
+ cluster?: string
70
+ namespace?: string
71
+ name?: string
72
+ }
73
+
74
+ export type GetMongodbUsersRespUserItem = {
75
+ username?: string
76
+ password?: string
77
+ }
78
+
79
+ export type GetMongodbUsersResp = {
80
+ users?: GetMongodbUsersRespUserItem[]
81
+ }
82
+
83
+ export type GetMongodbListReq = {
84
+ page?: number
85
+ pageSize?: number
86
+ sortDir?: GetMongodbListReqSortDir
87
+ sortBy?: string
88
+ searchKey?: string
89
+ workspaceId?: number
90
+ filterCluster?: string
91
+ filterNamespace?: string
92
+ }
93
+
94
+ export type GetMongodbConfReq = {
95
+ page?: number
96
+ pageSize?: number
97
+ sortDir?: GetMongodbConfReqSortDir
98
+ sortBy?: string
99
+ searchKey?: string
100
+ cluster?: string
101
+ namespace?: string
102
+ name?: string
103
+ }
104
+
105
+ export type GetMongodbParamReq = {
106
+ cluster?: string
107
+ }
108
+
109
+ export type CreateMongodbReqPorts = {
110
+ name?: string
111
+ protocol?: string
112
+ port?: number
113
+ targetPort?: number
114
+ nodePort?: number
115
+ }
116
+
117
+ export type CreateMongodbReq = {
118
+ workspaceId?: number
119
+ cluster?: string
120
+ namespace?: string
121
+ name?: string
122
+ describe?: string
123
+ version?: string
124
+ mode?: CreateMongodbReqMode
125
+ replicasetMembers?: number
126
+ replicasetArbiters?: number
127
+ rootName?: string
128
+ rootPassword?: string
129
+ storageClassName?: string
130
+ storageCapacity?: string
131
+ serviceType?: CommonCommon.ServiceType
132
+ serviceAnnotations?: {[key: string]: string}
133
+ ports?: CreateMongodbReqPorts[]
134
+ cpuRequest?: string
135
+ cpuLimit?: string
136
+ memoryRequest?: string
137
+ memoryLimit?: string
138
+ conf?: string
139
+ serviceMonitorInterval?: string
140
+ affinity?: CommonCommon.Affinity
141
+ externalTrafficPolicy?: CommonCommon.ExternalTrafficPolicy
142
+ lbTyp?: CommonCommon.LBTyp
143
+ lbPoolName?: string
144
+ lbAddress?: string
145
+ }
146
+
147
+ export type UpdateMongodbConfReq = {
148
+ cluster?: string
149
+ namespace?: string
150
+ name?: string
151
+ conf?: string
152
+ }
153
+
154
+ export type UpdateMongodbParamsResp = {
155
+ message?: string
156
+ }
157
+
158
+ export type UpdateMongodbConfResp = {
159
+ message?: string
160
+ }
161
+
162
+ export type GetMongodbParamRespSelectDataStringValue = {
163
+ value?: string
164
+ }
165
+
166
+ export type GetMongodbParamRespSelectDataResourceValue = {
167
+ cpuRequest?: string
168
+ cpuLimit?: string
169
+ memoryRequest?: string
170
+ memoryLimit?: string
171
+ }
172
+
173
+ export type GetMongodbParamRespSelectDataIntValue = {
174
+ value?: number
175
+ }
176
+
177
+ export type GetMongodbParamRespSelectDataStorageClassValue = {
178
+ name?: string
179
+ allowVolumeExpansion?: boolean
180
+ }
181
+
182
+
183
+ type BaseGetMongodbParamRespSelectData = {
184
+ }
185
+
186
+ export type GetMongodbParamRespSelectData = BaseGetMongodbParamRespSelectData
187
+ & OneOf<{ sValue: GetMongodbParamRespSelectDataStringValue; rValue: GetMongodbParamRespSelectDataResourceValue; iValue: GetMongodbParamRespSelectDataIntValue; scValue: GetMongodbParamRespSelectDataStorageClassValue }>
188
+
189
+ export type GetMongodbParamRespSelect = {
190
+ selectType?: GetMongodbParamRespSelectSelectType
191
+ data?: GetMongodbParamRespSelectData[]
192
+ }
193
+
194
+ export type GetMongodbParamResp = {
195
+ version?: GetMongodbParamRespSelect
196
+ conf?: GetMongodbParamRespSelect
197
+ replicas?: GetMongodbParamRespSelect
198
+ resource?: GetMongodbParamRespSelect
199
+ storage?: GetMongodbParamRespSelect
200
+ }
201
+
202
+ export type GetMongodbBackupProviderListResp = {
203
+ provider?: GetMongodbParamRespSelect
204
+ }
205
+
206
+ export type CreateMongodbResp = {
207
+ message?: string
208
+ }
209
+
210
+ export type GetMongodbOperatorVersionListReq = {
211
+ }
212
+
213
+ export type GetMongodbOperatorVersionListRespGetMongodbOperatorVersionListData = {
214
+ cluster?: string
215
+ namespace?: string
216
+ version?: string
217
+ }
218
+
219
+ export type GetMongodbOperatorVersionListResp = {
220
+ items?: GetMongodbOperatorVersionListRespGetMongodbOperatorVersionListData[]
221
+ pagination?: CommonCommon.Pagination
222
+ }
223
+
224
+ export type DeleteMongodbReq = {
225
+ cluster?: string
226
+ namespace?: string
227
+ name?: string
228
+ }
229
+
230
+ export type DeleteMongodbsReq = {
231
+ data?: DeleteMongodbReq[]
232
+ }
233
+
234
+ export type DeleteMongodbResp = {
235
+ message?: string
236
+ }
237
+
238
+ export type DeleteMongodbsResp = {
239
+ message?: string
240
+ }
241
+
242
+ export type GetMongodbPodListReq = {
243
+ cluster?: string
244
+ namespace?: string
245
+ name?: string
246
+ page?: number
247
+ pageSize?: number
248
+ sortDir?: GetMongodbPodListReqSortDir
249
+ sortBy?: string
250
+ searchKey?: string
251
+ }
252
+
253
+ export type GetMongodbPodListRespData = {
254
+ podName?: string
255
+ status?: GetMongodbPodListRespPodStatus
256
+ ip?: string
257
+ restart?: number
258
+ cpuUsage?: number
259
+ cpuLimit?: number
260
+ memoryUsage?: number
261
+ memoryLimit?: number
262
+ createTimestamp?: string
263
+ podType?: GetMongodbPodListRespPodType
264
+ common?: CommonCommon.PodCommon
265
+ }
266
+
267
+ export type GetMongodbPodListResp = {
268
+ items?: GetMongodbPodListRespData[]
269
+ pagination?: CommonCommon.Pagination
270
+ }
271
+
272
+ export type GetMongodbGrafanaAddrReq = {
273
+ cluster?: string
274
+ namespace?: string
275
+ name?: string
276
+ from?: string
277
+ to?: string
278
+ }
279
+
280
+ export type GetMongodbGrafanaAddrResp = {
281
+ data?: string
282
+ }
283
+
284
+ export type GetMongodbReq = {
285
+ cluster?: string
286
+ namespace?: string
287
+ name?: string
288
+ }
289
+
290
+ export type GetMongodbResp = {
291
+ data?: MongodbItem
292
+ }
293
+
294
+ export type GetMongodbConfRespItems = {
295
+ paramType?: GetMongodbConfRespItemsParamType
296
+ paramName?: string
297
+ value?: string
298
+ }
299
+
300
+ export type GetMongodbConfResp = {
301
+ items?: GetMongodbConfRespItems[]
302
+ pagination?: CommonCommon.Pagination
303
+ conf?: UpdateMongodbConfReq
304
+ }
305
+
306
+ export type GetMongodbListResp = {
307
+ items?: MongodbItem[]
308
+ pagination?: CommonCommon.Pagination
309
+ }
310
+
311
+ export type MongodbItemStatus = {
312
+ status?: Status
313
+ podsAreReadyNum?: number
314
+ clusterIPs?: string[]
315
+ common?: CommonCommon.CommonItemStatus
316
+ }
317
+
318
+ export type MongodbItemMetadata = {
319
+ annotations?: {[key: string]: string}
320
+ creationTimestamp?: string
321
+ name?: string
322
+ namespace?: string
323
+ }
324
+
325
+ export type MongodbItem = {
326
+ apiVersion?: string
327
+ kind?: string
328
+ metadata?: MongodbItemMetadata
329
+ spec?: CreateMongodbReq
330
+ status?: MongodbItemStatus
331
+ }
332
+
333
+ export class Mongodb {
334
+ static GetMongodbList(req: GetMongodbListReq, initReq?: fm.InitReq): Promise<GetMongodbListResp> {
335
+ return fm.fetchReq<GetMongodbListReq, GetMongodbListResp>(`/apis/mcamel.io/mongodb/v1alpha1/${req["workspaceId"]}/mongodbs?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
336
+ }
337
+ static GetMongodbOperatorVersionList(req: GetMongodbOperatorVersionListReq, initReq?: fm.InitReq): Promise<GetMongodbOperatorVersionListResp> {
338
+ return fm.fetchReq<GetMongodbOperatorVersionListReq, GetMongodbOperatorVersionListResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb-operator/versions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
339
+ }
340
+ static GetMongodb(req: GetMongodbReq, initReq?: fm.InitReq): Promise<GetMongodbResp> {
341
+ return fm.fetchReq<GetMongodbReq, GetMongodbResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
342
+ }
343
+ static GetMongodbParam(req: GetMongodbParamReq, initReq?: fm.InitReq): Promise<GetMongodbParamResp> {
344
+ return fm.fetchReq<GetMongodbParamReq, GetMongodbParamResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb-params/${req["cluster"]}?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
345
+ }
346
+ static GetMongodbPodList(req: GetMongodbPodListReq, initReq?: fm.InitReq): Promise<GetMongodbPodListResp> {
347
+ return fm.fetchReq<GetMongodbPodListReq, GetMongodbPodListResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}/pods?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
348
+ }
349
+ static GetMongodbGrafanaAddr(req: GetMongodbGrafanaAddrReq, initReq?: fm.InitReq): Promise<GetMongodbGrafanaAddrResp> {
350
+ return fm.fetchReq<GetMongodbGrafanaAddrReq, GetMongodbGrafanaAddrResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}/grafana?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
351
+ }
352
+ static CreateMongodb(req: CreateMongodbReq, initReq?: fm.InitReq): Promise<CreateMongodbResp> {
353
+ return fm.fetchReq<CreateMongodbReq, CreateMongodbResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb`, {...initReq, method: "POST", body: JSON.stringify(req)})
354
+ }
355
+ static GetMongodbConfs(req: GetMongodbConfReq, initReq?: fm.InitReq): Promise<GetMongodbConfResp> {
356
+ return fm.fetchReq<GetMongodbConfReq, GetMongodbConfResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}/confs?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
357
+ }
358
+ static UpdateMongodbConf(req: UpdateMongodbConfReq, initReq?: fm.InitReq): Promise<UpdateMongodbConfResp> {
359
+ return fm.fetchReq<UpdateMongodbConfReq, UpdateMongodbConfResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}/conf`, {...initReq, method: "PUT", body: JSON.stringify(req)})
360
+ }
361
+ static UpdateMongodbParams(req: CreateMongodbReq, initReq?: fm.InitReq): Promise<UpdateMongodbParamsResp> {
362
+ return fm.fetchReq<CreateMongodbReq, UpdateMongodbParamsResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}/params`, {...initReq, method: "PUT", body: JSON.stringify(req)})
363
+ }
364
+ static DeleteMongodb(req: DeleteMongodbReq, initReq?: fm.InitReq): Promise<DeleteMongodbResp> {
365
+ return fm.fetchReq<DeleteMongodbReq, DeleteMongodbResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}`, {...initReq, method: "DELETE"})
366
+ }
367
+ static DeleteMongodbs(req: DeleteMongodbsReq, initReq?: fm.InitReq): Promise<DeleteMongodbsResp> {
368
+ return fm.fetchReq<DeleteMongodbsReq, DeleteMongodbsResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodbs`, {...initReq, method: "POST", body: JSON.stringify(req)})
369
+ }
370
+ static GetMongodbUsers(req: GetMongodbUsersReq, initReq?: fm.InitReq): Promise<GetMongodbUsersResp> {
371
+ return fm.fetchReq<GetMongodbUsersReq, GetMongodbUsersResp>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/${req["cluster"]}/${req["namespace"]}/${req["name"]}/users?${fm.renderURLSearchParams(req, ["cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
372
+ }
373
+ }
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name":"@daocloud-proto/mcamel-mongodb",
3
+ "version":"0.0.1-42",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
package/version.pb.ts ADDED
@@ -0,0 +1,27 @@
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 fm from "./fetch.pb"
8
+ export type CommonReply = {
9
+ code?: number
10
+ msg?: string
11
+ }
12
+
13
+ export type GetVersionReply = {
14
+ commonReply?: CommonReply
15
+ gitCommit?: string
16
+ gitVersion?: string
17
+ buildTime?: string
18
+ }
19
+
20
+ export type Empty = {
21
+ }
22
+
23
+ export class Version {
24
+ static Get(req: Empty, initReq?: fm.InitReq): Promise<GetVersionReply> {
25
+ return fm.fetchReq<Empty, GetVersionReply>(`/apis/mcamel.io/mongodb/v1alpha1/mongodb/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
26
+ }
27
+ }