@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.
- package/api/appsDev.d.ts +2 -2
- package/api/appsDev.js +13 -22
- package/api/crm.d.ts +2 -2
- package/api/crm.js +9 -16
- package/api/customObjects.d.ts +2 -2
- package/api/customObjects.js +13 -22
- package/api/designManager.d.ts +2 -2
- package/api/designManager.js +5 -10
- package/api/devSecrets.d.ts +2 -2
- package/api/devSecrets.js +9 -16
- package/api/developerTestAccounts.d.ts +2 -4
- package/api/developerTestAccounts.js +23 -52
- package/api/fileManager.d.ts +2 -2
- package/api/fileManager.js +14 -24
- package/api/fileMapper.d.ts +2 -3
- package/api/fileMapper.js +34 -49
- package/api/fileTransport.d.ts +1 -1
- package/api/fileTransport.js +12 -21
- package/api/fireAlarm.d.ts +2 -3
- package/api/fireAlarm.js +5 -9
- package/api/functions.d.ts +2 -2
- package/api/functions.js +11 -19
- package/api/github.d.ts +2 -4
- package/api/github.js +16 -27
- package/api/hubdb.d.ts +2 -2
- package/api/hubdb.js +19 -31
- package/api/lighthouseScore.d.ts +2 -2
- package/api/lighthouseScore.js +7 -13
- package/api/localDevAuth.d.ts +3 -6
- package/api/localDevAuth.js +10 -37
- package/api/marketplaceValidation.d.ts +2 -2
- package/api/marketplaceValidation.js +7 -13
- package/api/projects.d.ts +6 -8
- package/api/projects.js +65 -100
- package/api/sandboxHubs.d.ts +2 -5
- package/api/sandboxHubs.js +15 -42
- package/api/sandboxSync.d.ts +2 -2
- package/api/sandboxSync.js +7 -12
- package/api/secrets.d.ts +2 -2
- package/api/secrets.js +9 -16
- package/api/validateHubl.d.ts +2 -2
- package/api/validateHubl.js +3 -7
- package/config/defaultAccountOverride.d.ts +2 -1
- package/config/defaultAccountOverride.js +16 -26
- package/config/index.d.ts +4 -4
- package/config/index.js +141 -177
- package/config/migrate.d.ts +2 -2
- package/config/migrate.js +26 -37
- package/config/state.d.ts +1 -1
- package/config/state.js +17 -45
- package/config/utils.d.ts +4 -4
- package/config/utils.js +85 -108
- package/constants/api.js +3 -6
- package/constants/auth.js +9 -12
- package/constants/config.js +37 -43
- package/constants/endpoints.d.ts +6 -0
- package/constants/endpoints.js +6 -0
- package/constants/environments.js +1 -4
- package/constants/extensions.js +6 -9
- package/constants/files.js +5 -8
- package/constants/ports.js +3 -6
- package/constants/projects.js +2 -5
- package/enums/build.d.ts +1 -0
- package/enums/build.js +6 -8
- package/enums/deploy.js +2 -5
- package/enums/project.js +1 -4
- package/errors/index.d.ts +4 -5
- package/errors/index.js +17 -39
- package/errors/isSystemError.d.ts +2 -0
- package/errors/isSystemError.js +9 -0
- package/http/addQueryParams.d.ts +1 -1
- package/http/addQueryParams.js +1 -5
- package/http/client.js +14 -42
- package/http/getAxiosConfig.d.ts +1 -1
- package/http/getAxiosConfig.js +21 -31
- package/http/index.d.ts +2 -2
- package/http/index.js +39 -46
- package/http/unauthed.d.ts +1 -1
- package/http/unauthed.js +15 -18
- package/lang/en.json +1 -1
- package/lib/archive.d.ts +1 -3
- package/lib/archive.js +37 -67
- package/lib/cms/functions.d.ts +1 -1
- package/lib/cms/functions.js +45 -55
- package/lib/cms/handleFieldsJS.js +36 -44
- package/lib/cms/modules.d.ts +2 -2
- package/lib/cms/modules.js +49 -59
- package/lib/cms/processFieldsJs.js +17 -32
- package/lib/cms/templates.js +17 -26
- package/lib/cms/themes.js +10 -18
- package/lib/cms/uploadFolder.d.ts +4 -4
- package/lib/cms/uploadFolder.js +55 -64
- package/lib/cms/validate.d.ts +1 -1
- package/lib/cms/validate.js +11 -18
- package/lib/cms/watch.d.ts +2 -2
- package/lib/cms/watch.js +66 -73
- package/lib/crm.d.ts +1 -1
- package/lib/crm.js +15 -23
- package/lib/customObjects.d.ts +1 -1
- package/lib/customObjects.js +15 -25
- package/lib/environment.d.ts +1 -1
- package/lib/environment.js +5 -11
- package/lib/escapeRegExp.js +1 -5
- package/lib/fileManager.js +43 -51
- package/lib/fileMapper.d.ts +1 -1
- package/lib/fileMapper.js +68 -84
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +18 -27
- package/lib/github.d.ts +1 -3
- package/lib/github.js +39 -51
- package/lib/gitignore.d.ts +1 -1
- package/lib/gitignore.js +16 -24
- package/lib/hubdb.d.ts +1 -1
- package/lib/hubdb.js +29 -40
- package/lib/ignoreRules.js +25 -34
- package/lib/isDeepEqual.js +1 -5
- package/lib/logger.d.ts +8 -20
- package/lib/logger.js +47 -59
- package/lib/notify.js +9 -16
- package/lib/oauth.d.ts +2 -2
- package/lib/oauth.js +12 -17
- package/lib/path.d.ts +0 -1
- package/lib/path.js +30 -48
- package/lib/personalAccessKey.d.ts +2 -4
- package/lib/personalAccessKey.js +43 -60
- package/lib/portManager.d.ts +2 -2
- package/lib/portManager.js +26 -41
- package/lib/text.js +2 -7
- package/lib/trackUsage.d.ts +0 -2
- package/lib/trackUsage.js +23 -29
- package/lib/urls.js +4 -9
- package/models/FileSystemError.d.ts +1 -1
- package/models/FileSystemError.js +12 -16
- package/models/HubSpotConfigError.d.ts +1 -1
- package/models/HubSpotConfigError.js +8 -12
- package/models/HubSpotHttpError.d.ts +1 -1
- package/models/HubSpotHttpError.js +22 -26
- package/models/OAuth2Manager.d.ts +1 -1
- package/models/OAuth2Manager.js +17 -24
- package/package.json +20 -16
- package/types/Accounts.d.ts +6 -5
- package/types/Accounts.js +1 -2
- package/types/Activity.d.ts +3 -3
- package/types/Activity.js +1 -2
- package/types/Api.d.ts +1 -1
- package/types/Api.js +1 -2
- package/types/Apps.js +1 -2
- package/types/Archive.js +1 -2
- package/types/Build.d.ts +4 -5
- package/types/Build.js +1 -2
- package/types/CLIOptions.js +1 -2
- package/types/ComponentStructure.d.ts +2 -2
- package/types/ComponentStructure.js +1 -2
- package/types/Config.d.ts +4 -6
- package/types/Config.js +1 -2
- package/types/Crm.js +1 -2
- package/types/Deploy.d.ts +5 -11
- package/types/Deploy.js +1 -2
- package/types/DesignManager.js +1 -2
- package/types/DevSecrets.js +1 -2
- package/types/Error.js +1 -2
- package/types/FieldsJS.js +1 -2
- package/types/FileManager.js +1 -2
- package/types/Files.d.ts +4 -4
- package/types/Files.js +1 -2
- package/types/FireAlarm.js +1 -2
- package/types/Functions.js +1 -2
- package/types/Github.d.ts +1 -1
- package/types/Github.js +1 -2
- package/types/Http.d.ts +0 -4
- package/types/Http.js +1 -2
- package/types/Hubdb.js +1 -2
- package/types/HublValidation.js +1 -2
- package/types/Lang.d.ts +1 -1
- package/types/Lang.js +1 -2
- package/types/Lighthouse.js +1 -2
- package/types/MarketplaceValidation.js +1 -2
- package/types/Migration.d.ts +2 -2
- package/types/Migration.js +1 -4
- package/types/Modules.js +1 -2
- package/types/PortManager.js +1 -2
- package/types/Project.d.ts +3 -21
- package/types/Project.js +1 -2
- package/types/ProjectComponents.d.ts +24 -0
- package/types/ProjectComponents.js +1 -0
- package/types/ProjectLog.js +1 -2
- package/types/Sandbox.js +2 -5
- package/types/Schemas.js +1 -2
- package/types/Secrets.js +1 -2
- package/types/Utils.js +1 -2
- package/types/developerTestAccounts.js +1 -2
- package/utils/PortManagerServer.d.ts +1 -2
- package/utils/PortManagerServer.js +32 -38
- package/utils/cms/fieldsJS.d.ts +1 -1
- package/utils/cms/fieldsJS.js +1 -5
- package/utils/cms/modules.d.ts +1 -1
- package/utils/cms/modules.js +13 -22
- package/utils/detectPort.js +12 -19
- package/utils/git.js +17 -26
- package/utils/lang.d.ts +1 -1
- package/utils/lang.js +5 -14
- package/utils/personalAccessKey.d.ts +8 -0
- package/utils/personalAccessKey.js +51 -0
- package/errors/errors_DEPRECATED.d.ts +0 -3
- package/errors/errors_DEPRECATED.js +0 -60
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
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 =
|
|
23
|
+
this.name = HubSpotHttpErrorName;
|
|
27
24
|
this.context = context;
|
|
28
25
|
this.cause = options?.cause;
|
|
29
|
-
if (options &&
|
|
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 (
|
|
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 &&
|
|
147
|
-
const preposition = (method &&
|
|
148
|
-
|
|
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 =
|
|
149
|
+
messageDetail = i18n(`errors.apiErrors.messageDetail`, {
|
|
153
150
|
accountId: context.accountId,
|
|
154
151
|
requestName,
|
|
155
152
|
});
|
|
156
153
|
}
|
|
157
154
|
else {
|
|
158
|
-
messageDetail =
|
|
155
|
+
messageDetail = i18n(`errors.apiErrors.genericMessageDetail`);
|
|
159
156
|
}
|
|
160
157
|
const errorMessage = [];
|
|
161
158
|
if ((method === 'put' || method === 'post') && context.payload) {
|
|
162
|
-
errorMessage.push(
|
|
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 =
|
|
164
|
+
statusBasedMessage = i18n(`errors.apiErrors.codes.400`, {
|
|
168
165
|
messageDetail,
|
|
169
166
|
});
|
|
170
167
|
break;
|
|
171
168
|
case 401:
|
|
172
|
-
statusBasedMessage =
|
|
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 =
|
|
176
|
+
statusBasedMessage = i18n(`errors.apiErrors.codes.404`, {
|
|
180
177
|
messageDetail,
|
|
181
178
|
});
|
|
182
179
|
break;
|
|
183
180
|
case 429:
|
|
184
|
-
statusBasedMessage =
|
|
181
|
+
statusBasedMessage = i18n(`errors.apiErrors.codes.429`, {
|
|
185
182
|
messageDetail,
|
|
186
183
|
});
|
|
187
184
|
break;
|
|
188
185
|
case 503:
|
|
189
|
-
statusBasedMessage =
|
|
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 =
|
|
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 =
|
|
197
|
+
statusBasedMessage = i18n(`errors.apiErrors.codes.400Generic`, {
|
|
201
198
|
messageDetail,
|
|
202
199
|
});
|
|
203
200
|
}
|
|
204
201
|
else {
|
|
205
|
-
statusBasedMessage =
|
|
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;
|
package/models/OAuth2Manager.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
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 =
|
|
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(
|
|
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
|
-
(
|
|
27
|
+
moment()
|
|
34
28
|
.add(5, 'minutes')
|
|
35
|
-
.isAfter((
|
|
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
|
-
|
|
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 (
|
|
47
|
-
url: `${
|
|
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 = (
|
|
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
|
-
|
|
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
|
-
|
|
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": "
|
|
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
|
|
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": "^
|
|
34
|
+
"@types/node": "^20.14.8",
|
|
33
35
|
"@types/unixify": "^1.0.0",
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"eslint-plugin-import": "^2.
|
|
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
|
-
"
|
|
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": "^
|
|
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": "
|
|
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": "
|
|
82
|
+
"ignore": "^7.0.0",
|
|
79
83
|
"js-yaml": "4.1.0",
|
|
80
84
|
"moment": "2.30.1",
|
|
81
|
-
"p-queue": "
|
|
82
|
-
"prettier": "3.
|
|
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": ">=
|
|
91
|
+
"node": ">=20.0.0"
|
|
88
92
|
}
|
|
89
93
|
}
|
package/types/Accounts.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { HUBSPOT_ACCOUNT_TYPES } from '../constants/config';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Activity.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Apps.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Archive.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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 './
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/CLIOptions.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Crm.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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 './
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/DesignManager.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/DevSecrets.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Error.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/FieldsJS.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/FileManager.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/FireAlarm.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Functions.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Github.d.ts
CHANGED
package/types/Github.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Http.d.ts
CHANGED
package/types/Http.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Hubdb.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/HublValidation.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Lang.d.ts
CHANGED
package/types/Lang.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Lighthouse.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/Migration.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ValueOf } from './Utils';
|
|
2
|
-
import { ProjectStandardError } from './
|
|
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";
|
package/types/Migration.js
CHANGED
package/types/Modules.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/types/PortManager.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|