types.module.ts 1.86 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
  message: string;
Lukas Burgey's avatar
Lukas Burgey committed
71
72
73
74
}
export interface DeploymentState {
  id: number;
  service: Service;
75
76
  services: Service[];
  group: Group;
Lukas Burgey's avatar
Lukas Burgey committed
77
  key: SSHKeyRef;
Lukas Burgey's avatar
Lukas Burgey committed
78
79
80
  state_items: DeploymentStateItem[];
}
export interface Deployment {
Lukas Burgey's avatar
Lukas Burgey committed
81
  id: number;
Lukas Burgey's avatar
Lukas Burgey committed
82
  service: Service;
Lukas Burgey's avatar
Lukas Burgey committed
83
84
  services: Service[];
  group: number; // the group id
Lukas Burgey's avatar
Lukas Burgey committed
85
86
  ssh_keys: SSHKeyRef[];
  states: DeploymentState[];
87
  sites: Site[];
88
89
90
}

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

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

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


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