types.module.ts 2 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 type GroupMap = Map<Group, Service[]>

Lukas Burgey's avatar
Lukas Burgey committed
34
35
export interface Site {
  id: number;
36
37
38
  name: string;
}

39
40
41
42
43
44
45
export interface NewSSHKey {
  name: string;
  key: string;
}

export interface SSHKey {
  id: number;
46
47
48
49
  name: string;
  key: string;
}

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

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

63
64
65
66
interface JSONObject {
  [key: string]: string;
}

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

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

92
93
94
95
export interface UserInfo {
  groups: string[];
}

96
export interface User {
97
  id: number;
98
  profile_name: string;
99
  userinfo: UserInfo;
100
  ssh_keys: SSHKey[];
Lukas Burgey's avatar
Lukas Burgey committed
101
  services: Service[];
Lukas Burgey's avatar
wip    
Lukas Burgey committed
102
  groups: Group[];
103
104
}

Lukas Burgey's avatar
Lukas Burgey committed
105
106
107
export interface UserState {
  deployments: Deployment[];
  deployment_state_items: DeploymentStateItem[];
108
109
}

Lukas Burgey's avatar
Lukas Burgey committed
110
export interface StateAPIResult {
111
  user: User;
Lukas Burgey's avatar
Lukas Burgey committed
112
113
  user_state: UserState;
  services: Service[];
Lukas Burgey's avatar
Lukas Burgey committed
114
  error?: string;
115
116
117
118
119
120
121
122
123
124
125
}


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