@hubspot/cli 6.2.2-experimental.0 → 6.2.2-experimental.2
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/bin/cli.js +2 -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/doctor.d.ts +8 -0
- package/commands/doctor.js +60 -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 +22 -9
- package/commands/lint.d.ts +4 -4
- package/commands/lint.js +41 -3
- 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 +7 -5
- 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 +4 -2
- 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 +75 -13
- package/lib/DevServerManager.d.ts +1 -35
- package/lib/DevServerManager.js +4 -5
- 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 +24 -17
- package/lib/commonOpts.js +75 -56
- 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 +3 -7
- package/lib/dependencyManagement.js +21 -0
- package/lib/developerTestAccounts.d.ts +1 -7
- package/lib/developerTestAccounts.js +2 -0
- package/lib/doctor/Diagnosis.d.ts +27 -0
- package/lib/doctor/Diagnosis.js +119 -0
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +61 -0
- package/lib/doctor/DiagnosticInfoBuilder.js +158 -0
- package/lib/doctor/Doctor.d.ts +21 -0
- package/lib/doctor/Doctor.js +328 -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 +8 -10
- package/lib/interpolation.js +42 -47
- 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 +2 -38
- package/lib/projects.js +15 -8
- 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 +35 -57
- package/lib/ui/SpinniesManager.js +67 -34
- package/lib/ui/git.d.ts +1 -1
- package/lib/ui/git.js +18 -16
- package/lib/ui/index.d.ts +16 -36
- package/lib/ui/index.js +88 -113
- package/lib/ui/serverlessFunctionLogs.d.ts +1 -1
- package/lib/ui/serverlessFunctionLogs.js +26 -19
- package/lib/ui/spinniesUtils.d.ts +29 -57
- package/lib/ui/spinniesUtils.js +46 -30
- package/lib/ui/supportHyperlinks.d.ts +7 -3
- package/lib/ui/supportHyperlinks.js +11 -9
- package/lib/ui/supportsColor.d.ts +13 -9
- package/lib/ui/supportsColor.js +20 -16
- package/lib/ui/table.d.ts +3 -2
- package/lib/ui/table.js +18 -10
- package/lib/upload.d.ts +1 -1
- package/lib/upload.js +4 -2
- package/lib/usageTracking.d.ts +2 -6
- package/lib/usageTracking.js +14 -1
- package/lib/validation.d.ts +1 -16
- package/lib/validation.js +2 -2
- package/package.json +20 -10
- 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/lib/lang.js
CHANGED
|
@@ -1,53 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MISSING_LANGUAGE_DATA_PREFIX = void 0;
|
|
7
|
+
exports.i18n = i18n;
|
|
8
|
+
exports.setLangData = setLangData;
|
|
9
|
+
const util_1 = __importDefault(require("util"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
12
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
13
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
14
|
+
const interpolation_1 = require("./interpolation");
|
|
15
|
+
exports.MISSING_LANGUAGE_DATA_PREFIX = '[Missing language data]';
|
|
9
16
|
let locale;
|
|
10
17
|
let languageObj;
|
|
11
|
-
|
|
18
|
+
function loadLanguageFromYaml() {
|
|
12
19
|
if (languageObj)
|
|
13
20
|
return;
|
|
14
21
|
try {
|
|
15
22
|
const nodeLocale = Intl.DateTimeFormat()
|
|
16
23
|
.resolvedOptions()
|
|
17
24
|
.locale.split('-')[0];
|
|
18
|
-
const languageFilePath =
|
|
19
|
-
const languageFileExists =
|
|
25
|
+
const languageFilePath = path_1.default.join(__dirname, `../lang/${nodeLocale}.lyaml`);
|
|
26
|
+
const languageFileExists = fs_extra_1.default.existsSync(languageFilePath);
|
|
20
27
|
// Fall back to using the default language file
|
|
21
28
|
locale = languageFileExists ? nodeLocale : 'en';
|
|
22
|
-
languageObj =
|
|
23
|
-
logger.debug('Loaded language data: ',
|
|
29
|
+
languageObj = js_yaml_1.default.load(fs_extra_1.default.readFileSync(path_1.default.join(__dirname, `../lang/${locale}.lyaml`), 'utf8'));
|
|
30
|
+
logger_1.logger.debug('Loaded language data: ', util_1.default.inspect(languageObj, true, 999, true));
|
|
24
31
|
}
|
|
25
32
|
catch (e) {
|
|
26
|
-
logger.error('Error loading language data: ', e);
|
|
33
|
+
logger_1.logger.error('Error loading language data: ', e);
|
|
27
34
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
35
|
+
}
|
|
36
|
+
function getTextValue(lookupDotNotation) {
|
|
30
37
|
const lookupProps = [locale, ...lookupDotNotation.split('.')];
|
|
31
|
-
const missingTextData = `${MISSING_LANGUAGE_DATA_PREFIX}: ${lookupProps.join('.')}`;
|
|
38
|
+
const missingTextData = `${exports.MISSING_LANGUAGE_DATA_PREFIX}: ${lookupProps.join('.')}`;
|
|
32
39
|
let textValue = languageObj;
|
|
33
40
|
let previouslyCheckedProp = lookupProps[0];
|
|
34
41
|
try {
|
|
35
42
|
lookupProps.forEach(prop => {
|
|
36
|
-
textValue
|
|
43
|
+
if (textValue && typeof textValue === 'object') {
|
|
44
|
+
textValue = textValue[prop];
|
|
45
|
+
}
|
|
37
46
|
previouslyCheckedProp = prop;
|
|
38
47
|
});
|
|
39
48
|
}
|
|
40
49
|
catch (e) {
|
|
41
|
-
logger.debug(`Unable to access language property: ${lookupProps.join('.')}. Failed to access prop "${previouslyCheckedProp}".`);
|
|
42
|
-
logger.error('Unable to access language property.');
|
|
50
|
+
logger_1.logger.debug(`Unable to access language property: ${lookupProps.join('.')}. Failed to access prop "${previouslyCheckedProp}".`);
|
|
51
|
+
logger_1.logger.error('Unable to access language property.');
|
|
43
52
|
return missingTextData;
|
|
44
53
|
}
|
|
45
54
|
if (!textValue) {
|
|
46
55
|
return missingTextData;
|
|
47
56
|
}
|
|
57
|
+
if (typeof textValue !== 'string') {
|
|
58
|
+
return missingTextData;
|
|
59
|
+
}
|
|
48
60
|
return textValue;
|
|
49
|
-
}
|
|
50
|
-
|
|
61
|
+
}
|
|
62
|
+
function i18n(lookupDotNotation, options = {}) {
|
|
51
63
|
if (!languageObj) {
|
|
52
64
|
loadLanguageFromYaml();
|
|
53
65
|
}
|
|
@@ -55,15 +67,10 @@ const i18n = (lookupDotNotation, options = {}) => {
|
|
|
55
67
|
throw new Error(`i18n must be passed a string value for lookupDotNotation, received ${typeof lookupDotNotation}`);
|
|
56
68
|
}
|
|
57
69
|
const textValue = getTextValue(lookupDotNotation);
|
|
58
|
-
const shouldInterpolate = !textValue.startsWith(MISSING_LANGUAGE_DATA_PREFIX);
|
|
59
|
-
return shouldInterpolate ? interpolate(textValue, options) : textValue;
|
|
60
|
-
}
|
|
61
|
-
|
|
70
|
+
const shouldInterpolate = !textValue.startsWith(exports.MISSING_LANGUAGE_DATA_PREFIX);
|
|
71
|
+
return shouldInterpolate ? (0, interpolation_1.interpolate)(textValue, options) : textValue;
|
|
72
|
+
}
|
|
73
|
+
function setLangData(newLocale, newLangObj) {
|
|
62
74
|
locale = newLocale;
|
|
63
75
|
languageObj = newLangObj;
|
|
64
|
-
}
|
|
65
|
-
module.exports = {
|
|
66
|
-
i18n,
|
|
67
|
-
setLangData,
|
|
68
|
-
MISSING_LANGUAGE_DATA_PREFIX,
|
|
69
|
-
};
|
|
76
|
+
}
|
package/lib/links.d.ts
CHANGED
|
@@ -1,127 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
APPS_MARKETPLACE: {
|
|
3
|
-
shortcut: string;
|
|
4
|
-
alias: string;
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
7
|
-
ASSET_MARKETPLACE: {
|
|
8
|
-
shortcut: string;
|
|
9
|
-
alias: string;
|
|
10
|
-
url: string;
|
|
11
|
-
};
|
|
12
|
-
CONTENT_STAGING: {
|
|
13
|
-
shortcut: string;
|
|
14
|
-
alias: string;
|
|
15
|
-
url: string;
|
|
16
|
-
};
|
|
17
|
-
DESIGN_MANAGER: {
|
|
18
|
-
shortcut: string;
|
|
19
|
-
alias: string;
|
|
20
|
-
url: string;
|
|
21
|
-
};
|
|
22
|
-
DOCS: {
|
|
23
|
-
shortcut: string;
|
|
24
|
-
url: string;
|
|
25
|
-
};
|
|
26
|
-
FILE_MANAGER: {
|
|
27
|
-
shortcut: string;
|
|
28
|
-
alias: string;
|
|
29
|
-
url: string;
|
|
30
|
-
};
|
|
31
|
-
FORUMS: {
|
|
32
|
-
shortcut: string;
|
|
33
|
-
url: string;
|
|
34
|
-
};
|
|
35
|
-
HUBDB: {
|
|
36
|
-
shortcut: string;
|
|
37
|
-
alias: string;
|
|
38
|
-
url: string;
|
|
39
|
-
};
|
|
40
|
-
SETTINGS: {
|
|
41
|
-
shortcut: string;
|
|
42
|
-
alias: string;
|
|
43
|
-
url: string;
|
|
44
|
-
};
|
|
45
|
-
SETTINGS_NAVIGATION: {
|
|
46
|
-
shortcut: string;
|
|
47
|
-
alias: string;
|
|
48
|
-
url: string;
|
|
49
|
-
};
|
|
50
|
-
SETTINGS_WEBSITE: {
|
|
51
|
-
shortcut: string;
|
|
52
|
-
alias: string;
|
|
53
|
-
url: string;
|
|
54
|
-
};
|
|
55
|
-
SETTINGS_URL_REDIRECTS: {
|
|
56
|
-
shortcut: string;
|
|
57
|
-
alias: string;
|
|
58
|
-
url: string;
|
|
59
|
-
};
|
|
60
|
-
PURCHASED_ASSETS: {
|
|
61
|
-
shortcut: string;
|
|
62
|
-
alias: string;
|
|
63
|
-
url: string;
|
|
64
|
-
};
|
|
65
|
-
WEBSITE_PAGES: {
|
|
66
|
-
shortcut: string;
|
|
67
|
-
alias: string;
|
|
68
|
-
url: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export function getSiteLinksAsArray(accountId: any): ({
|
|
72
|
-
shortcut: string;
|
|
73
|
-
alias: string;
|
|
74
|
-
url: string;
|
|
75
|
-
} | {
|
|
76
|
-
shortcut: string;
|
|
77
|
-
alias: string;
|
|
78
|
-
url: string;
|
|
79
|
-
} | {
|
|
80
|
-
shortcut: string;
|
|
81
|
-
alias: string;
|
|
82
|
-
url: string;
|
|
83
|
-
} | {
|
|
84
|
-
shortcut: string;
|
|
85
|
-
alias: string;
|
|
86
|
-
url: string;
|
|
87
|
-
} | {
|
|
88
|
-
shortcut: string;
|
|
89
|
-
url: string;
|
|
90
|
-
} | {
|
|
91
|
-
shortcut: string;
|
|
92
|
-
alias: string;
|
|
93
|
-
url: string;
|
|
94
|
-
} | {
|
|
95
|
-
shortcut: string;
|
|
96
|
-
url: string;
|
|
97
|
-
} | {
|
|
98
|
-
shortcut: string;
|
|
99
|
-
alias: string;
|
|
100
|
-
url: string;
|
|
101
|
-
} | {
|
|
102
|
-
shortcut: string;
|
|
103
|
-
alias: string;
|
|
104
|
-
url: string;
|
|
105
|
-
} | {
|
|
106
|
-
shortcut: string;
|
|
107
|
-
alias: string;
|
|
108
|
-
url: string;
|
|
109
|
-
} | {
|
|
110
|
-
shortcut: string;
|
|
111
|
-
alias: string;
|
|
112
|
-
url: string;
|
|
113
|
-
} | {
|
|
114
|
-
shortcut: string;
|
|
115
|
-
alias: string;
|
|
116
|
-
url: string;
|
|
117
|
-
} | {
|
|
118
|
-
shortcut: string;
|
|
119
|
-
alias: string;
|
|
120
|
-
url: string;
|
|
121
|
-
} | {
|
|
122
|
-
shortcut: string;
|
|
123
|
-
alias: string;
|
|
124
|
-
url: string;
|
|
125
|
-
})[];
|
|
126
|
-
export function logSiteLinks(accountId: any): void;
|
|
127
|
-
export function openLink(accountId: any, shortcut: any): void;
|
|
1
|
+
export {};
|
package/lib/links.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { getEnv } = require('@hubspot/local-dev-lib/config');
|
|
3
5
|
const { ENVIRONMENTS, } = require('@hubspot/local-dev-lib/constants/environments');
|
|
4
6
|
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls');
|
package/lib/localDev.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function checkIfDefaultAccountIsSupported(accountConfig: any, hasPublicApps: any): void;
|
|
3
|
-
export function checkIfAccountFlagIsSupported(accountConfig: any, hasPublicApps: any): void;
|
|
4
|
-
export function suggestRecommendedNestedAccount(accounts: any, accountConfig: any, hasPublicApps: any): Promise<any>;
|
|
5
|
-
export function createSandboxForLocalDev(accountId: any, accountConfig: any, env: any): Promise<any>;
|
|
6
|
-
export function createDeveloperTestAccountForLocalDev(accountId: any, accountConfig: any, env: any): Promise<any>;
|
|
7
|
-
export function useExistingDevTestAccount(env: any, account: any): Promise<void>;
|
|
8
|
-
export function createNewProjectForLocalDev(projectConfig: any, targetAccountId: any, shouldCreateWithoutConfirmation: any, hasPublicApps: any): Promise<import("@hubspot/local-dev-lib/types/Project").Project>;
|
|
9
|
-
export function createInitialBuildForNewProject(projectConfig: any, projectDir: any, targetAccountId: any): Promise<any>;
|
|
10
|
-
export function getAccountHomeUrl(accountId: any): string;
|
|
11
|
-
export function checkIfParentAccountIsAuthed(accountConfig: any): void;
|
|
1
|
+
export {};
|
package/lib/localDev.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
3
5
|
const { HUBSPOT_ACCOUNT_TYPES, HUBSPOT_ACCOUNT_TYPE_STRINGS, } = require('@hubspot/local-dev-lib/constants/config');
|
|
4
6
|
const { isMissingScopeError, isSpecifiedError, } = require('@hubspot/local-dev-lib/errors/index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const chalk = require('chalk');
|
|
3
5
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
4
6
|
const { requestValidation, getValidationStatus, getValidationResults, } = require('@hubspot/local-dev-lib/api/marketplaceValidation');
|
package/lib/oauth.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/lib/oauth.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const express = require('express');
|
|
3
5
|
const open = require('open');
|
|
4
6
|
const { OAuth2Manager, } = require('@hubspot/local-dev-lib/models/OAuth2Manager');
|
|
@@ -19,7 +21,7 @@ const buildAuthUrl = oauthManager => {
|
|
|
19
21
|
};
|
|
20
22
|
const handleServerOnProcessEnd = server => {
|
|
21
23
|
const shutdownServerIfRunning = () => {
|
|
22
|
-
server
|
|
24
|
+
server?.close();
|
|
23
25
|
};
|
|
24
26
|
handleExit(shutdownServerIfRunning);
|
|
25
27
|
};
|
package/lib/polling.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/lib/polling.js
CHANGED
package/lib/process.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface KeyPress {
|
|
2
|
+
ctrl?: boolean;
|
|
3
|
+
shift?: boolean;
|
|
4
|
+
alt?: boolean;
|
|
5
|
+
meta?: boolean;
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function handleExit(callback: (onTerminate: {
|
|
9
|
+
isSIGHUP: boolean;
|
|
10
|
+
}) => void): void;
|
|
11
|
+
export declare function handleKeypress(callback: (onKeyPress: KeyPress) => void): void;
|
|
12
|
+
export {};
|
package/lib/process.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handleExit = handleExit;
|
|
7
|
+
exports.handleKeypress = handleKeypress;
|
|
8
|
+
const readline_1 = __importDefault(require("readline"));
|
|
9
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
+
const lang_1 = require("./lang");
|
|
5
11
|
const i18nKey = 'lib.process';
|
|
6
|
-
|
|
12
|
+
function handleExit(callback) {
|
|
7
13
|
const terminationSignals = [
|
|
8
14
|
'beforeExit',
|
|
9
15
|
'SIGINT', // Terminal trying to interrupt (Ctrl + C)
|
|
@@ -23,17 +29,17 @@ const handleExit = callback => {
|
|
|
23
29
|
const isSIGHUP = signal === 'SIGHUP';
|
|
24
30
|
// Prevent logs when terminal closes
|
|
25
31
|
if (isSIGHUP) {
|
|
26
|
-
setLogLevel(LOG_LEVEL.NONE);
|
|
32
|
+
(0, logger_1.setLogLevel)(logger_1.LOG_LEVEL.NONE);
|
|
27
33
|
}
|
|
28
|
-
logger.debug(i18n(`${i18nKey}.exitDebug`, { signal }));
|
|
34
|
+
logger_1.logger.debug((0, lang_1.i18n)(`${i18nKey}.exitDebug`, { signal }));
|
|
29
35
|
await callback({ isSIGHUP });
|
|
30
36
|
}
|
|
31
37
|
});
|
|
32
38
|
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
}
|
|
40
|
+
function handleKeypress(callback) {
|
|
41
|
+
readline_1.default.createInterface(process.stdin, process.stdout);
|
|
42
|
+
readline_1.default.emitKeypressEvents(process.stdin);
|
|
37
43
|
if (process.stdin.isTTY) {
|
|
38
44
|
process.stdin.setRawMode(true);
|
|
39
45
|
}
|
|
@@ -43,8 +49,4 @@ const handleKeypress = callback => {
|
|
|
43
49
|
callback(key);
|
|
44
50
|
}
|
|
45
51
|
});
|
|
46
|
-
}
|
|
47
|
-
module.exports = {
|
|
48
|
-
handleExit,
|
|
49
|
-
handleKeypress,
|
|
50
|
-
};
|
|
52
|
+
}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
"private-app": string;
|
|
3
|
-
"public-app": string;
|
|
4
|
-
"hubl-theme": string;
|
|
5
|
-
};
|
|
6
|
-
export const COMPONENT_TYPES: Readonly<{
|
|
7
|
-
privateApp: "private-app";
|
|
8
|
-
publicApp: "public-app";
|
|
9
|
-
hublTheme: "hubl-theme";
|
|
10
|
-
}>;
|
|
11
|
-
export function findProjectComponents(projectSourceDir: any): Promise<any[]>;
|
|
12
|
-
export function getAppCardConfigs(appConfig: any, appPath: any): any[];
|
|
13
|
-
export function getProjectComponentTypes(components: any): {};
|
|
1
|
+
export {};
|
package/lib/projectStructure.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const fs = require('fs');
|
|
3
5
|
const path = require('path');
|
|
4
6
|
const { walk } = require('@hubspot/local-dev-lib/fs');
|
|
@@ -15,7 +17,7 @@ const CONFIG_FILES = {
|
|
|
15
17
|
[COMPONENT_TYPES.hublTheme]: 'theme.json',
|
|
16
18
|
};
|
|
17
19
|
function getTypeFromConfigFile(configFile) {
|
|
18
|
-
for (
|
|
20
|
+
for (const key in CONFIG_FILES) {
|
|
19
21
|
if (CONFIG_FILES[key] === configFile) {
|
|
20
22
|
return key;
|
|
21
23
|
}
|
|
@@ -36,7 +38,7 @@ function loadConfigFile(configPath) {
|
|
|
36
38
|
return null;
|
|
37
39
|
}
|
|
38
40
|
function getAppCardConfigs(appConfig, appPath) {
|
|
39
|
-
|
|
41
|
+
const cardConfigs = [];
|
|
40
42
|
let cards;
|
|
41
43
|
if (appConfig && appConfig.extensions && appConfig.extensions.crm) {
|
|
42
44
|
cards = appConfig.extensions.crm.cards;
|
package/lib/projects.d.ts
CHANGED
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
projectConfig: null;
|
|
4
|
-
projectDir: null;
|
|
5
|
-
} | {
|
|
6
|
-
projectDir: string;
|
|
1
|
+
export declare const getProjectConfig: (_dir: any) => Promise<{
|
|
2
|
+
projectDir: any;
|
|
7
3
|
projectConfig: any;
|
|
8
4
|
} | undefined>;
|
|
9
|
-
export function getIsInProject(_dir: any): boolean;
|
|
10
|
-
export function pollProjectBuildAndDeploy(accountId: any, projectConfig: any, tempFile: any, buildId: any, silenceLogs?: boolean): Promise<{
|
|
11
|
-
succeeded: boolean;
|
|
12
|
-
buildId: any;
|
|
13
|
-
buildResult: any;
|
|
14
|
-
deployResult: null;
|
|
15
|
-
}>;
|
|
16
|
-
export function handleProjectUpload(accountId: any, projectConfig: any, projectDir: any, callbackFunc: any, uploadMessage: any): Promise<any>;
|
|
17
|
-
export function createProjectConfig(projectPath: any, projectName: any, template: any, templateSource: any, githubRef: any): Promise<boolean>;
|
|
18
|
-
export function validateProjectConfig(projectConfig: any, projectDir: any): undefined;
|
|
19
|
-
export function getProjectHomeUrl(accountId: any): string;
|
|
20
|
-
export function getProjectDetailUrl(projectName: any, accountId: any): string | undefined;
|
|
21
|
-
export function getProjectBuildDetailUrl(projectName: any, buildId: any, accountId: any): string | undefined;
|
|
22
|
-
export function pollBuildStatus(accountId: any, taskName: any, taskId: any, deployedBuildId?: null, silenceLogs?: boolean): Promise<any>;
|
|
23
|
-
export function pollDeployStatus(accountId: any, taskName: any, taskId: any, deployedBuildId?: null, silenceLogs?: boolean): Promise<any>;
|
|
24
|
-
export function ensureProjectExists(accountId: any, projectName: any, { forceCreate, allowCreate, noLogs, withPolling, uploadCommand, }?: {
|
|
25
|
-
forceCreate?: boolean | undefined;
|
|
26
|
-
allowCreate?: boolean | undefined;
|
|
27
|
-
noLogs?: boolean | undefined;
|
|
28
|
-
withPolling?: boolean | undefined;
|
|
29
|
-
uploadCommand?: boolean | undefined;
|
|
30
|
-
}): Promise<void | {
|
|
31
|
-
projectExists: boolean;
|
|
32
|
-
project: any;
|
|
33
|
-
} | {
|
|
34
|
-
projectExists: boolean;
|
|
35
|
-
project?: undefined;
|
|
36
|
-
}>;
|
|
37
|
-
export function logFeedbackMessage(buildId: any): void;
|
|
38
|
-
export function createProjectComponent(component: any, name: any, projectComponentsVersion: any): Promise<void>;
|
|
39
|
-
export function displayWarnLogs(accountId: any, projectName: any, taskId: any, isDeploy?: boolean): Promise<void>;
|
|
40
|
-
export function getProjectComponentsByVersion(projectComponentsVersion: any): Promise<any>;
|
package/lib/projects.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectConfig = void 0;
|
|
4
|
+
// @ts-nocheck
|
|
2
5
|
const fs = require('fs-extra');
|
|
3
6
|
const path = require('path');
|
|
4
7
|
const archiver = require('archiver');
|
|
@@ -18,7 +21,7 @@ const { getCwd, getAbsoluteFilePath } = require('@hubspot/local-dev-lib/path');
|
|
|
18
21
|
const { downloadGithubRepoContents } = require('@hubspot/local-dev-lib/github');
|
|
19
22
|
const { promptUser } = require('./prompts/promptUtils');
|
|
20
23
|
const { EXIT_CODES } = require('./enums/exitCodes');
|
|
21
|
-
const { uiLine, uiLink, uiAccountDescription } = require('
|
|
24
|
+
const { uiLine, uiLink, uiAccountDescription } = require('./ui');
|
|
22
25
|
const { i18n } = require('./lang');
|
|
23
26
|
const SpinniesManager = require('./ui/SpinniesManager');
|
|
24
27
|
const { logError, ApiErrorContext } = require('./errorHandlers/index');
|
|
@@ -67,8 +70,9 @@ const getProjectConfig = async (_dir) => {
|
|
|
67
70
|
logger.error('Could not read from project config');
|
|
68
71
|
}
|
|
69
72
|
};
|
|
73
|
+
exports.getProjectConfig = getProjectConfig;
|
|
70
74
|
const createProjectConfig = async (projectPath, projectName, template, templateSource, githubRef) => {
|
|
71
|
-
const { projectConfig, projectDir } = await getProjectConfig(projectPath);
|
|
75
|
+
const { projectConfig, projectDir } = await (0, exports.getProjectConfig)(projectPath);
|
|
72
76
|
if (projectConfig) {
|
|
73
77
|
logger.warn(projectPath === projectDir
|
|
74
78
|
? 'A project already exists in that location.'
|
|
@@ -496,9 +500,12 @@ const makePollTaskStatusFunc = ({ statusFn, structureFn, statusText, statusStrin
|
|
|
496
500
|
: i18n(`${i18nKey}.makePollTaskStatusFunc.failedStatusText`);
|
|
497
501
|
const hasNewline = spinner.text.includes('\n') || Boolean(topLevelTask);
|
|
498
502
|
const updatedText = `${spinner.text.replace('\n', '')} ${taskStatusText}${hasNewline ? '\n' : ''}`;
|
|
499
|
-
status === statusText.STATES.SUCCESS
|
|
500
|
-
|
|
501
|
-
|
|
503
|
+
if (status === statusText.STATES.SUCCESS) {
|
|
504
|
+
SpinniesManager.succeed(id, { text: updatedText });
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
SpinniesManager.fail(id, { text: updatedText });
|
|
508
|
+
}
|
|
502
509
|
if (topLevelTask) {
|
|
503
510
|
topLevelTask.subtasks.forEach(currentSubtask => SpinniesManager.remove(currentSubtask.id));
|
|
504
511
|
}
|
|
@@ -610,8 +617,8 @@ const logFeedbackMessage = buildId => {
|
|
|
610
617
|
};
|
|
611
618
|
const createProjectComponent = async (component, name, projectComponentsVersion) => {
|
|
612
619
|
const i18nKey = 'commands.project.subcommands.add';
|
|
613
|
-
|
|
614
|
-
const configInfo = await getProjectConfig();
|
|
620
|
+
const componentName = name;
|
|
621
|
+
const configInfo = await (0, exports.getProjectConfig)();
|
|
615
622
|
if (!configInfo.projectDir && !configInfo.projectConfig) {
|
|
616
623
|
logger.error(i18n(`${i18nKey}.error.locationInProject`));
|
|
617
624
|
process.exit(EXIT_CODES.ERROR);
|
|
@@ -655,7 +662,7 @@ const getProjectComponentsByVersion = async (projectComponentsVersion) => {
|
|
|
655
662
|
};
|
|
656
663
|
module.exports = {
|
|
657
664
|
writeProjectConfig,
|
|
658
|
-
getProjectConfig,
|
|
665
|
+
getProjectConfig: exports.getProjectConfig,
|
|
659
666
|
getIsInProject,
|
|
660
667
|
pollProjectBuildAndDeploy,
|
|
661
668
|
handleProjectUpload,
|
package/lib/projectsWatch.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/lib/projectsWatch.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const chokidar = require('chokidar');
|
|
3
5
|
const path = require('path');
|
|
4
6
|
const chalk = require('chalk');
|
|
@@ -112,13 +114,16 @@ const createNewBuild = async (accountId, projectName, platformVersion) => {
|
|
|
112
114
|
const handleWatchEvent = async (accountId, projectName, platformVersion, projectSourceDir, filePath, action = 'upload') => {
|
|
113
115
|
const remotePath = path.relative(projectSourceDir, filePath);
|
|
114
116
|
if (queue.isPaused) {
|
|
115
|
-
standbyeQueue.find(file => file.filePath === filePath)
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
if (standbyeQueue.find(file => file.filePath === filePath)) {
|
|
118
|
+
logger.debug(i18n(`${i18nKey}.debug.fileAlreadyQueued`, { filePath }));
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
standbyeQueue.push({
|
|
118
122
|
filePath,
|
|
119
123
|
remotePath,
|
|
120
124
|
action,
|
|
121
125
|
});
|
|
126
|
+
}
|
|
122
127
|
}
|
|
123
128
|
else {
|
|
124
129
|
await queueFileOrFolder(accountId, projectName, platformVersion, filePath, remotePath, action);
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
name: string;
|
|
3
|
-
message: any;
|
|
4
|
-
default: any;
|
|
5
|
-
validate(val: any): any;
|
|
6
|
-
};
|
|
7
|
-
export function cliAccountNamePrompt(defaultName: any): Promise<any>;
|
|
8
|
-
export function hubspotAccountNamePrompt({ accountType, currentPortalCount }: {
|
|
9
|
-
accountType: any;
|
|
10
|
-
currentPortalCount?: number | undefined;
|
|
11
|
-
}): Promise<any>;
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { accountNameExistsInConfig } = require('@hubspot/local-dev-lib/config');
|
|
3
|
-
const { STRING_WITH_NO_SPACES_REGEX } = require('../regex');
|
|
4
5
|
const { promptUser } = require('./promptUtils');
|
|
5
6
|
const { i18n } = require('../lang');
|
|
6
7
|
const { HUBSPOT_ACCOUNT_TYPES, } = require('@hubspot/local-dev-lib/constants/config');
|
|
@@ -16,7 +17,7 @@ const getCliAccountNamePromptConfig = defaultName => ({
|
|
|
16
17
|
else if (!val.length) {
|
|
17
18
|
return i18n(`${i18nKey}.errors.nameRequired`);
|
|
18
19
|
}
|
|
19
|
-
else if (
|
|
20
|
+
else if (val.indexOf(' ') >= 0) {
|
|
20
21
|
return i18n(`${i18nKey}.errors.spacesInName`);
|
|
21
22
|
}
|
|
22
23
|
return accountNameExistsInConfig(val)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
3
4
|
const { promptUser } = require('./promptUtils');
|
|
4
5
|
const { i18n } = require('../lang');
|
|
5
6
|
const { uiAccountDescription } = require('../ui');
|
|
@@ -22,22 +23,6 @@ const selectAccountFromConfig = async (config, prompt) => {
|
|
|
22
23
|
]);
|
|
23
24
|
return selectedDefault;
|
|
24
25
|
};
|
|
25
|
-
const selectAndSetAsDefaultAccountPrompt = async (config) => {
|
|
26
|
-
const { default: selectedDefault } = await promptUser([
|
|
27
|
-
{
|
|
28
|
-
type: 'list',
|
|
29
|
-
look: false,
|
|
30
|
-
name: 'default',
|
|
31
|
-
pageSize: 20,
|
|
32
|
-
message: i18n(`${i18nKey}.promptMessage`),
|
|
33
|
-
choices: mapAccountChoices(config.portals),
|
|
34
|
-
default: config.defaultPortal,
|
|
35
|
-
},
|
|
36
|
-
]);
|
|
37
|
-
updateDefaultAccount(selectedDefault);
|
|
38
|
-
};
|
|
39
26
|
module.exports = {
|
|
40
|
-
selectAndSetAsDefaultAccountPrompt,
|
|
41
27
|
selectAccountFromConfig,
|
|
42
|
-
mapAccountChoices,
|
|
43
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|