@hubspot/cli 5.1.3-beta.0 → 5.1.3-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/commands/auth.js +3 -2
- package/commands/cms/convertFields.js +1 -1
- package/commands/cms/lighthouseScore.js +2 -2
- package/commands/create/function.js +9 -2
- package/commands/create/module.js +10 -4
- package/commands/create/template.js +10 -3
- package/commands/fetch.js +2 -19
- package/commands/filemanager/fetch.js +2 -19
- package/commands/filemanager/upload.js +7 -10
- package/commands/list.js +1 -1
- package/commands/logs.js +5 -2
- package/commands/mv.js +1 -2
- package/commands/project/dev.js +4 -2
- package/commands/project/download.js +1 -8
- package/commands/project/logs.js +3 -4
- package/commands/remove.js +1 -1
- package/commands/sandbox/create.js +3 -1
- package/commands/sandbox/delete.js +1 -1
- package/commands/sandbox/sync.js +1 -1
- package/commands/upload.js +9 -6
- package/lang/en.lyaml +1 -17
- package/lib/DevServerManager.js +0 -2
- package/lib/__tests__/validation.js +2 -2
- package/lib/commonOpts.js +11 -0
- package/lib/errorHandlers/apiErrors.js +10 -0
- package/lib/errorHandlers/standardErrors.js +3 -1
- package/lib/oauth.js +14 -15
- package/lib/process.js +7 -0
- package/lib/projects.js +1 -1
- package/lib/sandbox-create.js +17 -1
- package/lib/sandbox-sync.js +1 -1
- package/lib/sandboxes.js +1 -1
- package/lib/validation.js +2 -2
- package/package.json +6 -6
- package/lib/logCallbacks.js +0 -20
package/commands/auth.js
CHANGED
|
@@ -44,7 +44,7 @@ const { trackAuthAction, trackCommandUsage } = require('../lib/usageTracking');
|
|
|
44
44
|
const { authenticateWithOauth } = require('../lib/oauth');
|
|
45
45
|
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
46
46
|
const { uiFeatureHighlight } = require('../lib/ui');
|
|
47
|
-
const { logErrorInstance } = require('
|
|
47
|
+
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
|
|
48
48
|
|
|
49
49
|
const i18nKey = 'cli.commands.auth';
|
|
50
50
|
|
|
@@ -154,7 +154,8 @@ exports.handler = async options => {
|
|
|
154
154
|
process.exit(EXIT_CODES.ERROR);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
const accountName =
|
|
157
|
+
const accountName =
|
|
158
|
+
(updatedConfig && updatedConfig.name) || validName || configData.name;
|
|
158
159
|
|
|
159
160
|
const setAsDefault = await setAsDefaultAccountPrompt(accountName);
|
|
160
161
|
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
} = require('@hubspot/cli-lib/lib/handleFieldsJs');
|
|
13
13
|
|
|
14
14
|
const { trackConvertFieldsUsage } = require('../../lib/usageTracking');
|
|
15
|
-
const { logErrorInstance } = require('
|
|
15
|
+
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
16
16
|
const i18nKey = 'cli.commands.convertFields';
|
|
17
17
|
|
|
18
18
|
exports.command = 'convert-fields';
|
|
@@ -13,12 +13,12 @@ const {
|
|
|
13
13
|
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
14
14
|
const { promptUser } = require('../../lib/prompts/promptUtils');
|
|
15
15
|
const { i18n } = require('../../lib/lang');
|
|
16
|
-
const { fetchThemes } = require('@hubspot/
|
|
16
|
+
const { fetchThemes } = require('@hubspot/local-dev-lib/api/designManager');
|
|
17
17
|
const {
|
|
18
18
|
requestLighthouseScore,
|
|
19
19
|
getLighthouseScoreStatus,
|
|
20
20
|
getLighthouseScore,
|
|
21
|
-
} = require('@hubspot/
|
|
21
|
+
} = require('@hubspot/local-dev-lib/api/lighthouseScore');
|
|
22
22
|
const {
|
|
23
23
|
HUBSPOT_FOLDER,
|
|
24
24
|
MARKETPLACE_FOLDER,
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
const { createFunction } = require('@hubspot/
|
|
1
|
+
const { createFunction } = require('@hubspot/local-dev-lib/cms/functions');
|
|
2
2
|
const {
|
|
3
3
|
createFunctionPrompt,
|
|
4
4
|
} = require('../../lib/prompts/createFunctionPrompt');
|
|
5
|
+
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
6
|
+
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
5
7
|
|
|
6
8
|
module.exports = {
|
|
7
9
|
dest: ({ name }) => name,
|
|
8
10
|
execute: async ({ dest }) => {
|
|
9
11
|
const functionDefinition = await createFunctionPrompt();
|
|
10
|
-
|
|
12
|
+
try {
|
|
13
|
+
await createFunction(functionDefinition, dest);
|
|
14
|
+
} catch (e) {
|
|
15
|
+
logErrorInstance(e);
|
|
16
|
+
process.exit(EXIT_CODES.ERROR);
|
|
17
|
+
}
|
|
11
18
|
},
|
|
12
19
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
const { createModulePrompt } = require('../../lib/prompts/createModulePrompt');
|
|
2
1
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
2
|
+
const { createModule } = require('@hubspot/local-dev-lib/cms/modules');
|
|
3
3
|
const { i18n } = require('../../lib/lang');
|
|
4
|
-
const {
|
|
4
|
+
const { createModulePrompt } = require('../../lib/prompts/createModulePrompt');
|
|
5
|
+
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
6
|
+
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
5
7
|
|
|
6
8
|
const i18nKey = 'cli.commands.create.subcommands.module';
|
|
7
9
|
|
|
@@ -12,11 +14,15 @@ module.exports = {
|
|
|
12
14
|
logger.error(i18n(`${i18nKey}.errors.nameRequired`));
|
|
13
15
|
return false;
|
|
14
16
|
}
|
|
15
|
-
|
|
16
17
|
return true;
|
|
17
18
|
},
|
|
18
19
|
execute: async ({ name, dest }) => {
|
|
19
20
|
const moduleDefinition = await createModulePrompt();
|
|
20
|
-
|
|
21
|
+
try {
|
|
22
|
+
await createModule(moduleDefinition, name, dest);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
logErrorInstance(e);
|
|
25
|
+
process.exit(EXIT_CODES.ERROR);
|
|
26
|
+
}
|
|
21
27
|
},
|
|
22
28
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
const { createTemplate } = require('@hubspot/local-dev-lib/cms/templates');
|
|
2
|
+
const { logger } = require('@hubspot/cli-lib/logger');
|
|
3
|
+
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
1
4
|
const {
|
|
2
5
|
createTemplatePrompt,
|
|
3
6
|
} = require('../../lib/prompts/createTemplatePrompt');
|
|
4
|
-
const { logger } = require('@hubspot/cli-lib/logger');
|
|
5
7
|
const { i18n } = require('../../lib/lang');
|
|
6
|
-
const {
|
|
8
|
+
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
7
9
|
|
|
8
10
|
const i18nKey = 'cli.commands.create.subcommands.template';
|
|
9
11
|
|
|
@@ -19,7 +21,12 @@ module.exports = {
|
|
|
19
21
|
},
|
|
20
22
|
execute: async ({ name, dest }) => {
|
|
21
23
|
const { templateType } = await createTemplatePrompt();
|
|
22
|
-
|
|
24
|
+
try {
|
|
25
|
+
await createTemplate(name, dest, templateType);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
logErrorInstance(e);
|
|
28
|
+
process.exit(EXIT_CODES.ERROR);
|
|
29
|
+
}
|
|
23
30
|
return { templateType };
|
|
24
31
|
},
|
|
25
32
|
};
|
package/commands/fetch.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const { downloadFileOrFolder } = require('@hubspot/local-dev-lib/fileMapper');
|
|
2
2
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
3
|
-
|
|
4
3
|
const {
|
|
5
4
|
addConfigOptions,
|
|
6
5
|
addAccountOptions,
|
|
@@ -17,22 +16,7 @@ const { i18n } = require('../lib/lang');
|
|
|
17
16
|
|
|
18
17
|
const i18nKey = 'cli.commands.fetch';
|
|
19
18
|
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
20
|
-
const {
|
|
21
|
-
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
|
|
22
|
-
|
|
23
|
-
const fileMapperLogCallbacks = buildLogCallbacks({
|
|
24
|
-
skippedExisting: `${i18nKey}.fileMapperLogCallbacks.skippedExisting`,
|
|
25
|
-
wroteFolder: `${i18nKey}.fileMapperLogCallbacks.wroteFolder`,
|
|
26
|
-
completedFetch: {
|
|
27
|
-
key: `${i18nKey}.fileMapperLogCallbacks.completedFetch`,
|
|
28
|
-
logger: logger.success,
|
|
29
|
-
},
|
|
30
|
-
folderFetch: `${i18nKey}.fileMapperLogCallbacks.folderFetch`,
|
|
31
|
-
completedFolderFetch: {
|
|
32
|
-
key: `${i18nKey}.fileMapperLogCallbacks.completedFolderFetch`,
|
|
33
|
-
logger: logger.success,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
19
|
+
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
|
|
36
20
|
|
|
37
21
|
exports.command = 'fetch <src> [dest]';
|
|
38
22
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -63,8 +47,7 @@ exports.handler = async options => {
|
|
|
63
47
|
src,
|
|
64
48
|
resolveLocalPath(dest),
|
|
65
49
|
mode,
|
|
66
|
-
options
|
|
67
|
-
fileMapperLogCallbacks
|
|
50
|
+
options
|
|
68
51
|
);
|
|
69
52
|
} catch (err) {
|
|
70
53
|
logErrorInstance(err);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
const { downloadFileOrFolder } = require('@hubspot/local-dev-lib/fileManager');
|
|
2
2
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
3
3
|
const { resolveLocalPath } = require('../../lib/filesystem');
|
|
4
|
-
const { buildLogCallbacks } = require('../../lib/logCallbacks');
|
|
5
|
-
|
|
6
4
|
const {
|
|
7
5
|
addConfigOptions,
|
|
8
6
|
addAccountOptions,
|
|
@@ -15,21 +13,7 @@ const { i18n } = require('../../lib/lang');
|
|
|
15
13
|
|
|
16
14
|
const i18nKey = 'cli.commands.filemanager.subcommands.fetch';
|
|
17
15
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
18
|
-
const { logErrorInstance } = require('
|
|
19
|
-
|
|
20
|
-
const downloadLogCallbacks = buildLogCallbacks({
|
|
21
|
-
skippedExisting: `${i18nKey}.downloadLogCallbacks.skippedExisting`,
|
|
22
|
-
fetchFolderStarted: `${i18nKey}.downloadLogCallbacks.fetchFolderStarted`,
|
|
23
|
-
fetchFolderSuccess: {
|
|
24
|
-
key: `${i18nKey}.downloadLogCallbacks.fetchFolderSuccess`,
|
|
25
|
-
logger: logger.success,
|
|
26
|
-
},
|
|
27
|
-
fetchFileStarted: `${i18nKey}.downloadLogCallbacks.fetchFileStarted`,
|
|
28
|
-
fetchFileSuccess: {
|
|
29
|
-
key: `${i18nKey}.downloadLogCallbacks.fetchFileSuccess`,
|
|
30
|
-
logger: logger.success,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
16
|
+
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
33
17
|
|
|
34
18
|
exports.command = 'fetch <src> [dest]';
|
|
35
19
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -57,8 +41,7 @@ exports.handler = async options => {
|
|
|
57
41
|
src,
|
|
58
42
|
dest,
|
|
59
43
|
false,
|
|
60
|
-
includeArchived || false
|
|
61
|
-
downloadLogCallbacks
|
|
44
|
+
includeArchived || false
|
|
62
45
|
);
|
|
63
46
|
} catch (err) {
|
|
64
47
|
logErrorInstance(err);
|
|
@@ -2,17 +2,19 @@ const fs = require('fs');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
4
|
const { uploadFolder } = require('@hubspot/local-dev-lib/fileManager');
|
|
5
|
-
const { uploadFile } = require('@hubspot/
|
|
5
|
+
const { uploadFile } = require('@hubspot/local-dev-lib/api/fileManager');
|
|
6
6
|
const { getCwd, convertToUnixPath } = require('@hubspot/local-dev-lib/path');
|
|
7
7
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
8
|
+
const {
|
|
9
|
+
validateSrcAndDestPaths,
|
|
10
|
+
} = require('@hubspot/local-dev-lib/cms/modules');
|
|
11
|
+
const { shouldIgnoreFile } = require('@hubspot/local-dev-lib/ignoreRules');
|
|
12
|
+
|
|
8
13
|
const {
|
|
9
14
|
ApiErrorContext,
|
|
10
15
|
logApiUploadErrorInstance,
|
|
11
16
|
} = require('../../lib/errorHandlers/apiErrors');
|
|
12
17
|
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
13
|
-
const { validateSrcAndDestPaths } = require('@hubspot/cli-lib/modules');
|
|
14
|
-
const { shouldIgnoreFile } = require('@hubspot/local-dev-lib/ignoreRules');
|
|
15
|
-
|
|
16
18
|
const {
|
|
17
19
|
addConfigOptions,
|
|
18
20
|
addAccountOptions,
|
|
@@ -25,11 +27,6 @@ const { i18n } = require('../../lib/lang');
|
|
|
25
27
|
|
|
26
28
|
const i18nKey = 'cli.commands.filemanager.subcommands.upload';
|
|
27
29
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
28
|
-
const { buildLogCallbacks } = require('../../lib/logCallbacks');
|
|
29
|
-
|
|
30
|
-
const uploadLogCallbacks = buildLogCallbacks({
|
|
31
|
-
uploadSuccess: `${i18nKey}.uploadLogCallbacks.uploadSuccess`,
|
|
32
|
-
});
|
|
33
30
|
|
|
34
31
|
exports.command = 'upload <src> <dest>';
|
|
35
32
|
exports.describe = i18n(`${i18nKey}.describe`);
|
|
@@ -126,7 +123,7 @@ exports.handler = async options => {
|
|
|
126
123
|
src,
|
|
127
124
|
})
|
|
128
125
|
);
|
|
129
|
-
uploadFolder(accountId, absoluteSrcPath, dest
|
|
126
|
+
uploadFolder(accountId, absoluteSrcPath, dest)
|
|
130
127
|
.then(() => {
|
|
131
128
|
logger.success(
|
|
132
129
|
i18n(`${i18nKey}.success.uploadComplete`, {
|
package/commands/list.js
CHANGED
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
} = require('../lib/errorHandlers/apiErrors');
|
|
16
16
|
const {
|
|
17
17
|
getDirectoryContentsByPath,
|
|
18
|
-
} = require('@hubspot/
|
|
18
|
+
} = require('@hubspot/local-dev-lib/api/fileMapper');
|
|
19
19
|
const {
|
|
20
20
|
HUBSPOT_FOLDER,
|
|
21
21
|
MARKETPLACE_FOLDER,
|
package/commands/logs.js
CHANGED
|
@@ -10,15 +10,16 @@ const { outputLogs } = require('@hubspot/cli-lib/lib/logs');
|
|
|
10
10
|
const {
|
|
11
11
|
getFunctionLogs,
|
|
12
12
|
getLatestFunctionLog,
|
|
13
|
-
} = require('@hubspot/
|
|
13
|
+
} = require('@hubspot/local-dev-lib/api/functions');
|
|
14
14
|
const { tailLogs } = require('../lib/serverlessLogs');
|
|
15
15
|
const { loadAndValidateOptions } = require('../lib/validation');
|
|
16
16
|
const { i18n } = require('../lib/lang');
|
|
17
|
+
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
17
18
|
|
|
18
19
|
const i18nKey = 'cli.commands.logs';
|
|
19
20
|
|
|
20
21
|
const handleLogsError = (e, accountId, functionPath) => {
|
|
21
|
-
if (e.
|
|
22
|
+
if (e.response.status === 404 || e.response.status == 400) {
|
|
22
23
|
logger.error(
|
|
23
24
|
i18n(`${i18nKey}.errors.noLogsFound`, {
|
|
24
25
|
accountId,
|
|
@@ -63,12 +64,14 @@ const endpointLog = async (accountId, options) => {
|
|
|
63
64
|
logsResp = await getLatestFunctionLog(accountId, functionPath);
|
|
64
65
|
} catch (e) {
|
|
65
66
|
handleLogsError(e, accountId, functionPath);
|
|
67
|
+
process.exit(EXIT_CODES.ERROR);
|
|
66
68
|
}
|
|
67
69
|
} else {
|
|
68
70
|
try {
|
|
69
71
|
logsResp = await getFunctionLogs(accountId, functionPath, options);
|
|
70
72
|
} catch (e) {
|
|
71
73
|
handleLogsError(e, accountId, functionPath);
|
|
74
|
+
process.exit(EXIT_CODES.ERROR);
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
|
package/commands/mv.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const { moveFile } = require('@hubspot/
|
|
1
|
+
const { moveFile } = require('@hubspot/local-dev-lib/api/fileMapper');
|
|
2
2
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
3
3
|
const {
|
|
4
4
|
logApiErrorInstance,
|
|
5
5
|
ApiErrorContext,
|
|
6
6
|
} = require('../lib/errorHandlers/apiErrors');
|
|
7
|
-
|
|
8
7
|
const {
|
|
9
8
|
addConfigOptions,
|
|
10
9
|
addAccountOptions,
|
package/commands/project/dev.js
CHANGED
|
@@ -61,9 +61,11 @@ const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
|
|
61
61
|
const {
|
|
62
62
|
logApiErrorInstance,
|
|
63
63
|
ApiErrorContext,
|
|
64
|
-
|
|
65
|
-
isSpecifiedError,
|
|
64
|
+
isSpecifiedError, // Migrate isSpecifiedError to local-dev-lib version only after uploadProject is migrated to local-dev-lib
|
|
66
65
|
} = require('../../lib/errorHandlers/apiErrors');
|
|
66
|
+
const {
|
|
67
|
+
isMissingScopeError,
|
|
68
|
+
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
67
69
|
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
68
70
|
|
|
69
71
|
const i18nKey = 'cli.commands.project.subcommands.dev';
|
|
@@ -24,16 +24,10 @@ const {
|
|
|
24
24
|
} = require('../../lib/prompts/downloadProjectPrompt');
|
|
25
25
|
const { i18n } = require('../../lib/lang');
|
|
26
26
|
const { uiBetaTag } = require('../../lib/ui');
|
|
27
|
-
const { buildLogCallbacks } = require('../../lib/logCallbacks');
|
|
28
27
|
|
|
29
28
|
const i18nKey = 'cli.commands.project.subcommands.download';
|
|
30
29
|
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
31
30
|
|
|
32
|
-
const archiveLogCallbacks = buildLogCallbacks({
|
|
33
|
-
init: `${i18nKey}.archiveLogCallbacks.init`,
|
|
34
|
-
copy: `${i18nKey}.archiveLogCallbacks.copy`,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
31
|
exports.command = 'download [--project]';
|
|
38
32
|
exports.describe = uiBetaTag(i18n(`${i18nKey}.describe`), false);
|
|
39
33
|
|
|
@@ -99,8 +93,7 @@ exports.handler = async options => {
|
|
|
99
93
|
zippedProject,
|
|
100
94
|
projectName,
|
|
101
95
|
path.resolve(absoluteDestPath),
|
|
102
|
-
{ includesRootDir: false }
|
|
103
|
-
archiveLogCallbacks
|
|
96
|
+
{ includesRootDir: false }
|
|
104
97
|
);
|
|
105
98
|
|
|
106
99
|
logger.log(
|
package/commands/project/logs.js
CHANGED
|
@@ -21,15 +21,14 @@ const {
|
|
|
21
21
|
// const {
|
|
22
22
|
// getProjectAppFunctionLogs,
|
|
23
23
|
// getLatestProjectAppFunctionLog,
|
|
24
|
+
// getFunctionLogs,
|
|
25
|
+
// getLatestFunctionLog,
|
|
24
26
|
// } = require('@hubspot/cli-lib/api/functions');
|
|
25
27
|
// const {
|
|
26
28
|
// logApiErrorInstance,
|
|
27
29
|
// ApiErrorContext,
|
|
28
30
|
// } = require('../../lib/errorHandlers/apiErrors');
|
|
29
|
-
|
|
30
|
-
// getFunctionLogs,
|
|
31
|
-
// getLatestFunctionLog,
|
|
32
|
-
// } = require('@hubspot/cli-lib/api/results');
|
|
31
|
+
|
|
33
32
|
const { ensureProjectExists } = require('../../lib/projects');
|
|
34
33
|
const { loadAndValidateOptions } = require('../../lib/validation');
|
|
35
34
|
const { uiBetaTag, uiLine, uiLink } = require('../../lib/ui');
|
package/commands/remove.js
CHANGED
|
@@ -33,7 +33,9 @@ const {
|
|
|
33
33
|
const { promptUser } = require('../../lib/prompts/promptUtils');
|
|
34
34
|
const { syncSandbox } = require('../../lib/sandbox-sync');
|
|
35
35
|
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
36
|
-
const {
|
|
36
|
+
const {
|
|
37
|
+
isMissingScopeError,
|
|
38
|
+
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
37
39
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
|
38
40
|
|
|
39
41
|
const i18nKey = 'cli.commands.sandbox.subcommands.create';
|
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
const {
|
|
16
16
|
isSpecifiedError,
|
|
17
17
|
isSpecifiedHubSpotAuthError,
|
|
18
|
-
} = require('
|
|
18
|
+
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
19
19
|
const { deleteSandbox } = require('@hubspot/local-dev-lib/sandboxes');
|
|
20
20
|
const { i18n } = require('../../lib/lang');
|
|
21
21
|
const { deleteSandboxPrompt } = require('../../lib/prompts/sandboxesPrompt');
|
package/commands/sandbox/sync.js
CHANGED
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
} = require('../../lib/sandboxes');
|
|
25
25
|
const { syncSandbox } = require('../../lib/sandbox-sync');
|
|
26
26
|
const { getValidEnv } = require('@hubspot/local-dev-lib/environment');
|
|
27
|
-
const { isSpecifiedError } = require('
|
|
27
|
+
const { isSpecifiedError } = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
28
28
|
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
|
|
29
29
|
|
|
30
30
|
const i18nKey = 'cli.commands.sandbox.subcommands.sync';
|
package/commands/upload.js
CHANGED
|
@@ -4,7 +4,7 @@ const { uploadFolder, hasUploadErrors } = require('@hubspot/cli-lib');
|
|
|
4
4
|
const {
|
|
5
5
|
getFileMapperQueryValues,
|
|
6
6
|
} = require('@hubspot/local-dev-lib/fileMapper');
|
|
7
|
-
const { upload, deleteFile } = require('@hubspot/
|
|
7
|
+
const { upload, deleteFile } = require('@hubspot/local-dev-lib/api/fileMapper');
|
|
8
8
|
const {
|
|
9
9
|
getCwd,
|
|
10
10
|
convertToUnixPath,
|
|
@@ -16,8 +16,14 @@ const {
|
|
|
16
16
|
logApiUploadErrorInstance,
|
|
17
17
|
} = require('../lib/errorHandlers/apiErrors');
|
|
18
18
|
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
|
|
19
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
validateSrcAndDestPaths,
|
|
21
|
+
} = require('@hubspot/local-dev-lib/cms/modules');
|
|
20
22
|
const { shouldIgnoreFile } = require('@hubspot/local-dev-lib/ignoreRules');
|
|
23
|
+
const {
|
|
24
|
+
getThemePreviewUrl,
|
|
25
|
+
getThemeJSONPath,
|
|
26
|
+
} = require('@hubspot/local-dev-lib/cms/themes');
|
|
21
27
|
|
|
22
28
|
const {
|
|
23
29
|
addConfigOptions,
|
|
@@ -32,10 +38,7 @@ const { cleanUploadPrompt } = require('../lib/prompts/cleanUploadPrompt');
|
|
|
32
38
|
const { validateMode, loadAndValidateOptions } = require('../lib/validation');
|
|
33
39
|
const { trackCommandUsage } = require('../lib/usageTracking');
|
|
34
40
|
const { getUploadableFileList } = require('../lib/upload');
|
|
35
|
-
|
|
36
|
-
getThemePreviewUrl,
|
|
37
|
-
getThemeJSONPath,
|
|
38
|
-
} = require('@hubspot/local-dev-lib/cms/themes');
|
|
41
|
+
|
|
39
42
|
const { i18n } = require('../lib/lang');
|
|
40
43
|
const i18nKey = 'cli.commands.upload';
|
|
41
44
|
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
package/lang/en.lyaml
CHANGED
|
@@ -274,12 +274,6 @@ en:
|
|
|
274
274
|
describe: "Local directory you would like the files to be placed in, relative to your current working directory"
|
|
275
275
|
src:
|
|
276
276
|
describe: "Path in HubSpot Design Tools"
|
|
277
|
-
fileMapperLogCallbacks:
|
|
278
|
-
skippedExisting: 'Skipped existing "{{ filepath }}"'
|
|
279
|
-
wroteFolder: 'Wrote folder "{{ filepath }}"'
|
|
280
|
-
completedFetch: 'Completed fetch of file "{{ src }}"{{ version }} to "{{ dest }}" from the Design Manager'
|
|
281
|
-
folderFetch: 'Fetched "{{ src }}" from account {{ accountId }} from the Design Manager successfully'
|
|
282
|
-
completedFolderFetch: 'Completed fetch of folder "{{ src }}"{{ version }} to "{{ dest }}" from the Design Manager'
|
|
283
277
|
filemanager:
|
|
284
278
|
describe: "Commands for working with the File Manager."
|
|
285
279
|
subcommands:
|
|
@@ -295,12 +289,6 @@ en:
|
|
|
295
289
|
describe: "Path in HubSpot Design Tools"
|
|
296
290
|
src:
|
|
297
291
|
describe: "Path to the local directory you would like the files to be placed, relative to your current working directory. If omitted, this argument will default to your current working directory"
|
|
298
|
-
downloadLogCallbacks:
|
|
299
|
-
skippedExisting: "Skipped existing {{ filepath }}"
|
|
300
|
-
fetchFolderStarted: 'Fetching folder from "{{ src }}" to "{{ dest }}" in the File Manager of account {{ accountId }}'
|
|
301
|
-
fetchFolderSuccess: "Completed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the File Manager"
|
|
302
|
-
fetchFileStarted: "Fetching file from \"{{ src }}\" to \"{{ dest }}\" in the File Manager of account {{ accountId }}"
|
|
303
|
-
fetchFileSuccess: "Completed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the File Manager"
|
|
304
292
|
upload:
|
|
305
293
|
describe: "Upload a folder or file from your computer to the HubSpot File Manager"
|
|
306
294
|
errors:
|
|
@@ -319,8 +307,6 @@ en:
|
|
|
319
307
|
success:
|
|
320
308
|
upload: "Uploaded file from \"{{ src }}\" to \"{{ dest }}\" in the File Manager of account {{ accountId }}"
|
|
321
309
|
uploadComplete: "Uploading files to \"{{ dest }}\" in the File Manager is complete"
|
|
322
|
-
uploadLogCallbacks:
|
|
323
|
-
uploadSuccess: 'Uploaded file "{{ file }}" to "{{ destPath }}"'
|
|
324
310
|
functions:
|
|
325
311
|
describe: "Commands for working with functions."
|
|
326
312
|
subcommands:
|
|
@@ -645,9 +631,6 @@ en:
|
|
|
645
631
|
describe: "The name of the project to download"
|
|
646
632
|
dest:
|
|
647
633
|
describe: "Destination folder for the project"
|
|
648
|
-
archiveLogCallbacks:
|
|
649
|
-
init: "Extracting project source..."
|
|
650
|
-
copy: "Copying project source..."
|
|
651
634
|
open:
|
|
652
635
|
describe: "Open the specified project's details page in the browser"
|
|
653
636
|
options:
|
|
@@ -1201,6 +1184,7 @@ en:
|
|
|
1201
1184
|
configFileUpdated: "{{ configFilename }} updated with {{ authMethod }} for account {{ account }}."
|
|
1202
1185
|
failure:
|
|
1203
1186
|
invalidUser: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because your account has been removed from {{#bold}}{{ parentAccountName }}{{/bold}} or your permission set doesn't allow you to create the sandbox. To update your permissions, contact a super admin in {{#bold}}{{ parentAccountName }}{{/bold}}."
|
|
1187
|
+
403Gating: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because {{#bold}}{{ parentAccountName }}{{/bold}} does not have access to development sandboxes. To opt in to the CRM Development Beta and use development sandboxes, visit https://app.hubspot.com/l/whats-new/betas?productUpdateId=13860216."
|
|
1204
1188
|
limit:
|
|
1205
1189
|
developer:
|
|
1206
1190
|
one: "{{#bold}}{{ accountName }}{{/bold}} reached the limit of {{ limit }} development sandbox.
|
package/lib/DevServerManager.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const httpClient = require('@hubspot/cli-lib/http');
|
|
2
1
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
3
2
|
const { COMPONENT_TYPES } = require('./projectStructure');
|
|
4
3
|
const { i18n } = require('./lang');
|
|
@@ -91,7 +90,6 @@ class DevServerManager {
|
|
|
91
90
|
await serverInterface.start({
|
|
92
91
|
accountId,
|
|
93
92
|
debug: this.debug,
|
|
94
|
-
httpClient,
|
|
95
93
|
projectConfig,
|
|
96
94
|
requestPorts,
|
|
97
95
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { getAccountConfig } = require('@hubspot/local-dev-lib/config');
|
|
2
|
-
const { getOauthManager } = require('@hubspot/
|
|
2
|
+
const { getOauthManager } = require('@hubspot/local-dev-lib/oauth');
|
|
3
3
|
const {
|
|
4
4
|
accessTokenForPersonalAccessKey,
|
|
5
5
|
} = require('@hubspot/local-dev-lib/personalAccessKey');
|
|
@@ -10,7 +10,7 @@ const { validateAccount } = require('../validation');
|
|
|
10
10
|
jest.mock('@hubspot/cli-lib');
|
|
11
11
|
jest.mock('@hubspot/local-dev-lib/config');
|
|
12
12
|
jest.mock('@hubspot/cli-lib/logger');
|
|
13
|
-
jest.mock('@hubspot/
|
|
13
|
+
jest.mock('@hubspot/local-dev-lib/oauth');
|
|
14
14
|
jest.mock('@hubspot/local-dev-lib/personalAccessKey');
|
|
15
15
|
jest.mock('../commonOpts');
|
|
16
16
|
|
package/lib/commonOpts.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
const Logger = require('@hubspot/cli-lib/logger');
|
|
2
|
+
const {
|
|
3
|
+
setLogLevel: setLocalDevLibLogLevel,
|
|
4
|
+
} = require('@hubspot/local-dev-lib/logger');
|
|
2
5
|
const { DEFAULT_MODE, Mode } = require('@hubspot/cli-lib');
|
|
3
6
|
const {
|
|
4
7
|
getAccountId: getAccountIdFromConfig,
|
|
@@ -66,8 +69,16 @@ const setLogLevel = (options = {}) => {
|
|
|
66
69
|
const { debug } = options;
|
|
67
70
|
if (debug) {
|
|
68
71
|
Logger.setLogLevel(LOG_LEVEL.DEBUG);
|
|
72
|
+
|
|
73
|
+
// Update the log level in local-dev-lib's instance of the logger
|
|
74
|
+
// This will evenutally replace cli-lib's version of it
|
|
75
|
+
setLocalDevLibLogLevel(LOG_LEVEL.DEBUG);
|
|
69
76
|
} else {
|
|
70
77
|
Logger.setLogLevel(LOG_LEVEL.LOG);
|
|
78
|
+
|
|
79
|
+
// Update the log level in local-dev-lib's instance of the logger
|
|
80
|
+
// This will evenutally replace cli-lib's version of it
|
|
81
|
+
setLocalDevLibLogLevel(LOG_LEVEL.LOG);
|
|
71
82
|
}
|
|
72
83
|
};
|
|
73
84
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
2
2
|
const { getAccountConfig } = require('@hubspot/local-dev-lib/config');
|
|
3
|
+
const {
|
|
4
|
+
getAxiosErrorWithContext,
|
|
5
|
+
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
3
6
|
const {
|
|
4
7
|
SCOPE_GROUPS,
|
|
5
8
|
PERSONAL_ACCESS_KEY_AUTH_METHOD,
|
|
@@ -251,6 +254,13 @@ function logApiStatusCodeError(error, context) {
|
|
|
251
254
|
* @param {ApiErrorContext} context
|
|
252
255
|
*/
|
|
253
256
|
function logApiErrorInstance(error, context) {
|
|
257
|
+
// Use the new local-dev-lib error handler
|
|
258
|
+
// NOTE: This will eventually replace the logic in logApiStatusCodeError
|
|
259
|
+
if (error.isAxiosError) {
|
|
260
|
+
const errorWithContext = getAxiosErrorWithContext(error, context);
|
|
261
|
+
logger.error(errorWithContext.message);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
254
264
|
// StatusCodeError
|
|
255
265
|
if (isApiStatusCodeError(error)) {
|
|
256
266
|
logApiStatusCodeError(error, context);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const util = require('util');
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
HubSpotAuthError,
|
|
4
|
+
} = require('@hubspot/local-dev-lib/models/HubSpotAuthError');
|
|
3
5
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
4
6
|
const { i18n } = require('../lang');
|
|
5
7
|
|
package/lib/oauth.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const open = require('open');
|
|
3
|
-
const
|
|
3
|
+
const {
|
|
4
|
+
default: OAuth2Manager,
|
|
5
|
+
} = require('@hubspot/local-dev-lib/models/OAuth2Manager');
|
|
4
6
|
const { getAccountConfig } = require('@hubspot/local-dev-lib/config');
|
|
5
|
-
const { addOauthToAccountConfig } = require('@hubspot/
|
|
7
|
+
const { addOauthToAccountConfig } = require('@hubspot/local-dev-lib/oauth');
|
|
6
8
|
const { handleExit } = require('./process');
|
|
7
9
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
|
8
10
|
const { logger } = require('@hubspot/cli-lib/logger');
|
|
@@ -13,11 +15,11 @@ const redirectUri = `http://localhost:${PORT}/oauth-callback`;
|
|
|
13
15
|
|
|
14
16
|
const buildAuthUrl = oauthManager => {
|
|
15
17
|
return (
|
|
16
|
-
`${getHubSpotWebsiteOrigin(oauthManager.env)}/oauth/${
|
|
17
|
-
oauthManager.accountId
|
|
18
|
+
`${getHubSpotWebsiteOrigin(oauthManager.account.env)}/oauth/${
|
|
19
|
+
oauthManager.account.accountId
|
|
18
20
|
}/authorize` +
|
|
19
|
-
`?client_id=${encodeURIComponent(oauthManager.clientId)}` + // app's client ID
|
|
20
|
-
`&scope=${encodeURIComponent(oauthManager.scopes.join(' '))}` + // scopes being requested by the app
|
|
21
|
+
`?client_id=${encodeURIComponent(oauthManager.account.clientId)}` + // app's client ID
|
|
22
|
+
`&scope=${encodeURIComponent(oauthManager.account.scopes.join(' '))}` + // scopes being requested by the app
|
|
21
23
|
`&redirect_uri=${encodeURIComponent(redirectUri)}` // where to send the user after the consent page
|
|
22
24
|
);
|
|
23
25
|
};
|
|
@@ -44,8 +46,8 @@ const authorize = async oauthManager => {
|
|
|
44
46
|
if (req.query.code) {
|
|
45
47
|
const authCodeProof = {
|
|
46
48
|
grant_type: 'authorization_code',
|
|
47
|
-
client_id: oauthManager.clientId,
|
|
48
|
-
client_secret: oauthManager.clientSecret,
|
|
49
|
+
client_id: oauthManager.account.clientId,
|
|
50
|
+
client_secret: oauthManager.account.clientSecret,
|
|
49
51
|
redirect_uri: redirectUri,
|
|
50
52
|
code: req.query.code,
|
|
51
53
|
};
|
|
@@ -84,13 +86,10 @@ const authorize = async oauthManager => {
|
|
|
84
86
|
const setupOauth = accountConfig => {
|
|
85
87
|
const accountId = parseInt(accountConfig.portalId, 10);
|
|
86
88
|
const config = getAccountConfig(accountId) || {};
|
|
87
|
-
return new OAuth2Manager(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
logger
|
|
93
|
-
);
|
|
89
|
+
return new OAuth2Manager({
|
|
90
|
+
...accountConfig,
|
|
91
|
+
environment: accountConfig.env || config.env || ENVIRONMENTS.PROD,
|
|
92
|
+
});
|
|
94
93
|
};
|
|
95
94
|
|
|
96
95
|
const authenticateWithOauth = async configData => {
|
package/lib/process.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const readline = require('readline');
|
|
2
2
|
const { logger, setLogLevel, LOG_LEVEL } = require('@hubspot/cli-lib/logger');
|
|
3
|
+
const {
|
|
4
|
+
setLogLevel: setLocalDevLibLogLevel,
|
|
5
|
+
} = require('@hubspot/local-dev-lib/logger');
|
|
3
6
|
const { i18n } = require('./lang');
|
|
4
7
|
|
|
5
8
|
const i18nKey = 'cli.lib.process';
|
|
@@ -28,6 +31,10 @@ const handleExit = callback => {
|
|
|
28
31
|
// Prevent logs when terminal closes
|
|
29
32
|
if (isSIGHUP) {
|
|
30
33
|
setLogLevel(LOG_LEVEL.NONE);
|
|
34
|
+
|
|
35
|
+
// Update the log level in local-dev-lib's instance of the logger
|
|
36
|
+
// This will evenutally replace cli-lib's version of it
|
|
37
|
+
setLocalDevLibLogLevel(LOG_LEVEL.LOG);
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
logger.debug(i18n(`${i18nKey}.exitDebug`, { signal }));
|
package/lib/projects.js
CHANGED
|
@@ -40,7 +40,7 @@ const SpinniesManager = require('./SpinniesManager');
|
|
|
40
40
|
const {
|
|
41
41
|
logApiErrorInstance,
|
|
42
42
|
ApiErrorContext,
|
|
43
|
-
isSpecifiedError,
|
|
43
|
+
isSpecifiedError, // Migrate isSpecifiedError to local-dev-lib version only after fetchProject is migrated to local-dev-lib
|
|
44
44
|
isSpecifiedHubSpotAuthError,
|
|
45
45
|
} = require('./errorHandlers/apiErrors');
|
|
46
46
|
const { HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH } = require('./constants');
|
package/lib/sandbox-create.js
CHANGED
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
const {
|
|
17
17
|
isMissingScopeError,
|
|
18
18
|
isSpecifiedError,
|
|
19
|
-
} = require('
|
|
19
|
+
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
20
20
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
|
21
21
|
const { getEnv, getAccountId } = require('@hubspot/local-dev-lib/config');
|
|
22
22
|
const { createSandbox } = require('@hubspot/local-dev-lib/sandboxes');
|
|
@@ -101,6 +101,22 @@ const buildSandbox = async ({
|
|
|
101
101
|
})
|
|
102
102
|
);
|
|
103
103
|
logger.log('');
|
|
104
|
+
} else if (
|
|
105
|
+
isSpecifiedError(err, {
|
|
106
|
+
statusCode: 403,
|
|
107
|
+
category: 'BANNED',
|
|
108
|
+
subCategory: 'SandboxErrors.DEVELOPMENT_SANDBOX_ACCESS_NOT_ALLOWED',
|
|
109
|
+
})
|
|
110
|
+
) {
|
|
111
|
+
logger.log('');
|
|
112
|
+
logger.error(
|
|
113
|
+
i18n(`${i18nKey}.failure.403Gating`, {
|
|
114
|
+
accountName: name,
|
|
115
|
+
parentAccountName: accountConfig.name || accountId,
|
|
116
|
+
accountId,
|
|
117
|
+
})
|
|
118
|
+
);
|
|
119
|
+
logger.log('');
|
|
104
120
|
} else if (
|
|
105
121
|
isSpecifiedError(err, {
|
|
106
122
|
statusCode: 400,
|
package/lib/sandbox-sync.js
CHANGED
|
@@ -18,7 +18,7 @@ const {
|
|
|
18
18
|
const {
|
|
19
19
|
isSpecifiedError,
|
|
20
20
|
isMissingScopeError,
|
|
21
|
-
} = require('
|
|
21
|
+
} = require('@hubspot/local-dev-lib/errors/apiErrors');
|
|
22
22
|
const { getSandboxTypeAsString } = require('./sandboxes');
|
|
23
23
|
const { getAccountId } = require('@hubspot/local-dev-lib/config');
|
|
24
24
|
const { uiAccountDescription } = require('./ui');
|
package/lib/sandboxes.js
CHANGED
|
@@ -237,7 +237,7 @@ const validateSandboxUsageLimits = async (accountConfig, sandboxType, env) => {
|
|
|
237
237
|
*/
|
|
238
238
|
const saveSandboxToConfig = async (env, result, force = false) => {
|
|
239
239
|
let personalAccessKey = result.personalAccessKey;
|
|
240
|
-
if (personalAccessKey) {
|
|
240
|
+
if (!personalAccessKey) {
|
|
241
241
|
const configData = await personalAccessKeyPrompt({
|
|
242
242
|
env,
|
|
243
243
|
account: result.sandbox.sandboxHubId,
|
package/lib/validation.js
CHANGED
|
@@ -14,7 +14,7 @@ const {
|
|
|
14
14
|
loadConfigFromEnvironment,
|
|
15
15
|
} = require('@hubspot/local-dev-lib/config');
|
|
16
16
|
const { getAbsoluteFilePath } = require('@hubspot/local-dev-lib/path');
|
|
17
|
-
const { getOauthManager } = require('@hubspot/
|
|
17
|
+
const { getOauthManager } = require('@hubspot/local-dev-lib/oauth');
|
|
18
18
|
const {
|
|
19
19
|
accessTokenForPersonalAccessKey,
|
|
20
20
|
} = require('@hubspot/local-dev-lib/personalAccessKey');
|
|
@@ -118,7 +118,7 @@ async function validateAccount(options) {
|
|
|
118
118
|
logger.error(
|
|
119
119
|
`The OAuth2 configuration for account ${accountId} is incorrect`
|
|
120
120
|
);
|
|
121
|
-
logger.error('Run "
|
|
121
|
+
logger.error('Run "hs auth --type=oauth2" to reauthenticate');
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "5.1.3-beta.
|
|
3
|
+
"version": "5.1.3-beta.1",
|
|
4
4
|
"description": "CLI for working with HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"url": "https://github.com/HubSpot/hubspot-cms-tools"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@hubspot/cli-lib": "^
|
|
12
|
-
"@hubspot/local-dev-lib": "^0.
|
|
13
|
-
"@hubspot/serverless-dev-runtime": "5.1.3-beta.
|
|
14
|
-
"@hubspot/ui-extensions-dev-server": "0.8.
|
|
11
|
+
"@hubspot/cli-lib": "^9.0.0",
|
|
12
|
+
"@hubspot/local-dev-lib": "^0.3.0",
|
|
13
|
+
"@hubspot/serverless-dev-runtime": "5.1.3-beta.1",
|
|
14
|
+
"@hubspot/ui-extensions-dev-server": "0.8.9",
|
|
15
15
|
"archiver": "^5.3.0",
|
|
16
16
|
"chalk": "^4.1.2",
|
|
17
17
|
"chokidar": "^3.0.1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "4b53ba30127c3d8c12e5ccd6d4dc3833cc87e7b1"
|
|
49
49
|
}
|
package/lib/logCallbacks.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const { logger } = require('@hubspot/cli-lib/logger');
|
|
2
|
-
const { i18n } = require('./lang');
|
|
3
|
-
|
|
4
|
-
function buildLogCallbacks(logData) {
|
|
5
|
-
const callbacksObject = {};
|
|
6
|
-
for (let key in logData) {
|
|
7
|
-
if (typeof logData[key] === 'string') {
|
|
8
|
-
callbacksObject[key] = interpolationData =>
|
|
9
|
-
logger.log(i18n(logData[key], interpolationData));
|
|
10
|
-
} else {
|
|
11
|
-
callbacksObject[key] = interpolationData =>
|
|
12
|
-
logData[key].logger(i18n(logData[key].key, interpolationData));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return callbacksObject;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
module.exports = {
|
|
19
|
-
buildLogCallbacks,
|
|
20
|
-
};
|