@hubspot/cli 6.2.2-experimental.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +12 -0
- package/README.md +71 -0
- package/commands/accounts/clean.d.ts +1 -4
- package/commands/accounts/clean.js +2 -0
- package/commands/accounts/info.d.ts +1 -4
- package/commands/accounts/info.js +3 -1
- package/commands/accounts/list.d.ts +1 -4
- package/commands/accounts/list.js +2 -0
- package/commands/accounts/remove.d.ts +1 -4
- package/commands/accounts/remove.js +2 -0
- package/commands/accounts/rename.d.ts +1 -4
- package/commands/accounts/rename.js +2 -0
- package/commands/accounts/use.d.ts +1 -4
- package/commands/accounts/use.js +2 -0
- package/commands/accounts.d.ts +1 -3
- package/commands/accounts.js +2 -0
- package/commands/auth.d.ts +1 -4
- package/commands/auth.js +2 -2
- package/commands/cms/convertFields.d.ts +1 -4
- package/commands/cms/convertFields.js +2 -0
- package/commands/cms/lighthouseScore.d.ts +1 -4
- package/commands/cms/lighthouseScore.js +2 -0
- package/commands/cms/reactModules.d.ts +1 -4
- package/commands/cms/reactModules.js +2 -0
- package/commands/cms.d.ts +1 -3
- package/commands/cms.js +2 -0
- package/commands/config/set.d.ts +1 -4
- package/commands/config/set.js +3 -3
- package/commands/config.d.ts +1 -3
- package/commands/config.js +2 -0
- package/commands/create/api-sample.d.ts +1 -13
- package/commands/create/api-sample.js +4 -2
- package/commands/create/app.d.ts +1 -10
- package/commands/create/app.js +2 -0
- package/commands/create/function.d.ts +1 -6
- package/commands/create/function.js +2 -0
- package/commands/create/index.d.ts +1 -109
- package/commands/create/index.js +2 -0
- package/commands/create/module.d.ts +1 -11
- package/commands/create/module.js +2 -0
- package/commands/create/react-app.d.ts +1 -9
- package/commands/create/react-app.js +2 -0
- package/commands/create/template.d.ts +1 -12
- package/commands/create/template.js +2 -0
- package/commands/create/vue-app.d.ts +1 -9
- package/commands/create/vue-app.js +2 -0
- package/commands/create/webpack-serverless.d.ts +1 -9
- package/commands/create/webpack-serverless.js +2 -0
- package/commands/create/website-theme.d.ts +1 -9
- package/commands/create/website-theme.js +2 -0
- package/commands/create.d.ts +24 -4
- package/commands/create.js +4 -3
- package/commands/customObject/create.d.ts +1 -4
- package/commands/customObject/create.js +2 -0
- package/commands/customObject/schema/create.d.ts +1 -4
- package/commands/customObject/schema/create.js +2 -0
- package/commands/customObject/schema/delete.d.ts +1 -4
- package/commands/customObject/schema/delete.js +3 -1
- package/commands/customObject/schema/fetch-all.d.ts +1 -4
- package/commands/customObject/schema/fetch-all.js +2 -0
- package/commands/customObject/schema/fetch.d.ts +1 -4
- package/commands/customObject/schema/fetch.js +3 -1
- package/commands/customObject/schema/list.d.ts +1 -3
- package/commands/customObject/schema/list.js +2 -0
- package/commands/customObject/schema/update.d.ts +1 -4
- package/commands/customObject/schema/update.js +2 -0
- package/commands/customObject/schema.d.ts +1 -3
- package/commands/customObject/schema.js +2 -0
- package/commands/customObject.d.ts +1 -3
- package/commands/customObject.js +2 -0
- package/commands/feedback.d.ts +1 -4
- package/commands/feedback.js +21 -4
- package/commands/fetch.d.ts +1 -4
- package/commands/fetch.js +2 -0
- package/commands/filemanager/fetch.d.ts +1 -4
- package/commands/filemanager/fetch.js +4 -2
- package/commands/filemanager/upload.d.ts +1 -4
- package/commands/filemanager/upload.js +2 -0
- package/commands/filemanager.d.ts +1 -3
- package/commands/filemanager.js +2 -0
- package/commands/functions/deploy.d.ts +1 -4
- package/commands/functions/deploy.js +2 -0
- package/commands/functions/list.d.ts +1 -4
- package/commands/functions/list.js +13 -2
- package/commands/functions/server.d.ts +1 -4
- package/commands/functions/server.js +2 -0
- package/commands/functions.d.ts +1 -3
- package/commands/functions.js +2 -0
- package/commands/hubdb/clear.d.ts +1 -4
- package/commands/hubdb/clear.js +2 -0
- package/commands/hubdb/create.d.ts +1 -4
- package/commands/hubdb/create.js +2 -0
- package/commands/hubdb/delete.d.ts +1 -4
- package/commands/hubdb/delete.js +2 -0
- package/commands/hubdb/fetch.d.ts +1 -4
- package/commands/hubdb/fetch.js +2 -0
- package/commands/hubdb.d.ts +1 -3
- package/commands/hubdb.js +2 -0
- package/commands/init.d.ts +1 -4
- package/commands/init.js +2 -2
- package/commands/lint.d.ts +1 -4
- package/commands/lint.js +30 -1
- package/commands/list.d.ts +1 -4
- package/commands/list.js +2 -0
- package/commands/logs.d.ts +1 -4
- package/commands/logs.js +2 -0
- package/commands/module/marketplace-validate.d.ts +1 -4
- package/commands/module/marketplace-validate.js +3 -1
- package/commands/module.d.ts +1 -3
- package/commands/module.js +2 -0
- package/commands/mv.d.ts +1 -4
- package/commands/mv.js +2 -0
- package/commands/open.d.ts +1 -4
- package/commands/open.js +2 -0
- package/commands/project/add.d.ts +1 -4
- package/commands/project/add.js +2 -0
- package/commands/project/cloneApp.d.ts +1 -4
- package/commands/project/cloneApp.js +2 -0
- package/commands/project/create.d.ts +1 -4
- package/commands/project/create.js +2 -0
- package/commands/project/deploy.d.ts +1 -4
- package/commands/project/deploy.js +12 -3
- package/commands/project/dev.d.ts +1 -4
- package/commands/project/dev.js +3 -0
- package/commands/project/download.d.ts +1 -4
- package/commands/project/download.js +4 -2
- package/commands/project/installDeps.d.ts +1 -6
- package/commands/project/installDeps.js +2 -0
- package/commands/project/listBuilds.d.ts +1 -4
- package/commands/project/listBuilds.js +2 -0
- package/commands/project/logs.d.ts +1 -4
- package/commands/project/logs.js +3 -1
- package/commands/project/migrateApp.d.ts +1 -4
- package/commands/project/migrateApp.js +2 -0
- package/commands/project/open.d.ts +1 -4
- package/commands/project/open.js +2 -0
- package/commands/project/upload.d.ts +1 -4
- package/commands/project/upload.js +2 -0
- package/commands/project/watch.d.ts +1 -4
- package/commands/project/watch.js +2 -0
- package/commands/project.d.ts +1 -3
- package/commands/project.js +2 -0
- package/commands/remove.d.ts +1 -4
- package/commands/remove.js +2 -0
- package/commands/sandbox/create.d.ts +1 -4
- package/commands/sandbox/create.js +2 -0
- package/commands/sandbox/delete.d.ts +1 -4
- package/commands/sandbox/delete.js +7 -3
- package/commands/sandbox.d.ts +1 -3
- package/commands/sandbox.js +2 -0
- package/commands/secrets/addSecret.d.ts +1 -4
- package/commands/secrets/addSecret.js +2 -0
- package/commands/secrets/deleteSecret.d.ts +1 -4
- package/commands/secrets/deleteSecret.js +2 -0
- package/commands/secrets/listSecrets.d.ts +1 -4
- package/commands/secrets/listSecrets.js +2 -0
- package/commands/secrets/updateSecret.d.ts +1 -4
- package/commands/secrets/updateSecret.js +2 -0
- package/commands/secrets.d.ts +1 -3
- package/commands/secrets.js +2 -0
- package/commands/theme/generate-selectors.d.ts +1 -4
- package/commands/theme/generate-selectors.js +3 -1
- package/commands/theme/marketplace-validate.d.ts +1 -4
- package/commands/theme/marketplace-validate.js +3 -1
- package/commands/theme/preview.d.ts +1 -4
- package/commands/theme/preview.js +56 -46
- package/commands/theme.d.ts +1 -3
- package/commands/theme.js +2 -0
- package/commands/upload.d.ts +1 -4
- package/commands/upload.js +2 -0
- package/commands/watch.d.ts +1 -4
- package/commands/watch.js +2 -0
- package/lang/en.lyaml +8 -13
- package/lib/DevServerManager.d.ts +1 -35
- package/lib/DevServerManager.js +2 -0
- package/lib/LocalDevManager.d.ts +1 -41
- package/lib/LocalDevManager.js +5 -3
- package/lib/ProjectLogsManager.d.ts +1 -0
- package/lib/{projectLogsManager.js → ProjectLogsManager.js} +2 -0
- package/lib/accountTypes.d.ts +7 -6
- package/lib/accountTypes.js +31 -17
- package/lib/buildAccount.d.ts +1 -22
- package/lib/buildAccount.js +2 -0
- package/lib/commonOpts.d.ts +23 -17
- package/lib/commonOpts.js +73 -54
- package/lib/configOptions.d.ts +1 -0
- package/lib/configOptions.js +110 -0
- package/lib/constants.d.ts +76 -83
- package/lib/constants.js +21 -46
- package/lib/dependencyManagement.d.ts +1 -7
- package/lib/dependencyManagement.js +2 -0
- package/lib/developerTestAccounts.d.ts +1 -7
- package/lib/developerTestAccounts.js +2 -0
- package/lib/enums/exitCodes.d.ts +5 -5
- package/lib/enums/exitCodes.js +3 -2
- package/lib/errorHandlers/index.d.ts +1 -19
- package/lib/errorHandlers/index.js +2 -0
- package/lib/errorHandlers/suppressError.d.ts +1 -1
- package/lib/errorHandlers/suppressError.js +2 -0
- package/lib/filesystem.d.ts +2 -2
- package/lib/filesystem.js +12 -10
- package/lib/generateSelectors.d.ts +1 -0
- package/lib/{generate-selectors.js → generateSelectors.js} +3 -1
- package/lib/hasFeature.d.ts +1 -1
- package/lib/hasFeature.js +7 -8
- package/lib/hasFlag.d.ts +1 -2
- package/lib/hasFlag.js +7 -3
- package/lib/interpolation.d.ts +5 -10
- package/lib/interpolation.js +39 -45
- package/lib/lang.d.ts +9 -3
- package/lib/lang.js +38 -31
- package/lib/links.d.ts +1 -127
- package/lib/links.js +2 -0
- package/lib/localDev.d.ts +1 -11
- package/lib/localDev.js +2 -0
- package/lib/marketplaceValidate.d.ts +1 -0
- package/lib/{marketplace-validate.js → marketplaceValidate.js} +2 -0
- package/lib/oauth.d.ts +1 -1
- package/lib/oauth.js +3 -1
- package/lib/polling.d.ts +1 -1
- package/lib/polling.js +2 -0
- package/lib/process.d.ts +12 -2
- package/lib/process.js +17 -15
- package/lib/projectStructure.d.ts +1 -13
- package/lib/projectStructure.js +4 -2
- package/lib/projects.d.ts +1 -40
- package/lib/projects.js +10 -5
- package/lib/projectsWatch.d.ts +1 -1
- package/lib/projectsWatch.js +8 -3
- package/lib/prompts/accountNamePrompt.d.ts +1 -11
- package/lib/prompts/accountNamePrompt.js +3 -2
- package/lib/prompts/accountsPrompt.d.ts +1 -3
- package/lib/prompts/accountsPrompt.js +2 -17
- package/lib/prompts/cleanUploadPrompt.d.ts +1 -1
- package/lib/prompts/cleanUploadPrompt.js +2 -0
- package/lib/prompts/cmsFieldPrompt.d.ts +1 -1
- package/lib/prompts/cmsFieldPrompt.js +2 -0
- package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
- package/lib/prompts/createApiSamplePrompt.js +2 -0
- package/lib/prompts/createFunctionPrompt.d.ts +1 -1
- package/lib/prompts/createFunctionPrompt.js +5 -4
- package/lib/prompts/createModulePrompt.d.ts +1 -1
- package/lib/prompts/createModulePrompt.js +2 -0
- package/lib/prompts/createProjectPrompt.d.ts +1 -1
- package/lib/prompts/createProjectPrompt.js +10 -5
- package/lib/prompts/createTemplatePrompt.d.ts +1 -1
- package/lib/prompts/createTemplatePrompt.js +2 -0
- package/lib/prompts/downloadProjectPrompt.d.ts +1 -1
- package/lib/prompts/downloadProjectPrompt.js +3 -1
- package/lib/prompts/installPublicAppPrompt.d.ts +1 -1
- package/lib/prompts/installPublicAppPrompt.js +2 -0
- package/lib/prompts/personalAccessKeyPrompt.d.ts +1 -69
- package/lib/prompts/personalAccessKeyPrompt.js +2 -0
- package/lib/prompts/previewPrompt.d.ts +1 -2
- package/lib/prompts/previewPrompt.js +2 -0
- package/lib/prompts/projectAddPrompt.d.ts +1 -1
- package/lib/prompts/projectAddPrompt.js +2 -0
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -4
- package/lib/prompts/projectDevTargetAccountPrompt.js +2 -0
- package/lib/prompts/projectNamePrompt.d.ts +1 -1
- package/lib/prompts/projectNamePrompt.js +2 -0
- package/lib/prompts/projectsLogsPrompt.d.ts +1 -5
- package/lib/prompts/projectsLogsPrompt.js +2 -0
- package/lib/prompts/promptUtils.d.ts +12 -2
- package/lib/prompts/promptUtils.js +25 -12
- package/lib/prompts/sandboxesPrompt.d.ts +1 -2
- package/lib/prompts/sandboxesPrompt.js +2 -0
- package/lib/prompts/secretPrompt.d.ts +1 -1
- package/lib/prompts/secretPrompt.js +2 -0
- package/lib/prompts/selectPublicAppPrompt.d.ts +1 -5
- package/lib/prompts/selectPublicAppPrompt.js +3 -1
- package/lib/prompts/setAsDefaultAccountPrompt.d.ts +1 -1
- package/lib/prompts/setAsDefaultAccountPrompt.js +2 -0
- package/lib/prompts/uploadPrompt.d.ts +1 -1
- package/lib/prompts/uploadPrompt.js +2 -0
- package/lib/sandboxSync.d.ts +1 -8
- package/lib/sandboxSync.js +3 -1
- package/lib/sandboxes.d.ts +1 -40
- package/lib/sandboxes.js +2 -0
- package/lib/schema.d.ts +3 -2
- package/lib/schema.js +20 -18
- package/lib/serverlessLogs.d.ts +1 -8
- package/lib/serverlessLogs.js +3 -1
- package/lib/ui/SpinniesManager.d.ts +1 -61
- package/lib/ui/SpinniesManager.js +2 -0
- package/lib/ui/git.d.ts +1 -1
- package/lib/ui/git.js +2 -0
- package/lib/ui/index.d.ts +1 -36
- package/lib/ui/index.js +2 -0
- package/lib/ui/serverlessFunctionLogs.d.ts +1 -1
- package/lib/ui/serverlessFunctionLogs.js +2 -0
- package/lib/ui/spinniesUtils.d.ts +1 -60
- package/lib/ui/spinniesUtils.js +2 -0
- package/lib/ui/supportHyperlinks.d.ts +1 -3
- package/lib/ui/supportHyperlinks.js +3 -1
- package/lib/ui/supportsColor.d.ts +1 -13
- package/lib/ui/supportsColor.js +3 -1
- package/lib/ui/table.d.ts +1 -2
- package/lib/ui/table.js +2 -0
- package/lib/upload.d.ts +1 -1
- package/lib/upload.js +4 -2
- package/lib/usageTracking.d.ts +1 -6
- package/lib/usageTracking.js +12 -1
- package/lib/validation.d.ts +1 -16
- package/lib/validation.js +2 -2
- package/package.json +17 -9
- package/commands/config/set/allowUsageTracking.d.ts +0 -4
- package/commands/config/set/allowUsageTracking.js +0 -45
- package/commands/config/set/defaultMode.d.ts +0 -4
- package/commands/config/set/defaultMode.js +0 -48
- package/commands/config/set/httpTimeout.d.ts +0 -4
- package/commands/config/set/httpTimeout.js +0 -33
- package/lib/debugInfo.d.ts +0 -3
- package/lib/debugInfo.js +0 -18
- package/lib/environment.d.ts +0 -1
- package/lib/environment.js +0 -14
- package/lib/generate-selectors.d.ts +0 -6
- package/lib/getFunctionArrays.d.ts +0 -1
- package/lib/getFunctionArrays.js +0 -17
- package/lib/hublValidate.d.ts +0 -4
- package/lib/hublValidate.js +0 -28
- package/lib/interpolationHelpers.d.ts +0 -6
- package/lib/interpolationHelpers.js +0 -26
- package/lib/marketplace-validate.d.ts +0 -5
- package/lib/projectLogsManager.d.ts +0 -19
- package/lib/prompts/activeInstallConfirmationPrompt.d.ts +0 -1
- package/lib/prompts/activeInstallConfirmationPrompt.js +0 -18
- package/lib/prompts/deployBuildIdPrompt.d.ts +0 -1
- package/lib/prompts/deployBuildIdPrompt.js +0 -20
- package/lib/prompts/feedbackPrompt.d.ts +0 -2
- package/lib/prompts/feedbackPrompt.js +0 -37
- package/lib/prompts/folderOverwritePrompt.d.ts +0 -1
- package/lib/prompts/folderOverwritePrompt.js +0 -15
- package/lib/regex.d.ts +0 -1
- package/lib/regex.js +0 -5
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "
|
|
8
|
+
"@hubspot/local-dev-lib": "2.1.1",
|
|
9
9
|
"@hubspot/serverless-dev-runtime": "7.0.0",
|
|
10
|
-
"@hubspot/theme-preview-dev-server": "0.0.
|
|
10
|
+
"@hubspot/theme-preview-dev-server": "0.0.9",
|
|
11
11
|
"@hubspot/ui-extensions-dev-server": "0.8.33",
|
|
12
|
+
"@types/fs-extra": "^11.0.4",
|
|
13
|
+
"@types/js-yaml": "^4.0.9",
|
|
12
14
|
"archiver": "^7.0.1",
|
|
13
15
|
"chalk": "^4.1.2",
|
|
14
16
|
"chokidar": "^3.0.1",
|
|
@@ -30,33 +32,39 @@
|
|
|
30
32
|
"yargs": "17.7.2"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
35
|
+
"@types/semver": "^7.5.8",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.11.0",
|
|
37
|
+
"@typescript-eslint/parser": "^8.11.0",
|
|
33
38
|
"axios": "^1.7.2",
|
|
34
39
|
"eslint": "^8.56.0",
|
|
40
|
+
"eslint-plugin-import": "^2.31.0",
|
|
35
41
|
"husky": "^4.3.8",
|
|
36
42
|
"lint-staged": "^10.5.4",
|
|
37
43
|
"madge": "^8.0.0",
|
|
38
44
|
"mock-stdin": "^1.0.0",
|
|
39
45
|
"prettier": "^1.19.1",
|
|
40
46
|
"semver": "^7.6.3",
|
|
47
|
+
"ts-jest": "^29.2.5",
|
|
48
|
+
"ts-node": "^10.9.2",
|
|
41
49
|
"typescript": "^5.6.2"
|
|
42
50
|
},
|
|
43
51
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"copy-files": "cp -r lang dist/lang && cp bin/hs dist/bin/hs && cp bin/hscms dist/bin/hscms",
|
|
52
|
+
"build": "ts-node ./scripts/build.ts",
|
|
46
53
|
"lint": "eslint . && prettier --list-different ./**/*.{js,json}",
|
|
47
54
|
"prettier:write": "prettier --write ./**/*.{js,json}",
|
|
48
55
|
"test": "jest",
|
|
49
56
|
"test-cli": "yarn --cwd 'acceptance-tests' test-ci",
|
|
50
57
|
"test-cli-debug": "yarn --cwd 'acceptance-tests' test-debug",
|
|
51
58
|
"test-cli-qa": "yarn --cwd 'acceptance-tests' test-qa",
|
|
52
|
-
"test-cli-latest": "yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn test-
|
|
59
|
+
"test-cli-latest": "yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn --cwd 'acceptance-tests' test-latest",
|
|
53
60
|
"build-docker": "docker image build --tag hs-cli-image . && docker image prune -f",
|
|
54
61
|
"circular-deps": "yarn madge --circular .",
|
|
55
|
-
"release": "
|
|
56
|
-
"hs": "yarn build && node ./dist/bin/hs"
|
|
62
|
+
"release": "yarn ts-node ./scripts/release.ts release",
|
|
63
|
+
"hs": "yarn build && node ./dist/bin/hs",
|
|
64
|
+
"update-ldl": "yarn add --exact @hubspot/local-dev-lib@latest"
|
|
57
65
|
},
|
|
58
66
|
"lint-staged": {
|
|
59
|
-
"**/*.{js,scss,css}": [
|
|
67
|
+
"**/*.{js,ts,scss,css}": [
|
|
60
68
|
"prettier -l",
|
|
61
69
|
"eslint"
|
|
62
70
|
]
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
3
|
-
const { updateAllowUsageTracking } = require('@hubspot/local-dev-lib/config');
|
|
4
|
-
const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
5
|
-
const { promptUser } = require('../../../lib/prompts/promptUtils');
|
|
6
|
-
const { i18n } = require('../../../lib/lang');
|
|
7
|
-
const i18nKey = 'commands.config.subcommands.set.options.allowUsageTracking';
|
|
8
|
-
const enableOrDisableUsageTracking = async () => {
|
|
9
|
-
const { isEnabled } = await promptUser([
|
|
10
|
-
{
|
|
11
|
-
type: 'list',
|
|
12
|
-
look: false,
|
|
13
|
-
name: 'isEnabled',
|
|
14
|
-
pageSize: 20,
|
|
15
|
-
message: i18n(`${i18nKey}.promptMessage`),
|
|
16
|
-
choices: [
|
|
17
|
-
{
|
|
18
|
-
name: i18n(`${i18nKey}.labels.enabled`),
|
|
19
|
-
value: true,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: i18n(`${i18nKey}.labels.disabled`),
|
|
23
|
-
value: false,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
default: true,
|
|
27
|
-
},
|
|
28
|
-
]);
|
|
29
|
-
return isEnabled;
|
|
30
|
-
};
|
|
31
|
-
const setAllowUsageTracking = async ({ accountId, allowUsageTracking }) => {
|
|
32
|
-
trackCommandUsage('config-set-allow-usage-tracking', null, accountId);
|
|
33
|
-
let isEnabled;
|
|
34
|
-
if (typeof allowUsageTracking === 'boolean') {
|
|
35
|
-
isEnabled = allowUsageTracking;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
isEnabled = await enableOrDisableUsageTracking();
|
|
39
|
-
}
|
|
40
|
-
updateAllowUsageTracking(isEnabled);
|
|
41
|
-
return logger.log(i18n(`${i18nKey}.success`, { isEnabled }));
|
|
42
|
-
};
|
|
43
|
-
module.exports = {
|
|
44
|
-
setAllowUsageTracking,
|
|
45
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
3
|
-
const { updateDefaultMode } = require('@hubspot/local-dev-lib/config');
|
|
4
|
-
const { MODE } = require('@hubspot/local-dev-lib/constants/files');
|
|
5
|
-
const { commaSeparatedValues } = require('@hubspot/local-dev-lib/text');
|
|
6
|
-
const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
7
|
-
const { promptUser } = require('../../../lib/prompts/promptUtils');
|
|
8
|
-
const { i18n } = require('../../../lib/lang');
|
|
9
|
-
const i18nKey = 'commands.config.subcommands.set.options.defaultMode';
|
|
10
|
-
const ALL_MODES = Object.values(MODE);
|
|
11
|
-
const selectMode = async () => {
|
|
12
|
-
const { mode } = await promptUser([
|
|
13
|
-
{
|
|
14
|
-
type: 'list',
|
|
15
|
-
look: false,
|
|
16
|
-
name: 'mode',
|
|
17
|
-
pageSize: 20,
|
|
18
|
-
message: i18n(`${i18nKey}.promptMessage`),
|
|
19
|
-
choices: ALL_MODES,
|
|
20
|
-
default: MODE.publish,
|
|
21
|
-
},
|
|
22
|
-
]);
|
|
23
|
-
return mode;
|
|
24
|
-
};
|
|
25
|
-
const setDefaultMode = async ({ accountId, defaultMode }) => {
|
|
26
|
-
trackCommandUsage('config-set-default-mode', null, accountId);
|
|
27
|
-
let newDefault;
|
|
28
|
-
if (!defaultMode) {
|
|
29
|
-
newDefault = await selectMode();
|
|
30
|
-
}
|
|
31
|
-
else if (defaultMode && ALL_MODES.find(m => m === defaultMode)) {
|
|
32
|
-
newDefault = defaultMode;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
logger.error(i18n(`${i18nKey}.errors`, {
|
|
36
|
-
mode: newDefault,
|
|
37
|
-
validModes: commaSeparatedValues(ALL_MODES),
|
|
38
|
-
}));
|
|
39
|
-
newDefault = await selectMode();
|
|
40
|
-
}
|
|
41
|
-
updateDefaultMode(newDefault);
|
|
42
|
-
return logger.success(i18n(`${i18nKey}.success`, {
|
|
43
|
-
mode: newDefault,
|
|
44
|
-
}));
|
|
45
|
-
};
|
|
46
|
-
module.exports = {
|
|
47
|
-
setDefaultMode,
|
|
48
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
3
|
-
const { updateHttpTimeout } = require('@hubspot/local-dev-lib/config');
|
|
4
|
-
const { promptUser } = require('../../../lib/prompts/promptUtils');
|
|
5
|
-
const { trackCommandUsage } = require('../../../lib/usageTracking');
|
|
6
|
-
const { i18n } = require('../../../lib/lang');
|
|
7
|
-
const i18nKey = 'commands.config.subcommands.set.options.httpTimeout';
|
|
8
|
-
const enterTimeout = async () => {
|
|
9
|
-
const { timeout } = await promptUser([
|
|
10
|
-
{
|
|
11
|
-
name: 'timeout',
|
|
12
|
-
message: i18n(`${i18nKey}.promptMessage`),
|
|
13
|
-
type: 'input',
|
|
14
|
-
default: 30000,
|
|
15
|
-
},
|
|
16
|
-
]);
|
|
17
|
-
return timeout;
|
|
18
|
-
};
|
|
19
|
-
const setHttpTimeout = async ({ accountId, httpTimeout }) => {
|
|
20
|
-
trackCommandUsage('config-set-http-timeout', null, accountId);
|
|
21
|
-
let newHttpTimeout;
|
|
22
|
-
if (!httpTimeout) {
|
|
23
|
-
newHttpTimeout = await enterTimeout();
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
newHttpTimeout = httpTimeout;
|
|
27
|
-
}
|
|
28
|
-
updateHttpTimeout(newHttpTimeout);
|
|
29
|
-
return logger.success(i18n(`${i18nKey}.success`, { timeout: newHttpTimeout }));
|
|
30
|
-
};
|
|
31
|
-
module.exports = {
|
|
32
|
-
setHttpTimeout,
|
|
33
|
-
};
|
package/lib/debugInfo.d.ts
DELETED
package/lib/debugInfo.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { version } = require('../package.json');
|
|
3
|
-
const { getPlatform } = require('./environment');
|
|
4
|
-
const logDebugInfo = ({ debug }) => {
|
|
5
|
-
if (!debug) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
console.log('');
|
|
9
|
-
console.log('Debugging info');
|
|
10
|
-
console.log('==============');
|
|
11
|
-
console.log(`CLI version: ${version}`);
|
|
12
|
-
console.log(`node version: ${process.version}`);
|
|
13
|
-
console.log(`platform: ${getPlatform()}`);
|
|
14
|
-
console.log('');
|
|
15
|
-
};
|
|
16
|
-
module.exports = {
|
|
17
|
-
logDebugInfo,
|
|
18
|
-
};
|
package/lib/environment.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getPlatform(): "aix" | "android" | "freebsd" | "haiku" | "linux" | "openbsd" | "sunos" | "cygwin" | "netbsd" | "macos" | "windows";
|
package/lib/environment.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export function findFieldsJsonPath(basePath: any): any;
|
|
2
|
-
export function combineThemeCss(basePath: any, cssString?: string): any;
|
|
3
|
-
export function setPreviewSelectors(fields: any, fieldPath: any, selectors: any, depth?: number): any;
|
|
4
|
-
export function generateInheritedSelectors(fields: any): any[];
|
|
5
|
-
export function generateSelectorsMap(fields: any, fieldKey?: any[]): {};
|
|
6
|
-
export function getMaxFieldsDepth(): number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function getFunctionArrays(resp: any): any;
|
package/lib/getFunctionArrays.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const moment = require('moment');
|
|
3
|
-
const getFunctionArrays = resp => {
|
|
4
|
-
return resp.objects.map(func => {
|
|
5
|
-
const { route, method, created, updated, secretNames } = func;
|
|
6
|
-
return [
|
|
7
|
-
route,
|
|
8
|
-
method,
|
|
9
|
-
secretNames.join(', '),
|
|
10
|
-
moment(created).format(),
|
|
11
|
-
moment(updated).format(),
|
|
12
|
-
];
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
module.exports = {
|
|
16
|
-
getFunctionArrays,
|
|
17
|
-
};
|
package/lib/hublValidate.d.ts
DELETED
package/lib/hublValidate.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
3
|
-
const getErrorsFromHublValidationObject = validation => (validation && validation.meta && validation.meta.template_errors) || [];
|
|
4
|
-
function printHublValidationError(err) {
|
|
5
|
-
const { severity, message, lineno, startPosition } = err;
|
|
6
|
-
const method = severity === 'FATAL' ? 'error' : 'warn';
|
|
7
|
-
logger[method]('[%d, %d]: %s', lineno, startPosition, message);
|
|
8
|
-
}
|
|
9
|
-
function printHublValidationResult({ file, validation }) {
|
|
10
|
-
let count = 0;
|
|
11
|
-
const errors = getErrorsFromHublValidationObject(validation);
|
|
12
|
-
if (!errors.length) {
|
|
13
|
-
return count;
|
|
14
|
-
}
|
|
15
|
-
logger.group(file);
|
|
16
|
-
errors.forEach(err => {
|
|
17
|
-
if (err.reason !== 'SYNTAX_ERROR') {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
++count;
|
|
21
|
-
printHublValidationError(err);
|
|
22
|
-
});
|
|
23
|
-
logger.groupEnd(file);
|
|
24
|
-
return count;
|
|
25
|
-
}
|
|
26
|
-
module.exports = {
|
|
27
|
-
printHublValidationResult,
|
|
28
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export function bold(stringValue: any): string;
|
|
2
|
-
export function yellow(stringValue: any): string;
|
|
3
|
-
export function green(stringValue: any): string;
|
|
4
|
-
export function red(stringValue: any): string;
|
|
5
|
-
export function cyan(stringValue: any): string;
|
|
6
|
-
export function orange(stringValue: any): string;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
/**
|
|
4
|
-
* These helper methods are used to modify text output within the CLI. They
|
|
5
|
-
* should all take in a string value and output a modified string value.
|
|
6
|
-
*/
|
|
7
|
-
module.exports = {
|
|
8
|
-
bold: function (stringValue) {
|
|
9
|
-
return chalk.bold(stringValue);
|
|
10
|
-
},
|
|
11
|
-
yellow: function (stringValue) {
|
|
12
|
-
return chalk.reset.yellow(stringValue);
|
|
13
|
-
},
|
|
14
|
-
green: function (stringValue) {
|
|
15
|
-
return chalk.reset.green(stringValue);
|
|
16
|
-
},
|
|
17
|
-
red: function (stringValue) {
|
|
18
|
-
return chalk.reset.red(stringValue);
|
|
19
|
-
},
|
|
20
|
-
cyan: function (stringValue) {
|
|
21
|
-
return chalk.cyan(stringValue);
|
|
22
|
-
},
|
|
23
|
-
orange: function (stringValue) {
|
|
24
|
-
return chalk.hex('#FC9900')(stringValue);
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export function kickOffValidation(accountId: any, assetType: any, src: any): Promise<number>;
|
|
2
|
-
export function pollForValidationFinish(accountId: any, validationId: any): Promise<void>;
|
|
3
|
-
export function fetchValidationResults(accountId: any, validationId: any): Promise<import("@hubspot/local-dev-lib/types/MarketplaceValidation").GetValidationResultsResponse>;
|
|
4
|
-
export function processValidationErrors(i18nKey: any, validationResults: any): void;
|
|
5
|
-
export function displayValidationResults(i18nKey: any, validationResults: any): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare const _exports: ProjectLogsManager;
|
|
2
|
-
export = _exports;
|
|
3
|
-
declare class ProjectLogsManager {
|
|
4
|
-
reset(): void;
|
|
5
|
-
init(accountId: any): Promise<void>;
|
|
6
|
-
projectName: any;
|
|
7
|
-
accountId: any;
|
|
8
|
-
functions: any[] | undefined;
|
|
9
|
-
projectId: any;
|
|
10
|
-
fetchFunctionDetails(): Promise<void>;
|
|
11
|
-
getFunctionNames(): any[];
|
|
12
|
-
setFunction(functionName: any): void;
|
|
13
|
-
selectedFunction: any;
|
|
14
|
-
functionName: any;
|
|
15
|
-
appId: any;
|
|
16
|
-
endpointName: any;
|
|
17
|
-
method: any;
|
|
18
|
-
isPublicFunction: boolean | undefined;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function activeInstallConfirmationPrompt(): Promise<any>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { promptUser } = require('./promptUtils');
|
|
3
|
-
const { i18n } = require('../lang');
|
|
4
|
-
const i18nKey = 'lib.prompts.activeInstallConfirmationPrompt';
|
|
5
|
-
const activeInstallConfirmationPrompt = async () => {
|
|
6
|
-
const { proceed } = await promptUser([
|
|
7
|
-
{
|
|
8
|
-
name: 'proceed',
|
|
9
|
-
message: i18n(`${i18nKey}.message`),
|
|
10
|
-
type: 'confirm',
|
|
11
|
-
default: false,
|
|
12
|
-
},
|
|
13
|
-
]);
|
|
14
|
-
return proceed;
|
|
15
|
-
};
|
|
16
|
-
module.exports = {
|
|
17
|
-
activeInstallConfirmationPrompt,
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function deployBuildIdPrompt(latestBuildId: any, deployedBuildId: any, validate: any): Promise<any>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { promptUser } = require('./promptUtils');
|
|
3
|
-
const { i18n } = require('../lang');
|
|
4
|
-
const i18nKey = 'lib.prompts.deployBuildIdPrompt';
|
|
5
|
-
const deployBuildIdPrompt = (latestBuildId, deployedBuildId, validate) => {
|
|
6
|
-
return promptUser({
|
|
7
|
-
name: 'buildId',
|
|
8
|
-
message: i18n(`${i18nKey}.enterBuildId`),
|
|
9
|
-
default: () => {
|
|
10
|
-
if (latestBuildId === deployedBuildId) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
return latestBuildId;
|
|
14
|
-
},
|
|
15
|
-
validate,
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
module.exports = {
|
|
19
|
-
deployBuildIdPrompt,
|
|
20
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { promptUser } = require('./promptUtils');
|
|
3
|
-
const { i18n } = require('../lang');
|
|
4
|
-
const { FEEDBACK_OPTIONS } = require('../constants');
|
|
5
|
-
const i18nKey = 'lib.prompts.feedbackPrompt';
|
|
6
|
-
const feedbackTypePrompt = bypassPrompt => {
|
|
7
|
-
return promptUser([
|
|
8
|
-
{
|
|
9
|
-
name: 'type',
|
|
10
|
-
message: i18n(`${i18nKey}.feedbackType.message`),
|
|
11
|
-
type: 'list',
|
|
12
|
-
when: !bypassPrompt,
|
|
13
|
-
choices: Object.values(FEEDBACK_OPTIONS).map(option => ({
|
|
14
|
-
name: i18n(`${i18nKey}.feedbackType.${option}`),
|
|
15
|
-
value: option,
|
|
16
|
-
})),
|
|
17
|
-
},
|
|
18
|
-
]);
|
|
19
|
-
};
|
|
20
|
-
const shouldOpenBrowserPrompt = (type, bypassPrompt) => {
|
|
21
|
-
return promptUser([
|
|
22
|
-
{
|
|
23
|
-
name: 'shouldOpen',
|
|
24
|
-
message: () => {
|
|
25
|
-
return type === FEEDBACK_OPTIONS.BUG
|
|
26
|
-
? i18n(`${i18nKey}.bugPrompt`)
|
|
27
|
-
: i18n(`${i18nKey}.generalPrompt`);
|
|
28
|
-
},
|
|
29
|
-
type: 'confirm',
|
|
30
|
-
when: !bypassPrompt,
|
|
31
|
-
},
|
|
32
|
-
]);
|
|
33
|
-
};
|
|
34
|
-
module.exports = {
|
|
35
|
-
feedbackTypePrompt,
|
|
36
|
-
shouldOpenBrowserPrompt,
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function folderOverwritePrompt(folderName: any): Promise<any>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { promptUser } = require('./promptUtils');
|
|
3
|
-
const { i18n } = require('../lang');
|
|
4
|
-
const i18nKey = 'lib.prompts.folderOverwritePrompt';
|
|
5
|
-
const folderOverwritePrompt = folderName => {
|
|
6
|
-
return promptUser({
|
|
7
|
-
type: 'confirm',
|
|
8
|
-
name: 'overwrite',
|
|
9
|
-
message: i18n(`${i18nKey}.overwriteConfirm`, { folderName }),
|
|
10
|
-
default: false,
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
module.exports = {
|
|
14
|
-
folderOverwritePrompt,
|
|
15
|
-
};
|
package/lib/regex.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const STRING_WITH_NO_SPACES_REGEX: RegExp;
|