types.module.ts 1.84 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;
51
52
  site: Site[];
  description: string;
Lukas Burgey's avatar
wip    
Lukas Burgey committed
53
  groups: Group[];
54
55
}

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

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

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

Lukas Burgey's avatar
Lukas Burgey committed
98
99
100
101
export interface UserState {
  deployments: Deployment[];
  deployment_states: DeploymentState[];
  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 { }