From 892ea45212b7517ee862024d12dcf34d48c4ecf0 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Mon, 16 Dec 2024 12:09:10 -0500 Subject: [PATCH 1/5] Add visible property to subbuild and subdeploy status --- types/Build.ts | 1 + types/Deploy.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/Build.ts b/types/Build.ts index 590318ef..e6aac77e 100644 --- a/types/Build.ts +++ b/types/Build.ts @@ -18,6 +18,7 @@ export type SubbuildStatus = { startedAt: string; status: ValueOf; id: string; + visible: boolean; }; export type Build = { diff --git a/types/Deploy.ts b/types/Deploy.ts index 83e93de0..8c26ca4d 100644 --- a/types/Deploy.ts +++ b/types/Deploy.ts @@ -18,6 +18,7 @@ export type SubdeployStatus = { startedAt: string; status: DeployStatus; id: string; + visible: boolean; }; export type Deploy = { From 2625af6916eb8b25e32b608fe4aa89acc32b02dd Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Mon, 16 Dec 2024 12:15:54 -0500 Subject: [PATCH 2/5] v0.1.0-experimental.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d532ed5f..4da4a9c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hubspot/local-dev-lib", - "version": "3.0.1", + "version": "0.1.0-experimental.2", "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI", "main": "lib/index.js", "repository": { From baf5a19a3e8bceef9a01f1600d7dc0048d07e480 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Mon, 16 Dec 2024 13:06:38 -0500 Subject: [PATCH 3/5] Remove OptionalError --- types/Build.ts | 4 ++-- types/Deploy.ts | 4 ++-- types/Error.ts | 2 -- types/Migration.ts | 5 +++-- types/Project.ts | 17 +++++++++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/types/Build.ts b/types/Build.ts index e6aac77e..48ff5ebc 100644 --- a/types/Build.ts +++ b/types/Build.ts @@ -6,7 +6,7 @@ import { } from '../enums/build'; import { ActivitySource } from './Activity'; import { DeployStatusTaskLocator } from './Deploy'; -import { OptionalError } from './Error'; +import { ProjectStandardError } from './Project'; export type SubbuildStatus = { buildName: string; @@ -14,7 +14,7 @@ export type SubbuildStatus = { errorMessage: string; finishedAt: string; rootPath: string; - standardError?: OptionalError; + standardError: ProjectStandardError | null; startedAt: string; status: ValueOf; id: string; diff --git a/types/Deploy.ts b/types/Deploy.ts index 8c26ca4d..8b162614 100644 --- a/types/Deploy.ts +++ b/types/Deploy.ts @@ -2,7 +2,7 @@ import { ValueOf } from './Utils'; import { ACTIVITY_SOURCE } from '../enums/project'; import { DEPLOY_ACTION, DEPLOY_STATUS } from '../enums/deploy'; import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build'; -import { OptionalError } from './Error'; +import { ProjectStandardError } from './Project'; export type DeployStatus = ValueOf; @@ -14,7 +14,7 @@ export type SubdeployStatus = { | ValueOf; errorMessage: string; finishedAt: string; - standardError?: OptionalError; + standardError: ProjectStandardError | null; startedAt: string; status: DeployStatus; id: string; diff --git a/types/Error.ts b/types/Error.ts index 39f87538..e1a6e2fd 100644 --- a/types/Error.ts +++ b/types/Error.ts @@ -36,8 +36,6 @@ export interface HubSpotHttpErrorContext extends FileSystemErrorContext { projectName?: string; } -export type OptionalError = BaseError | null | undefined; - export type ErrorContext = { accountId?: number; }; diff --git a/types/Migration.ts b/types/Migration.ts index 6e33cffe..284eedde 100644 --- a/types/Migration.ts +++ b/types/Migration.ts @@ -1,5 +1,6 @@ import { ValueOf } from './Utils'; -import { OptionalError } from './Error'; +import { ProjectStandardError } from './Project'; + export const MIGRATION_STATUS = { BUILDING: 'BUILDING', FAILURE: 'FAILURE', @@ -21,6 +22,6 @@ export type CloneAppResponse = { export type PollAppResponse = { id: number; project?: { id: number; name: string; buildId: number; deployId: number }; - error?: OptionalError; + error: ProjectStandardError | null; status: ValueOf; }; diff --git a/types/Project.ts b/types/Project.ts index e37c0371..d3a1ecb2 100644 --- a/types/Project.ts +++ b/types/Project.ts @@ -45,3 +45,20 @@ export type FetchPlatformVersionResponse = { defaultPlatformVersion: string; activePlatformVersions: Array; }; + +export type ProjectStandardError = { + status: string; + id?: string; + category: string; + subCategory?: string; + message?: string; + errors?: Array<{ + message: string; + in?: string; + code?: string; + subcateogy?: string; + context: object; + }>; + context: object; + links: { [key: string]: string }; +}; From fffca03797804425c37afc8e119801da846d2f9a Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Mon, 16 Dec 2024 15:54:55 -0500 Subject: [PATCH 4/5] update types --- api/projects.ts | 6 +----- package.json | 2 +- types/Build.ts | 1 + types/Project.ts | 5 +++++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/api/projects.ts b/api/projects.ts index ce7be00b..dd90d718 100644 --- a/api/projects.ts +++ b/api/projects.ts @@ -7,6 +7,7 @@ import { UploadProjectResponse, ProjectSettings, FetchPlatformVersionResponse, + WarnLogsResponse, } from '../types/Project'; import { Build, FetchProjectBuildsResponse } from '../types/Build'; import { @@ -14,7 +15,6 @@ import { ProjectComponentsMetadata, } from '../types/ComponentStructure'; import { Deploy, ProjectDeployResponse } from '../types/Deploy'; -import { ProjectLog } from '../types/ProjectLog'; import { MigrateAppResponse, CloneAppResponse, @@ -272,10 +272,6 @@ export function cancelStagedBuild( }); } -type WarnLogsResponse = { - logs: Array; -}; - export function fetchBuildWarnLogs( accountId: number, projectName: string, diff --git a/package.json b/package.json index 4da4a9c3..d532ed5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hubspot/local-dev-lib", - "version": "0.1.0-experimental.2", + "version": "3.0.1", "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI", "main": "lib/index.js", "repository": { diff --git a/types/Build.ts b/types/Build.ts index 48ff5ebc..1d150b9d 100644 --- a/types/Build.ts +++ b/types/Build.ts @@ -36,6 +36,7 @@ export type Build = { status: ValueOf; subbuildStatuses: Array; uploadMessage: string; + autoDeployId: number; }; export type FetchProjectBuildsResponse = { diff --git a/types/Project.ts b/types/Project.ts index d3a1ecb2..7835fd69 100644 --- a/types/Project.ts +++ b/types/Project.ts @@ -1,5 +1,6 @@ import { Build } from './Build'; import { GithubSourceData } from './Github'; +import { ProjectLog } from './ProjectLog'; export type Project = { createdAt: number; @@ -62,3 +63,7 @@ export type ProjectStandardError = { context: object; links: { [key: string]: string }; }; + +export type WarnLogsResponse = { + logs: Array; +}; From b3c75af8c906ba6b324caa8047fb68d71175d949 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 17 Dec 2024 11:02:07 -0500 Subject: [PATCH 5/5] Restore OptionalError --- types/Error.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/Error.ts b/types/Error.ts index e1a6e2fd..4b2593b1 100644 --- a/types/Error.ts +++ b/types/Error.ts @@ -36,6 +36,9 @@ export interface HubSpotHttpErrorContext extends FileSystemErrorContext { projectName?: string; } +// TODO: Remove in next major release +export type OptionalError = BaseError | null | undefined; + export type ErrorContext = { accountId?: number; };