Skip to content

Commit

Permalink
Merge pull request #227 from platformsh/fix-environment-types
Browse files Browse the repository at this point in the history
fix environment types
  • Loading branch information
shakaman authored Mar 20, 2023
2 parents 1b3b731 + fa4ea95 commit c755b00
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/model/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Route from "./Route";
import EnvironmentAccess from "./EnvironmentAccess";
import Metrics from "./Metrics";
import Commit from "./git/Commit";
import { getLink } from "../refs";

const paramDefaults = {
projectId: "project"
Expand Down Expand Up @@ -45,17 +44,29 @@ export enum Status {
};

interface DeploymentState {
crons: object;
crons: {
enabled: boolean;
status: "running" | "paused";
};
last_deployment_at: string | null;
last_deployment_successful: boolean;
}

interface HttpAccess {
is_enabled?: boolean;
addresses?: {
permission: "allow" | "deny";
address: string;
}[];
basic_auth?: Record<string, string | undefined>
}

export default class Environment extends Ressource {
id: string = ""
status: Status = Status.inactive;
head_commit: string = "";
name: string = "";
parent: string = "";
parent: string | null = null;
machine_name:string = "";
restrict_robots:boolean = false;
title: string = "";
Expand All @@ -69,7 +80,7 @@ export default class Environment extends Ressource {
has_code: boolean = false;
deployment_target: string = "";
deployment_state: DeploymentState | object = {};
http_access = {};
http_access: HttpAccess = {};
is_main: boolean = false;
type: string = "";

Expand Down Expand Up @@ -109,7 +120,7 @@ export default class Environment extends Ressource {
);
}

update(data: Environment) {
update(data: Partial<Environment>) {
return super.update(data);
}

Expand Down

0 comments on commit c755b00

Please sign in to comment.