@hubspot/local-dev-lib 4.0.4 → 5.0.0-beta.1

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.
Files changed (205) hide show
  1. package/api/appsDev.d.ts +2 -2
  2. package/api/appsDev.js +13 -22
  3. package/api/crm.d.ts +2 -2
  4. package/api/crm.js +9 -16
  5. package/api/customObjects.d.ts +2 -2
  6. package/api/customObjects.js +13 -22
  7. package/api/designManager.d.ts +2 -2
  8. package/api/designManager.js +5 -10
  9. package/api/devSecrets.d.ts +2 -2
  10. package/api/devSecrets.js +9 -16
  11. package/api/developerTestAccounts.d.ts +2 -4
  12. package/api/developerTestAccounts.js +23 -52
  13. package/api/fileManager.d.ts +2 -2
  14. package/api/fileManager.js +14 -24
  15. package/api/fileMapper.d.ts +2 -3
  16. package/api/fileMapper.js +34 -49
  17. package/api/fileTransport.d.ts +1 -1
  18. package/api/fileTransport.js +12 -21
  19. package/api/fireAlarm.d.ts +2 -3
  20. package/api/fireAlarm.js +5 -9
  21. package/api/functions.d.ts +2 -2
  22. package/api/functions.js +11 -19
  23. package/api/github.d.ts +2 -4
  24. package/api/github.js +16 -27
  25. package/api/hubdb.d.ts +2 -2
  26. package/api/hubdb.js +19 -31
  27. package/api/lighthouseScore.d.ts +2 -2
  28. package/api/lighthouseScore.js +7 -13
  29. package/api/localDevAuth.d.ts +3 -6
  30. package/api/localDevAuth.js +10 -37
  31. package/api/marketplaceValidation.d.ts +2 -2
  32. package/api/marketplaceValidation.js +7 -13
  33. package/api/projects.d.ts +6 -8
  34. package/api/projects.js +65 -100
  35. package/api/sandboxHubs.d.ts +2 -5
  36. package/api/sandboxHubs.js +15 -42
  37. package/api/sandboxSync.d.ts +2 -2
  38. package/api/sandboxSync.js +7 -12
  39. package/api/secrets.d.ts +2 -2
  40. package/api/secrets.js +9 -16
  41. package/api/validateHubl.d.ts +2 -2
  42. package/api/validateHubl.js +3 -7
  43. package/config/defaultAccountOverride.d.ts +2 -1
  44. package/config/defaultAccountOverride.js +16 -26
  45. package/config/index.d.ts +4 -4
  46. package/config/index.js +141 -177
  47. package/config/migrate.d.ts +2 -2
  48. package/config/migrate.js +26 -37
  49. package/config/state.d.ts +1 -1
  50. package/config/state.js +17 -45
  51. package/config/utils.d.ts +4 -4
  52. package/config/utils.js +85 -108
  53. package/constants/api.js +3 -6
  54. package/constants/auth.js +9 -12
  55. package/constants/config.js +37 -43
  56. package/constants/endpoints.d.ts +6 -0
  57. package/constants/endpoints.js +6 -0
  58. package/constants/environments.js +1 -4
  59. package/constants/extensions.js +6 -9
  60. package/constants/files.js +5 -8
  61. package/constants/ports.js +3 -6
  62. package/constants/projects.js +2 -5
  63. package/enums/build.d.ts +1 -0
  64. package/enums/build.js +6 -8
  65. package/enums/deploy.js +2 -5
  66. package/enums/project.js +1 -4
  67. package/errors/index.d.ts +4 -5
  68. package/errors/index.js +17 -39
  69. package/errors/isSystemError.d.ts +2 -0
  70. package/errors/isSystemError.js +9 -0
  71. package/http/addQueryParams.d.ts +1 -1
  72. package/http/addQueryParams.js +1 -5
  73. package/http/client.js +14 -42
  74. package/http/getAxiosConfig.d.ts +1 -1
  75. package/http/getAxiosConfig.js +21 -31
  76. package/http/index.d.ts +2 -2
  77. package/http/index.js +39 -46
  78. package/http/unauthed.d.ts +1 -1
  79. package/http/unauthed.js +15 -18
  80. package/lang/en.json +1 -1
  81. package/lib/archive.d.ts +1 -3
  82. package/lib/archive.js +37 -67
  83. package/lib/cms/functions.d.ts +1 -1
  84. package/lib/cms/functions.js +45 -55
  85. package/lib/cms/handleFieldsJS.js +36 -44
  86. package/lib/cms/modules.d.ts +2 -2
  87. package/lib/cms/modules.js +49 -59
  88. package/lib/cms/processFieldsJs.js +17 -32
  89. package/lib/cms/templates.js +17 -26
  90. package/lib/cms/themes.js +10 -18
  91. package/lib/cms/uploadFolder.d.ts +4 -4
  92. package/lib/cms/uploadFolder.js +55 -64
  93. package/lib/cms/validate.d.ts +1 -1
  94. package/lib/cms/validate.js +11 -18
  95. package/lib/cms/watch.d.ts +2 -2
  96. package/lib/cms/watch.js +66 -73
  97. package/lib/crm.d.ts +1 -1
  98. package/lib/crm.js +15 -23
  99. package/lib/customObjects.d.ts +1 -1
  100. package/lib/customObjects.js +15 -25
  101. package/lib/environment.d.ts +1 -1
  102. package/lib/environment.js +5 -11
  103. package/lib/escapeRegExp.js +1 -5
  104. package/lib/fileManager.js +43 -51
  105. package/lib/fileMapper.d.ts +1 -1
  106. package/lib/fileMapper.js +68 -84
  107. package/lib/fs.d.ts +1 -1
  108. package/lib/fs.js +18 -27
  109. package/lib/github.d.ts +1 -3
  110. package/lib/github.js +39 -51
  111. package/lib/gitignore.d.ts +1 -1
  112. package/lib/gitignore.js +16 -24
  113. package/lib/hubdb.d.ts +1 -1
  114. package/lib/hubdb.js +29 -40
  115. package/lib/ignoreRules.js +25 -34
  116. package/lib/isDeepEqual.js +1 -5
  117. package/lib/logger.d.ts +8 -20
  118. package/lib/logger.js +47 -59
  119. package/lib/notify.js +9 -16
  120. package/lib/oauth.d.ts +2 -2
  121. package/lib/oauth.js +12 -17
  122. package/lib/path.d.ts +0 -1
  123. package/lib/path.js +30 -48
  124. package/lib/personalAccessKey.d.ts +2 -4
  125. package/lib/personalAccessKey.js +43 -60
  126. package/lib/portManager.d.ts +2 -2
  127. package/lib/portManager.js +26 -41
  128. package/lib/text.js +2 -7
  129. package/lib/trackUsage.d.ts +0 -2
  130. package/lib/trackUsage.js +23 -29
  131. package/lib/urls.js +4 -9
  132. package/models/FileSystemError.d.ts +1 -1
  133. package/models/FileSystemError.js +12 -16
  134. package/models/HubSpotConfigError.d.ts +1 -1
  135. package/models/HubSpotConfigError.js +8 -12
  136. package/models/HubSpotHttpError.d.ts +1 -1
  137. package/models/HubSpotHttpError.js +22 -26
  138. package/models/OAuth2Manager.d.ts +1 -1
  139. package/models/OAuth2Manager.js +17 -24
  140. package/package.json +20 -16
  141. package/types/Accounts.d.ts +6 -5
  142. package/types/Accounts.js +1 -2
  143. package/types/Activity.d.ts +3 -3
  144. package/types/Activity.js +1 -2
  145. package/types/Api.d.ts +1 -1
  146. package/types/Api.js +1 -2
  147. package/types/Apps.js +1 -2
  148. package/types/Archive.js +1 -2
  149. package/types/Build.d.ts +4 -5
  150. package/types/Build.js +1 -2
  151. package/types/CLIOptions.js +1 -2
  152. package/types/ComponentStructure.d.ts +2 -2
  153. package/types/ComponentStructure.js +1 -2
  154. package/types/Config.d.ts +4 -6
  155. package/types/Config.js +1 -2
  156. package/types/Crm.js +1 -2
  157. package/types/Deploy.d.ts +5 -11
  158. package/types/Deploy.js +1 -2
  159. package/types/DesignManager.js +1 -2
  160. package/types/DevSecrets.js +1 -2
  161. package/types/Error.js +1 -2
  162. package/types/FieldsJS.js +1 -2
  163. package/types/FileManager.js +1 -2
  164. package/types/Files.d.ts +4 -4
  165. package/types/Files.js +1 -2
  166. package/types/FireAlarm.js +1 -2
  167. package/types/Functions.js +1 -2
  168. package/types/Github.d.ts +1 -1
  169. package/types/Github.js +1 -2
  170. package/types/Http.d.ts +0 -4
  171. package/types/Http.js +1 -2
  172. package/types/Hubdb.js +1 -2
  173. package/types/HublValidation.js +1 -2
  174. package/types/Lang.d.ts +1 -1
  175. package/types/Lang.js +1 -2
  176. package/types/Lighthouse.js +1 -2
  177. package/types/MarketplaceValidation.js +1 -2
  178. package/types/Migration.d.ts +2 -2
  179. package/types/Migration.js +1 -4
  180. package/types/Modules.js +1 -2
  181. package/types/PortManager.js +1 -2
  182. package/types/Project.d.ts +3 -21
  183. package/types/Project.js +1 -2
  184. package/types/ProjectComponents.d.ts +24 -0
  185. package/types/ProjectComponents.js +1 -0
  186. package/types/ProjectLog.js +1 -2
  187. package/types/Sandbox.js +2 -5
  188. package/types/Schemas.js +1 -2
  189. package/types/Secrets.js +1 -2
  190. package/types/Utils.js +1 -2
  191. package/types/developerTestAccounts.js +1 -2
  192. package/utils/PortManagerServer.d.ts +1 -2
  193. package/utils/PortManagerServer.js +32 -38
  194. package/utils/cms/fieldsJS.d.ts +1 -1
  195. package/utils/cms/fieldsJS.js +1 -5
  196. package/utils/cms/modules.d.ts +1 -1
  197. package/utils/cms/modules.js +13 -22
  198. package/utils/detectPort.js +12 -19
  199. package/utils/git.js +17 -26
  200. package/utils/lang.d.ts +1 -1
  201. package/utils/lang.js +5 -14
  202. package/utils/personalAccessKey.d.ts +8 -0
  203. package/utils/personalAccessKey.js +51 -0
  204. package/errors/errors_DEPRECATED.d.ts +0 -3
  205. package/errors/errors_DEPRECATED.js +0 -60
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HubSpotHttpError = exports.HubSpotHttpErrorName = void 0;
4
- const axios_1 = require("axios");
5
- const api_1 = require("../constants/api");
6
- const lang_1 = require("../utils/lang");
7
- exports.HubSpotHttpErrorName = 'HubSpotHttpError';
1
+ import { isAxiosError } from 'axios';
2
+ import { HTTP_METHOD_PREPOSITIONS, HTTP_METHOD_VERBS, } from '../constants/api.js';
3
+ import { i18n } from '../utils/lang.js';
4
+ export const HubSpotHttpErrorName = 'HubSpotHttpError';
8
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- class HubSpotHttpError extends Error {
6
+ export class HubSpotHttpError extends Error {
10
7
  status;
11
8
  code;
12
9
  statusText;
@@ -23,10 +20,10 @@ class HubSpotHttpError extends Error {
23
20
  correlationId;
24
21
  constructor(message, options, context) {
25
22
  super(message, options);
26
- this.name = exports.HubSpotHttpErrorName;
23
+ this.name = HubSpotHttpErrorName;
27
24
  this.context = context;
28
25
  this.cause = options?.cause;
29
- if (options && (0, axios_1.isAxiosError)(options.cause)) {
26
+ if (options && isAxiosError(options.cause)) {
30
27
  this.extractDerivedContext(options.cause);
31
28
  const { response, config, code } = options.cause;
32
29
  this.message = this.joinErrorMessages(options.cause, {
@@ -64,7 +61,7 @@ class HubSpotHttpError extends Error {
64
61
  updateContext(context, additionalDebugContext) {
65
62
  this.context = { ...this.context, ...context };
66
63
  // Update the error messages when the context is updated
67
- if ((0, axios_1.isAxiosError)(this.cause)) {
64
+ if (isAxiosError(this.cause)) {
68
65
  this.message = this.joinErrorMessages(this.cause, this.context, additionalDebugContext);
69
66
  }
70
67
  }
@@ -143,66 +140,66 @@ class HubSpotHttpError extends Error {
143
140
  const method = error.config?.method;
144
141
  let messageDetail;
145
142
  if (context.accountId) {
146
- const action = (method && api_1.HTTP_METHOD_VERBS[method]) || api_1.HTTP_METHOD_VERBS.get;
147
- const preposition = (method && api_1.HTTP_METHOD_PREPOSITIONS[method]) ||
148
- api_1.HTTP_METHOD_PREPOSITIONS.get;
143
+ const action = (method && HTTP_METHOD_VERBS[method]) || HTTP_METHOD_VERBS.get;
144
+ const preposition = (method && HTTP_METHOD_PREPOSITIONS[method]) ||
145
+ HTTP_METHOD_PREPOSITIONS.get;
149
146
  const requestName = context.request
150
147
  ? `${action} ${preposition} '${context.request}'`
151
148
  : action;
152
- messageDetail = (0, lang_1.i18n)(`errors.apiErrors.messageDetail`, {
149
+ messageDetail = i18n(`errors.apiErrors.messageDetail`, {
153
150
  accountId: context.accountId,
154
151
  requestName,
155
152
  });
156
153
  }
157
154
  else {
158
- messageDetail = (0, lang_1.i18n)(`errors.apiErrors.genericMessageDetail`);
155
+ messageDetail = i18n(`errors.apiErrors.genericMessageDetail`);
159
156
  }
160
157
  const errorMessage = [];
161
158
  if ((method === 'put' || method === 'post') && context.payload) {
162
- errorMessage.push((0, lang_1.i18n)(`errors.apiErrors.unableToUpload`, { payload: context.payload }));
159
+ errorMessage.push(i18n(`errors.apiErrors.unableToUpload`, { payload: context.payload }));
163
160
  }
164
161
  let statusBasedMessage;
165
162
  switch (status) {
166
163
  case 400:
167
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.400`, {
164
+ statusBasedMessage = i18n(`errors.apiErrors.codes.400`, {
168
165
  messageDetail,
169
166
  });
170
167
  break;
171
168
  case 401:
172
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.401`, {
169
+ statusBasedMessage = i18n(`errors.apiErrors.codes.401`, {
173
170
  messageDetail,
174
171
  });
175
172
  break;
176
173
  case 403:
177
174
  break;
178
175
  case 404:
179
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.404`, {
176
+ statusBasedMessage = i18n(`errors.apiErrors.codes.404`, {
180
177
  messageDetail,
181
178
  });
182
179
  break;
183
180
  case 429:
184
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.429`, {
181
+ statusBasedMessage = i18n(`errors.apiErrors.codes.429`, {
185
182
  messageDetail,
186
183
  });
187
184
  break;
188
185
  case 503:
189
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.503`, {
186
+ statusBasedMessage = i18n(`errors.apiErrors.codes.503`, {
190
187
  messageDetail,
191
188
  });
192
189
  break;
193
190
  default:
194
191
  if (status && status >= 500 && status < 600) {
195
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.500Generic`, {
192
+ statusBasedMessage = i18n(`errors.apiErrors.codes.500Generic`, {
196
193
  messageDetail,
197
194
  });
198
195
  }
199
196
  else if (status && status >= 400 && status < 500) {
200
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.400Generic`, {
197
+ statusBasedMessage = i18n(`errors.apiErrors.codes.400Generic`, {
201
198
  messageDetail,
202
199
  });
203
200
  }
204
201
  else {
205
- statusBasedMessage = (0, lang_1.i18n)(`errors.apiErrors.codes.generic`, {
202
+ statusBasedMessage = i18n(`errors.apiErrors.codes.generic`, {
206
203
  messageDetail,
207
204
  });
208
205
  }
@@ -225,4 +222,3 @@ class HubSpotHttpError extends Error {
225
222
  return errorMessage.join(' ');
226
223
  }
227
224
  }
228
- exports.HubSpotHttpError = HubSpotHttpError;
@@ -1,4 +1,4 @@
1
- import { OAuthConfigAccount, WriteTokenInfoFunction, RefreshTokenResponse, ExchangeProof } from '../types/Accounts';
1
+ import { OAuthConfigAccount, WriteTokenInfoFunction, RefreshTokenResponse, ExchangeProof } from '../types/Accounts.js';
2
2
  export declare class OAuth2Manager {
3
3
  account: OAuthConfigAccount;
4
4
  writeTokenInfo?: WriteTokenInfoFunction;
@@ -1,17 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.OAuth2Manager = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const moment_1 = __importDefault(require("moment"));
9
- const urls_1 = require("../lib/urls");
10
- const environment_1 = require("../lib/environment");
11
- const logger_1 = require("../lib/logger");
12
- const lang_1 = require("../utils/lang");
1
+ import axios from 'axios';
2
+ import moment from 'moment';
3
+ import { getHubSpotApiOrigin } from '../lib/urls.js';
4
+ import { getValidEnv } from '../lib/environment.js';
5
+ import { logger } from '../lib/logger.js';
6
+ import { i18n } from '../utils/lang.js';
13
7
  const i18nKey = 'models.OAuth2Manager';
14
- class OAuth2Manager {
8
+ export class OAuth2Manager {
15
9
  account;
16
10
  writeTokenInfo;
17
11
  refreshTokenRequest;
@@ -20,31 +14,31 @@ class OAuth2Manager {
20
14
  this.refreshTokenRequest = null;
21
15
  this.account = account;
22
16
  if (this.account.env) {
23
- this.account.env = (0, environment_1.getValidEnv)(this.account.env, '');
17
+ this.account.env = getValidEnv(this.account.env, '');
24
18
  }
25
19
  }
26
20
  async accessToken() {
27
21
  if (!this.account.auth.tokenInfo.refreshToken) {
28
- throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.missingRefreshToken`, {
22
+ throw new Error(i18n(`${i18nKey}.errors.missingRefreshToken`, {
29
23
  accountId: this.account.accountId,
30
24
  }));
31
25
  }
32
26
  if (!this.account.auth.tokenInfo.accessToken ||
33
- (0, moment_1.default)()
27
+ moment()
34
28
  .add(5, 'minutes')
35
- .isAfter((0, moment_1.default)(new Date(this.account.auth.tokenInfo.expiresAt || '')))) {
29
+ .isAfter(moment(new Date(this.account.auth.tokenInfo.expiresAt || '')))) {
36
30
  await this.refreshAccessToken();
37
31
  }
38
32
  return this.account.auth.tokenInfo.accessToken;
39
33
  }
40
34
  async fetchAccessToken(exchangeProof) {
41
- logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.fetchingAccessToken`, {
35
+ logger.debug(i18n(`${i18nKey}.fetchingAccessToken`, {
42
36
  accountId: this.account.accountId,
43
37
  clientId: this.account.auth.clientId,
44
38
  }));
45
39
  try {
46
- const { data } = await (0, axios_1.default)({
47
- url: `${(0, urls_1.getHubSpotApiOrigin)((0, environment_1.getValidEnv)(this.account.env))}/oauth/v1/token`,
40
+ const { data } = await axios({
41
+ url: `${getHubSpotApiOrigin(getValidEnv(this.account.env))}/oauth/v1/token`,
48
42
  method: 'post',
49
43
  data: exchangeProof,
50
44
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
@@ -56,11 +50,11 @@ class OAuth2Manager {
56
50
  }
57
51
  this.account.auth.tokenInfo.refreshToken = refreshToken;
58
52
  this.account.auth.tokenInfo.accessToken = accessToken;
59
- this.account.auth.tokenInfo.expiresAt = (0, moment_1.default)()
53
+ this.account.auth.tokenInfo.expiresAt = moment()
60
54
  .add(Math.round(parseInt(expiresIn) * 0.75), 'seconds')
61
55
  .toString();
62
56
  if (this.writeTokenInfo) {
63
- logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.updatingTokenInfo`, {
57
+ logger.debug(i18n(`${i18nKey}.updatingTokenInfo`, {
64
58
  accountId: this.account.accountId,
65
59
  clientId: this.account.auth.clientId,
66
60
  }));
@@ -73,7 +67,7 @@ class OAuth2Manager {
73
67
  }
74
68
  async exchangeForTokens(exchangeProof) {
75
69
  if (this.refreshTokenRequest) {
76
- logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.refreshingAccessToken`, {
70
+ logger.debug(i18n(`${i18nKey}.refreshingAccessToken`, {
77
71
  accountId: this.account.accountId,
78
72
  clientId: this.account.auth.clientId,
79
73
  }));
@@ -93,4 +87,3 @@ class OAuth2Manager {
93
87
  await this.exchangeForTokens(refreshTokenProof);
94
88
  }
95
89
  }
96
- exports.OAuth2Manager = OAuth2Manager;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "4.0.4",
3
+ "version": "5.0.0-beta.1",
4
+ "type": "module",
4
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
5
6
  "repository": {
6
7
  "type": "git",
@@ -12,11 +13,13 @@
12
13
  },
13
14
  "scripts": {
14
15
  "build": "tsx ./scripts/build.ts",
16
+ "circular-deps": "yarn madge --circular --extensions ts --exclude 'dist/.*' .",
15
17
  "lint": "eslint --max-warnings=0 . && prettier . --check",
16
18
  "local-dev": "yarn build && cd dist && yarn link && cd .. && tsc --watch --rootDir . --outdir dist",
17
19
  "prettier:write": "prettier . --write",
18
20
  "release": "tsx ./scripts/release.ts release",
19
- "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ./node_modules/.bin/jest"
21
+ "test": "NODE_NO_WARNINGS=1 vitest run",
22
+ "test:watch": "NODE_NO_WARNINGS=1 vitest"
20
23
  },
21
24
  "license": "Apache-2.0",
22
25
  "devDependencies": {
@@ -27,24 +30,24 @@
27
30
  "@types/express": "^4.17.18",
28
31
  "@types/findup-sync": "^4.0.2",
29
32
  "@types/fs-extra": "^11.0.1",
30
- "@types/jest": "^29.5.0",
31
33
  "@types/js-yaml": "^4.0.5",
32
- "@types/node": "^18.14.2",
34
+ "@types/node": "^20.14.8",
33
35
  "@types/unixify": "^1.0.0",
34
- "@typescript-eslint/eslint-plugin": "^5.54.0",
35
- "@typescript-eslint/parser": "^5.59.7",
36
- "eslint": "^8.35.0",
37
- "eslint-plugin-import": "^2.29.1",
36
+ "@typescript-eslint/eslint-plugin": "^8.30.1",
37
+ "@typescript-eslint/parser": "^8.11.0",
38
+ "eslint": "^9.38.0",
39
+ "eslint-plugin-import": "^2.31.0",
38
40
  "husky": "^8.0.0",
39
- "jest": "^29.5.0",
41
+ "madge": "^8.0.0",
40
42
  "open": "^8.4.2",
41
- "ts-jest": "^29.0.5",
42
43
  "tsx": "^4.20.6",
43
- "typescript": "^4.9.5",
44
+ "typescript": "^5.9.3",
45
+ "vitest": "^2.1.9",
44
46
  "yargs": "^17.7.2"
45
47
  },
46
48
  "exports": {
47
49
  "./*": "./lib/*.js",
50
+ "./*/cms/*": "./lib/cms/*.js",
48
51
  "./api/*": "./api/*.js",
49
52
  "./errors/*": "./errors/*.js",
50
53
  "./http": "./http/index.js",
@@ -54,6 +57,7 @@
54
57
  "./config/state": "./config/state.js",
55
58
  "./config": "./config/index.js",
56
59
  "./constants/*": "./constants/*.js",
60
+ "./enums/*": "./enums/*.js",
57
61
  "./models/*": "./models/*.js",
58
62
  "./types/*": {
59
63
  "types": "./types/*.d.ts",
@@ -63,7 +67,7 @@
63
67
  "dependencies": {
64
68
  "address": "2.0.2",
65
69
  "axios": "1.12.0",
66
- "chalk": "2.4.2",
70
+ "chalk": "5.6.2",
67
71
  "chokidar": "3.6.0",
68
72
  "content-disposition": "0.5.4",
69
73
  "cors": "2.8.5",
@@ -75,15 +79,15 @@
75
79
  "fs-extra": "11.2.0",
76
80
  "http-proxy-agent": "7.0.2",
77
81
  "https-proxy-agent": "7.0.6",
78
- "ignore": "5.3.1",
82
+ "ignore": "^7.0.0",
79
83
  "js-yaml": "4.1.0",
80
84
  "moment": "2.30.1",
81
- "p-queue": "6.6.2",
82
- "prettier": "3.3.1",
85
+ "p-queue": "^7.0.0",
86
+ "prettier": "^3.6.2",
83
87
  "semver": "6.3.1",
84
88
  "unixify": "1.0.0"
85
89
  },
86
90
  "engines": {
87
- "node": ">=16.20.0"
91
+ "node": ">=20.0.0"
88
92
  }
89
93
  }
@@ -1,8 +1,9 @@
1
- import { HUBSPOT_ACCOUNT_TYPES } from '../constants/config';
2
- import { CmsPublishMode } from './Files';
3
- import { Environment } from './Config';
4
- import { ValueOf } from './Utils';
5
- import { PERSONAL_ACCESS_KEY_AUTH_METHOD, OAUTH_AUTH_METHOD, API_KEY_AUTH_METHOD } from '../constants/auth';
1
+ import { HUBSPOT_ACCOUNT_TYPES } from '../constants/config.js';
2
+ import { ENVIRONMENTS } from '../constants/environments.js';
3
+ import { CmsPublishMode } from './Files.js';
4
+ import { ValueOf } from './Utils.js';
5
+ import { PERSONAL_ACCESS_KEY_AUTH_METHOD, OAUTH_AUTH_METHOD, API_KEY_AUTH_METHOD } from '../constants/auth.js';
6
+ export type Environment = ValueOf<typeof ENVIRONMENTS> | '';
6
7
  export type AuthType = 'personalaccesskey' | 'apikey' | 'oauth2';
7
8
  interface BaseHubSpotConfigAccount {
8
9
  name: string;
package/types/Accounts.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,6 +1,6 @@
1
- import { ACTIVITY_SOURCE } from '../enums/project';
2
- import { ValueOf } from './Utils';
3
- import { GithubSourceData } from './Github';
1
+ import { ACTIVITY_SOURCE } from '../enums/project.js';
2
+ import { ValueOf } from './Utils.js';
3
+ import { GithubSourceData } from './Github.js';
4
4
  export interface GithubActivitySource extends GithubSourceData {
5
5
  authorEmail: string;
6
6
  authorName: string;
package/types/Activity.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Api.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { HTTP_METHOD_VERBS } from '../constants/api';
1
+ import { HTTP_METHOD_VERBS } from '../constants/api.js';
2
2
  export type HttpMethod = keyof typeof HTTP_METHOD_VERBS;
package/types/Api.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Apps.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Archive.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Build.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { ValueOf } from './Utils';
2
- import { BUILD_STATUS, SUBBUILD_TYPES, DEPLOYABLE_STATES } from '../enums/build';
3
- import { ActivitySource } from './Activity';
4
- import { DeployStatusTaskLocator } from './Deploy';
5
- import { ProjectStandardError } from './Project';
1
+ import { ValueOf } from './Utils.js';
2
+ import { BUILD_STATUS, SUBBUILD_TYPES, DEPLOYABLE_STATES } from '../enums/build.js';
3
+ import { ActivitySource } from './Activity.js';
4
+ import { DeployStatusTaskLocator, ProjectStandardError } from './ProjectComponents.js';
6
5
  export type SubbuildStatus = {
7
6
  buildName: string;
8
7
  buildType: ValueOf<typeof SUBBUILD_TYPES>;
package/types/Build.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build';
2
- import { ValueOf } from './Utils';
1
+ import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build.js';
2
+ import { ValueOf } from './Utils.js';
3
3
  export type ComponentStructure = {
4
4
  [key: string]: Array<string>;
5
5
  };
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Config.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { CONFIG_FLAGS, HUBSPOT_CONFIG_ERROR_TYPES, HUBSPOT_CONFIG_OPERATIONS } from '../constants/config';
2
- import { ENVIRONMENTS } from '../constants/environments';
3
- import { DeprecatedHubSpotConfigAccountFields, HubSpotConfigAccount } from './Accounts';
4
- import { CmsPublishMode } from './Files';
5
- import { ValueOf } from './Utils';
1
+ import { CONFIG_FLAGS, HUBSPOT_CONFIG_ERROR_TYPES, HUBSPOT_CONFIG_OPERATIONS } from '../constants/config.js';
2
+ import { DeprecatedHubSpotConfigAccountFields, Environment, HubSpotConfigAccount } from './Accounts.js';
3
+ import { CmsPublishMode } from './Files.js';
4
+ import { ValueOf } from './Utils.js';
6
5
  export interface HubSpotConfig {
7
6
  accounts: Array<HubSpotConfigAccount>;
8
7
  allowUsageTracking?: boolean;
@@ -22,7 +21,6 @@ export type DeprecatedHubSpotConfigFields = {
22
21
  defaultPortal?: string;
23
22
  defaultMode?: CmsPublishMode;
24
23
  };
25
- export type Environment = ValueOf<typeof ENVIRONMENTS> | '';
26
24
  export type GitInclusionResult = {
27
25
  inGit: boolean;
28
26
  configIgnored: boolean;
package/types/Config.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Crm.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Deploy.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ValueOf } from './Utils';
2
- import { ACTIVITY_SOURCE } from '../enums/project';
3
- import { DEPLOY_ACTION, DEPLOY_STATUS } from '../enums/deploy';
4
- import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build';
5
- import { ProjectStandardError } from './Project';
1
+ import { ValueOf } from './Utils.js';
2
+ import { ACTIVITY_SOURCE } from '../enums/project.js';
3
+ import { DEPLOY_ACTION, DEPLOY_STATUS } from '../enums/deploy.js';
4
+ import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build.js';
5
+ import { ProjectStandardError } from './ProjectComponents.js';
6
6
  export type DeployStatus = ValueOf<typeof DEPLOY_STATUS>;
7
7
  export type SubdeployStatus = {
8
8
  action: ValueOf<typeof DEPLOY_ACTION>;
@@ -29,12 +29,6 @@ export type Deploy = {
29
29
  userId: number;
30
30
  source: ValueOf<typeof ACTIVITY_SOURCE>;
31
31
  };
32
- export type DeployStatusTaskLocator = {
33
- id: string;
34
- links: Array<{
35
- status: string;
36
- }>;
37
- };
38
32
  export type SubdeployValidationIssue = {
39
33
  uid: string;
40
34
  componentTypeName: string;
package/types/Deploy.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Error.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/FieldsJS.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Files.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ValueOf } from '../types/Utils';
2
- import { STAT_TYPES, FILE_TYPES, FILE_UPLOAD_RESULT_TYPES } from '../constants/files';
3
- import { CMS_PUBLISH_MODE } from '../constants/files';
4
- import { HttpOptions } from './Http';
1
+ import { ValueOf } from '../types/Utils.js';
2
+ import { STAT_TYPES, FILE_TYPES, FILE_UPLOAD_RESULT_TYPES } from '../constants/files.js';
3
+ import { CMS_PUBLISH_MODE } from '../constants/files.js';
4
+ import { HttpOptions } from './Http.js';
5
5
  import { AxiosError } from 'axios';
6
6
  export type StatType = ValueOf<typeof STAT_TYPES>;
7
7
  export type FileData = {
package/types/Files.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Github.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Collision } from './Archive';
1
+ import { Collision } from './Archive.js';
2
2
  type GithubAuthor = {
3
3
  login: string;
4
4
  id: number;
package/types/Github.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Http.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
- /// <reference types="node" />
5
1
  import { AxiosPromise, ResponseType } from 'axios';
6
2
  import { ReadStream } from 'fs';
7
3
  import { Stream } from 'stream';
package/types/Http.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Hubdb.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/types/Lang.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import lang from '../lang/en.json';
2
- import { Leaves } from './Utils';
2
+ import { Leaves } from './Utils.js';
3
3
  export type GenericLanguageObject = {
4
4
  [key: string]: string | GenericLanguageObject;
5
5
  };
package/types/Lang.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { ValueOf } from './Utils';
2
- import { ProjectStandardError } from './Project';
1
+ import { ValueOf } from './Utils.js';
2
+ import { ProjectStandardError } from './ProjectComponents.js';
3
3
  export declare const MIGRATION_STATUS: {
4
4
  readonly BUILDING: "BUILDING";
5
5
  readonly FAILURE: "FAILURE";
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MIGRATION_STATUS = void 0;
4
- exports.MIGRATION_STATUS = {
1
+ export const MIGRATION_STATUS = {
5
2
  BUILDING: 'BUILDING',
6
3
  FAILURE: 'FAILURE',
7
4
  PREPARING: 'PREPARING',
package/types/Modules.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};