types.module.ts 1.9 KB
Newer Older
1
2
3
4
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';


Lukas Burgey's avatar
Lukas Burgey committed
5
// auth stuff
6
7
export interface IdP {
  id: number;
8
9
10
11
12
13
14
15
  name: string;
}

export interface AuthInfo {
  idps: IdP[];
  default: number;
}

16
17
18
19
20
export interface AllAuthInfo {
  idps: IdP[];
  selected: IdP;
}

Lukas Burgey's avatar
Lukas Burgey committed
21
// user stuff
Lukas Burgey's avatar
Lukas Burgey committed
22
23
24
25
export interface GroupDescription {
  description: string;
}

Lukas Burgey's avatar
Lukas Burgey committed
26
export interface Group {
Lukas Burgey's avatar
wip    
Lukas Burgey committed
27
  id: number;
Lukas Burgey's avatar
Lukas Burgey committed
28
  name: string;
Lukas Burgey's avatar
Lukas Burgey committed
29
  description: GroupDescription;
Lukas Burgey's avatar
Lukas Burgey committed
30
31
32
33
}

export interface Site {
  id: number;
34
35
36
  name: string;
}

37
38
39
40
41
42
43
export interface NewSSHKey {
  name: string;
  key: string;
}

export interface SSHKey {
  id: number;
44
45
46
47
  name: string;
  key: string;
}

Lukas Burgey's avatar
Lukas Burgey committed
48
49
50
51
52
export interface SSHKeyRef {
  id: number;
  name: string;
}

53
export interface Service {
54
  id: number;
55
  name: string;
56
57
  site: Site[];
  description: string;
Lukas Burgey's avatar
wip    
Lukas Burgey committed
58
  groups: Group[];
59
60
}

61
62
63
64
interface JSONObject {
  [key: string]: string;
}

65
// corresponds to NewDeploymentStateItem in the backend
Lukas Burgey's avatar
Lukas Burgey committed
66
67
export interface DeploymentStateItem {
  id: number;
68
69
70
  service: Service | undefined;
  group: Group | undefined;
  services: Service[];
Lukas Burgey's avatar
Lukas Burgey committed
71
72
  site: Site;
  state: string;
73
74
  questionnaire: JSONObject;
  credentials: JSONObject;
Lukas Burgey's avatar
Lukas Burgey committed
75
  message: string;
Lukas Burgey's avatar
Lukas Burgey committed
76
}
77
78

// corresponds to NewDeployment in the backend
Lukas Burgey's avatar
Lukas Burgey committed
79
export interface Deployment {
Lukas Burgey's avatar
Lukas Burgey committed
80
  id: number;
81
82
  service: Service | undefined;
  group: number | undefined; // the group id
Lukas Burgey's avatar
Lukas Burgey committed
83
  services: Service[];
84
  sites: Site[];
85
86
87
  state_items: DeploymentStateItem[];
  state: string
  state_target: string
88
89
90
}

export interface User {
91
  id: number;
92
  profile_name: string;
93
94
  userinfo: any;
  ssh_keys: SSHKey[];
Lukas Burgey's avatar
Lukas Burgey committed
95
  services: Service[];
Lukas Burgey's avatar
wip    
Lukas Burgey committed
96
  groups: Group[];
97
98
}

Lukas Burgey's avatar
Lukas Burgey committed
99
100
101
export interface UserState {
  deployments: Deployment[];
  deployment_state_items: DeploymentStateItem[];
102
103
}

Lukas Burgey's avatar
Lukas Burgey committed
104
export interface StateAPIResult {
105
  user: User;
Lukas Burgey's avatar
Lukas Burgey committed
106
107
  user_state: UserState;
  services: Service[];
Lukas Burgey's avatar
Lukas Burgey committed
108
  error?: string;
109
110
111
112
113
114
115
116
117
118
119
}


@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [
  ]
})
export class TypesModule { }