From 09b3b97e049725d8fb42a24bde57ca63c7c6a334 Mon Sep 17 00:00:00 2001 From: Jordan Jensen Date: Mon, 28 Oct 2024 14:33:52 -0700 Subject: [PATCH] Add frontend types for environment API endpoint --- .../vscode/src/api/resources/ContentRecords.ts | 13 +++++++++++++ extensions/vscode/src/api/types/contentRecords.ts | 2 ++ 2 files changed, 15 insertions(+) diff --git a/extensions/vscode/src/api/resources/ContentRecords.ts b/extensions/vscode/src/api/resources/ContentRecords.ts index 4b109dc3b..5b576bfbc 100644 --- a/extensions/vscode/src/api/resources/ContentRecords.ts +++ b/extensions/vscode/src/api/resources/ContentRecords.ts @@ -6,6 +6,7 @@ import { PreContentRecord, AllContentRecordTypes, ContentRecord, + Environment, } from "../types/contentRecords"; export class ContentRecords { @@ -130,4 +131,16 @@ export class ContentRecords { }, ); } + + getEnv(deploymentName: string, dir: string) { + const encodedName = encodeURIComponent(deploymentName); + return this.client.get( + `deployments/${encodedName}/environment`, + { + params: { + dir, + }, + }, + ); + } } diff --git a/extensions/vscode/src/api/types/contentRecords.ts b/extensions/vscode/src/api/types/contentRecords.ts index aacd77ce0..e93734e17 100644 --- a/extensions/vscode/src/api/types/contentRecords.ts +++ b/extensions/vscode/src/api/types/contentRecords.ts @@ -76,6 +76,8 @@ export type AllContentRecordTypes = | PreContentRecordWithConfig | ContentRecordError; +export type Environment = Array; + export function isSuccessful( d: AllContentRecordTypes | undefined, ): boolean | undefined {