@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
|
@@ -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 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function getProjectConfig(_dir: any): Promise<{
|
|
3
|
-
projectConfig: null;
|
|
4
|
-
projectDir: null;
|
|
5
|
-
} | {
|
|
6
|
-
projectDir: string;
|
|
7
|
-
projectConfig: any;
|
|
8
|
-
} | 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>;
|
|
1
|
+
export {};
|
package/lib/projects.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-extra');
|
|
3
5
|
const path = require('path');
|
|
4
6
|
const archiver = require('archiver');
|
|
@@ -18,7 +20,7 @@ const { getCwd, getAbsoluteFilePath } = require('@hubspot/local-dev-lib/path');
|
|
|
18
20
|
const { downloadGithubRepoContents } = require('@hubspot/local-dev-lib/github');
|
|
19
21
|
const { promptUser } = require('./prompts/promptUtils');
|
|
20
22
|
const { EXIT_CODES } = require('./enums/exitCodes');
|
|
21
|
-
const { uiLine, uiLink, uiAccountDescription } = require('
|
|
23
|
+
const { uiLine, uiLink, uiAccountDescription } = require('./ui');
|
|
22
24
|
const { i18n } = require('./lang');
|
|
23
25
|
const SpinniesManager = require('./ui/SpinniesManager');
|
|
24
26
|
const { logError, ApiErrorContext } = require('./errorHandlers/index');
|
|
@@ -496,9 +498,12 @@ const makePollTaskStatusFunc = ({ statusFn, structureFn, statusText, statusStrin
|
|
|
496
498
|
: i18n(`${i18nKey}.makePollTaskStatusFunc.failedStatusText`);
|
|
497
499
|
const hasNewline = spinner.text.includes('\n') || Boolean(topLevelTask);
|
|
498
500
|
const updatedText = `${spinner.text.replace('\n', '')} ${taskStatusText}${hasNewline ? '\n' : ''}`;
|
|
499
|
-
status === statusText.STATES.SUCCESS
|
|
500
|
-
|
|
501
|
-
|
|
501
|
+
if (status === statusText.STATES.SUCCESS) {
|
|
502
|
+
SpinniesManager.succeed(id, { text: updatedText });
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
SpinniesManager.fail(id, { text: updatedText });
|
|
506
|
+
}
|
|
502
507
|
if (topLevelTask) {
|
|
503
508
|
topLevelTask.subtasks.forEach(currentSubtask => SpinniesManager.remove(currentSubtask.id));
|
|
504
509
|
}
|
|
@@ -610,7 +615,7 @@ const logFeedbackMessage = buildId => {
|
|
|
610
615
|
};
|
|
611
616
|
const createProjectComponent = async (component, name, projectComponentsVersion) => {
|
|
612
617
|
const i18nKey = 'commands.project.subcommands.add';
|
|
613
|
-
|
|
618
|
+
const componentName = name;
|
|
614
619
|
const configInfo = await getProjectConfig();
|
|
615
620
|
if (!configInfo.projectDir && !configInfo.projectConfig) {
|
|
616
621
|
logger.error(i18n(`${i18nKey}.error.locationInProject`));
|
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 {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { promptUser } = require('./promptUtils');
|
|
3
5
|
const { i18n } = require('../lang');
|
|
4
|
-
const { STRING_WITH_NO_SPACES_REGEX } = require('../regex');
|
|
5
6
|
const i18nKey = 'lib.prompts.createFunctionPrompt';
|
|
6
7
|
const FUNCTIONS_FOLDER_PROMPT = {
|
|
7
8
|
name: 'functionsFolder',
|
|
@@ -13,7 +14,7 @@ const FUNCTIONS_FOLDER_PROMPT = {
|
|
|
13
14
|
else if (!val.length) {
|
|
14
15
|
return i18n(`${i18nKey}.errors.blank`);
|
|
15
16
|
}
|
|
16
|
-
else if (
|
|
17
|
+
else if (val.indexOf(' ') >= 0) {
|
|
17
18
|
return i18n(`${i18nKey}.errors.space`);
|
|
18
19
|
}
|
|
19
20
|
return true;
|
|
@@ -29,7 +30,7 @@ const FUNCTION_FILENAME_PROMPT = {
|
|
|
29
30
|
else if (!val.length) {
|
|
30
31
|
return i18n(`${i18nKey}.errors.blank`);
|
|
31
32
|
}
|
|
32
|
-
else if (
|
|
33
|
+
else if (val.indexOf(' ') >= 0) {
|
|
33
34
|
return i18n(`${i18nKey}.errors.space`);
|
|
34
35
|
}
|
|
35
36
|
return true;
|
|
@@ -52,7 +53,7 @@ const ENDPOINT_PATH_PROMPT = {
|
|
|
52
53
|
else if (!val.length) {
|
|
53
54
|
return i18n(`${i18nKey}.errors.blank`);
|
|
54
55
|
}
|
|
55
|
-
else if (
|
|
56
|
+
else if (val.indexOf(' ') >= 0) {
|
|
56
57
|
return i18n(`${i18nKey}.errors.space`);
|
|
57
58
|
}
|
|
58
59
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
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 { getCwd, sanitizeFileName, isValidPath, untildify, } = require('@hubspot/local-dev-lib/path');
|
|
5
|
-
const { PROJECT_COMPONENT_TYPES } = require('
|
|
7
|
+
const { PROJECT_COMPONENT_TYPES } = require('../constants');
|
|
6
8
|
const { promptUser } = require('./promptUtils');
|
|
7
9
|
const { fetchFileFromRepository } = require('@hubspot/local-dev-lib/github');
|
|
8
10
|
const { i18n } = require('../lang');
|
|
9
11
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
10
|
-
const { EXIT_CODES } = require('
|
|
12
|
+
const { EXIT_CODES } = require('../enums/exitCodes');
|
|
11
13
|
const { HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, DEFAULT_PROJECT_TEMPLATE_BRANCH, } = require('../constants');
|
|
12
14
|
const i18nKey = 'lib.prompts.createProjectPrompt';
|
|
13
15
|
const PROJECT_PROPERTIES = ['name', 'label', 'path', 'insertPath'];
|
|
@@ -16,7 +18,7 @@ const hasAllProperties = projectList => {
|
|
|
16
18
|
};
|
|
17
19
|
const createTemplateOptions = async (templateSource, githubRef) => {
|
|
18
20
|
const hasCustomTemplateSource = Boolean(templateSource);
|
|
19
|
-
|
|
21
|
+
const branch = hasCustomTemplateSource
|
|
20
22
|
? DEFAULT_PROJECT_TEMPLATE_BRANCH
|
|
21
23
|
: githubRef;
|
|
22
24
|
const config = await fetchFileFromRepository(templateSource || HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, 'config.json', branch);
|
|
@@ -30,6 +32,9 @@ const createTemplateOptions = async (templateSource, githubRef) => {
|
|
|
30
32
|
}
|
|
31
33
|
return config[PROJECT_COMPONENT_TYPES.PROJECTS];
|
|
32
34
|
};
|
|
35
|
+
function findTemplate(projectTemplates, templateNameOrLabel) {
|
|
36
|
+
return projectTemplates.find(t => t.name === templateNameOrLabel || t.label === templateNameOrLabel);
|
|
37
|
+
}
|
|
33
38
|
const createProjectPrompt = async (githubRef, promptOptions = {}, skipTemplatePrompt = false) => {
|
|
34
39
|
let projectTemplates = [];
|
|
35
40
|
let selectedTemplate;
|
|
@@ -37,7 +42,7 @@ const createProjectPrompt = async (githubRef, promptOptions = {}, skipTemplatePr
|
|
|
37
42
|
projectTemplates = await createTemplateOptions(promptOptions.templateSource, githubRef);
|
|
38
43
|
selectedTemplate =
|
|
39
44
|
promptOptions.template &&
|
|
40
|
-
projectTemplates
|
|
45
|
+
findTemplate(projectTemplates, promptOptions.template);
|
|
41
46
|
}
|
|
42
47
|
const result = await promptUser([
|
|
43
48
|
{
|
|
@@ -79,7 +84,7 @@ const createProjectPrompt = async (githubRef, promptOptions = {}, skipTemplatePr
|
|
|
79
84
|
name: 'template',
|
|
80
85
|
message: () => {
|
|
81
86
|
return promptOptions.template &&
|
|
82
|
-
!projectTemplates
|
|
87
|
+
!findTemplate(projectTemplates, promptOptions.template)
|
|
83
88
|
? i18n(`${i18nKey}.errors.invalidTemplate`, {
|
|
84
89
|
template: promptOptions.template,
|
|
85
90
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { promptUser } = require('./promptUtils');
|
|
3
5
|
const { getAccountId } = require('@hubspot/local-dev-lib/config');
|
|
4
6
|
const { fetchProjects } = require('@hubspot/local-dev-lib/api/projects');
|
|
5
|
-
const { logError, ApiErrorContext } = require('
|
|
7
|
+
const { logError, ApiErrorContext } = require('../errorHandlers/index');
|
|
6
8
|
const { EXIT_CODES } = require('../enums/exitCodes');
|
|
7
9
|
const { i18n } = require('../lang');
|
|
8
10
|
const i18nKey = 'lib.prompts.downloadProjectPrompt';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Displays notification to user that we are about to open the browser,
|
|
3
|
-
* then opens their browser to the personal-access-key shortlink
|
|
4
|
-
*/
|
|
5
|
-
export function personalAccessKeyPrompt({ env, account }?: {}): Promise<{
|
|
6
|
-
personalAccessKey: any;
|
|
7
|
-
env: any;
|
|
8
|
-
}>;
|
|
9
|
-
export namespace CLIENT_ID {
|
|
10
|
-
let name: string;
|
|
11
|
-
let message: any;
|
|
12
|
-
function validate(val: any): any;
|
|
13
|
-
}
|
|
14
|
-
export namespace CLIENT_SECRET {
|
|
15
|
-
let name_1: string;
|
|
16
|
-
export { name_1 as name };
|
|
17
|
-
let message_1: any;
|
|
18
|
-
export { message_1 as message };
|
|
19
|
-
export function validate(val: any): any;
|
|
20
|
-
}
|
|
21
|
-
export namespace ACCOUNT_ID {
|
|
22
|
-
let name_2: string;
|
|
23
|
-
export { name_2 as name };
|
|
24
|
-
let message_2: any;
|
|
25
|
-
export { message_2 as message };
|
|
26
|
-
export let type: string;
|
|
27
|
-
export function validate(val: any): any;
|
|
28
|
-
}
|
|
29
|
-
export namespace SCOPES {
|
|
30
|
-
let type_1: string;
|
|
31
|
-
export { type_1 as type };
|
|
32
|
-
let name_3: string;
|
|
33
|
-
export { name_3 as name };
|
|
34
|
-
let message_3: any;
|
|
35
|
-
export { message_3 as message };
|
|
36
|
-
export { DEFAULT_OAUTH_SCOPES as default };
|
|
37
|
-
export { OAUTH_SCOPES as choices };
|
|
38
|
-
}
|
|
39
|
-
export namespace PERSONAL_ACCESS_KEY {
|
|
40
|
-
let name_4: string;
|
|
41
|
-
export { name_4 as name };
|
|
42
|
-
let message_4: any;
|
|
43
|
-
export { message_4 as message };
|
|
44
|
-
export function transformer(val: any): any;
|
|
45
|
-
export function validate(val: any): any;
|
|
46
|
-
}
|
|
47
|
-
export const OAUTH_FLOW: ({
|
|
48
|
-
name: string;
|
|
49
|
-
message: any;
|
|
50
|
-
validate(val: any): any;
|
|
51
|
-
} | {
|
|
52
|
-
type: string;
|
|
53
|
-
name: string;
|
|
54
|
-
message: any;
|
|
55
|
-
default: readonly ["content"];
|
|
56
|
-
choices: readonly [{
|
|
57
|
-
readonly name: "All CMS APIs, Calendar API, Email and Email Events APIs";
|
|
58
|
-
readonly value: "content";
|
|
59
|
-
readonly checked: true;
|
|
60
|
-
}, {
|
|
61
|
-
readonly name: "HubDB API";
|
|
62
|
-
readonly value: "hubdb";
|
|
63
|
-
}, {
|
|
64
|
-
readonly name: "File Manager API";
|
|
65
|
-
readonly value: "files";
|
|
66
|
-
}];
|
|
67
|
-
})[];
|
|
68
|
-
import { DEFAULT_OAUTH_SCOPES } from "@hubspot/local-dev-lib/constants/auth";
|
|
69
|
-
import { OAUTH_SCOPES } from "@hubspot/local-dev-lib/constants/auth";
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const open = require('open');
|
|
3
5
|
const { OAUTH_SCOPES, DEFAULT_OAUTH_SCOPES, } = require('@hubspot/local-dev-lib/constants/auth');
|
|
4
6
|
const { deleteEmptyConfigFile } = require('@hubspot/local-dev-lib/config');
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function previewProjectPrompt(themeComponents: any): Promise<any>;
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function selectDeveloperTestTargetAccountPrompt(accounts: any, defaultAccountConfig: any): Promise<any>;
|
|
3
|
-
export function confirmDefaultAccountPrompt(accountName: any, accountType: any): Promise<any>;
|
|
4
|
-
export function confirmUseExistingDeveloperTestAccountPrompt(account: any): Promise<any>;
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function confirmPrompt(message:
|
|
1
|
+
export declare const promptUser: any;
|
|
2
|
+
export declare function confirmPrompt(message: string, options?: {
|
|
3
|
+
defaultAnswer?: boolean;
|
|
4
|
+
when?: boolean | (() => boolean);
|
|
5
|
+
}): Promise<boolean>;
|
|
6
|
+
export declare function listPrompt(message: string, { choices, when, }: {
|
|
7
|
+
choices: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}>;
|
|
11
|
+
when?: boolean | (() => boolean);
|
|
12
|
+
}): Promise<string>;
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promptUser = void 0;
|
|
4
|
+
exports.confirmPrompt = confirmPrompt;
|
|
5
|
+
exports.listPrompt = listPrompt;
|
|
2
6
|
const inquirer = require('inquirer');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
const
|
|
8
|
-
const { choice } = await promptUser([
|
|
7
|
+
// NOTE: we can eventually delete this and directly use inquirer.prompt when the files support imports
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
exports.promptUser = inquirer.createPromptModule();
|
|
10
|
+
async function confirmPrompt(message, options = {}) {
|
|
11
|
+
const { defaultAnswer, when } = options;
|
|
12
|
+
const { choice } = await (0, exports.promptUser)([
|
|
9
13
|
{
|
|
10
14
|
name: 'choice',
|
|
11
15
|
type: 'confirm',
|
|
12
|
-
default: defaultAnswer,
|
|
13
16
|
message,
|
|
17
|
+
default: defaultAnswer || true,
|
|
18
|
+
when,
|
|
14
19
|
},
|
|
15
20
|
]);
|
|
16
21
|
return choice;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
promptUser
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
}
|
|
23
|
+
async function listPrompt(message, { choices, when, }) {
|
|
24
|
+
const { choice } = await (0, exports.promptUser)([
|
|
25
|
+
{
|
|
26
|
+
name: 'choice',
|
|
27
|
+
type: 'list',
|
|
28
|
+
message,
|
|
29
|
+
choices,
|
|
30
|
+
when,
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
return choice;
|
|
34
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function deleteSandboxPrompt(config: any, promptParentAccount?: boolean): Promise<any> | undefined;
|
|
1
|
+
export {};
|