@hubspot/local-dev-lib 0.7.6-experimental.4 → 0.7.8-experimental.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/projects.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { HubSpotPromise, QueryParams } from '../types/Http.js';
2
- import { Project, FetchProjectResponse, UploadProjectResponse, ProjectSettings, FetchPlatformVersionResponse, WarnLogsResponse, UploadIRResponse } from '../types/Project.js';
2
+ import { Project, FetchProjectResponse, UploadProjectResponse, ProjectSettings, FetchPlatformVersionResponse, WarnLogsResponse, UploadIRResponse, Release, FetchListReleasesResponse } from '../types/Project.js';
3
3
  import { Build, FetchProjectBuildsResponse } from '../types/Build.js';
4
4
  import { ComponentStructureResponse, ProjectComponentsMetadata } from '../types/ComponentStructure.js';
5
5
  import { Deploy, ProjectDeployResponse, ProjectDeployResponseV1, ProjectDeletionResponse } from '../types/Deploy.js';
@@ -39,6 +39,9 @@ export declare function deleteFileFromBuild(accountId: number, projectName: stri
39
39
  export declare function cancelStagedBuild(accountId: number, projectName: string): HubSpotPromise<void>;
40
40
  export declare function fetchBuildWarnLogs(accountId: number, projectName: string, buildId: number): HubSpotPromise<WarnLogsResponse>;
41
41
  export declare function fetchDeployWarnLogs(accountId: number, projectName: string, deployId: number): HubSpotPromise<WarnLogsResponse>;
42
+ export declare function createRelease(accountId: number, projectName: string, buildId: number): HubSpotPromise<Release>;
43
+ export declare function listReleases(accountId: number, projectName: string, params?: QueryParams): HubSpotPromise<FetchListReleasesResponse>;
44
+ export declare function getReleaseInfo(accountId: number, projectName: string, releaseTag: string): HubSpotPromise<Release>;
42
45
  /**
43
46
  * @deprecated
44
47
  */
package/api/projects.js CHANGED
@@ -215,6 +215,23 @@ export function fetchDeployWarnLogs(accountId, projectName, deployId) {
215
215
  url: `${PROJECTS_LOGS_API_PATH}/logs/projects/${encodeURIComponent(projectName)}/deploys/${deployId}/combined/warn`,
216
216
  });
217
217
  }
218
+ export function createRelease(accountId, projectName, buildId) {
219
+ return http.post(accountId, {
220
+ url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/releases`,
221
+ data: { buildId },
222
+ });
223
+ }
224
+ export function listReleases(accountId, projectName, params = {}) {
225
+ return http.get(accountId, {
226
+ url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/releases`,
227
+ params,
228
+ });
229
+ }
230
+ export function getReleaseInfo(accountId, projectName, releaseTag) {
231
+ return http.get(accountId, {
232
+ url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/releases/${encodeURIComponent(releaseTag)}`,
233
+ });
234
+ }
218
235
  /**
219
236
  * @deprecated
220
237
  */
package/config/state.js CHANGED
@@ -7,6 +7,7 @@ import { STATE_FLAGS } from '../constants/config.js';
7
7
  const i18nKey = 'config.state';
8
8
  const DEFAULT_STATE = {
9
9
  [STATE_FLAGS.MCP_TOTAL_TOOL_CALLS]: 0,
10
+ [STATE_FLAGS.USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION]: undefined,
10
11
  };
11
12
  function ensureCLIDirectory() {
12
13
  try {
@@ -21,19 +22,16 @@ function ensureCLIDirectory() {
21
22
  }));
22
23
  }
23
24
  }
24
- function sanitizeAndMerge(parsed) {
25
+ function parseState(parsed) {
25
26
  if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
26
27
  return structuredClone(DEFAULT_STATE);
27
28
  }
28
- const state = parsed;
29
+ const record = parsed;
29
30
  const result = structuredClone(DEFAULT_STATE);
30
- for (const key in DEFAULT_STATE) {
31
- const typedKey = key;
32
- if (key in state &&
33
- typeof state[typedKey] === typeof DEFAULT_STATE[typedKey]) {
34
- result[typedKey] = state[typedKey];
31
+ for (const key of Object.keys(DEFAULT_STATE)) {
32
+ if (key in record && record[key] !== undefined) {
33
+ Object.assign(result, { [key]: record[key] });
35
34
  }
36
- // keys not in parsed file remain as DEFAULT values
37
35
  }
38
36
  return result;
39
37
  }
@@ -48,7 +46,7 @@ function getCurrentState() {
48
46
  return structuredClone(DEFAULT_STATE);
49
47
  }
50
48
  const parsed = JSON.parse(data);
51
- return sanitizeAndMerge(parsed);
49
+ return parseState(parsed);
52
50
  }
53
51
  catch (error) {
54
52
  logger.debug(i18n(`${i18nKey}.getCurrentState.errors.errorReading`, {
@@ -56,6 +56,7 @@ export declare const HUBSPOT_ACCOUNT_TYPE_STRINGS: {
56
56
  };
57
57
  export declare const STATE_FLAGS: {
58
58
  readonly MCP_TOTAL_TOOL_CALLS: "mcpTotalToolCalls";
59
+ readonly USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION: "usageTrackingMessageLastShowVersion";
59
60
  };
60
61
  export declare const CONFIG_FLAGS: {
61
62
  readonly DEFAULT_CMS_PUBLISH_MODE: "defaultCmsPublishMode";
@@ -59,6 +59,7 @@ export const HUBSPOT_ACCOUNT_TYPE_STRINGS = {
59
59
  };
60
60
  export const STATE_FLAGS = {
61
61
  MCP_TOTAL_TOOL_CALLS: 'mcpTotalToolCalls',
62
+ USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION: 'usageTrackingMessageLastShowVersion',
62
63
  };
63
64
  export const CONFIG_FLAGS = {
64
65
  DEFAULT_CMS_PUBLISH_MODE: 'defaultCmsPublishMode',
package/lib/logger.d.ts CHANGED
@@ -14,6 +14,7 @@ interface LogLabels {
14
14
  debug: string;
15
15
  }
16
16
  export declare function getLabels(): LogLabels;
17
+ export declare function getSymbols(): LogLabels;
17
18
  /**
18
19
  * Chalk styles for logger strings.
19
20
  */
package/lib/logger.js CHANGED
@@ -13,7 +13,14 @@ const UNICODE_LABELS = {
13
13
  warning: '⚠ WARNING',
14
14
  error: '✖ ERROR',
15
15
  info: 'ℹ INFO',
16
- debug: 'DEBUG',
16
+ debug: 'DEBUG',
17
+ };
18
+ const UNICODE_SYMBOLS = {
19
+ success: '✔',
20
+ warning: '⚠',
21
+ error: '✖',
22
+ info: 'ℹ',
23
+ debug: '⚙',
17
24
  };
18
25
  const ASCII_LABELS = {
19
26
  success: '[SUCCESS]',
@@ -25,14 +32,17 @@ const ASCII_LABELS = {
25
32
  export function getLabels() {
26
33
  return isUnicodeSupported() ? UNICODE_LABELS : ASCII_LABELS;
27
34
  }
35
+ export function getSymbols() {
36
+ return isUnicodeSupported() ? UNICODE_SYMBOLS : ASCII_LABELS;
37
+ }
28
38
  /**
29
39
  * Chalk styles for logger strings.
30
40
  */
31
41
  export const Styles = {
32
- debug: chalk.reset.blue,
42
+ debug: chalk.reset.grey,
33
43
  log: chalk.reset.white,
34
44
  success: chalk.reset.green,
35
- info: chalk.reset.white,
45
+ info: chalk.reset.blue,
36
46
  warn: chalk.reset.yellow,
37
47
  error: chalk.reset.red,
38
48
  };
@@ -66,7 +76,7 @@ export class Logger {
66
76
  }
67
77
  debug(...args) {
68
78
  const labels = getLabels();
69
- console.debug(...stylize(labels.debug, Styles.log, args));
79
+ console.debug(...stylize(labels.debug, Styles.debug, args));
70
80
  }
71
81
  group(...args) {
72
82
  console.group(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "0.7.6-experimental.4",
3
+ "version": "0.7.8-experimental.0",
4
4
  "type": "module",
5
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
6
6
  "files": [
package/types/Config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CONFIG_FLAGS, HUBSPOT_CONFIG_ERROR_TYPES, HUBSPOT_CONFIG_OPERATIONS } from '../constants/config.js';
1
+ import { CONFIG_FLAGS, HUBSPOT_CONFIG_ERROR_TYPES, HUBSPOT_CONFIG_OPERATIONS, STATE_FLAGS } from '../constants/config.js';
2
2
  import { DeprecatedHubSpotConfigAccountFields, Environment, HubSpotConfigAccount } from './Accounts.js';
3
3
  import { CmsPublishMode } from './Files.js';
4
4
  import { ValueOf } from './Utils.js';
@@ -28,7 +28,8 @@ export type GitInclusionResult = {
28
28
  };
29
29
  export type ConfigFlag = ValueOf<typeof CONFIG_FLAGS>;
30
30
  export type HubSpotState = {
31
- mcpTotalToolCalls: number;
31
+ [STATE_FLAGS.MCP_TOTAL_TOOL_CALLS]: number;
32
+ [STATE_FLAGS.USAGE_TRACKING_MESSAGE_LAST_SHOW_VERSION]?: string;
32
33
  };
33
34
  export type HubSpotConfigErrorType = ValueOf<typeof HUBSPOT_CONFIG_ERROR_TYPES>;
34
35
  export type HubSpotConfigOperation = ValueOf<typeof HUBSPOT_CONFIG_OPERATIONS>;
package/types/Config.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import { STATE_FLAGS, } from '../constants/config.js';
@@ -1,6 +1,8 @@
1
1
  import type { Build } from './Build.js';
2
2
  import { GithubSourceData } from './Github.js';
3
3
  import { ProjectLog } from './ProjectLog.js';
4
+ import { ValueOf } from './Utils.js';
5
+ import { SUBBUILD_TYPES } from '../enums/build.js';
4
6
  export type Project = {
5
7
  createdAt: number;
6
8
  deletedAt: number;
@@ -48,3 +50,22 @@ export type FetchPlatformVersionResponse = {
48
50
  export type WarnLogsResponse = {
49
51
  logs: Array<ProjectLog>;
50
52
  };
53
+ export type Release = {
54
+ releaseTag: string;
55
+ buildId: number;
56
+ createdAt: string;
57
+ components?: Array<{
58
+ buildType: ValueOf<typeof SUBBUILD_TYPES>;
59
+ buildName?: string;
60
+ rootPath?: string;
61
+ id?: string;
62
+ }>;
63
+ };
64
+ export type FetchListReleasesResponse = {
65
+ results: Array<Release>;
66
+ paging: {
67
+ next: {
68
+ after: string;
69
+ };
70
+ };
71
+ };