@orsetra/shared-ui 1.1.18 → 1.1.20

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.
package/api/env.ts ADDED
@@ -0,0 +1,29 @@
1
+ export interface CreateEnvRequest {
2
+ name: string;
3
+ alias?: string;
4
+ project: string;
5
+ description?: string;
6
+ targets: string[];
7
+ namespace?: string;
8
+ }
9
+
10
+ export interface Env {
11
+ name: string;
12
+ alias?: string;
13
+ description?: string;
14
+ namespace: string;
15
+ targets?: NameAlias[];
16
+ project: NameAlias;
17
+ createTime?: string;
18
+ updateTime?: string;
19
+ }
20
+
21
+ export interface EnvListResponse {
22
+ envs: Env[];
23
+ total: number;
24
+ }
25
+
26
+ export interface NameAlias {
27
+ name: string;
28
+ alias?: string;
29
+ }
package/api/index.ts ADDED
@@ -0,0 +1,16 @@
1
+ export * from './addon';
2
+ export * from './application';
3
+ export * from './cluster';
4
+ export * from './component';
5
+ export * from './configs';
6
+ export * from './definitions';
7
+ export * from './env';
8
+ export * from './kubernetes';
9
+ export * from './observation';
10
+ export * from './project';
11
+ export * from './pipeline';
12
+ export * from './repository';
13
+ export * from './roles';
14
+ export * from './system';
15
+ export * from './target';
16
+ export * from './user';
@@ -0,0 +1,9 @@
1
+ export interface ObjectReference {
2
+ kind?: string;
3
+ namespace?: string;
4
+ name?: string;
5
+ uid?: string;
6
+ apiVersion?: string;
7
+ resourceVersion?: string;
8
+ fieldPath?: string;
9
+ }
@@ -0,0 +1,241 @@
1
+ import type { ApplicationComponent, ComponentStatus } from './application';
2
+
3
+ export interface PodBase {
4
+ cluster: string;
5
+ component: string;
6
+ metadata: {
7
+ creationTime: string;
8
+ name: string;
9
+ namespace: string;
10
+ version: {
11
+ deployVersion: string;
12
+ publishVersion: string;
13
+ revision: string;
14
+ };
15
+ };
16
+ status: {
17
+ phase: string;
18
+ podIP?: string;
19
+ hostIP?: string;
20
+ nodeName?: string;
21
+ };
22
+ workload: {
23
+ apiVersion: string;
24
+ kind: string;
25
+ };
26
+ }
27
+
28
+ export interface Container {
29
+ image: string;
30
+ name: string;
31
+ resources?: {
32
+ limits?: {
33
+ cpu: string;
34
+ memory: string;
35
+ };
36
+ requests?: {
37
+ cpu: string;
38
+ memory: string;
39
+ };
40
+ usage?: {
41
+ cpu: string;
42
+ memory: string;
43
+ };
44
+ };
45
+ status?: Podstatus;
46
+ }
47
+
48
+ export interface Podstatus {
49
+ restartCount: number;
50
+ state: {
51
+ running?: {};
52
+ terminated?: {};
53
+ waiting?: {};
54
+ };
55
+ }
56
+
57
+ export interface PodDetailBase {
58
+ containers: Container[];
59
+ events: Event[];
60
+ }
61
+
62
+ export interface Event {
63
+ TypeMeta: {};
64
+ count?: number;
65
+ action?: string;
66
+ eventTime?: string | null;
67
+ firstTimestamp?: string | null;
68
+ involvedObject?: {
69
+ apiVersion?: string;
70
+ fieldPath?: string;
71
+ kind?: string;
72
+ name?: string;
73
+ namespace?: string;
74
+ resourceVersion?: string;
75
+ uid?: string;
76
+ };
77
+ lastTimestamp?: string | null;
78
+ message: string;
79
+ metadata?: Metadata;
80
+ reason: string;
81
+ reportingComponent?: string;
82
+ reportingInstance?: string;
83
+ source?: {
84
+ component: string;
85
+ host?: string;
86
+ };
87
+ type: string;
88
+ }
89
+
90
+ export interface Metadata {
91
+ creationTimestamp?: string;
92
+ managedFields?: ManagedFields[];
93
+ name: string;
94
+ namespace: string;
95
+ resourceVersion: string;
96
+ selfLink: string;
97
+ uid: string;
98
+ annotations?: Record<string, string>;
99
+ labels?: Record<string, string>;
100
+ }
101
+
102
+ export interface ManagedFields {
103
+ apiVersion?: string;
104
+ fieldsType?: string;
105
+ fieldsV1?: any;
106
+ manager: string;
107
+ operation: string;
108
+ time: string;
109
+ }
110
+
111
+ export interface CloudResource {
112
+ name: string;
113
+ region: string;
114
+ url: string;
115
+ status: string;
116
+ }
117
+
118
+ export interface Configuration extends ResourceObject {
119
+ apiVersion: string;
120
+ kind: string;
121
+ spec: {
122
+ providerRef: {
123
+ name: string;
124
+ namespace: string;
125
+ };
126
+ region?: string;
127
+ };
128
+ status?: {
129
+ apply?: {
130
+ outputs?: any;
131
+ state?: string;
132
+ message?: string;
133
+ region?: string;
134
+ };
135
+ };
136
+ }
137
+
138
+ export interface Secret {
139
+ apiVersion: string;
140
+ kind: string;
141
+ metadata: {
142
+ name: string;
143
+ namespace: string;
144
+ annotations: Record<string, string>;
145
+ labels: Record<string, string>;
146
+ };
147
+ data: Record<string, string>;
148
+ }
149
+
150
+ export interface Service {
151
+ apiVersion: string;
152
+ kind: string;
153
+ metadata: {
154
+ name: string;
155
+ namespace: string;
156
+ annotations: any;
157
+ labels: any;
158
+ };
159
+ spec: {
160
+ type: string;
161
+ ports?: [
162
+ {
163
+ nodePort: number;
164
+ port: number;
165
+ protocol: string;
166
+ targetPort: number;
167
+ },
168
+ ];
169
+ };
170
+ status?: {
171
+ loadBalancer?: {
172
+ ingress?: [{ ip: string }];
173
+ };
174
+ };
175
+ }
176
+
177
+ export interface ContainerLogResponse {
178
+ logs: string;
179
+ err: string;
180
+ info: {
181
+ fromDate: string;
182
+ toDate: string;
183
+ };
184
+ }
185
+
186
+ export interface Endpoint {
187
+ endpoint: {
188
+ appProtocol: string;
189
+ host: string;
190
+ port: number | string;
191
+ protocol: string;
192
+ path?: string;
193
+ inner: boolean;
194
+ portName?: string;
195
+ };
196
+ ref: {
197
+ kind: string;
198
+ name: string;
199
+ namespace: string;
200
+ resourceVersion: string;
201
+ uid: string;
202
+ };
203
+ }
204
+
205
+ export interface Resource {
206
+ apiVersion?: string;
207
+ cluster?: string;
208
+ kind?: string;
209
+ name: string;
210
+ namespace?: string;
211
+ }
212
+
213
+ export interface AppliedResource extends Resource {
214
+ component: string;
215
+ trait?: string;
216
+ publishVersion?: string;
217
+ revision?: string;
218
+ latest: boolean;
219
+ resourceTree?: ResourceTreeNode;
220
+ }
221
+
222
+ export interface ResourceTreeNode extends Resource {
223
+ uid?: string;
224
+ healthStatus?: ResourceHealthStatus;
225
+ additionalInfo?: Record<string, any>;
226
+ leafNodes?: ResourceTreeNode[];
227
+
228
+ // For the component node
229
+ service?: ComponentStatus;
230
+ component?: ApplicationComponent;
231
+ }
232
+
233
+ export interface ResourceHealthStatus {
234
+ statusCode: string;
235
+ reason: string;
236
+ message: string;
237
+ }
238
+
239
+ export interface ResourceObject {
240
+ metadata: Metadata;
241
+ }
@@ -0,0 +1,172 @@
1
+ import type { Condition, InputItem, OutputItem, WorkflowMode, WorkflowStepStatus } from './application';
2
+ import type { NameAlias } from './env';
3
+ import { KeyValue } from "../types";
4
+
5
+ export interface CreatePipelineRequest {
6
+ name: string;
7
+ project: string;
8
+ alias?: string;
9
+ description?: string;
10
+ spec: {
11
+ steps: WorkflowStep[];
12
+ mode?: PipelineRunMode;
13
+ };
14
+ }
15
+
16
+ interface PipelineMeta {
17
+ name: string;
18
+ alias?: string;
19
+ description?: string;
20
+ project: NameAlias;
21
+ createTime?: string;
22
+ }
23
+
24
+ export interface PipelineListItem extends PipelineMeta {
25
+ info?: {
26
+ lastRun?: PipelineRun;
27
+ runStat?: {
28
+ activeNum: number;
29
+ total: RunStateInfo;
30
+ week: RunStateInfo[];
31
+ };
32
+ };
33
+ }
34
+
35
+ export interface PipelineSpec {
36
+ mode: PipelineRunMode;
37
+ steps: WorkflowStep[];
38
+ }
39
+
40
+ export interface PipelineBase extends PipelineMeta {
41
+ spec: PipelineSpec;
42
+ }
43
+
44
+ export interface PipelineRun extends PipelineRunBase {
45
+ status?: PipelineRunStatus;
46
+ }
47
+
48
+ export interface PipelineDetail {
49
+ alias: string;
50
+ description: string;
51
+ name: string;
52
+ project: NameAlias;
53
+ createTime?: string;
54
+ spec: {
55
+ steps: WorkflowStep[];
56
+ mode?: PipelineRunMode;
57
+ };
58
+ }
59
+
60
+ export interface RunStateInfo {
61
+ total: number;
62
+ success: number;
63
+ fail: number;
64
+ }
65
+
66
+ export interface PipelineRunMeta {
67
+ pipelineName: string;
68
+ project: NameAlias;
69
+ pipelineRunName: string;
70
+ }
71
+
72
+ export interface PipelineRunBase extends PipelineRunMeta {
73
+ record: string;
74
+ contextName?: string;
75
+ contextValues?: KeyValue[];
76
+ spec: PipelineRunSpec;
77
+ }
78
+
79
+ export interface PipelineRunBriefing {
80
+ pipelineRunName: string;
81
+ finished: boolean;
82
+ phase: RunPhase;
83
+ message: string;
84
+ startTime: string;
85
+ endTime: string;
86
+ contextName: string;
87
+ contextValues: KeyValue[];
88
+ }
89
+
90
+ interface PipelineRunSpec {
91
+ context?: Record<string, any>;
92
+ mode?: PipelineRunMode;
93
+ workflowSpec: {
94
+ steps: WorkflowStep[];
95
+ };
96
+ }
97
+
98
+ export interface WorkflowStepBase {
99
+ name: string;
100
+ alias?: string;
101
+ description?: string;
102
+ type: string;
103
+ meta?: {
104
+ alias?: string;
105
+ };
106
+ if?: string;
107
+ timeout?: string;
108
+ dependsOn?: string[];
109
+ inputs?: InputItem[];
110
+ outputs?: OutputItem[];
111
+ properties?: Record<string, any>;
112
+ }
113
+
114
+ export interface WorkflowStep extends WorkflowStepBase {
115
+ mode?: WorkflowMode;
116
+ subSteps?: WorkflowStepBase[];
117
+ }
118
+
119
+ interface PipelineRunMode {
120
+ steps?: WorkflowMode;
121
+ subSteps?: WorkflowMode;
122
+ }
123
+
124
+ export type RunPhase =
125
+ | 'initializing'
126
+ | 'executing'
127
+ | 'suspending'
128
+ | 'terminated'
129
+ | 'failed'
130
+ | 'succeeded'
131
+ | 'skipped'
132
+ | string;
133
+
134
+ export interface PipelineRunStatus {
135
+ conditions?: Condition[];
136
+ mode?: PipelineRunMode;
137
+ status: RunPhase;
138
+ message?: string;
139
+ suspend: boolean;
140
+ suspendState?: string;
141
+ terminated: boolean;
142
+ finished: boolean;
143
+ steps?: WorkflowStepStatus[];
144
+ startTime?: string;
145
+ endTime?: string;
146
+ }
147
+
148
+ export interface WorkflowStepOutputs {
149
+ stepName: string;
150
+ stepID: string;
151
+ values?: WorkflowStepOutputValue[];
152
+ }
153
+
154
+ export interface WorkflowStepInputs {
155
+ name: string;
156
+ id: string;
157
+ type: string;
158
+ values?: WorkflowStepInputValue[];
159
+ }
160
+
161
+ export interface WorkflowStepOutputValue {
162
+ name: string;
163
+ valueFrom: string;
164
+ value: string;
165
+ }
166
+
167
+ export interface WorkflowStepInputValue {
168
+ from: string;
169
+ parameterKey?: string;
170
+ value: string;
171
+ fromStep: string;
172
+ }
package/api/project.ts ADDED
@@ -0,0 +1,86 @@
1
+ import type { NameAlias } from './env';
2
+ export interface Project {
3
+ name: string;
4
+ alias?: string;
5
+ description?: string;
6
+ createTime?: string;
7
+ updateTime?: string;
8
+ owner?: NameAlias;
9
+ organizationID?: string;
10
+ }
11
+
12
+ export interface ProjectBaseCreate {
13
+ name: string;
14
+ alias?: string;
15
+ description?: string;
16
+ owner?: string;
17
+ organizationID?: string;
18
+ }
19
+
20
+ export interface ProjectDetail {
21
+ name: string;
22
+ alias?: string;
23
+ description?: string;
24
+ createTime?: string;
25
+ updateTime?: string;
26
+ owner?: NameAlias;
27
+ organizationID?: string;
28
+ }
29
+
30
+ export interface ProjectUser {
31
+ name: string;
32
+ createTime?: string;
33
+ updateTime?: string;
34
+ userRoles: string[];
35
+ }
36
+
37
+ export interface ProjectUserCreate {
38
+ userName: string;
39
+ userRoles: string;
40
+ }
41
+
42
+ export interface ProjectName {
43
+ projectName: string;
44
+ }
45
+
46
+ export interface QueryProjectUser {
47
+ projectName: string;
48
+ userName: string;
49
+ }
50
+
51
+ export interface UserRoles {
52
+ userRoles: string[];
53
+ }
54
+
55
+ export interface QueryProjectRole {
56
+ projectName: string;
57
+ roleName: string;
58
+ }
59
+
60
+ export interface ProjectRole {
61
+ name: string;
62
+ alias?: string;
63
+ permissions: string[];
64
+ }
65
+
66
+ export interface ProjectRoleBase {
67
+ name: string;
68
+ alias?: string;
69
+ createTime?: string;
70
+ updateTime?: string;
71
+ permissions?: NameAlias[];
72
+ }
73
+
74
+ export interface ProjectMember {
75
+ name: string;
76
+ alias?: string;
77
+ createTime?: string;
78
+ updateTime?: string;
79
+ userRoles: string[];
80
+ }
81
+
82
+ export interface ProjectUserQuery {
83
+ projectName: string;
84
+ page: number;
85
+ pageSize: number;
86
+ }
@@ -0,0 +1,77 @@
1
+ export interface HelmRepo {
2
+ url: string;
3
+ type?: string;
4
+ secretName?: string;
5
+ }
6
+
7
+ export interface ChartVersion {
8
+ name: string;
9
+ version: string;
10
+ description?: string;
11
+ apiVersion: string;
12
+ appVersion: string;
13
+ type?: string;
14
+ urls: string[];
15
+ created: string;
16
+ digest: string;
17
+ icon?: string;
18
+ }
19
+
20
+ export interface ImageInfo {
21
+ info?: {
22
+ architecture: string;
23
+ config?: {
24
+ ArgsEscaped: boolean;
25
+ Cmd: string[];
26
+ Env: string[];
27
+ Labels: Record<string, string>;
28
+ Volumes: Record<string, any>;
29
+ ExposedPorts: Record<string, any>;
30
+ };
31
+ manifest?: {
32
+ config: {
33
+ size: number;
34
+ mediaType: string;
35
+ };
36
+ layers: Array<{
37
+ mediaType: string;
38
+ size: number;
39
+ }>;
40
+ };
41
+ created: string;
42
+ os: string;
43
+ docker_version: string;
44
+ author?: string;
45
+ };
46
+ size: number;
47
+ name: string;
48
+ secretNames?: string[];
49
+ registry: string;
50
+ message?: string;
51
+ }
52
+
53
+ export interface ImageRegistry {
54
+ name?: string;
55
+ secretName: string;
56
+ domain?: string;
57
+ }
58
+
59
+ export interface GetImageReposResponse {
60
+ registries: ImageRegistry[];
61
+ }
62
+
63
+ export async function getImageRepos(params: { project: string }): Promise<GetImageReposResponse> {
64
+ const response = await fetch(`/api/v1/projects/${params.project}/image-registries`);
65
+ if (!response.ok) {
66
+ throw new Error(`Failed to fetch image registries: ${response.statusText}`);
67
+ }
68
+ return response.json();
69
+ }
70
+
71
+ export async function getImageInfo(params: { project: string; name: string }): Promise<ImageInfo> {
72
+ const response = await fetch(`/api/v1/projects/${params.project}/images/${encodeURIComponent(params.name)}`);
73
+ if (!response.ok) {
74
+ throw new Error(`Failed to fetch image info: ${response.statusText}`);
75
+ }
76
+ return response.json();
77
+ }
package/api/roles.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { NameAlias } from './env';
2
+
3
+ export interface RolesBase {
4
+ name: string;
5
+ alias?: string;
6
+ createTime?: string;
7
+ updateTime?: string;
8
+ permissions?: NameAlias[];
9
+ }
10
+
11
+ export interface RolesCreateBase {
12
+ name: string;
13
+ alias?: string;
14
+ permissions: string[];
15
+ }
package/api/system.ts ADDED
@@ -0,0 +1,41 @@
1
+ export interface SystemInfo {
2
+ systemVersion?: {
3
+ velaVersion: string;
4
+ gitVersion: string;
5
+ };
6
+ installTime: string;
7
+ enableCollection: boolean;
8
+ loginType?: boolean;
9
+ platformID: string;
10
+ statisticInfo: {
11
+ clusterCount?: string;
12
+ appCount?: string;
13
+ enableAddonList?: Record<string, string>;
14
+ componentDefinitionTopList?: string[];
15
+ traitDefinitionTopList?: string[];
16
+ workflowDefinitionTopList?: string[];
17
+ policyDefinitionTopList?: string[];
18
+ updateTime: string;
19
+ };
20
+ dexUserDefaultProjects?: Array<{
21
+ name: string;
22
+ roles: string[];
23
+ }>;
24
+ }
25
+
26
+ export interface UpdateSystemInfo {
27
+ enableCollection: boolean;
28
+ loginType: 'local' | 'dex';
29
+ velaAddress: string;
30
+ dexUserDefaultProjects?: Array<{
31
+ name: string;
32
+ roles: string[];
33
+ }>;
34
+ }
35
+
36
+ export interface DexConfig {
37
+ clientID: string;
38
+ clientSecret: string;
39
+ issuer: string;
40
+ redirectURL: string;
41
+ }
package/api/target.ts ADDED
@@ -0,0 +1,20 @@
1
+ import type { NameAlias } from './env';
2
+ export type Target = {
3
+ id?: string;
4
+ name: string;
5
+ alias?: string;
6
+ description?: string;
7
+ clusterAlias?: string;
8
+ cluster?: {
9
+ clusterName?: string;
10
+ namespace?: string;
11
+ };
12
+ variable?: any;
13
+ project?: NameAlias;
14
+ };
15
+ export interface ProvideList {
16
+ name: string;
17
+ region: string;
18
+ provider: string;
19
+ createTime: string;
20
+ }