types.module.ts 2.23 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
22
23
export interface EntitlementNameSpace  {
  name: string;
Lukas Burgey's avatar
Lukas Burgey committed
24
25
}

26
export interface VO {
Lukas Burgey's avatar
wip    
Lukas Burgey committed
27
  id: number;
Lukas Burgey's avatar
Lukas Burgey committed
28
  name: string;
29
30
31
32
  pretty_name: string;
  description: string;
  resourceType: string;
  name_space?: EntitlementNameSpace;
Lukas Burgey's avatar
Lukas Burgey committed
33
34
35
36
}

export interface Site {
  id: number;
37
38
39
  name: string;
}

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

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

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

56
export interface Service {
57
  id: number;
58
  name: string;
59
60
  site: Site[];
  description: string;
61
  vos: VO[];
62
63
}

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

Lukas Burgey's avatar
Lukas Burgey committed
68
69
70
71
72
73
export interface CredentialState {
  state: string;
  state_target: string;
  credential: SSHKeyRef;
}

74
// corresponds to NewDeploymentStateItem in the backend
Lukas Burgey's avatar
Lukas Burgey committed
75
76
export interface DeploymentStateItem {
  id: number;
77
  service: Service | undefined;
78
  vo: VO | undefined;
79
  services: Service[];
Lukas Burgey's avatar
Lukas Burgey committed
80
81
  site: Site;
  state: string;
82
83
  questionnaire: JSONObject;
  credentials: JSONObject;
Lukas Burgey's avatar
Lukas Burgey committed
84
  credential_states: CredentialState[];
Lukas Burgey's avatar
Lukas Burgey committed
85
  message: string;
Lukas Burgey's avatar
Lukas Burgey committed
86
}
87
88

// corresponds to NewDeployment in the backend
Lukas Burgey's avatar
Lukas Burgey committed
89
export interface Deployment {
Lukas Burgey's avatar
Lukas Burgey committed
90
  id: number;
91
  service: Service | undefined;
92
  vo: number | undefined; // the vo id
Lukas Burgey's avatar
Lukas Burgey committed
93
  services: Service[];
94
  sites: Site[];
95
96
97
  state_items: DeploymentStateItem[];
  state: string
  state_target: string
98
99
}

100
export interface UserInfo {
101
  vos: string[];
102
103
}

104
export interface User {
105
  id: number;
106
  profile_name: string;
107
  userinfo: UserInfo;
108
  ssh_keys: SSHKey[];
109
  vos: VO[];
110
111
112
113
114

  // these are additions here
  services: Service[];
  deployments: Deployment[];
  error?: string;
115
116
}

Lukas Burgey's avatar
Lukas Burgey committed
117
118
export interface UserState {
  deployments: Deployment[];
119
  //deployment_state_items: DeploymentStateItem[];
120
121
}

122
export interface State {
123
  user: User;
124
125
126
127
128
  error?: string;
}

export interface Update {
  deployment?: Deployment;
Lukas Burgey's avatar
Lukas Burgey committed
129
  error?: string;
130
131
132
133
134
135
136
137
138
139
140
}


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