types.module.ts 1.57 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 23 24 25 26 27
// user stuff
export interface Group {
  name: string;
}

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

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

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

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

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

Lukas Burgey's avatar
Lukas Burgey committed
54 55 56 57 58 59 60
export interface DeploymentStateItem {
  id: number;
  site: Site;
  state: string;
  questionnaire: any;
  credentials: any;
  key: SSHKeyRef;
61
  service: Service;
Lukas Burgey's avatar
Lukas Burgey committed
62 63 64 65 66 67 68 69 70 71 72
}
export interface DeploymentState {
  id: number;
  service: Service;
  state_items: DeploymentStateItem[];
}
export interface Deployment {
  service: Service;
  ssh_keys: SSHKeyRef[];
  ssh_keys_to_withdraw: SSHKeyRef[];
  states: DeploymentState[];
73 74 75 76 77 78
}

export interface User {
  email: string;
  userinfo: any;
  ssh_keys: SSHKey[];
Lukas Burgey's avatar
Lukas Burgey committed
79
  services: Service[];
80
  id: number;
81 82
}

Lukas Burgey's avatar
Lukas Burgey committed
83 84 85 86
export interface UserState {
  deployments: Deployment[];
  deployment_states: DeploymentState[];
  deployment_state_items: DeploymentStateItem[];
87 88
}

Lukas Burgey's avatar
Lukas Burgey committed
89
export interface StateAPIResult {
90
  user: User;
Lukas Burgey's avatar
Lukas Burgey committed
91 92 93
  user_state: UserState;
  services: Service[];
  error: string;
94 95 96 97 98 99 100 101 102 103 104
}


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