types.module.ts 1.73 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
22
// user stuff
export interface Group {
Lukas Burgey's avatar
wip    
Lukas Burgey committed
23
  id: number;
Lukas Burgey's avatar
Lukas Burgey committed
24
25
26
27
28
  name: string;
}

export interface Site {
  id: number;
29
30
31
  name: string;
}

32
33
34
35
36
37
38
export interface NewSSHKey {
  name: string;
  key: string;
}

export interface SSHKey {
  id: number;
39
40
41
42
  name: string;
  key: string;
}

Lukas Burgey's avatar
Lukas Burgey committed
43
44
45
46
47
export interface SSHKeyRef {
  id: number;
  name: string;
}

48
export interface Service {
49
  id: number;
50
  name: string;
Lukas Burgey's avatar
Lukas Burgey committed
51
  sites: Site[];
Lukas Burgey's avatar
wip    
Lukas Burgey committed
52
  groups: Group[];
53
54
}

55
56
57
58
interface JSONObject {
  [key: string]: string;
}

Lukas Burgey's avatar
Lukas Burgey committed
59
60
61
62
export interface DeploymentStateItem {
  id: number;
  site: Site;
  state: string;
63
64
  questionnaire: JSONObject;
  credentials: JSONObject;
Lukas Burgey's avatar
Lukas Burgey committed
65
  key: SSHKeyRef;
66
  service: Service;
Lukas Burgey's avatar
Lukas Burgey committed
67
68
69
70
}
export interface DeploymentState {
  id: number;
  service: Service;
Lukas Burgey's avatar
Lukas Burgey committed
71
  key: SSHKeyRef;
Lukas Burgey's avatar
Lukas Burgey committed
72
73
74
  state_items: DeploymentStateItem[];
}
export interface Deployment {
Lukas Burgey's avatar
Lukas Burgey committed
75
  id: number;
Lukas Burgey's avatar
Lukas Burgey committed
76
  service: Service;
Lukas Burgey's avatar
Lukas Burgey committed
77
78
  services: Service[];
  group: number; // the group id
Lukas Burgey's avatar
Lukas Burgey committed
79
80
  ssh_keys: SSHKeyRef[];
  states: DeploymentState[];
81
82
83
}

export interface User {
84
  profile_name: string;
85
86
  userinfo: any;
  ssh_keys: SSHKey[];
Lukas Burgey's avatar
Lukas Burgey committed
87
  services: Service[];
88
  id: number;
Lukas Burgey's avatar
wip    
Lukas Burgey committed
89
  groups: Group[];
90
91
}

Lukas Burgey's avatar
Lukas Burgey committed
92
93
94
95
export interface UserState {
  deployments: Deployment[];
  deployment_states: DeploymentState[];
  deployment_state_items: DeploymentStateItem[];
96
97
}

Lukas Burgey's avatar
Lukas Burgey committed
98
export interface StateAPIResult {
99
  user: User;
Lukas Burgey's avatar
Lukas Burgey committed
100
101
  user_state: UserState;
  services: Service[];
Lukas Burgey's avatar
Lukas Burgey committed
102
  error?: string;
103
104
105
106
107
108
109
110
111
112
113
}


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