types.module.ts 1.81 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;
}

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

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

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

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

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


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