@daocloud-proto/skoala 0.3.3 → 0.4.1-4

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.
Files changed (44) hide show
  1. package/api/general/v1alpha1/skoala.pb.ts +34 -7
  2. package/api/hosted/v1alpha1/api.pb.ts +260 -0
  3. package/api/hosted/v1alpha1/gateway.pb.ts +112 -66
  4. package/api/hosted/v1alpha1/nacos.pb.ts +104 -2
  5. package/api/hosted/v1alpha1/sentinel.pb.ts +52 -10
  6. package/api/integrated/v1alpha1/insight.pb.ts +39 -4
  7. package/api/integrated/v1alpha1/instance.pb.ts +31 -19
  8. package/api/integrated/v1alpha1/registry.pb.ts +8 -5
  9. package/api/integrated/v1alpha1/service.pb.ts +8 -11
  10. package/api/skoala/v1alpha1/book.pb.ts +2 -2
  11. package/api/skoala/v1alpha1/skoala.pb.ts +45 -20
  12. package/feature_gate/v1alpha1/feature_gate.pb.ts +27 -0
  13. package/fetch.pb.ts +109 -0
  14. package/github.com/mwitkow/go-proto-validators/validator.pb.ts +29 -0
  15. package/google/api/annotations.pb.ts +1 -0
  16. package/google/api/http.pb.ts +34 -0
  17. package/google/protobuf/any.pb.ts +9 -0
  18. package/google/protobuf/api.pb.ts +32 -0
  19. package/google/protobuf/descriptor.pb.ts +262 -0
  20. package/google/protobuf/duration.pb.ts +9 -0
  21. package/google/protobuf/empty.pb.ts +7 -0
  22. package/google/protobuf/field_mask.pb.ts +8 -0
  23. package/google/protobuf/struct.pb.ts +33 -0
  24. package/google/protobuf/timestamp.pb.ts +9 -0
  25. package/google/protobuf/type.pb.ts +83 -0
  26. package/google/protobuf/wrappers.pb.ts +40 -0
  27. package/google/rpc/status.pb.ts +12 -0
  28. package/insight/v1alpha1/alert.pb.ts +291 -0
  29. package/insight/v1alpha1/notify.pb.ts +84 -0
  30. package/log/v1alpha1/log.pb.ts +113 -0
  31. package/metric/v1alpha1/metric.pb.ts +98 -0
  32. package/package.json +1 -1
  33. package/resource/v1alpha1/cluster.pb.ts +101 -0
  34. package/resource/v1alpha1/job.pb.ts +93 -0
  35. package/resource/v1alpha1/node.pb.ts +62 -0
  36. package/resource/v1alpha1/pod.pb.ts +82 -0
  37. package/resource/v1alpha1/service.pb.ts +61 -0
  38. package/resource/v1alpha1/type.pb.ts +9 -0
  39. package/resource/v1alpha1/workload.pb.ts +69 -0
  40. package/span_metric/v1alpha1/openmetrics.pb.ts +130 -0
  41. package/span_metric/v1alpha1/otelspankind.pb.ts +14 -0
  42. package/span_metric/v1alpha1/span_metric.pb.ts +100 -0
  43. package/type/v1alpha1/page.pb.ts +11 -0
  44. package/validate/validate.pb.ts +266 -0
@@ -3,42 +3,84 @@
3
3
  /*
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
+
7
+ import * as SkoalaApiGeneralV1alpha1Skoala from "../../general/v1alpha1/skoala.pb"
6
8
  export type ListSentinelReq = {
7
- workspaceId?: string
9
+ workspace?: string
10
+ cluster?: string
11
+ namespace?: string
8
12
  page?: number
13
+ pageSize?: number
9
14
  }
10
15
 
11
16
  export type ListSentinelRes = {
17
+ items?: Sentinel[]
18
+ pagination?: SkoalaApiGeneralV1alpha1Skoala.Pagination
19
+ }
20
+
21
+ export type Sentinel = {
22
+ workspace?: string
23
+ cluster?: string
24
+ namespace?: string
25
+ name?: string
26
+ config?: SentinelConfig
12
27
  }
13
28
 
14
29
  export type GetSentinelReq = {
15
- workspaceId?: string
16
- sentinelName?: string
30
+ workspace?: string
31
+ cluster?: string
32
+ namespace?: string
33
+ name?: string
17
34
  }
18
35
 
19
36
  export type GetSentinelRes = {
37
+ sentinel?: Sentinel
20
38
  }
21
39
 
22
40
  export type UpdateSentinelReq = {
23
- workspaceId?: string
24
- sentinelName?: string
25
- config?: string
41
+ workspace?: string
42
+ cluster?: string
43
+ namespace?: string
44
+ name?: string
45
+ nacosAddress?: string
46
+ config?: SentinelConfig
26
47
  }
27
48
 
28
49
  export type UpdateSentinelRes = {
29
50
  }
30
51
 
52
+ export type Resources = {
53
+ cpuRequests?: string
54
+ cpuLimits?: string
55
+ memoryRequests?: string
56
+ memoryLimits?: string
57
+ }
58
+
59
+ export type SentinelConfig = {
60
+ type?: string
61
+ port?: number
62
+ nodePort?: number
63
+ resources?: Resources
64
+ image?: string
65
+ }
66
+
31
67
  export type CreateSentinelReq = {
32
- workspaceId?: string
33
- gatewayName?: string
68
+ workspace?: string
69
+ cluster?: string
70
+ namespace?: string
71
+ name?: string
72
+ nacosAddress?: string
73
+ config?: SentinelConfig
34
74
  }
35
75
 
36
76
  export type CreateSentinelRes = {
37
77
  }
38
78
 
39
79
  export type DeleteSentinelReq = {
40
- workspaceId?: string
41
- sentinelName?: string
80
+ workspace?: string
81
+ cluster?: string
82
+ namespace?: string
83
+ name?: string
42
84
  }
43
85
 
44
86
  export type DeleteSentinelRes = {
@@ -4,12 +4,47 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
- import * as InsightIoApiSpan_metricV1alpha1Span_metric from "../../../span_metric/v1alpha1/span_metric.pb"
7
+ import * as InsightIoApiMetricV1alpha1Metric from "../../../metric/v1alpha1/metric.pb"
8
8
  export type Insight = {
9
+ serviceDetail?: InsightValue
10
+ serviceMetrics?: InsightMetrics
11
+ instanceMonitorMetrics?: MonitorMetrics
12
+ }
13
+
14
+ export type InstanceInsight = {
15
+ instanceDetail?: InsightValue
16
+ instanceMetrics?: InsightMetrics
17
+ instanceMonitorMetrics?: MonitorMetrics
18
+ }
19
+
20
+ export type InsightValue = {
9
21
  call?: string
10
22
  successRates?: string
11
23
  latencies?: string
12
- metricsLatencies?: {[key: string]: InsightIoApiSpan_metricV1alpha1Span_metric.GetMetricsResponse}
13
- metricsErrorRates?: InsightIoApiSpan_metricV1alpha1Span_metric.GetMetricsResponse
14
- metricsCallRates?: InsightIoApiSpan_metricV1alpha1Span_metric.GetMetricsResponse
24
+ }
25
+
26
+ export type InsightMetrics = {
27
+ p50Metrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
28
+ p75Metrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
29
+ p90Metrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
30
+ p95Metrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
31
+ p99Metrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
32
+ reqRateMetric?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
33
+ repLatencyMetric?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
34
+ errorsRateMetrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
35
+ successTotalCallsMetrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
36
+ errorTotalCallsMetrics?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
37
+ }
38
+
39
+ export type MonitorMetrics = {
40
+ cpuRequest?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
41
+ cpuLimit?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
42
+ cpuUsage?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
43
+ memoryRequest?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
44
+ memoryLimit?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
45
+ memoryUsage?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
46
+ diskRead?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
47
+ diskWrite?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
48
+ netBytesReceived?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
49
+ netBytesTransmitted?: InsightIoApiMetricV1alpha1Metric.SampleStream[]
15
50
  }
@@ -4,17 +4,27 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
- import * as SkoalaApiIntegratedV1alpha1Registry from "./registry.pb"
7
+ import * as SkoalaApiGeneralV1alpha1Skoala from "../../general/v1alpha1/skoala.pb"
8
+ import * as SkoalaApiIntegratedV1alpha1Insight from "./insight.pb"
9
+
10
+ export enum InstanceStatus {
11
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
12
+ RUNNING = "RUNNING",
13
+ FAILED = "FAILED",
14
+ }
15
+
8
16
  export type Instance = {
9
- workspaceId?: string
10
17
  id?: string
11
18
  serviceName?: string
12
19
  frameworkType?: string
13
20
  host?: string
14
- port?: number
21
+ ports?: number[]
22
+ instanceStatus?: InstanceStatus
23
+ enabled?: boolean
15
24
  metadata?: {[key: string]: string}
16
- registry?: SkoalaApiIntegratedV1alpha1Registry.Registry
17
25
  detail?: {[key: string]: string}
26
+ updateAt?: string
27
+ insight?: SkoalaApiIntegratedV1alpha1Insight.InstanceInsight
18
28
  }
19
29
 
20
30
  export type ListInstanceReq = {
@@ -23,37 +33,39 @@ export type ListInstanceReq = {
23
33
  namespaceId?: string
24
34
  groupName?: string
25
35
  serviceName?: string
36
+ instanceId?: string
37
+ page?: number
38
+ pageSize?: number
26
39
  }
27
40
 
28
- export type ListAllInstanceReq = {
29
- workspaceId?: string
30
- page?: number
31
- size?: number
41
+ export type ListInstanceRes = {
42
+ items?: Instance[]
43
+ pagination?: SkoalaApiGeneralV1alpha1Skoala.Pagination
32
44
  }
33
45
 
34
- export type ListRegistryAllInstanceReq = {
46
+ export type GetInstanceReq = {
35
47
  workspaceId?: string
36
48
  registryId?: string
37
- page?: number
38
- size?: number
49
+ namespaceId?: string
50
+ groupName?: string
51
+ serviceName?: string
52
+ instanceId?: string
39
53
  }
40
54
 
41
- export type ListInstanceRes = {
42
- instances?: Instance[]
43
- page?: number
44
- size?: number
45
- total?: number
55
+ export type GetInstanceRes = {
56
+ instance?: Instance
46
57
  }
47
58
 
48
- export type GetInstanceReq = {
59
+ export type UpdateInstanceReq = {
49
60
  workspaceId?: string
50
61
  registryId?: string
51
62
  namespaceId?: string
52
63
  groupName?: string
53
- serviceName?: string
54
64
  instanceId?: string
65
+ serviceName?: string
66
+ enabled?: boolean
55
67
  }
56
68
 
57
- export type GetInstanceRes = {
69
+ export type UpdateInstanceRes = {
58
70
  instance?: Instance
59
71
  }
@@ -4,6 +4,8 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ import * as SkoalaApiGeneralV1alpha1Skoala from "../../general/v1alpha1/skoala.pb"
8
+
7
9
  export enum RegistryStatus {
8
10
  STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
9
11
  RUNNING = "RUNNING",
@@ -22,6 +24,7 @@ export enum RegistryType {
22
24
  export type Registry = {
23
25
  workspaceId?: string
24
26
  registryId?: string
27
+ extId?: string
25
28
  name?: string
26
29
  type?: RegistryType
27
30
  status?: RegistryStatus
@@ -45,14 +48,12 @@ export type ListRegistryReq = {
45
48
  type?: string
46
49
  name?: string
47
50
  page?: number
48
- size?: number
51
+ pageSize?: number
49
52
  }
50
53
 
51
54
  export type ListRegistryRes = {
52
- registries?: Registry[]
53
- page?: number
54
- size?: number
55
- total?: number
55
+ items?: Registry[]
56
+ pagination?: SkoalaApiGeneralV1alpha1Skoala.Pagination
56
57
  }
57
58
 
58
59
  export type GetRegistryReq = {
@@ -67,6 +68,7 @@ export type GetRegistryRes = {
67
68
  export type UpdateRegistryReq = {
68
69
  workspaceId?: string
69
70
  registryId?: string
71
+ extId?: string
70
72
  name?: string
71
73
  type?: string
72
74
  addresses?: string[]
@@ -81,6 +83,7 @@ export type UpdateRegistryRes = {
81
83
  export type CreateRegistryReq = {
82
84
  workspaceId?: string
83
85
  name?: string
86
+ extId?: string
84
87
  type?: string
85
88
  addresses?: string[]
86
89
  namespaces?: Namespace[]
@@ -4,11 +4,13 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ import * as SkoalaApiGeneralV1alpha1Skoala from "../../general/v1alpha1/skoala.pb"
7
8
  import * as SkoalaApiIntegratedV1alpha1Insight from "./insight.pb"
8
9
  import * as SkoalaApiIntegratedV1alpha1Registry from "./registry.pb"
9
10
  export type Service = {
10
11
  name?: string
11
12
  namespace?: NamespaceWithGroup
13
+ healthInstanceCount?: number
12
14
  instanceCount?: number
13
15
  registry?: SkoalaApiIntegratedV1alpha1Registry.Registry
14
16
  detail?: {[key: string]: string}
@@ -18,21 +20,14 @@ export type Service = {
18
20
  export type ListServiceReq = {
19
21
  workspaceId?: string
20
22
  registryId?: string
23
+ serviceName?: string
21
24
  page?: number
22
- size?: number
23
- }
24
-
25
- export type ListAllServiceReq = {
26
- workspaceId?: string
27
- page?: number
28
- size?: number
25
+ pageSize?: number
29
26
  }
30
27
 
31
28
  export type ListServiceRes = {
32
- services?: Service[]
33
- page?: number
34
- size?: number
35
- total?: number
29
+ items?: Service[]
30
+ pagination?: SkoalaApiGeneralV1alpha1Skoala.Pagination
36
31
  }
37
32
 
38
33
  export type GetServiceReq = {
@@ -41,6 +36,8 @@ export type GetServiceReq = {
41
36
  namespaceId?: string
42
37
  groupName?: string
43
38
  serviceName?: string
39
+ start?: string
40
+ end?: string
44
41
  }
45
42
 
46
43
  export type GetServiceRes = {
@@ -89,10 +89,10 @@ export class Book {
89
89
  return fm.fetchReq<ListBookReq, ListBookReply>(`/v1alpha1/books?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
90
90
  }
91
91
  static Create(req: CreateBookReq, initReq?: fm.InitReq): Promise<CreateBookReply> {
92
- return fm.fetchReq<CreateBookReq, CreateBookReply>(`/v1alpha1/books`, {...initReq, method: "POST", body: JSON.stringify(req)})
92
+ return fm.fetchReq<CreateBookReq, CreateBookReply>(`/v1alpha1/books`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
93
93
  }
94
94
  static Update(req: UpdateBookReq, initReq?: fm.InitReq): Promise<UpdateBookRely> {
95
- return fm.fetchReq<UpdateBookReq, UpdateBookRely>(`/v1alpha1/books/${req["uid"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
95
+ return fm.fetchReq<UpdateBookReq, UpdateBookRely>(`/v1alpha1/books/${req["uid"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
96
96
  }
97
97
  static Delete(req: DeleteBookReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
98
98
  return fm.fetchReq<DeleteBookReq, GoogleProtobufEmpty.Empty>(`/v1alpha1/books/${req["uid"]}`, {...initReq, method: "DELETE"})
@@ -8,6 +8,7 @@ import * as fm from "../../../fetch.pb"
8
8
  import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
9
9
  import * as SkoalaApiGeneralV1alpha1Skoala from "../../general/v1alpha1/skoala.pb"
10
10
  import * as SkoalaApiGeneralV1alpha1Version from "../../general/v1alpha1/version.pb"
11
+ import * as SkoalaApiHostedV1alpha1Api from "../../hosted/v1alpha1/api.pb"
11
12
  import * as SkoalaApiHostedV1alpha1Gateway from "../../hosted/v1alpha1/gateway.pb"
12
13
  import * as SkoalaApiHostedV1alpha1Nacos from "../../hosted/v1alpha1/nacos.pb"
13
14
  import * as SkoalaApiHostedV1alpha1Sentinel from "../../hosted/v1alpha1/sentinel.pb"
@@ -34,6 +35,9 @@ export class Skoala {
34
35
  static ListWorkspace(req: SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceReq, initReq?: fm.InitReq): Promise<SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceRes> {
35
36
  return fm.fetchReq<SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceReq, SkoalaApiGeneralV1alpha1Skoala.ListWorkspaceRes>(`/apis/skoala.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
36
37
  }
38
+ static GetWorkspace(req: SkoalaApiGeneralV1alpha1Skoala.GetWorkspaceReq, initReq?: fm.InitReq): Promise<SkoalaApiGeneralV1alpha1Skoala.GetWorkspaceRes> {
39
+ return fm.fetchReq<SkoalaApiGeneralV1alpha1Skoala.GetWorkspaceReq, SkoalaApiGeneralV1alpha1Skoala.GetWorkspaceRes>(`/apis/skoala.io/v1alpha1/workspaces/${req["workspaceId"]}?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
40
+ }
37
41
  }
38
42
  export class Registry {
39
43
  static List(req: SkoalaApiIntegratedV1alpha1Registry.ListRegistryReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Registry.ListRegistryRes> {
@@ -43,16 +47,16 @@ export class Registry {
43
47
  return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.GetRegistryReq, SkoalaApiIntegratedV1alpha1Registry.GetRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/${req["registryId"]}?${fm.renderURLSearchParams(req, ["workspaceId", "registryId"])}`, {...initReq, method: "GET"})
44
48
  }
45
49
  static Create(req: SkoalaApiIntegratedV1alpha1Registry.CreateRegistryReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Registry.CreateRegistryRes> {
46
- return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.CreateRegistryReq, SkoalaApiIntegratedV1alpha1Registry.CreateRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries`, {...initReq, method: "POST", body: JSON.stringify(req)})
50
+ return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.CreateRegistryReq, SkoalaApiIntegratedV1alpha1Registry.CreateRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
47
51
  }
48
52
  static Update(req: SkoalaApiIntegratedV1alpha1Registry.UpdateRegistryReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Registry.UpdateRegistryRes> {
49
- return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.UpdateRegistryReq, SkoalaApiIntegratedV1alpha1Registry.UpdateRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/${req["registryId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
53
+ return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.UpdateRegistryReq, SkoalaApiIntegratedV1alpha1Registry.UpdateRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/${req["registryId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
50
54
  }
51
55
  static Delete(req: SkoalaApiIntegratedV1alpha1Registry.DeleteRegistryReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Registry.DeleteRegistryRes> {
52
56
  return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.DeleteRegistryReq, SkoalaApiIntegratedV1alpha1Registry.DeleteRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/${req["registryId"]}`, {...initReq, method: "DELETE"})
53
57
  }
54
58
  static Ping(req: SkoalaApiIntegratedV1alpha1Registry.PingRegistryReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Registry.PingRegistryRes> {
55
- return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.PingRegistryReq, SkoalaApiIntegratedV1alpha1Registry.PingRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/ping`, {...initReq, method: "POST", body: JSON.stringify(req)})
59
+ return fm.fetchReq<SkoalaApiIntegratedV1alpha1Registry.PingRegistryReq, SkoalaApiIntegratedV1alpha1Registry.PingRegistryRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/ping`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
56
60
  }
57
61
  }
58
62
  export class Service {
@@ -70,6 +74,9 @@ export class Instance {
70
74
  static Get(req: SkoalaApiIntegratedV1alpha1Instance.GetInstanceReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Instance.GetInstanceRes> {
71
75
  return fm.fetchReq<SkoalaApiIntegratedV1alpha1Instance.GetInstanceReq, SkoalaApiIntegratedV1alpha1Instance.GetInstanceRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/${req["registryId"]}/services/${req["serviceName"]}/instances/${req["instanceId"]}?${fm.renderURLSearchParams(req, ["workspaceId", "registryId", "serviceName", "instanceId"])}`, {...initReq, method: "GET"})
72
76
  }
77
+ static Update(req: SkoalaApiIntegratedV1alpha1Instance.UpdateInstanceReq, initReq?: fm.InitReq): Promise<SkoalaApiIntegratedV1alpha1Instance.UpdateInstanceRes> {
78
+ return fm.fetchReq<SkoalaApiIntegratedV1alpha1Instance.UpdateInstanceReq, SkoalaApiIntegratedV1alpha1Instance.UpdateInstanceRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/registries/${req["registryId"]}/services/${req["serviceName"]}/instances/${req["instanceId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
79
+ }
73
80
  }
74
81
  export class Nacos {
75
82
  static List(req: SkoalaApiHostedV1alpha1Nacos.ListNacosReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Nacos.ListNacosRes> {
@@ -78,31 +85,31 @@ export class Nacos {
78
85
  static Get(req: SkoalaApiHostedV1alpha1Nacos.GetNacosReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Nacos.GetNacosRes> {
79
86
  return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.GetNacosReq, SkoalaApiHostedV1alpha1Nacos.GetNacosRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses/${req["nacosName"]}?${fm.renderURLSearchParams(req, ["workspaceId", "nacosName"])}`, {...initReq, method: "GET"})
80
87
  }
81
- static Create(req: SkoalaApiHostedV1alpha1Nacos.CreateNacosReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Nacos.CreateNacosRes> {
82
- return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.CreateNacosReq, SkoalaApiHostedV1alpha1Nacos.CreateNacosRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses`, {...initReq, method: "POST", body: JSON.stringify(req)})
88
+ static Create(req: SkoalaApiHostedV1alpha1Nacos.CreateNacosReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
89
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.CreateNacosReq, GoogleProtobufEmpty.Empty>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
83
90
  }
84
- static Update(req: SkoalaApiHostedV1alpha1Nacos.UpdateNacosReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Nacos.UpdateNacosRes> {
85
- return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.UpdateNacosReq, SkoalaApiHostedV1alpha1Nacos.UpdateNacosRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses/${req["nacosName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
91
+ static Update(req: SkoalaApiHostedV1alpha1Nacos.UpdateNacosReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
92
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.UpdateNacosReq, GoogleProtobufEmpty.Empty>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses/${req["nacosName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
86
93
  }
87
- static Delete(req: SkoalaApiHostedV1alpha1Nacos.DeleteNacosReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Nacos.DeleteNacosRes> {
88
- return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.DeleteNacosReq, SkoalaApiHostedV1alpha1Nacos.DeleteNacosRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses/${req["nacosName"]}`, {...initReq, method: "DELETE"})
94
+ static Delete(req: SkoalaApiHostedV1alpha1Nacos.DeleteNacosReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
95
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Nacos.DeleteNacosReq, GoogleProtobufEmpty.Empty>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/nacoses/${req["nacosName"]}`, {...initReq, method: "DELETE"})
89
96
  }
90
97
  }
91
98
  export class Sentinel {
92
99
  static List(req: SkoalaApiHostedV1alpha1Sentinel.ListSentinelReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.ListSentinelRes> {
93
- return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.ListSentinelReq, SkoalaApiHostedV1alpha1Sentinel.ListSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/sentinels?${fm.renderURLSearchParams(req, ["workspaceId"])}`, {...initReq, method: "GET"})
100
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.ListSentinelReq, SkoalaApiHostedV1alpha1Sentinel.ListSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/sentinels?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
94
101
  }
95
- static Get(req: SkoalaApiHostedV1alpha1Sentinel.GetSentinelReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.GetSentinelRes> {
96
- return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.GetSentinelReq, SkoalaApiHostedV1alpha1Sentinel.GetSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/sentinels/${req["sentinelName"]}?${fm.renderURLSearchParams(req, ["workspaceId", "sentinelName"])}`, {...initReq, method: "GET"})
102
+ static Get(req: SkoalaApiHostedV1alpha1Sentinel.GetSentinelReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.Sentinel> {
103
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.GetSentinelReq, SkoalaApiHostedV1alpha1Sentinel.Sentinel>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/sentinels/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
97
104
  }
98
105
  static Create(req: SkoalaApiHostedV1alpha1Sentinel.CreateSentinelReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.CreateSentinelRes> {
99
- return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.CreateSentinelReq, SkoalaApiHostedV1alpha1Sentinel.CreateSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/sentinels`, {...initReq, method: "POST", body: JSON.stringify(req)})
106
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.CreateSentinelReq, SkoalaApiHostedV1alpha1Sentinel.CreateSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/sentinels`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
100
107
  }
101
108
  static Update(req: SkoalaApiHostedV1alpha1Sentinel.UpdateSentinelReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.UpdateSentinelRes> {
102
- return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.UpdateSentinelReq, SkoalaApiHostedV1alpha1Sentinel.UpdateSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/sentinels/${req["sentinelName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
109
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.UpdateSentinelReq, SkoalaApiHostedV1alpha1Sentinel.UpdateSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/sentinels/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
103
110
  }
104
111
  static Delete(req: SkoalaApiHostedV1alpha1Sentinel.DeleteSentinelReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Sentinel.DeleteSentinelRes> {
105
- return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.DeleteSentinelReq, SkoalaApiHostedV1alpha1Sentinel.DeleteSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/sentinels/${req["sentinelName"]}`, {...initReq, method: "DELETE"})
112
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Sentinel.DeleteSentinelReq, SkoalaApiHostedV1alpha1Sentinel.DeleteSentinelRes>(`/apis/hive.skoala.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/sentinels/${req["name"]}`, {...initReq, method: "DELETE"})
106
113
  }
107
114
  }
108
115
  export class Gateway {
@@ -112,19 +119,37 @@ export class Gateway {
112
119
  static ListClusterGateway(req: SkoalaApiHostedV1alpha1Gateway.ListClusterGatewayReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gateway.ListGatewayRes> {
113
120
  return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.ListClusterGatewayReq, SkoalaApiHostedV1alpha1Gateway.ListGatewayRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/gateways?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName"])}`, {...initReq, method: "GET"})
114
121
  }
115
- static ListNamespaceGateway(req: SkoalaApiHostedV1alpha1Gateway.ListNamespaceGatewayReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gateway.ListGatewayRes> {
116
- return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.ListNamespaceGatewayReq, SkoalaApiHostedV1alpha1Gateway.ListGatewayRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName"])}`, {...initReq, method: "GET"})
117
- }
118
122
  static Get(req: SkoalaApiHostedV1alpha1Gateway.GetGatewayReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gateway.GetGatewayRes> {
119
123
  return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.GetGatewayReq, SkoalaApiHostedV1alpha1Gateway.GetGatewayRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "gatewayName"])}`, {...initReq, method: "GET"})
120
124
  }
121
125
  static Create(req: SkoalaApiHostedV1alpha1Gateway.CreateGatewayReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
122
- return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.CreateGatewayReq, GoogleProtobufEmpty.Empty>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways`, {...initReq, method: "POST", body: JSON.stringify(req)})
126
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.CreateGatewayReq, GoogleProtobufEmpty.Empty>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
123
127
  }
124
128
  static Update(req: SkoalaApiHostedV1alpha1Gateway.UpdateGatewayReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
125
- return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.UpdateGatewayReq, GoogleProtobufEmpty.Empty>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
129
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.UpdateGatewayReq, GoogleProtobufEmpty.Empty>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
126
130
  }
127
131
  static Delete(req: SkoalaApiHostedV1alpha1Gateway.DeleteGatewayReq, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
128
132
  return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.DeleteGatewayReq, GoogleProtobufEmpty.Empty>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}`, {...initReq, method: "DELETE"})
129
133
  }
134
+ static GetImages(req: GoogleProtobufEmpty.Empty, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gateway.GetImagesRes> {
135
+ return fm.fetchReq<GoogleProtobufEmpty.Empty, SkoalaApiHostedV1alpha1Gateway.GetImagesRes>(`/apis/sesame.skoala.io/v1alpha1/images?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
136
+ }
137
+ static GetGatewayStatus(req: SkoalaApiHostedV1alpha1Gateway.GetGatewayStatusReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Gateway.GetGatewayStatusRes> {
138
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Gateway.GetGatewayStatusReq, SkoalaApiHostedV1alpha1Gateway.GetGatewayStatusRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/namespaces/${req["namespaceName"]}/gateways/${req["gatewayName"]}/status?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "namespaceName", "gatewayName"])}`, {...initReq, method: "GET"})
139
+ }
140
+ static CreateAPI(req: SkoalaApiHostedV1alpha1Api.CreateAPIReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Api.CreateAPIRes> {
141
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Api.CreateAPIReq, SkoalaApiHostedV1alpha1Api.CreateAPIRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/gateways/${req["gatewayName"]}/apis`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
142
+ }
143
+ static ListAPI(req: SkoalaApiHostedV1alpha1Api.APIListReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Api.APIListRes> {
144
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Api.APIListReq, SkoalaApiHostedV1alpha1Api.APIListRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/gateways/${req["gatewayName"]}/apis?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "gatewayName"])}`, {...initReq, method: "GET"})
145
+ }
146
+ static GetAPI(req: SkoalaApiHostedV1alpha1Api.GetAPIReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Api.GetAPIRes> {
147
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Api.GetAPIReq, SkoalaApiHostedV1alpha1Api.GetAPIRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/gateways/${req["gatewayName"]}/apis/${req["apiName"]}?${fm.renderURLSearchParams(req, ["workspaceId", "clusterName", "gatewayName", "apiName"])}`, {...initReq, method: "GET"})
148
+ }
149
+ static DeleteAPI(req: SkoalaApiHostedV1alpha1Api.DeleteAPIReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Api.DeleteAPIRes> {
150
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Api.DeleteAPIReq, SkoalaApiHostedV1alpha1Api.DeleteAPIRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/gateways/${req["gatewayName"]}/apis/${req["apiName"]}`, {...initReq, method: "DELETE"})
151
+ }
152
+ static UpdateAPI(req: SkoalaApiHostedV1alpha1Api.UpdateAPIReq, initReq?: fm.InitReq): Promise<SkoalaApiHostedV1alpha1Api.UpdateAPIRes> {
153
+ return fm.fetchReq<SkoalaApiHostedV1alpha1Api.UpdateAPIReq, SkoalaApiHostedV1alpha1Api.UpdateAPIRes>(`/apis/sesame.skoala.io/v1alpha1/workspaces/${req["workspaceId"]}/clusters/${req["clusterName"]}/gateways/${req["gatewayName"]}/apis/${req["apiName"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
154
+ }
130
155
  }
@@ -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
+ export enum FeatureGateIDEnum {
8
+ METRICS = "METRICS",
9
+ LOGGING = "LOGGING",
10
+ TRACING = "TRACING",
11
+ }
12
+
13
+ export type FeatureGateID = {
14
+ id?: FeatureGateIDEnum
15
+ }
16
+
17
+ export type FeatureGate = {
18
+ id?: FeatureGateIDEnum
19
+ name?: string
20
+ description?: string
21
+ enabled?: boolean
22
+ status?: string
23
+ }
24
+
25
+ export type FeatureGatesResp = {
26
+ items?: FeatureGate[]
27
+ }
package/fetch.pb.ts CHANGED
@@ -4,10 +4,119 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ /**
8
+ * base64 encoder and decoder
9
+ * Copied and adapted from https://github.com/protobufjs/protobuf.js/blob/master/lib/base64/index.js
10
+ */
11
+ // Base64 encoding table
12
+ const b64 = new Array(64);
13
+
14
+ // Base64 decoding table
15
+ const s64 = new Array(123);
16
+
17
+ // 65..90, 97..122, 48..57, 43, 47
18
+ for (let i = 0; i < 64;)
19
+ s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
20
+
21
+ export function b64Encode(buffer: Uint8Array, start: number, end: number): string {
22
+ let parts: string[] = null;
23
+ const chunk = [];
24
+ let i = 0, // output index
25
+ j = 0, // goto index
26
+ t; // temporary
27
+ while (start < end) {
28
+ const b = buffer[start++];
29
+ switch (j) {
30
+ case 0:
31
+ chunk[i++] = b64[b >> 2];
32
+ t = (b & 3) << 4;
33
+ j = 1;
34
+ break;
35
+ case 1:
36
+ chunk[i++] = b64[t | b >> 4];
37
+ t = (b & 15) << 2;
38
+ j = 2;
39
+ break;
40
+ case 2:
41
+ chunk[i++] = b64[t | b >> 6];
42
+ chunk[i++] = b64[b & 63];
43
+ j = 0;
44
+ break;
45
+ }
46
+ if (i > 8191) {
47
+ (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
48
+ i = 0;
49
+ }
50
+ }
51
+ if (j) {
52
+ chunk[i++] = b64[t];
53
+ chunk[i++] = 61;
54
+ if (j === 1)
55
+ chunk[i++] = 61;
56
+ }
57
+ if (parts) {
58
+ if (i)
59
+ parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
60
+ return parts.join("");
61
+ }
62
+ return String.fromCharCode.apply(String, chunk.slice(0, i));
63
+ }
64
+
65
+ const invalidEncoding = "invalid encoding";
66
+
67
+ export function b64Decode(s: string): Uint8Array {
68
+ const buffer = [];
69
+ let offset = 0;
70
+ let j = 0, // goto index
71
+ t; // temporary
72
+ for (let i = 0; i < s.length;) {
73
+ let c = s.charCodeAt(i++);
74
+ if (c === 61 && j > 1)
75
+ break;
76
+ if ((c = s64[c]) === undefined)
77
+ throw Error(invalidEncoding);
78
+ switch (j) {
79
+ case 0:
80
+ t = c;
81
+ j = 1;
82
+ break;
83
+ case 1:
84
+ buffer[offset++] = t << 2 | (c & 48) >> 4;
85
+ t = c;
86
+ j = 2;
87
+ break;
88
+ case 2:
89
+ buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;
90
+ t = c;
91
+ j = 3;
92
+ break;
93
+ case 3:
94
+ buffer[offset++] = (t & 3) << 6 | c;
95
+ j = 0;
96
+ break;
97
+ }
98
+ }
99
+ if (j === 1)
100
+ throw Error(invalidEncoding);
101
+ return new Uint8Array(buffer);
102
+ }
103
+
104
+ function b64Test(s: string): boolean {
105
+ return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s);
106
+ }
107
+
7
108
  export interface InitReq extends RequestInit {
8
109
  pathPrefix?: string
9
110
  }
10
111
 
112
+ export function replacer(key: any, value: any): any {
113
+ if(value && value.constructor === Uint8Array) {
114
+ return b64Encode(value, 0, value.length);
115
+ }
116
+
117
+ return value;
118
+ }
119
+
11
120
  export function fetchReq<I, O>(path: string, init?: InitReq): Promise<O> {
12
121
  const {pathPrefix, ...req} = init || {}
13
122