@daocloud-proto/insight 0.12.2-76 → 0.12.2-78

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.
@@ -255,8 +255,8 @@ export class Resource {
255
255
  }
256
256
  }
257
257
  export class Tracing {
258
- static ListServices(req: InsightIoApiTracingV1alpha1Tracing.QueryBaseRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Query.GetServicesResponse> {
259
- return fm.fetchReq<InsightIoApiTracingV1alpha1Tracing.QueryBaseRequest, InsightIoApiTracingV1alpha1Query.GetServicesResponse>(`/apis/insight.io/v1alpha1/traces/clusters/${req["cluster"]}/services?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
258
+ static ListServices(req: InsightIoApiTracingV1alpha1Tracing.ListServicesRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Query.GetServicesResponse> {
259
+ return fm.fetchReq<InsightIoApiTracingV1alpha1Tracing.ListServicesRequest, InsightIoApiTracingV1alpha1Query.GetServicesResponse>(`/apis/insight.io/v1alpha1/traces/clusters/${req["cluster"]}/services?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
260
260
  }
261
261
  static QueryOperations(req: InsightIoApiTracingV1alpha1Tracing.QueryBaseRequest, initReq?: fm.InitReq): Promise<InsightIoApiTracingV1alpha1Tracing.OperationsQueryResponse> {
262
262
  return fm.fetchReq<InsightIoApiTracingV1alpha1Tracing.QueryBaseRequest, InsightIoApiTracingV1alpha1Tracing.OperationsQueryResponse>(`/apis/insight.io/v1alpha1/traces/operations?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name":"@daocloud-proto/insight",
3
- "version":"0.12.2-76",
3
+ "version":"0.12.2-78",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -6,8 +6,17 @@
6
6
 
7
7
  import * as InsightIoApiMetricV1alpha1Metric from "../../metric/v1alpha1/metric.pb"
8
8
  import * as InsightIoApiSpan_metricV1alpha1Otelspankind from "./otelspankind.pb"
9
- export type MetricsQueryBaseRequest = {
10
- cluster?: string
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
+ type BaseMetricsQueryBaseRequest = {
11
20
  namespace?: string
12
21
  instanceName?: string
13
22
  extensionFilters?: string
@@ -20,8 +29,11 @@ export type MetricsQueryBaseRequest = {
20
29
  spanKinds?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
21
30
  }
22
31
 
23
- export type GetApdexRequest = {
24
- cluster?: string
32
+ export type MetricsQueryBaseRequest = BaseMetricsQueryBaseRequest
33
+ & OneOf<{ cluster: string; clusterName: string }>
34
+
35
+
36
+ type BaseGetApdexRequest = {
25
37
  namespace?: string
26
38
  name?: string
27
39
  apdexThreshold?: string
@@ -30,6 +42,9 @@ export type GetApdexRequest = {
30
42
  extensionFilters?: string
31
43
  }
32
44
 
45
+ export type GetApdexRequest = BaseGetApdexRequest
46
+ & OneOf<{ cluster: string; clusterName: string }>
47
+
33
48
  export type MetricsWithOperation = {
34
49
  operationName?: string
35
50
  spanKind?: string
@@ -5,6 +5,15 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiTracingV1alpha1Model from "./model.pb"
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);
8
17
  export type TracesResponseChunk = {
9
18
  traces?: InsightIoApiTracingV1alpha1Model.Trace[]
10
19
  }
@@ -13,7 +22,8 @@ export type SpansResponseChunk = {
13
22
  spans?: InsightIoApiTracingV1alpha1Model.Span[]
14
23
  }
15
24
 
16
- export type TraceQueryParameters = {
25
+
26
+ type BaseTraceQueryParameters = {
17
27
  serviceName?: string
18
28
  operationName?: string
19
29
  tags?: {[key: string]: string}
@@ -22,10 +32,12 @@ export type TraceQueryParameters = {
22
32
  durationMin?: string
23
33
  durationMax?: string
24
34
  limit?: number
25
- cluster?: string
26
35
  namespace?: string
27
36
  }
28
37
 
38
+ export type TraceQueryParameters = BaseTraceQueryParameters
39
+ & OneOf<{ cluster: string; clusterName: string }>
40
+
29
41
  export type FindTracesRequest = {
30
42
  query?: TraceQueryParameters
31
43
  }
@@ -5,8 +5,17 @@
5
5
  */
6
6
 
7
7
  import * as InsightIoApiSpan_metricV1alpha1Otelspankind from "../../span_metric/v1alpha1/otelspankind.pb"
8
- export type QueryBaseRequest = {
9
- cluster?: string
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 BaseQueryBaseRequest = {
10
19
  namespace?: string
11
20
  serviceName?: string
12
21
  spanKind?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
@@ -14,6 +23,9 @@ export type QueryBaseRequest = {
14
23
  end?: string
15
24
  }
16
25
 
26
+ export type QueryBaseRequest = BaseQueryBaseRequest
27
+ & OneOf<{ cluster: string; clusterName: string }>
28
+
17
29
  export type BatchQueryBaseRequest = {
18
30
  cluster?: string
19
31
  namespace?: string
@@ -30,8 +42,20 @@ export type OperationsQueryResponse = {
30
42
  operations?: Operation[]
31
43
  }
32
44
 
33
- export type TraceRequestById = {
45
+
46
+ type BaseTraceRequestById = {
34
47
  traceId?: string
48
+ namespace?: string
49
+ }
50
+
51
+ export type TraceRequestById = BaseTraceRequestById
52
+ & OneOf<{ cluster: string; clusterName: string }>
53
+
54
+ export type ListServicesRequest = {
35
55
  cluster?: string
36
56
  namespace?: string
57
+ serviceName?: string
58
+ spanKind?: InsightIoApiSpan_metricV1alpha1Otelspankind.SpanKind[]
59
+ start?: string
60
+ end?: string
37
61
  }