@daocloud-proto/baize 0.105.2 → 0.105.3

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.
@@ -7,12 +7,21 @@
7
7
  import * as BaizeCommonCommon from "../../../common/common.pb"
8
8
  import * as BaizeCommonK8s from "../../../common/k8s.pb"
9
9
  import * as fm from "../../../fetch.pb"
10
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
11
 
11
12
  export enum AnalysisType {
12
13
  TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
13
14
  TENSORBOARD = "TENSORBOARD",
14
15
  }
15
16
 
17
+ export enum AnalysisStatusPhase {
18
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
19
+ PENDING = "PENDING",
20
+ RUNNING = "RUNNING",
21
+ STOPPED = "STOPPED",
22
+ FAILED = "FAILED",
23
+ }
24
+
16
25
  export type AnalysisConfig = {
17
26
  enabled?: boolean
18
27
  type?: AnalysisType
@@ -23,6 +32,7 @@ export type AnalysisConfig = {
23
32
  export type AnalysisStatus = {
24
33
  accessUrl?: string
25
34
  message?: string
35
+ phase?: AnalysisStatusPhase
26
36
  }
27
37
 
28
38
  export type Analysis = {
@@ -35,6 +45,7 @@ export type Analysis = {
35
45
  kubeVolumes?: BaizeCommonK8s.KubeVolume[]
36
46
  logPath?: string
37
47
  status?: AnalysisStatus
48
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
38
49
  }
39
50
 
40
51
  export type ListAnalysisRequest = {
@@ -50,8 +61,18 @@ export type ListAnalysisResponse = {
50
61
  page?: BaizeCommonCommon.Pagination
51
62
  }
52
63
 
64
+ export type SingleAnalysisRequest = {
65
+ workspace?: number
66
+ cluster?: string
67
+ namespace?: string
68
+ name?: string
69
+ }
70
+
53
71
  export class AnalysisManagement {
54
72
  static ListAnalysis(req: ListAnalysisRequest, initReq?: fm.InitReq): Promise<ListAnalysisResponse> {
55
73
  return fm.fetchReq<ListAnalysisRequest, ListAnalysisResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/analysis?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
56
74
  }
75
+ static DeleteAnalysis(req: SingleAnalysisRequest, initReq?: fm.InitReq): Promise<Analysis> {
76
+ return fm.fetchReq<SingleAnalysisRequest, Analysis>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/analysis/${req["name"]}`, {...initReq, method: "DELETE"})
77
+ }
57
78
  }
@@ -77,7 +77,8 @@ export type ListJobsResponse = {
77
77
  page?: BaizeCommonCommon.Pagination
78
78
  }
79
79
 
80
- export type SingleJobRequest = {
80
+
81
+ /* baize modified */ export type BaseSingleJobRequest = {
81
82
  workspace?: number
82
83
  type?: JobType
83
84
  cluster?: string
@@ -85,6 +86,9 @@ export type SingleJobRequest = {
85
86
  name?: string
86
87
  }
87
88
 
89
+ export type SingleJobRequest = BaseSingleJobRequest
90
+ & OneOf<{ deleteAnalysis: boolean }>
91
+
88
92
  export type CreateJobRequest = {
89
93
  workspace?: number
90
94
  type?: JobType
@@ -10,6 +10,15 @@ import * as fm from "../../../fetch.pb"
10
10
  import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
11
11
  import * as BaizeManagement_apiAnalysisV1alpha1Analysis from "../../analysis/v1alpha1/analysis.pb"
12
12
 
13
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
14
+ type OneOf<T> =
15
+ | { [k in keyof T]?: undefined }
16
+ | (
17
+ keyof T extends infer K ?
18
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
19
+ : never)
20
+ : never);
21
+
13
22
  export enum NotebookType {
14
23
  TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
15
24
  JUPYTER = "JUPYTER",
@@ -87,13 +96,17 @@ export type ListNotebooksResponse = {
87
96
  page?: BaizeCommonCommon.Pagination
88
97
  }
89
98
 
90
- export type SingleNotebookRequest = {
99
+
100
+ /* baize modified */ export type BaseSingleNotebookRequest = {
91
101
  workspace?: number
92
102
  cluster?: string
93
103
  namespace?: string
94
104
  name?: string
95
105
  }
96
106
 
107
+ export type SingleNotebookRequest = BaseSingleNotebookRequest
108
+ & OneOf<{ deleteAnalysis: boolean }>
109
+
97
110
  export type CreateNotebookRequest = {
98
111
  workspace?: number
99
112
  cluster?: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/baize",
3
- "version": "v0.105.2",
3
+ "version": "v0.105.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"