@hubspot/local-dev-lib 0.0.7 → 0.0.9
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/customObjects.js +3 -3
- package/api/fileMapper.d.ts +2 -0
- package/api/fileMapper.js +3 -2
- package/api/functions.js +1 -1
- package/api/hubdb.js +4 -4
- package/api/lighthouseScore.d.ts +2 -2
- package/api/lighthouseScore.js +2 -2
- package/api/localDevAuth.d.ts +5 -1
- package/api/localDevAuth.js +1 -1
- package/api/marketplaceValidation.d.ts +2 -2
- package/api/marketplaceValidation.js +2 -2
- package/api/projects.js +2 -2
- package/api/sandboxHubs.js +1 -1
- package/api/sandboxSync.js +1 -1
- package/api/secrets.js +2 -2
- package/api/validateHubl.js +1 -1
- package/config/CLIConfiguration.js +20 -18
- package/config/configFile.js +1 -2
- package/config/configUtils.js +2 -1
- package/config/config_DEPRECATED.js +27 -24
- package/config/environment.js +4 -3
- package/constants/ports.d.ts +3 -0
- package/constants/ports.js +6 -0
- package/errors/apiErrors.d.ts +1 -1
- package/errors/apiErrors.js +13 -13
- package/errors/errors_DEPRECATED.js +2 -2
- package/errors/fileSystemErrors.js +1 -1
- package/errors/standardErrors.d.ts +4 -3
- package/errors/standardErrors.js +2 -2
- package/http/index.js +8 -4
- package/lang/en.json +383 -0
- package/lang/lang/en.json +383 -0
- package/lib/archive.js +10 -9
- package/lib/cms/functions.js +13 -13
- package/lib/cms/handleFieldsJS.js +8 -6
- package/lib/cms/modules.js +5 -4
- package/lib/cms/processFieldsJs.js +6 -8
- package/lib/cms/templates.js +10 -5
- package/lib/cms/uploadFolder.js +11 -7
- package/lib/cms/watch.js +33 -21
- package/lib/customObjects.d.ts +4 -4
- package/lib/customObjects.js +21 -4
- package/lib/fileMapper.js +28 -21
- package/lib/github.js +15 -11
- package/lib/gitignore.js +2 -1
- package/lib/hubdb.d.ts +1 -1
- package/lib/hubdb.js +5 -4
- package/lib/logging/git.js +1 -1
- package/lib/logging/logs.js +5 -1
- package/lib/oauth.js +5 -4
- package/lib/personalAccessKey.d.ts +1 -1
- package/lib/personalAccessKey.js +6 -5
- package/lib/portManager.d.ts +13 -0
- package/lib/portManager.js +45 -0
- package/lib/sandboxes.js +7 -7
- package/lib/trackUsage.js +3 -3
- package/models/HubSpotAuthError.d.ts +1 -1
- package/models/HubSpotAuthError.js +2 -2
- package/models/OAuth2Manager.d.ts +1 -1
- package/models/OAuth2Manager.js +5 -5
- package/package.json +7 -2
- package/types/Error.d.ts +3 -3
- package/types/Http.d.ts +8 -11
- package/types/Hubdb.d.ts +27 -17
- package/types/Lang.d.ts +7 -0
- package/types/Lang.js +2 -0
- package/types/PortManager.d.ts +4 -0
- package/types/PortManager.js +2 -0
- package/types/Schemas.d.ts +18 -33
- package/types/Utils.d.ts +5 -0
- package/utils/PortManagerServer.d.ts +29 -0
- package/utils/PortManagerServer.js +158 -0
- package/utils/cms/modules.js +2 -1
- package/utils/detectPort.d.ts +1 -0
- package/utils/detectPort.js +102 -0
- package/utils/lang.d.ts +2 -4
- package/utils/lang.js +12 -14
- package/utils/logger.d.ts +4 -3
- package/utils/logger.js +4 -3
- package/utils/notify.js +2 -1
- package/lang/en.lyaml +0 -247
package/errors/apiErrors.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare function isApiStatusCodeError(err: GenericError): boolean;
|
|
|
4
4
|
export declare function isMissingScopeError(err: GenericError): boolean;
|
|
5
5
|
export declare function isGatingError(err: GenericError): boolean;
|
|
6
6
|
export declare function isApiUploadValidationError(err: GenericError): boolean;
|
|
7
|
-
export declare function isSpecifiedHubSpotAuthError(err: GenericError, {
|
|
7
|
+
export declare function isSpecifiedHubSpotAuthError(err: GenericError, { status, category, subCategory }: Partial<HubSpotAuthError>): boolean;
|
|
8
8
|
/**
|
|
9
9
|
* @throws
|
|
10
10
|
*/
|
package/errors/apiErrors.js
CHANGED
|
@@ -4,35 +4,36 @@ exports.throwApiUploadError = exports.throwApiError = exports.throwApiStatusCode
|
|
|
4
4
|
const api_1 = require("../constants/api");
|
|
5
5
|
const lang_1 = require("../utils/lang");
|
|
6
6
|
const standardErrors_1 = require("./standardErrors");
|
|
7
|
+
const i18nKey = 'errors.apiErrors';
|
|
7
8
|
function isApiStatusCodeError(err) {
|
|
8
9
|
return (err.name === 'StatusCodeError' ||
|
|
9
|
-
(!!err.
|
|
10
|
+
(!!err.status && err.status >= 100 && err.status < 600));
|
|
10
11
|
}
|
|
11
12
|
exports.isApiStatusCodeError = isApiStatusCodeError;
|
|
12
13
|
function isMissingScopeError(err) {
|
|
13
14
|
return (isApiStatusCodeError(err) &&
|
|
14
|
-
err.
|
|
15
|
+
err.status === 403 &&
|
|
15
16
|
!!err.error &&
|
|
16
17
|
err.error.category === 'MISSING_SCOPES');
|
|
17
18
|
}
|
|
18
19
|
exports.isMissingScopeError = isMissingScopeError;
|
|
19
20
|
function isGatingError(err) {
|
|
20
21
|
return (isApiStatusCodeError(err) &&
|
|
21
|
-
err.
|
|
22
|
+
err.status === 403 &&
|
|
22
23
|
!!err.error &&
|
|
23
24
|
err.error.category === 'GATED');
|
|
24
25
|
}
|
|
25
26
|
exports.isGatingError = isGatingError;
|
|
26
27
|
function isApiUploadValidationError(err) {
|
|
27
28
|
return (isApiStatusCodeError(err) &&
|
|
28
|
-
err.
|
|
29
|
+
err.status === 400 &&
|
|
29
30
|
!!err.response &&
|
|
30
31
|
!!err.response.body &&
|
|
31
32
|
!!(err.response.body.message || !!err.response.body.errors));
|
|
32
33
|
}
|
|
33
34
|
exports.isApiUploadValidationError = isApiUploadValidationError;
|
|
34
|
-
function isSpecifiedHubSpotAuthError(err, {
|
|
35
|
-
const statusCodeErr = !
|
|
35
|
+
function isSpecifiedHubSpotAuthError(err, { status, category, subCategory }) {
|
|
36
|
+
const statusCodeErr = !status || err.status === status;
|
|
36
37
|
const categoryErr = !category || err.category === category;
|
|
37
38
|
const subCategoryErr = !subCategory || err.subCategory === subCategory;
|
|
38
39
|
return Boolean(err.name === 'HubSpotAuthError' &&
|
|
@@ -70,9 +71,9 @@ function logValidationErrors(error) {
|
|
|
70
71
|
* @throws
|
|
71
72
|
*/
|
|
72
73
|
function throwStatusCodeError(error, context = {}) {
|
|
73
|
-
const {
|
|
74
|
+
const { status, message, response } = error;
|
|
74
75
|
const errorData = JSON.stringify({
|
|
75
|
-
|
|
76
|
+
status,
|
|
76
77
|
message,
|
|
77
78
|
url: response ? response.request.href : null,
|
|
78
79
|
method: response ? response.request.method : null,
|
|
@@ -87,8 +88,7 @@ exports.throwStatusCodeError = throwStatusCodeError;
|
|
|
87
88
|
* @throws
|
|
88
89
|
*/
|
|
89
90
|
function throwApiStatusCodeError(error, context = {}) {
|
|
90
|
-
const
|
|
91
|
-
const { statusCode } = error;
|
|
91
|
+
const { status } = error;
|
|
92
92
|
const { method } = error.options || {};
|
|
93
93
|
const { projectName } = context;
|
|
94
94
|
const isPutOrPost = method === 'PUT' || method === 'POST';
|
|
@@ -110,7 +110,7 @@ function throwApiStatusCodeError(error, context = {}) {
|
|
|
110
110
|
}
|
|
111
111
|
const isProjectMissingScopeError = isMissingScopeError(error) && projectName;
|
|
112
112
|
const isProjectGatingError = isGatingError(error) && projectName;
|
|
113
|
-
switch (
|
|
113
|
+
switch (status) {
|
|
114
114
|
case 400:
|
|
115
115
|
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.400`, { messageDetail }));
|
|
116
116
|
break;
|
|
@@ -151,10 +151,10 @@ function throwApiStatusCodeError(error, context = {}) {
|
|
|
151
151
|
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.503`, { messageDetail }));
|
|
152
152
|
break;
|
|
153
153
|
default:
|
|
154
|
-
if (
|
|
154
|
+
if (status && status >= 500 && status < 600) {
|
|
155
155
|
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.500Generic`, { messageDetail }));
|
|
156
156
|
}
|
|
157
|
-
else if (
|
|
157
|
+
else if (status && status >= 400 && status < 500) {
|
|
158
158
|
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.400Generic`, { messageDetail }));
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
@@ -6,9 +6,9 @@ function isSystemError(err) {
|
|
|
6
6
|
}
|
|
7
7
|
function debugErrorAndContext(error, context) {
|
|
8
8
|
if (error.name === 'StatusCodeError') {
|
|
9
|
-
const {
|
|
9
|
+
const { status, message, response } = error;
|
|
10
10
|
console.debug('Error: %o', {
|
|
11
|
-
|
|
11
|
+
status,
|
|
12
12
|
message,
|
|
13
13
|
url: response.request.href,
|
|
14
14
|
method: response.request.method,
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.throwFileSystemError = void 0;
|
|
4
4
|
const lang_1 = require("../utils/lang");
|
|
5
5
|
const standardErrors_1 = require("./standardErrors");
|
|
6
|
-
const i18nKey = 'errors.
|
|
6
|
+
const i18nKey = 'errors.fileSystemErrors';
|
|
7
7
|
function throwFileSystemError(error, context) {
|
|
8
8
|
let fileAction = '';
|
|
9
9
|
if (context.read) {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { BaseError, StatusCodeError } from '../types/Error';
|
|
2
|
+
import { LangKey } from '../types/Lang';
|
|
2
3
|
export declare function isSystemError(err: BaseError): boolean;
|
|
3
4
|
export declare function isFatalError(err: BaseError): boolean;
|
|
4
5
|
/**
|
|
5
6
|
* @throws
|
|
6
7
|
*/
|
|
7
|
-
export declare function throwErrorWithMessage(identifier:
|
|
8
|
+
export declare function throwErrorWithMessage(identifier: LangKey, interpolation?: {
|
|
8
9
|
[key: string]: string | number;
|
|
9
10
|
}, cause?: BaseError): never;
|
|
10
11
|
/**
|
|
11
12
|
* @throws
|
|
12
13
|
*/
|
|
13
|
-
export declare function throwTypeErrorWithMessage(identifier:
|
|
14
|
+
export declare function throwTypeErrorWithMessage(identifier: LangKey, interpolation?: {
|
|
14
15
|
[key: string]: string | number;
|
|
15
16
|
}, cause?: BaseError): never;
|
|
16
17
|
/**
|
|
17
18
|
* @throws
|
|
18
19
|
*/
|
|
19
|
-
export declare function throwAuthErrorWithMessage(identifier:
|
|
20
|
+
export declare function throwAuthErrorWithMessage(identifier: LangKey, interpolation?: {
|
|
20
21
|
[key: string]: string | number;
|
|
21
22
|
}, cause?: StatusCodeError): never;
|
|
22
23
|
/**
|
package/errors/standardErrors.js
CHANGED
|
@@ -13,7 +13,7 @@ function isFatalError(err) {
|
|
|
13
13
|
}
|
|
14
14
|
exports.isFatalError = isFatalError;
|
|
15
15
|
function genericThrowErrorWithMessage(ErrorType, identifier, interpolation, cause) {
|
|
16
|
-
const message = (0, lang_1.i18n)(
|
|
16
|
+
const message = (0, lang_1.i18n)(identifier, interpolation);
|
|
17
17
|
if (cause) {
|
|
18
18
|
throw new ErrorType(message, { cause });
|
|
19
19
|
}
|
|
@@ -52,7 +52,7 @@ function throwError(error) {
|
|
|
52
52
|
else {
|
|
53
53
|
// Error or Error subclass
|
|
54
54
|
const name = error.name || 'Error';
|
|
55
|
-
const message = [(0, lang_1.i18n)('errors.
|
|
55
|
+
const message = [(0, lang_1.i18n)('errors.generic', { name })];
|
|
56
56
|
[error.message, error.reason].forEach(msg => {
|
|
57
57
|
if (msg) {
|
|
58
58
|
message.push(msg);
|
package/http/index.js
CHANGED
|
@@ -13,11 +13,12 @@ const oauth_1 = require("../lib/oauth");
|
|
|
13
13
|
const standardErrors_1 = require("../errors/standardErrors");
|
|
14
14
|
const logger_1 = require("../utils/logger");
|
|
15
15
|
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
const i18nKey = 'http.index';
|
|
16
17
|
async function withOauth(accountId, accountConfig, axiosConfig) {
|
|
17
18
|
const { headers } = axiosConfig;
|
|
18
19
|
const oauth = (0, oauth_1.getOauthManager)(accountId, accountConfig);
|
|
19
20
|
if (!oauth) {
|
|
20
|
-
(0, standardErrors_1.throwErrorWithMessage)(
|
|
21
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.errors.withOauth`, { accountId });
|
|
21
22
|
}
|
|
22
23
|
const accessToken = await oauth.accessToken();
|
|
23
24
|
return {
|
|
@@ -52,7 +53,7 @@ function withPortalId(portalId, axiosConfig) {
|
|
|
52
53
|
async function withAuth(accountId, options) {
|
|
53
54
|
const accountConfig = (0, config_1.getAccountConfig)(accountId);
|
|
54
55
|
if (!accountConfig) {
|
|
55
|
-
(0, standardErrors_1.throwErrorWithMessage)(
|
|
56
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.errors.withAuth`, { accountId });
|
|
56
57
|
}
|
|
57
58
|
const { env, authType, apiKey } = accountConfig;
|
|
58
59
|
const axiosConfig = withPortalId(accountId, (0, getAxiosConfig_1.getAxiosConfig)({ env, ...options }));
|
|
@@ -113,12 +114,13 @@ function createGetRequestStream(contentType) {
|
|
|
113
114
|
return async (accountId, options, destPath, logCallbacks) => {
|
|
114
115
|
const { query, ...rest } = options;
|
|
115
116
|
const axiosConfig = addQueryParams(rest, query);
|
|
116
|
-
const logger = (0, logger_1.makeTypedLogger)(logCallbacks
|
|
117
|
+
const logger = (0, logger_1.makeTypedLogger)(logCallbacks);
|
|
117
118
|
// eslint-disable-next-line no-async-promise-executor
|
|
118
119
|
return new Promise(async (resolve, reject) => {
|
|
119
120
|
try {
|
|
120
121
|
const { headers, ...opts } = await withAuth(accountId, axiosConfig);
|
|
121
122
|
const res = await (0, axios_1.default)({
|
|
123
|
+
method: 'get',
|
|
122
124
|
...opts,
|
|
123
125
|
headers: {
|
|
124
126
|
...headers,
|
|
@@ -149,7 +151,9 @@ function createGetRequestStream(contentType) {
|
|
|
149
151
|
reject(err);
|
|
150
152
|
});
|
|
151
153
|
writeStream.on('close', async () => {
|
|
152
|
-
logger('onWrite', {
|
|
154
|
+
logger('onWrite', `${i18nKey}.createGetRequestStream.onWrite`, {
|
|
155
|
+
filepath,
|
|
156
|
+
});
|
|
153
157
|
resolve(res);
|
|
154
158
|
});
|
|
155
159
|
}
|
package/lang/en.json
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lib": {
|
|
3
|
+
"trackUsage": {
|
|
4
|
+
"invalidEvent": "Usage tracking event {{ eventName }} is not a valid event type.",
|
|
5
|
+
"sendingEventAuthenticated": "Sending usage event to authenticated endpoint",
|
|
6
|
+
"sendingEventUnauthenticated": "Sending usage event to unauthenticated endpoint"
|
|
7
|
+
},
|
|
8
|
+
"archive": {
|
|
9
|
+
"extractZip": {
|
|
10
|
+
"init": "Extracting project source...",
|
|
11
|
+
"success": "Completed project source extraction.",
|
|
12
|
+
"errors": {
|
|
13
|
+
"write": "An error occured writing temp project source.",
|
|
14
|
+
"extract": "An error occured extracting project source."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"copySourceToDest": {
|
|
18
|
+
"init": "Copying project source...",
|
|
19
|
+
"sourceEmpty": "Project source is empty",
|
|
20
|
+
"success": "Completed copying project source.",
|
|
21
|
+
"error": "An error occured copying project source to {{ dest }}."
|
|
22
|
+
},
|
|
23
|
+
"cleanupTempDir": {
|
|
24
|
+
"error": "Failed to clean up temp dir: {{ tmpDir }}"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"gitignore": {
|
|
28
|
+
"errors": {
|
|
29
|
+
"configIgnore": "Unable to determine if config file is properly ignored by git."
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"github": {
|
|
33
|
+
"fetchJsonFromRepository": {
|
|
34
|
+
"fetching": "Fetching {{ url }}...",
|
|
35
|
+
"errors": {
|
|
36
|
+
"fetchFail": "An error occured fetching JSON file."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"fetchReleaseData": {
|
|
40
|
+
"errors": {
|
|
41
|
+
"fetchFail": "Failed fetching release data for {{ tag }} project."
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"downloadGithubRepoZip": {
|
|
45
|
+
"fetching": "Fetching {{ releaseType }} with name {{ repoName }}...",
|
|
46
|
+
"fetchingName": "Fetching {{ name }}...",
|
|
47
|
+
"completed": "Completed project fetch.",
|
|
48
|
+
"errors": {
|
|
49
|
+
"fetchFail": "An error occurred fetching the project source."
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"cloneGithubRepo": {
|
|
53
|
+
"success": "Your new {{ type }} has been created in {{ dest }}"
|
|
54
|
+
},
|
|
55
|
+
"downloadGithubRepoContents": {
|
|
56
|
+
"downloading": "Downloading content piece: {{ contentPiecePath }} from {{ downloadUrl }} to {{ downloadPath }}",
|
|
57
|
+
"errors": {
|
|
58
|
+
"fetchFail": "Failed to fetch contents: {{ errorMessage }}"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"hubdb": {
|
|
63
|
+
"errors": {
|
|
64
|
+
"invalidJsonPath": "The HubDB table file must be a '.json' file",
|
|
65
|
+
"invalidJsonFile": "The '{{{ src }}' path is not a path to a file"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"personalAccessKey": {
|
|
69
|
+
"errors": {
|
|
70
|
+
"accountNotFound": "Account with id {{ accountId }} does not exist.",
|
|
71
|
+
"invalidPersonalAccessKey": "Error while retrieving new access token: {{ errorMessage }}"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"sandboxes": {
|
|
75
|
+
"errors": {
|
|
76
|
+
"createSandbox": "There was an error creating your sandbox.",
|
|
77
|
+
"deleteSandbox": "There was an error deleting your sandbox.",
|
|
78
|
+
"getSandboxUsageLimits": "There was an error fetching sandbox usage limits.",
|
|
79
|
+
"initiateSync": "There was an error initiating the sandbox sync.",
|
|
80
|
+
"fetchTaskStatus": "There was an error fetching the task status while syncing sandboxes.",
|
|
81
|
+
"fetchTypes": "There was an error fetching sandbox types."
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"cms": {
|
|
85
|
+
"modules": {
|
|
86
|
+
"createModule": {
|
|
87
|
+
"creatingModule": "Creating module at {{ path }}",
|
|
88
|
+
"creatingPath": "Creating {{ path }}",
|
|
89
|
+
"errors": {
|
|
90
|
+
"writeModuleMeta": "The {{ path }} path already exists"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"functions": {
|
|
95
|
+
"updateExistingConfig": {
|
|
96
|
+
"unableToReadFile": "The file {{ configFilePath }} could not be read",
|
|
97
|
+
"invalidJSON": "The file {{ configFilePath }} is not valid JSON",
|
|
98
|
+
"couldNotUpdateFile": "The file {{ configFilePath }} could not be updated",
|
|
99
|
+
"errors": {
|
|
100
|
+
"configIsNotObjectError": "The existing {{ configFilePath }} is not an object",
|
|
101
|
+
"endpointAreadyExistsError": "The endpoint {{ endpointPath }} already exists in {{ configFilePath }}"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"createFunction": {
|
|
105
|
+
"destPathAlreadyExists": "The {{ path }} path already exists",
|
|
106
|
+
"createdDest": "Created {{ path }}",
|
|
107
|
+
"failedToCreateFile": "The file {{ configFilePath }} could not be created",
|
|
108
|
+
"createdFunctionFile": "Created {{ path }}",
|
|
109
|
+
"createdConfigFile": "Created {{ path }}",
|
|
110
|
+
"success": "A function for the endpoint '/_hcms/api/{{ endpointPath }}' has been created. Upload {{ folderName }} to try it out",
|
|
111
|
+
"errors": {
|
|
112
|
+
"nestedConfigError": "Cannot create a functions directory inside '{{ ancestorConfigPath }}'",
|
|
113
|
+
"jsFileConflictError": "The JavaScript file at '{{ functionFilePath }}'' already exists"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"handleFieldsJs": {
|
|
118
|
+
"convertFieldsJs": {
|
|
119
|
+
"creating": "Creating child process with pid {{ pid }}",
|
|
120
|
+
"terminating": "Child process with pid {{ pid }} has been terminated",
|
|
121
|
+
"errors": {
|
|
122
|
+
"errorConverting": "There was an error converting '{{ filePath }}'"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"saveOutput": {
|
|
126
|
+
"errors": {
|
|
127
|
+
"saveFailed": "There was an error saving the json output of {{ path }}"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"createTmpDirSync": {
|
|
131
|
+
"errors": {
|
|
132
|
+
"writeFailed": "An error occured writing temporary project source."
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"cleanupTmpDirSync": {
|
|
136
|
+
"errors": {
|
|
137
|
+
"deleteFailed": "There was an error deleting the temporary project source"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"uploadFolder": {
|
|
142
|
+
"uploadFolder": {
|
|
143
|
+
"success": "Uploaded file \"{{ file}}\" to \"{{ destPath }}\"",
|
|
144
|
+
"attempt": "Attempting to upload file \"{{ file }}\" to \"{{ destPath }}\"",
|
|
145
|
+
"failed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed so scheduled retry",
|
|
146
|
+
"retry": "Retrying to upload file \"{{ file }}\" to \"{{ destPath }}\"",
|
|
147
|
+
"retryFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"templates": {
|
|
151
|
+
"createTemplate": {
|
|
152
|
+
"creatingFile": "Creating file at {{ path }}",
|
|
153
|
+
"creatingPath": "Making {{ path }} if needed",
|
|
154
|
+
"errors": {
|
|
155
|
+
"pathExists": "The {{ path }} path already exists"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"processFieldsJs": {
|
|
160
|
+
"converting": "Converting \"{{ src }}\" to \"{{ dest }}\".",
|
|
161
|
+
"converted": "Finished converting \"{{ src }}\" to \"{{ dest }}\".",
|
|
162
|
+
"errors": {
|
|
163
|
+
"invalidMjsFile": ".mjs files are only supported when using Node 13.2.0+",
|
|
164
|
+
"notFunction": "There was an error loading JS file \"{{ path }}\". Expected type \"Function\" but received type \"{{ returned }}\". Make sure that your default export is a function.",
|
|
165
|
+
"notArray": "There was an error loading JS file \"{{ path }}\". Expected type \"Array\" but received type \"{{ returned }}\" . Make sure that your function returns an array"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"watch": {
|
|
169
|
+
"notifyOfThemePreview": "To preview this theme, visit: {{ previewUrl }}",
|
|
170
|
+
"skipUnsupportedExtension": "Skipping {{ file }} due to unsupported extension",
|
|
171
|
+
"skipIgnoreRule": "Skipping {{ file }} due to an ignore rule",
|
|
172
|
+
"uploadAttempt": "Attempting to upload file \"{{ file }}\" to \"{{ dest }}\"",
|
|
173
|
+
"uploadSuccess": "Uploaded file {{ file }} to {{ dest }}",
|
|
174
|
+
"uploadFailed": "Uploading file {{ file }} to {{ dest }} failed",
|
|
175
|
+
"uploadRetry": "Retrying to upload file \"{{ file }}\" to \"{{ dest }}\"",
|
|
176
|
+
"deleteAttempt": "Attempting to delete file {{ remoteFilePath }}",
|
|
177
|
+
"deleteAttemptWithType": "Attempting to delete {{ type }} {{ remoteFilePath }}",
|
|
178
|
+
"deleteSuccess": "Deleted file {{ remoteFilePath }}",
|
|
179
|
+
"deleteSuccessWithType": "Deleted {{ type }} {{ remoteFilePath }}",
|
|
180
|
+
"deleteFailed": "Deleting file {{ remoteFilePath }} failed",
|
|
181
|
+
"folderUploadSuccess": "Completed uploading files in {{ src }} to {{ dest }} in {{ accountId }}",
|
|
182
|
+
"ready": "Watcher is ready and watching {{ src }}. Any changes detected will be automatically uploaded and overwrite the current version in the developer file system."
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"logging": {
|
|
186
|
+
"git": {
|
|
187
|
+
"securityIssue": "Security Issue Detected",
|
|
188
|
+
"configFileTracked": "The HubSpot config file can be tracked by git.",
|
|
189
|
+
"fileName": "File: \"{{ configPath }}\"",
|
|
190
|
+
"remediate": "To remediate:",
|
|
191
|
+
"moveConfig": "- Move the config file to your home directory: '{{ homeDir }}'",
|
|
192
|
+
"addGitignore": "- Add gitignore pattern '{{ configPath }}' to a .gitignore file in root of your repository.",
|
|
193
|
+
"noRemote": "- Ensure that the config file has not already been pushed to a remote repository.",
|
|
194
|
+
"checkFailed": "Unable to determine if config file is properly ignored by git."
|
|
195
|
+
},
|
|
196
|
+
"logs": {
|
|
197
|
+
"unableToProcessLog": "Unable to process log {{ log }}"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"oauth": {
|
|
201
|
+
"writeTokenInfo": "Updating Oauth2 token info for portalId: {{ portalId }}",
|
|
202
|
+
"addOauthToAccountConfig": {
|
|
203
|
+
"init": "Updating configuration",
|
|
204
|
+
"success": "Configuration updated"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"fileMapper": {
|
|
208
|
+
"skippedExisting": "Skipped existing {{ filepath }}",
|
|
209
|
+
"wroteFolder": "Wrote folder {{ filepath }}",
|
|
210
|
+
"completedFetch": "Completed fetch of file \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
|
|
211
|
+
"folderFetch": "Fetched \"{{ src }}\" from account {{ accountId }} from the Design Manager successfully",
|
|
212
|
+
"completedFolderFetch": "Completed fetch of folder \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
|
|
213
|
+
"errors": {
|
|
214
|
+
"invalidRequest": "Invalid request for file: {{ src }}",
|
|
215
|
+
"invalidNode": "Invalid FileMapperNode: {{ json }}",
|
|
216
|
+
"invalidFileType": "Invalid file type requested: {{ srcPath }}",
|
|
217
|
+
"assetTimeout": "HubSpot assets are unavailable at the moment. Please wait a few minutes and try again.",
|
|
218
|
+
"failedToFetchFile": "Failed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
|
|
219
|
+
"failedToFetchFolder": "Failed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
|
|
220
|
+
"invalidFetchFolderRequest": "Invalid request for folder: \"{{ src }}\"",
|
|
221
|
+
"incompleteFetch": "Not all files in folder \"{{ src }}\" were successfully fetched. Re-run the last command to try again"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"config": {
|
|
226
|
+
"cliConfiguration": {
|
|
227
|
+
"errors": {
|
|
228
|
+
"noConfigLoaded": "No config loaded."
|
|
229
|
+
},
|
|
230
|
+
"load": {
|
|
231
|
+
"configFromEnv": "Loaded config from environment variables for {{ accountId }}",
|
|
232
|
+
"configFromFile": "Loaded config from configuration file.",
|
|
233
|
+
"empty": "The config file was empty. Initializing an empty config."
|
|
234
|
+
},
|
|
235
|
+
"validate": {
|
|
236
|
+
"noConfig": "Valiation failed: No config was found.",
|
|
237
|
+
"noConfigAccounts": "Valiation failed: config.accounts[] is not defined.",
|
|
238
|
+
"emptyAccountConfig": "Valiation failed: config.accounts[] has an empty entry.",
|
|
239
|
+
"noAccountId": "Valiation failed: config.accounts[] has an entry missing accountId.",
|
|
240
|
+
"duplicateAccountIds": "Valiation failed: config.accounts[] has multiple entries with {{ accountId }}.",
|
|
241
|
+
"duplicateAccountNames": "Valiation failed: config.accounts[] has multiple entries with {{ accountName }}.",
|
|
242
|
+
"nameContainsSpaces": "Valiation failed: config.name {{ accountName }} cannot contain spaces."
|
|
243
|
+
},
|
|
244
|
+
"updateAccount": {
|
|
245
|
+
"noConfigToUpdate": "No config to update.",
|
|
246
|
+
"updating": "Updating account config for {{ accountId }}",
|
|
247
|
+
"addingConfigEntry": "Adding account config entry for {{ accountId }}",
|
|
248
|
+
"errors": {
|
|
249
|
+
"accountIdRequired": "An accountId is required to update the config"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"updateDefaultAccount": {
|
|
253
|
+
"errors": {
|
|
254
|
+
"invalidInput": "A 'defaultAccount' with value of number or string is required to update the config."
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"renameAccount": {
|
|
258
|
+
"errors": {
|
|
259
|
+
"invalidName": "Cannot find account with identifier {{ currentName }}"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"removeAccountFromConfig": {
|
|
263
|
+
"deleting": "Deleting config for {{ accountId }}",
|
|
264
|
+
"errors": {
|
|
265
|
+
"invalidId": "Unable to find account for {{ nameOrId }}."
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"updateDefaultMode": {
|
|
269
|
+
"errors": {
|
|
270
|
+
"invalidMode": "The mode {{ defaultMode }} is invalid. Valid values are {{ validModes }}."
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"updateHttpTimeout": {
|
|
274
|
+
"errors": {
|
|
275
|
+
"invalidTimeout": "The value {{ timeout }} is invalid. The value must be a number greater than {{ minTimeout }}."
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"updateAllowUsageTracking": {
|
|
279
|
+
"errors": {
|
|
280
|
+
"invalidInput": "Unable to update allowUsageTracking. The value {{ isEnabled }} is invalid. The value must be a boolean."
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"configFile": {
|
|
285
|
+
"errorReading": "Config file could not be read: {{ configPath }}",
|
|
286
|
+
"writeSuccess": "Successfully wrote updated config data to {{ configPath }}",
|
|
287
|
+
"errorLoading": "A configuration file could not be found at {{ configPath }}.",
|
|
288
|
+
"errors": {
|
|
289
|
+
"parsing": "Config file could not be parsed"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"configUtils": {
|
|
293
|
+
"unknownType": "Unknown auth type {{ type }}"
|
|
294
|
+
},
|
|
295
|
+
"environment": {
|
|
296
|
+
"loadConfig": {
|
|
297
|
+
"missingAccountId": "Unable to load config from environment variables: Missing accountId",
|
|
298
|
+
"missingEnv": "Unable to load config from environment variables: Missing env",
|
|
299
|
+
"unknownAuthType": "Unable to load config from environment variables: Unknown auth type"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"models": {
|
|
304
|
+
"OAuth2Manager": {
|
|
305
|
+
"fetchingAccessToken": "Fetching access token for accountId {{ accountId }} for clientId {{ clientId }}",
|
|
306
|
+
"updatingTokenInfo": "Persisting updated tokenInfo for accountId {{ accountId }} for clientId {{ clientId }}",
|
|
307
|
+
"refreshingAccessToken": "Waiting for access token for accountId {{ accountId }} for clientId {{ clientId }} to be fetched",
|
|
308
|
+
"errors": {
|
|
309
|
+
"missingRefreshToken": "The account {{ accountId }} has not been authenticated with Oauth2",
|
|
310
|
+
"auth": "Error while retrieving new token: {{ token }}"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"utils": {
|
|
315
|
+
"notify": {
|
|
316
|
+
"errors": {
|
|
317
|
+
"filePath": "Unable to notify file '{{ filePath }}'"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"cms": {
|
|
321
|
+
"modules": {
|
|
322
|
+
"throwInvalidPathInput": "Expected Path Input"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"detectPort": {
|
|
326
|
+
"errors": {
|
|
327
|
+
"invalidPort": "Port must be between {{ minPort }} and {{ maxPort }}"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
"PortManagerServer": {
|
|
331
|
+
"started": "PortManagerServer running on port {{ port }}",
|
|
332
|
+
"setPort": "Server with instanceId {{ instanceId }} assigned to port {{ port }}",
|
|
333
|
+
"deletedPort": "Server with instanceId {{ instanceId }} unassigned from port {{ port }}",
|
|
334
|
+
"close": "PortManagerServer shutting down.",
|
|
335
|
+
"errors": {
|
|
336
|
+
"portInUse": "Failed to start PortManagerServer. Port {{ port }} is already in use.",
|
|
337
|
+
"duplicateInstance": "Failed to start PortManagerServer. An instance of PortManagerServer is already running.",
|
|
338
|
+
"404": "Could not find a server with instanceId {{ instanceId }}",
|
|
339
|
+
"409": "Failed to assign port. Server with instanceId {{ instanceId }} is already running on port {{ port }}",
|
|
340
|
+
"400": "Invalid port requested. Port must be between {{ minPort }} and {{ maxPort }}."
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"http": {
|
|
345
|
+
"index": {
|
|
346
|
+
"createGetRequestStream": {
|
|
347
|
+
"onWrite": "Wrote file {{ filepath }}"
|
|
348
|
+
},
|
|
349
|
+
"errors": {
|
|
350
|
+
"withOauth": "Oauth manager for account {{ accountId }} not found.",
|
|
351
|
+
"withAuth": "Account with id {{ accountId }} not found."
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"errors": {
|
|
356
|
+
"fileSystemErrors": {
|
|
357
|
+
"readAction": "reading from",
|
|
358
|
+
"writeAction": "writing to",
|
|
359
|
+
"otherAction": "accessing",
|
|
360
|
+
"unknownFilepath": "a file or folder",
|
|
361
|
+
"baseMessage": "An error occurred while {{ fileAction }} {{ filepath }}."
|
|
362
|
+
},
|
|
363
|
+
"apiErrors": {
|
|
364
|
+
"messageDetail": "{{ request }} in account {{ accountId }}",
|
|
365
|
+
"unableToUpload": "Unable to upload \"{{ payload }}.",
|
|
366
|
+
"codes": {
|
|
367
|
+
"400": "The {{ messageDetail }} was bad.",
|
|
368
|
+
"401": "The {{ messageDetail }} was unauthorized.",
|
|
369
|
+
"403": "The {{ messageDetail }} was forbidden.",
|
|
370
|
+
"404": "The {{ messageDetail }} was not found.",
|
|
371
|
+
"429": "The {{ messageDetail }} surpassed the rate limit. Retry in one minute.",
|
|
372
|
+
"503": "The {{ messageDetail }} could not be handled at this time. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
|
|
373
|
+
"403MissingScope": "Couldn't run the project command because there are scopes missing in your production account. To update scopes, deactivate your current personal access key for {{ accountId }}, and generate a new one. Then run `hs auth` to update the CLI with the new key.",
|
|
374
|
+
"403Gating": "The current target account {{ accountId }} does not have access to HubSpot projects. To opt in to the CRM Development Beta and use projects, visit https://app.hubspot.com/l/whats-new/betas?productUpdateId=13860216.",
|
|
375
|
+
"404Request": "The {{ action }} failed because \"{{ request }}\" was not found in account {{ accountId }}.",
|
|
376
|
+
"500Generic": "The {{ messageDetail }} failed due to a server error. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
|
|
377
|
+
"400Generic": "The {{ messageDetail }} failed due to a client error.",
|
|
378
|
+
"generic": "The {{ messageDetail }} failed."
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"generic": "A {{ name }} has occurred"
|
|
382
|
+
}
|
|
383
|
+
}
|