@hubspot/cli 7.5.11-experimental.0 → 7.7.0-experimental.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/bin/cli.js +5 -6
- package/bin/hsmcp.d.ts +2 -0
- package/bin/hsmcp.js +13 -0
- package/commands/account/auth.d.ts +3 -7
- package/commands/account/auth.js +19 -9
- package/commands/account/clean.d.ts +3 -7
- package/commands/account/clean.js +16 -9
- package/commands/account/createOverride.d.ts +3 -7
- package/commands/account/createOverride.js +23 -6
- package/commands/account/info.d.ts +3 -7
- package/commands/account/info.js +13 -5
- package/commands/account/list.d.ts +3 -7
- package/commands/account/list.js +15 -8
- package/commands/account/remove.d.ts +3 -7
- package/commands/account/remove.js +21 -9
- package/commands/account/removeOverride.d.ts +3 -7
- package/commands/account/removeOverride.js +23 -6
- package/commands/account/rename.d.ts +3 -7
- package/commands/account/rename.js +16 -9
- package/commands/account/use.d.ts +5 -9
- package/commands/account/use.js +14 -6
- package/commands/account.d.ts +3 -4
- package/commands/account.js +35 -58
- package/commands/app/migrate.d.ts +1 -2
- package/commands/app/migrate.js +7 -8
- package/commands/app/secret/add.d.ts +7 -0
- package/commands/app/secret/add.js +64 -0
- package/commands/app/secret/delete.d.ts +8 -0
- package/commands/app/secret/delete.js +87 -0
- package/commands/app/secret/list.d.ts +6 -0
- package/commands/app/secret/list.js +64 -0
- package/commands/app/secret/update.d.ts +7 -0
- package/commands/app/secret/update.js +77 -0
- package/commands/app/secret.d.ts +3 -0
- package/commands/app/secret.js +30 -0
- package/commands/app.d.ts +2 -5
- package/commands/app.js +12 -8
- package/commands/auth.d.ts +3 -7
- package/commands/auth.js +12 -5
- package/commands/cms/convertFields.d.ts +7 -1
- package/commands/cms/convertFields.js +57 -41
- package/commands/cms/getReactModule.d.ts +7 -1
- package/commands/cms/getReactModule.js +52 -34
- package/commands/cms/lighthouseScore.d.ts +8 -1
- package/commands/cms/lighthouseScore.js +129 -100
- package/commands/cms.d.ts +3 -1
- package/commands/cms.js +24 -15
- package/commands/completion.d.ts +3 -1
- package/commands/completion.js +25 -12
- package/commands/config/migrate.d.ts +3 -7
- package/commands/config/migrate.js +25 -15
- package/commands/config/set.d.ts +5 -6
- package/commands/config/set.js +38 -14
- package/commands/config.d.ts +3 -4
- package/commands/config.js +20 -44
- package/commands/create/api-sample.d.ts +3 -1
- package/commands/create/api-sample.js +34 -38
- package/commands/create/app.d.ts +3 -1
- package/commands/create/app.js +9 -7
- package/commands/create/function.d.ts +3 -1
- package/commands/create/function.js +11 -10
- package/commands/create/index.d.ts +5 -1
- package/commands/create/index.js +23 -11
- package/commands/create/module.d.ts +3 -1
- package/commands/create/module.js +14 -13
- package/commands/create/react-app.d.ts +3 -1
- package/commands/create/react-app.js +10 -7
- package/commands/create/template.d.ts +3 -1
- package/commands/create/template.js +14 -14
- package/commands/create/vue-app.d.ts +3 -1
- package/commands/create/vue-app.js +10 -7
- package/commands/create/webpack-serverless.d.ts +3 -1
- package/commands/create/webpack-serverless.js +10 -7
- package/commands/create/website-theme.d.ts +3 -1
- package/commands/create/website-theme.js +10 -9
- package/commands/create.d.ts +4 -24
- package/commands/create.js +64 -74
- package/commands/customObject/create.d.ts +4 -9
- package/commands/customObject/create.js +17 -10
- package/commands/customObject/schema/create.d.ts +4 -9
- package/commands/customObject/schema/create.js +18 -11
- package/commands/customObject/schema/delete.d.ts +4 -9
- package/commands/customObject/schema/delete.js +17 -10
- package/commands/customObject/schema/fetch-all.d.ts +4 -9
- package/commands/customObject/schema/fetch-all.js +17 -10
- package/commands/customObject/schema/fetch.d.ts +4 -9
- package/commands/customObject/schema/fetch.js +17 -10
- package/commands/customObject/schema/list.d.ts +4 -8
- package/commands/customObject/schema/list.js +17 -10
- package/commands/customObject/schema/update.d.ts +4 -9
- package/commands/customObject/schema/update.js +18 -11
- package/commands/customObject/schema.d.ts +3 -5
- package/commands/customObject/schema.js +27 -54
- package/commands/customObject.d.ts +3 -4
- package/commands/customObject.js +20 -45
- package/commands/doctor.d.ts +6 -8
- package/commands/doctor.js +32 -21
- package/commands/feedback.d.ts +4 -1
- package/commands/feedback.js +40 -47
- package/commands/fetch.d.ts +12 -1
- package/commands/fetch.js +49 -33
- package/commands/filemanager/fetch.d.ts +4 -9
- package/commands/filemanager/fetch.js +18 -11
- package/commands/filemanager/upload.d.ts +4 -9
- package/commands/filemanager/upload.js +17 -11
- package/commands/filemanager.d.ts +3 -4
- package/commands/filemanager.js +20 -41
- package/commands/function/deploy.d.ts +6 -1
- package/commands/function/deploy.js +70 -50
- package/commands/function/list.d.ts +6 -1
- package/commands/function/list.js +44 -32
- package/commands/function/server.d.ts +10 -1
- package/commands/function/server.js +49 -38
- package/commands/function.d.ts +5 -1
- package/commands/function.js +24 -10
- package/commands/hubdb/clear.d.ts +4 -9
- package/commands/hubdb/clear.js +17 -10
- package/commands/hubdb/create.d.ts +4 -9
- package/commands/hubdb/create.js +17 -10
- package/commands/hubdb/delete.d.ts +4 -9
- package/commands/hubdb/delete.js +17 -10
- package/commands/hubdb/fetch.d.ts +4 -9
- package/commands/hubdb/fetch.js +17 -10
- package/commands/hubdb.d.ts +3 -2
- package/commands/hubdb.js +23 -45
- package/commands/init.d.ts +3 -7
- package/commands/init.js +12 -5
- package/commands/lint.d.ts +6 -4
- package/commands/lint.js +44 -43
- package/commands/list.d.ts +3 -7
- package/commands/list.js +19 -11
- package/commands/logs.d.ts +10 -1
- package/commands/logs.js +53 -44
- package/commands/module/marketplace-validate.d.ts +6 -1
- package/commands/module/marketplace-validate.js +39 -27
- package/commands/module.d.ts +3 -1
- package/commands/module.js +22 -10
- package/commands/mv.d.ts +3 -7
- package/commands/mv.js +19 -11
- package/commands/open.d.ts +3 -7
- package/commands/open.js +19 -11
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +2 -2
- package/commands/project/create.js +3 -3
- package/commands/project/deploy.d.ts +1 -0
- package/commands/project/deploy.js +40 -12
- package/commands/project/dev/index.d.ts +1 -4
- package/commands/project/dev/index.js +48 -16
- package/commands/project/dev/unifiedFlow.d.ts +2 -1
- package/commands/project/dev/unifiedFlow.js +85 -30
- package/commands/project/migrate.d.ts +1 -0
- package/commands/project/profile/add.d.ts +7 -0
- package/commands/project/profile/add.js +209 -0
- package/commands/project/profile/delete.d.ts +6 -0
- package/commands/project/profile/delete.js +123 -0
- package/commands/project/profile.d.ts +3 -0
- package/commands/project/profile.js +25 -0
- package/commands/project/upload.d.ts +1 -0
- package/commands/project/upload.js +38 -8
- package/commands/project/validate.d.ts +4 -0
- package/commands/project/validate.js +53 -0
- package/commands/project.js +4 -0
- package/commands/remove.d.ts +3 -7
- package/commands/remove.js +19 -11
- package/commands/sandbox/create.d.ts +4 -9
- package/commands/sandbox/create.js +18 -11
- package/commands/sandbox/delete.d.ts +4 -9
- package/commands/sandbox/delete.js +18 -11
- package/commands/sandbox.d.ts +3 -4
- package/commands/sandbox.js +20 -43
- package/commands/secret/addSecret.d.ts +4 -9
- package/commands/secret/addSecret.js +17 -10
- package/commands/secret/deleteSecret.d.ts +4 -9
- package/commands/secret/deleteSecret.js +17 -10
- package/commands/secret/listSecret.d.ts +4 -9
- package/commands/secret/listSecret.js +17 -10
- package/commands/secret/updateSecret.d.ts +4 -9
- package/commands/secret/updateSecret.js +17 -10
- package/commands/secret.d.ts +3 -4
- package/commands/secret.js +25 -48
- package/commands/setupMcp.d.ts +8 -0
- package/commands/setupMcp.js +229 -0
- package/commands/theme/generate-selectors.d.ts +3 -7
- package/commands/theme/generate-selectors.js +14 -6
- package/commands/theme/marketplace-validate.d.ts +4 -9
- package/commands/theme/marketplace-validate.js +17 -10
- package/commands/theme/preview.d.ts +4 -9
- package/commands/theme/preview.js +16 -9
- package/commands/theme.d.ts +3 -4
- package/commands/theme.js +23 -46
- package/commands/upload.d.ts +12 -1
- package/commands/upload.js +118 -97
- package/commands/watch.d.ts +14 -1
- package/commands/watch.js +76 -65
- package/lang/en.d.ts +838 -574
- package/lang/en.js +630 -373
- package/lang/en.lyaml +30 -23
- package/lib/accountTypes.js +2 -1
- package/lib/app/migrate.d.ts +23 -0
- package/lib/app/migrate.js +14 -3
- package/lib/app/migrate_legacy.js +7 -7
- package/lib/app/urls.d.ts +16 -0
- package/lib/app/urls.js +16 -0
- package/lib/configMigrate.js +24 -10
- package/lib/configOptions.d.ts +4 -0
- package/lib/configOptions.js +41 -46
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -1
- package/lib/dependencyManagement.d.ts +0 -5
- package/lib/dependencyManagement.js +13 -39
- package/lib/doctor/Doctor.js +2 -1
- package/lib/filesystem.d.ts +1 -1
- package/lib/interpolation.d.ts +2 -3
- package/lib/lang.d.ts +2 -3
- package/lib/middleware/autoUpdateMiddleware.d.ts +1 -0
- package/lib/middleware/autoUpdateMiddleware.js +89 -0
- package/lib/middleware/configMiddleware.js +8 -0
- package/lib/npm.d.ts +9 -0
- package/lib/npm.js +36 -0
- package/lib/projectProfiles.d.ts +6 -0
- package/lib/projectProfiles.js +65 -0
- package/lib/projects/buildAndDeploy.js +17 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +26 -0
- package/lib/projects/localDev/AppDevModeInterface.js +156 -0
- package/lib/projects/localDev/DevServerManagerV2.d.ts +11 -22
- package/lib/projects/localDev/DevServerManagerV2.js +19 -15
- package/lib/projects/localDev/LocalDevLogger.d.ts +30 -0
- package/lib/projects/localDev/LocalDevLogger.js +158 -0
- package/lib/projects/localDev/LocalDevManager.js +12 -5
- package/lib/projects/localDev/LocalDevProcess.d.ts +27 -0
- package/lib/projects/localDev/LocalDevProcess.js +171 -0
- package/lib/projects/localDev/LocalDevState.d.ts +37 -0
- package/lib/projects/localDev/LocalDevState.js +78 -0
- package/lib/projects/localDev/LocalDevWatcher.d.ts +10 -0
- package/lib/projects/localDev/LocalDevWatcher.js +56 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +17 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +92 -0
- package/lib/projects/localDev/helpers.d.ts +3 -2
- package/lib/projects/localDev/helpers.js +32 -2
- package/lib/projects/upload.d.ts +2 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/createApiSamplePrompt.d.ts +2 -10
- package/lib/prompts/createTemplatePrompt.d.ts +22 -4
- package/lib/prompts/installAppPrompt.d.ts +1 -0
- package/lib/prompts/installAppPrompt.js +35 -0
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +6 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +6 -6
- package/lib/prompts/promptUtils.d.ts +2 -1
- package/lib/prompts/promptUtils.js +2 -1
- package/lib/prompts/selectAppPrompt.d.ts +2 -0
- package/lib/prompts/selectAppPrompt.js +40 -0
- package/lib/prompts/{selectPublicAppPrompt.d.ts → selectPublicAppForMigrationPrompt.d.ts} +1 -1
- package/lib/prompts/{selectPublicAppPrompt.js → selectPublicAppForMigrationPrompt.js} +8 -8
- package/lib/testUtils.d.ts +3 -3
- package/lib/testUtils.js +8 -9
- package/lib/ui/index.js +4 -1
- package/lib/upload.d.ts +1 -1
- package/lib/validation.js +4 -5
- package/lib/yargsUtils.d.ts +4 -0
- package/lib/yargsUtils.js +6 -0
- package/mcp-server/index.d.ts +1 -0
- package/mcp-server/index.js +17 -0
- package/mcp-server/mcpLoader.d.ts +5 -0
- package/mcp-server/mcpLoader.js +24 -0
- package/mcp-server/tools/ExplainProjectStructureTool.d.ts +33 -0
- package/mcp-server/tools/ExplainProjectStructureTool.js +266 -0
- package/mcp-server/tools/GenerateAppComponentTool.d.ts +99 -0
- package/mcp-server/tools/GenerateAppComponentTool.js +193 -0
- package/mcp-server/tools/GenerateCardComponentTool.d.ts +74 -0
- package/mcp-server/tools/GenerateCardComponentTool.js +146 -0
- package/mcp-server/tools/GenerateProjectConfigTool.d.ts +32 -0
- package/mcp-server/tools/GenerateProjectConfigTool.js +40 -0
- package/mcp-server/tools/HubSpotCLIHelper.d.ts +16 -0
- package/mcp-server/tools/HubSpotCLIHelper.js +74 -0
- package/mcp-server/tools/UploadProjectTool.d.ts +44 -0
- package/mcp-server/tools/UploadProjectTool.js +149 -0
- package/mcp-server/tools/ValidateProjectTool.d.ts +62 -0
- package/mcp-server/tools/ValidateProjectTool.js +315 -0
- package/package.json +13 -6
- package/types/Cms.d.ts +30 -0
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +24 -0
- package/types/LocalDev.js +2 -0
- package/types/Prompts.d.ts +0 -7
- package/types/Yargs.d.ts +8 -1
- package/lib/projects/localDev/LocalDevManagerV2.d.ts +0 -64
- package/lib/projects/localDev/LocalDevManagerV2.js +0 -345
- package/lib/prompts/installPublicAppPrompt.d.ts +0 -1
- package/lib/prompts/installPublicAppPrompt.js +0 -41
package/lang/en.lyaml
CHANGED
|
@@ -22,6 +22,7 @@ en:
|
|
|
22
22
|
subcommands:
|
|
23
23
|
auth:
|
|
24
24
|
describe: "Configure authentication for your HubSpot account."
|
|
25
|
+
verboseDescribe: "Configure authentication for a HubSpot account. This will create or update the global config file at {{ globalConfigPath }} that stores your account information.\n\nThe recommended authentication method is {{#bold}}{{ authMethod }}{{/bold}}, which uses an access token tied to a specific user account.\nIf a deprecated config file exists, you will be prompted to migrate it to the new global config file. If both deprecated and global config files exist, you will be prompted to merge them. If any conflicts exist between the two files, you will be prompted to reconcile them."
|
|
25
26
|
options:
|
|
26
27
|
account:
|
|
27
28
|
describe: "HubSpot account to authenticate"
|
|
@@ -39,6 +40,7 @@ en:
|
|
|
39
40
|
prompts:
|
|
40
41
|
replaceOverrideFile: "Replace existing account override file?"
|
|
41
42
|
errors:
|
|
43
|
+
globalConfigNotFound: "This command is only compatible with our new global config. Run {{ authCommand }} to get started."
|
|
42
44
|
accountNotFound: "The specified account could not be found in the config file {{ configPath }}"
|
|
43
45
|
options:
|
|
44
46
|
account:
|
|
@@ -54,6 +56,8 @@ en:
|
|
|
54
56
|
deleteOverrideFile: "Delete account override file?"
|
|
55
57
|
success: "Removed the default account override file."
|
|
56
58
|
noOverrideFile: "No default account override file found in the current working directory. No action required."
|
|
59
|
+
errors:
|
|
60
|
+
globalConfigNotFound: "This command is only compatible with our new global config. Run {{ authCommand }} to get started."
|
|
57
61
|
options:
|
|
58
62
|
force:
|
|
59
63
|
describe: "Skip confirmation prompt when removing the override file"
|
|
@@ -165,6 +169,7 @@ en:
|
|
|
165
169
|
subcommands:
|
|
166
170
|
migrate:
|
|
167
171
|
describe: "Migrate from the deprecated {{ deprecatedConfigPath }} file to the new global config file at {{ globalConfigPath }}."
|
|
172
|
+
verboseDescribe: "This command will create a new global configuration file in your root directory and rename the deprecated config to {{ archivedConfigPath }}. If any conflicting values are detected, we will prompt you to reconcile them unless the \"--force\" flag is supplied."
|
|
168
173
|
migrationAlreadyCompleted: "No {{ deprecatedConfigPath }} deprecated configuration file found. No migration necessary."
|
|
169
174
|
errors:
|
|
170
175
|
configNotFound: "A configuration file at {{ configPath }} could not be found. Please try again with a valid file path."
|
|
@@ -588,15 +593,21 @@ en:
|
|
|
588
593
|
betaMessage: "HubSpot projects local development"
|
|
589
594
|
placeholderAccountSelection: "Using default account as target account (for now)"
|
|
590
595
|
learnMoreLocalDevServer: "Learn more about the projects local dev server"
|
|
596
|
+
accountTypeInformation: "Testing in a developer test account is strongly recommended, but you can use a sandbox account if your plan allows you to create one."
|
|
597
|
+
learnMoreMessage: "Visit our {{ learnMoreLink }} to learn more."
|
|
598
|
+
learnMoreLink: "docs on Developer Test and Sandbox accounts "
|
|
591
599
|
errors:
|
|
592
600
|
noProjectConfig: "No project detected. Please run this command again from a project directory."
|
|
593
601
|
noAccount: "An error occurred while reading account {{ accountId }} from your config. Run {{ authCommand }} to re-auth this account."
|
|
594
602
|
noAccountsInConfig: "No accounts found in your config. Run {{ authCommand }} to configure a HubSpot account with the CLI."
|
|
595
603
|
invalidProjectComponents: "Projects cannot contain both private and public apps. Move your apps to separate projects before attempting local development."
|
|
596
604
|
noRunnableComponents: "No supported components were found in this project. Run {{ command }} to see a list of available components and add one to your project."
|
|
597
|
-
|
|
605
|
+
accountNotCombined: "Local development of Unified Apps is currently only compatible with accounts that are opted into the unified apps beta. Make sure that this account is opted in or switch accounts using {{ accountUseCommand }}."
|
|
598
606
|
examples:
|
|
599
607
|
default: "Start local dev for the current project"
|
|
608
|
+
options:
|
|
609
|
+
profile:
|
|
610
|
+
describe: "The profile to target during local dev"
|
|
600
611
|
create:
|
|
601
612
|
describe: "Create a new project."
|
|
602
613
|
errors:
|
|
@@ -715,6 +726,8 @@ en:
|
|
|
715
726
|
describe: "Project build ID to be deployed"
|
|
716
727
|
project:
|
|
717
728
|
describe: "Project name"
|
|
729
|
+
profile:
|
|
730
|
+
describe: "The profile to target with this deploy"
|
|
718
731
|
listBuilds:
|
|
719
732
|
describe: "List the project's builds."
|
|
720
733
|
continueOrExitPrompt: "Press <enter> to load more, or ctrl+c to exit"
|
|
@@ -782,6 +795,8 @@ en:
|
|
|
782
795
|
describe: "Automatically create project if it does not exist"
|
|
783
796
|
message:
|
|
784
797
|
describe: "Add a message when you upload your project and create a build"
|
|
798
|
+
profile:
|
|
799
|
+
describe: "The profile to target with this upload"
|
|
785
800
|
watch:
|
|
786
801
|
describe: "Watch your local project for changes and automatically upload changed files to a new build in HubSpot."
|
|
787
802
|
examples:
|
|
@@ -841,18 +856,10 @@ en:
|
|
|
841
856
|
default: "Opens the projects page for the specified account"
|
|
842
857
|
success: "Successfully opened \"{{ projectName }}\""
|
|
843
858
|
feedback:
|
|
844
|
-
describe: "Leave feedback
|
|
845
|
-
|
|
846
|
-
prompt: "What type of feedback would you like to leave?"
|
|
847
|
-
bug: "[--bug] Report a bug"
|
|
848
|
-
general: "[--general] Tell us about your experience with HubSpot's developer tools"
|
|
849
|
-
openPrompt: "Create a Github issue in your browser?"
|
|
859
|
+
describe: "Leave feedback or file a bug report."
|
|
860
|
+
openPrompt: "Open the feedback form in your browser?"
|
|
850
861
|
success: "We opened {{ url }} in your browser."
|
|
851
|
-
|
|
852
|
-
bug:
|
|
853
|
-
describe: "Open Github issues in your browser to report a bug."
|
|
854
|
-
general:
|
|
855
|
-
describe: "Open Github issues in your browser to give feedback."
|
|
862
|
+
error: "Navigate to {{ url }} to leave feedback."
|
|
856
863
|
installDeps:
|
|
857
864
|
help:
|
|
858
865
|
describe: "Install the dependencies for your project, or add a dependency to a subcomponent of a project."
|
|
@@ -1329,9 +1336,15 @@ en:
|
|
|
1329
1336
|
debug:
|
|
1330
1337
|
describe: "Set log level to debug"
|
|
1331
1338
|
configMigrate:
|
|
1332
|
-
|
|
1339
|
+
migrationHeader: "Migrate your existing configuration file to the new global location?"
|
|
1340
|
+
migrationDescription: "This action will create a new global configuration file in your root directory and rename the deprecated config to {{ archivedConfigPath}}. If any conflicting values are detected, we will prompt you to reconcile them unless the \"--force\" flag is supplied."
|
|
1341
|
+
mergeHeader: "Merge your existing configuration file with the global config?"
|
|
1342
|
+
mergeDescription: "This action will merge your deprecated config file with the global config file located in your root directory. It will also rename the deprecated config to {{ archivedConfigPath }}. If any conflicting values are detected, we will prompt you to reconcile them unless the \"--force\" flag is supplied."
|
|
1343
|
+
migrateConfigPromptDescription: "From deprecated config file: {{ deprecatedConfigPath }}\nTo new global config file: {{ globalConfigPath }}"
|
|
1344
|
+
migrateConfigPrompt: "Migrate to the new config?"
|
|
1333
1345
|
mergeConfigConflictPrompt: "Change the {{ property }} property in the global config from {{ newValue }} to {{ oldValue }}?"
|
|
1334
|
-
|
|
1346
|
+
mergeConfigsPromptDescription: "Two config files detected. \nDeprecated config file: {{ deprecatedConfigPath }}\nGlobal config: {{ globalConfigPath }}"
|
|
1347
|
+
mergeConfigsPrompt: "Merge configs?"
|
|
1335
1348
|
migrationSuccess: "The deprecated config file has been migrated to the new global config file at {{ globalConfigPath }}."
|
|
1336
1349
|
mergeSuccess: "The deprecated config file has been merged with the global config file at {{ globalConfigPath }}."
|
|
1337
1350
|
skippedExistingAccounts: "\nThe following accounts were not merged, because they already exist in the global config: {{ skippedAccountIds }}.\n"
|
|
@@ -1423,7 +1436,7 @@ en:
|
|
|
1423
1436
|
invalidCharacters: "The selected destination contains invalid characters. Please provide a new path and try again."
|
|
1424
1437
|
invalidTemplate: "[--template] Could not find template \"{{ template }}\". Please choose an available template:"
|
|
1425
1438
|
projectTemplateRequired: "Project template is required when projectTemplates is provided"
|
|
1426
|
-
|
|
1439
|
+
selectPublicAppForMigrationPrompt:
|
|
1427
1440
|
selectAppIdMigrate: "[--appId] Choose an app under {{ accountName }} to migrate:"
|
|
1428
1441
|
selectAppIdClone: "[--appId] Choose an app under {{ accountName }} to clone:"
|
|
1429
1442
|
errors:
|
|
@@ -1446,8 +1459,8 @@ en:
|
|
|
1446
1459
|
nameRequired: "A component name is required"
|
|
1447
1460
|
invalidType: "[--type] Could not find type \"{{ type }}\". Please choose an available type:"
|
|
1448
1461
|
secretPrompt:
|
|
1449
|
-
enterValue: "Enter a value for
|
|
1450
|
-
enterName: "Enter
|
|
1462
|
+
enterValue: "Enter a value for the secret: "
|
|
1463
|
+
enterName: "Enter the name of the secret to add: "
|
|
1451
1464
|
selectSecretUpdate: "Select the secret you want to update"
|
|
1452
1465
|
selectSecretDelete: "Select the secret you want to delete"
|
|
1453
1466
|
errors:
|
|
@@ -1478,12 +1491,6 @@ en:
|
|
|
1478
1491
|
errors:
|
|
1479
1492
|
srcRequired: "You must specify a source directory."
|
|
1480
1493
|
destRequired: "You must specify a destination directory."
|
|
1481
|
-
installPublicAppPrompt:
|
|
1482
|
-
explanation: "Local development requires this app to be installed in the target test account"
|
|
1483
|
-
reinstallExplanation: "This app's required scopes have been updated since it was last installed on the target test account. To avoid issues with local development, we recommend reinstalling the app with the updated scopes."
|
|
1484
|
-
prompt: "Open HubSpot to install this app?"
|
|
1485
|
-
reinstallPrompt: "Open HubSpot to reinstall this app?"
|
|
1486
|
-
decline: "To continue local development of this app, install it in your target test account and re-run {{#bold}}`hs project dev`{{/bold}}"
|
|
1487
1494
|
selectHubDBTablePrompt:
|
|
1488
1495
|
selectTable: "Select a HubDB table:"
|
|
1489
1496
|
enterDest: "Enter the destination path:"
|
package/lib/accountTypes.js
CHANGED
|
@@ -40,5 +40,6 @@ async function isUnifiedAccount(account) {
|
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
42
|
const isUngatedForUnifiedApps = await (0, hasFeature_1.hasFeature)(accountId, constants_1.FEATURES.UNIFIED_APPS);
|
|
43
|
-
return isStandardAccount(account) &&
|
|
43
|
+
return ((isStandardAccount(account) || isAppDeveloperAccount(account)) &&
|
|
44
|
+
isUngatedForUnifiedApps);
|
|
44
45
|
}
|
package/lib/app/migrate.d.ts
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
import { ArgumentsCamelCase } from 'yargs';
|
|
2
2
|
import { LoadedProjectConfig } from '../projects/config';
|
|
3
|
+
import { MigrationApp, MigrationFailed, MigrationStatus } from '../../api/migrate';
|
|
3
4
|
import { AccountArgs, CommonArgs, ConfigArgs, EnvironmentArgs } from '../../types/Yargs';
|
|
4
5
|
export type MigrateAppArgs = CommonArgs & AccountArgs & EnvironmentArgs & ConfigArgs & {
|
|
5
6
|
name?: string;
|
|
6
7
|
dest?: string;
|
|
7
8
|
appId?: number;
|
|
8
9
|
platformVersion: string;
|
|
10
|
+
unstable: boolean;
|
|
9
11
|
};
|
|
12
|
+
export declare function getUnmigratableReason(reasonCode: string, projectName: string | undefined, accountId: number): string;
|
|
13
|
+
export declare function generateFilterAppsByProjectNameFunction(projectConfig?: LoadedProjectConfig): (app: MigrationApp) => boolean;
|
|
14
|
+
export declare function buildErrorMessageFromMigrationStatus(error: MigrationFailed): string;
|
|
15
|
+
export declare function fetchMigrationApps(appId: MigrateAppArgs['appId'], derivedAccountId: number, platformVersion: string, projectConfig?: LoadedProjectConfig): Promise<MigrationApp[]>;
|
|
16
|
+
export declare function promptForAppToMigrate(allApps: MigrationApp[], derivedAccountId: number): Promise<number>;
|
|
17
|
+
export declare function selectAppToMigrate(allApps: MigrationApp[], derivedAccountId: number, appId?: number): Promise<{
|
|
18
|
+
proceed: boolean;
|
|
19
|
+
appIdToMigrate?: number;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function handleMigrationSetup(derivedAccountId: number, options: ArgumentsCamelCase<MigrateAppArgs>, projectConfig?: LoadedProjectConfig): Promise<{
|
|
22
|
+
appIdToMigrate?: number | undefined;
|
|
23
|
+
projectName?: string;
|
|
24
|
+
projectDest?: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function beginMigration(derivedAccountId: number, appId: number, platformVersion: string): Promise<{
|
|
27
|
+
migrationId: number;
|
|
28
|
+
uidMap: Record<string, string>;
|
|
29
|
+
} | undefined>;
|
|
30
|
+
export declare function pollMigrationStatus(derivedAccountId: number, migrationId: number, successStates?: string[]): Promise<MigrationStatus>;
|
|
31
|
+
export declare function finalizeMigration(derivedAccountId: number, migrationId: number, uidMap: Record<string, string>, projectName: string): Promise<number>;
|
|
32
|
+
export declare function downloadProjectFiles(derivedAccountId: number, projectName: string, buildId: number, projectDest: string, projectConfig?: LoadedProjectConfig): Promise<void>;
|
|
10
33
|
export declare function migrateApp2025_2(derivedAccountId: number, options: ArgumentsCamelCase<MigrateAppArgs>, projectConfig?: LoadedProjectConfig): Promise<void>;
|
|
11
34
|
export declare function logInvalidAccountError(): void;
|
package/lib/app/migrate.js
CHANGED
|
@@ -3,6 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getUnmigratableReason = getUnmigratableReason;
|
|
7
|
+
exports.generateFilterAppsByProjectNameFunction = generateFilterAppsByProjectNameFunction;
|
|
8
|
+
exports.buildErrorMessageFromMigrationStatus = buildErrorMessageFromMigrationStatus;
|
|
9
|
+
exports.fetchMigrationApps = fetchMigrationApps;
|
|
10
|
+
exports.promptForAppToMigrate = promptForAppToMigrate;
|
|
11
|
+
exports.selectAppToMigrate = selectAppToMigrate;
|
|
12
|
+
exports.handleMigrationSetup = handleMigrationSetup;
|
|
13
|
+
exports.beginMigration = beginMigration;
|
|
14
|
+
exports.pollMigrationStatus = pollMigrationStatus;
|
|
15
|
+
exports.finalizeMigration = finalizeMigration;
|
|
16
|
+
exports.downloadProjectFiles = downloadProjectFiles;
|
|
6
17
|
exports.migrateApp2025_2 = migrateApp2025_2;
|
|
7
18
|
exports.logInvalidAccountError = logInvalidAccountError;
|
|
8
19
|
const path_1 = __importDefault(require("path"));
|
|
@@ -43,7 +54,7 @@ function getUnmigratableReason(reasonCode, projectName, accountId) {
|
|
|
43
54
|
return en_1.lib.migrate.errors.unmigratableReasons.generic(reasonCode);
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
function
|
|
57
|
+
function generateFilterAppsByProjectNameFunction(projectConfig) {
|
|
47
58
|
return (app) => {
|
|
48
59
|
if (projectConfig) {
|
|
49
60
|
return app.projectName === projectConfig?.projectConfig?.name;
|
|
@@ -65,8 +76,8 @@ function buildErrorMessageFromMigrationStatus(error) {
|
|
|
65
76
|
}
|
|
66
77
|
async function fetchMigrationApps(appId, derivedAccountId, platformVersion, projectConfig) {
|
|
67
78
|
const { data: { migratableApps, unmigratableApps }, } = await (0, migrate_1.listAppsForMigration)(derivedAccountId, platformVersion);
|
|
68
|
-
const filteredMigratableApps = migratableApps.filter(
|
|
69
|
-
const filteredUnmigratableApps = unmigratableApps.filter(
|
|
79
|
+
const filteredMigratableApps = migratableApps.filter(generateFilterAppsByProjectNameFunction(projectConfig));
|
|
80
|
+
const filteredUnmigratableApps = unmigratableApps.filter(generateFilterAppsByProjectNameFunction(projectConfig));
|
|
70
81
|
const allApps = [...filteredMigratableApps, ...filteredUnmigratableApps];
|
|
71
82
|
if (allApps.length > 1 && projectConfig) {
|
|
72
83
|
throw new Error(en_1.lib.migrate.errors.project.multipleApps);
|
|
@@ -17,7 +17,7 @@ const exitCodes_1 = require("../enums/exitCodes");
|
|
|
17
17
|
const ui_1 = require("../ui");
|
|
18
18
|
const lang_1 = require("../lang");
|
|
19
19
|
const accountTypes_1 = require("../accountTypes");
|
|
20
|
-
const
|
|
20
|
+
const selectPublicAppForMigrationPrompt_1 = require("../prompts/selectPublicAppForMigrationPrompt");
|
|
21
21
|
const createProjectPrompt_1 = require("../prompts/createProjectPrompt");
|
|
22
22
|
const ensureProjectExists_1 = require("../projects/ensureProjectExists");
|
|
23
23
|
const usageTracking_1 = require("../usageTracking");
|
|
@@ -30,11 +30,11 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
|
|
|
30
30
|
const defaultAccountIsUnified = await (0, accountTypes_1.isUnifiedAccount)(accountConfig);
|
|
31
31
|
if (!(0, accountTypes_1.isAppDeveloperAccount)(accountConfig) && !defaultAccountIsUnified) {
|
|
32
32
|
(0, migrate_1.logInvalidAccountError)();
|
|
33
|
-
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
33
|
+
return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
34
34
|
}
|
|
35
35
|
let appId = options.appId;
|
|
36
36
|
if (!appId) {
|
|
37
|
-
const { appId: selectAppId } = await (0,
|
|
37
|
+
const { appId: selectAppId } = await (0, selectPublicAppForMigrationPrompt_1.selectPublicAppForMigrationPrompt)({
|
|
38
38
|
accountId: derivedAccountId,
|
|
39
39
|
accountName,
|
|
40
40
|
isMigratingApp: true,
|
|
@@ -51,12 +51,12 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
|
|
|
51
51
|
logger_1.logger.error((0, lang_1.i18n)(`commands.project.subcommands.migrateApp.errors.invalidApp`, {
|
|
52
52
|
appId,
|
|
53
53
|
}));
|
|
54
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
54
|
+
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
catch (error) {
|
|
58
58
|
(0, errorHandlers_1.logError)(error, new errorHandlers_1.ApiErrorContext({ accountId: derivedAccountId }));
|
|
59
|
-
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
59
|
+
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
60
60
|
}
|
|
61
61
|
const createProjectPromptResponse = await (0, createProjectPrompt_1.createProjectPrompt)(options);
|
|
62
62
|
const { name: projectName, dest: projectDest } = createProjectPromptResponse;
|
|
@@ -86,7 +86,7 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
|
|
|
86
86
|
});
|
|
87
87
|
process.stdin.resume();
|
|
88
88
|
if (!shouldCreateApp) {
|
|
89
|
-
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
89
|
+
return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
90
90
|
}
|
|
91
91
|
try {
|
|
92
92
|
SpinniesManager_1.default.init();
|
|
@@ -97,7 +97,7 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
|
|
|
97
97
|
if ((key.ctrl && key.name === 'c') || key.name === 'q') {
|
|
98
98
|
SpinniesManager_1.default.remove('migrateApp');
|
|
99
99
|
logger_1.logger.log((0, lang_1.i18n)(`commands.project.subcommands.migrateApp.migrationInterrupted`));
|
|
100
|
-
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
100
|
+
return process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
const { data: migrateResponse } = await (0, projects_1.migrateApp)(derivedAccountId, appId, projectName);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Environment } from '@hubspot/local-dev-lib/types/Config';
|
|
2
|
+
type PrivateAppInstallUrlArgs = {
|
|
3
|
+
targetAccountId: number;
|
|
4
|
+
env: Environment;
|
|
5
|
+
appId: string;
|
|
6
|
+
};
|
|
7
|
+
type PublicAppInstallUrlArgs = {
|
|
8
|
+
targetAccountId: number;
|
|
9
|
+
env: Environment;
|
|
10
|
+
clientId: string;
|
|
11
|
+
scopes: string[];
|
|
12
|
+
redirectUrls: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function getOauthAppInstallUrl({ targetAccountId, env, clientId, scopes, redirectUrls, }: PublicAppInstallUrlArgs): string;
|
|
15
|
+
export declare function getStaticAuthAppInstallUrl({ targetAccountId, env, appId, }: PrivateAppInstallUrlArgs): string;
|
|
16
|
+
export {};
|
package/lib/app/urls.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOauthAppInstallUrl = getOauthAppInstallUrl;
|
|
4
|
+
exports.getStaticAuthAppInstallUrl = getStaticAuthAppInstallUrl;
|
|
5
|
+
const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
6
|
+
function getOauthAppInstallUrl({ targetAccountId, env, clientId, scopes, redirectUrls, }) {
|
|
7
|
+
const websiteOrigin = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
8
|
+
return (`${websiteOrigin}/oauth/${targetAccountId}/authorize` +
|
|
9
|
+
`?client_id=${encodeURIComponent(clientId)}` +
|
|
10
|
+
`&scope=${encodeURIComponent(scopes.join(' '))}` +
|
|
11
|
+
`&redirect_uri=${encodeURIComponent(redirectUrls[0])}`);
|
|
12
|
+
}
|
|
13
|
+
function getStaticAuthAppInstallUrl({ targetAccountId, env, appId, }) {
|
|
14
|
+
const websiteOrigin = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
15
|
+
return `${websiteOrigin}/static-token/${targetAccountId}/authorize?appId=${appId}`;
|
|
16
|
+
}
|
package/lib/configMigrate.js
CHANGED
|
@@ -9,14 +9,21 @@ const promptUtils_1 = require("./prompts/promptUtils");
|
|
|
9
9
|
const lang_1 = require("./lang");
|
|
10
10
|
const usageTracking_1 = require("./usageTracking");
|
|
11
11
|
async function handleMigration(accountId, configPath) {
|
|
12
|
+
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.migrationHeader'));
|
|
13
|
+
logger_1.logger.log('');
|
|
14
|
+
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.migrationDescription', {
|
|
15
|
+
archivedConfigPath: config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
16
|
+
}));
|
|
17
|
+
logger_1.logger.log('');
|
|
18
|
+
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.migrateConfigPromptDescription', {
|
|
19
|
+
deprecatedConfigPath: (0, migrate_1.getConfigPath)(configPath, false) ||
|
|
20
|
+
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
21
|
+
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
22
|
+
}));
|
|
12
23
|
const { shouldMigrateConfig } = await (0, promptUtils_1.promptUser)({
|
|
13
24
|
name: 'shouldMigrateConfig',
|
|
14
25
|
type: 'confirm',
|
|
15
|
-
message: (0, lang_1.i18n)('lib.configMigrate.migrateConfigPrompt',
|
|
16
|
-
deprecatedConfigPath: (0, migrate_1.getConfigPath)(configPath, false) ||
|
|
17
|
-
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
18
|
-
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
19
|
-
}),
|
|
26
|
+
message: (0, lang_1.i18n)('lib.configMigrate.migrateConfigPrompt'),
|
|
20
27
|
});
|
|
21
28
|
if (!shouldMigrateConfig) {
|
|
22
29
|
(0, usageTracking_1.trackCommandMetadataUsage)('config-migrate', {
|
|
@@ -62,14 +69,21 @@ async function mergeConfigProperties(globalConfig, deprecatedConfig, force) {
|
|
|
62
69
|
return initialConfig;
|
|
63
70
|
}
|
|
64
71
|
async function handleMerge(accountId, configPath, force) {
|
|
72
|
+
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.mergeHeader'));
|
|
73
|
+
logger_1.logger.log('');
|
|
74
|
+
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.mergeDescription', {
|
|
75
|
+
archivedConfigPath: config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
76
|
+
}));
|
|
77
|
+
logger_1.logger.log('');
|
|
78
|
+
logger_1.logger.log((0, lang_1.i18n)('lib.configMigrate.mergeConfigsPromptDescription', {
|
|
79
|
+
deprecatedConfigPath: (0, migrate_1.getConfigPath)(configPath, false) ||
|
|
80
|
+
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
81
|
+
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
82
|
+
}));
|
|
65
83
|
const { shouldMergeConfigs } = await (0, promptUtils_1.promptUser)({
|
|
66
84
|
name: 'shouldMergeConfigs',
|
|
67
85
|
type: 'confirm',
|
|
68
|
-
message: (0, lang_1.i18n)('lib.configMigrate.mergeConfigsPrompt',
|
|
69
|
-
deprecatedConfigPath: (0, migrate_1.getConfigPath)(configPath, false) ||
|
|
70
|
-
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
71
|
-
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
72
|
-
}),
|
|
86
|
+
message: (0, lang_1.i18n)('lib.configMigrate.mergeConfigsPrompt'),
|
|
73
87
|
});
|
|
74
88
|
if (!shouldMergeConfigs) {
|
|
75
89
|
(0, usageTracking_1.trackCommandMetadataUsage)('config-migrate', {
|
package/lib/configOptions.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export declare function setAllowUsageTracking({ accountId, allowUsageTracking, }
|
|
|
3
3
|
accountId: number;
|
|
4
4
|
allowUsageTracking?: boolean;
|
|
5
5
|
}): Promise<void>;
|
|
6
|
+
export declare function setAllowAutoUpdates({ accountId, allowAutoUpdates, }: {
|
|
7
|
+
accountId: number;
|
|
8
|
+
allowAutoUpdates?: boolean;
|
|
9
|
+
}): Promise<void>;
|
|
6
10
|
export declare function setDefaultCmsPublishMode({ accountId, defaultCmsPublishMode, }: {
|
|
7
11
|
accountId: number;
|
|
8
12
|
defaultCmsPublishMode?: CmsPublishMode;
|
package/lib/configOptions.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setAllowUsageTracking = setAllowUsageTracking;
|
|
4
|
+
exports.setAllowAutoUpdates = setAllowAutoUpdates;
|
|
4
5
|
exports.setDefaultCmsPublishMode = setDefaultCmsPublishMode;
|
|
5
6
|
exports.setHttpTimeout = setHttpTimeout;
|
|
6
|
-
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
7
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
8
|
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
9
9
|
const text_1 = require("@hubspot/local-dev-lib/text");
|
|
10
10
|
const usageTracking_1 = require("./usageTracking");
|
|
11
11
|
const promptUtils_1 = require("./prompts/promptUtils");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
default: true,
|
|
31
|
-
},
|
|
32
|
-
]);
|
|
12
|
+
const en_1 = require("../lang/en");
|
|
13
|
+
const logger_1 = require("./ui/logger");
|
|
14
|
+
async function enableOrDisableBooleanFieldPrompt(fieldName) {
|
|
15
|
+
const isEnabled = await (0, promptUtils_1.listPrompt)(en_1.lib.configOptions.enableOrDisableBooleanFieldPrompt.message(fieldName), {
|
|
16
|
+
choices: [
|
|
17
|
+
{
|
|
18
|
+
name: en_1.lib.configOptions.enableOrDisableBooleanFieldPrompt.labels
|
|
19
|
+
.enabled,
|
|
20
|
+
value: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: en_1.lib.configOptions.enableOrDisableBooleanFieldPrompt.labels
|
|
24
|
+
.disabled,
|
|
25
|
+
value: false,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
defaultAnswer: true,
|
|
29
|
+
});
|
|
33
30
|
return isEnabled;
|
|
34
31
|
}
|
|
35
32
|
async function setAllowUsageTracking({ accountId, allowUsageTracking, }) {
|
|
@@ -39,25 +36,29 @@ async function setAllowUsageTracking({ accountId, allowUsageTracking, }) {
|
|
|
39
36
|
isEnabled = allowUsageTracking;
|
|
40
37
|
}
|
|
41
38
|
else {
|
|
42
|
-
isEnabled = await
|
|
39
|
+
isEnabled = await enableOrDisableBooleanFieldPrompt(en_1.lib.configOptions.setAllowUsageTracking.fieldName);
|
|
43
40
|
}
|
|
44
41
|
(0, config_1.updateAllowUsageTracking)(isEnabled);
|
|
45
|
-
logger_1.
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setAllowUsageTracking.success(isEnabled.toString()));
|
|
43
|
+
}
|
|
44
|
+
async function setAllowAutoUpdates({ accountId, allowAutoUpdates, }) {
|
|
45
|
+
(0, usageTracking_1.trackCommandUsage)('config-set-allow-auto-updates', undefined, accountId);
|
|
46
|
+
let isEnabled;
|
|
47
|
+
if (typeof allowAutoUpdates === 'boolean') {
|
|
48
|
+
isEnabled = allowAutoUpdates;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
isEnabled = await enableOrDisableBooleanFieldPrompt(en_1.lib.configOptions.setAllowAutoUpdates.fieldName);
|
|
52
|
+
}
|
|
53
|
+
(0, config_1.updateAllowAutoUpdates)(isEnabled);
|
|
54
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setAllowAutoUpdates.success(isEnabled.toString()));
|
|
48
55
|
}
|
|
49
56
|
const ALL_CMS_PUBLISH_MODES = Object.values(files_1.CMS_PUBLISH_MODE);
|
|
50
57
|
async function selectCmsPublishMode() {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
pageSize: 20,
|
|
56
|
-
message: (0, lang_1.i18n)(`commands.config.subcommands.set.options.defaultMode.promptMessage`),
|
|
57
|
-
choices: ALL_CMS_PUBLISH_MODES,
|
|
58
|
-
default: files_1.CMS_PUBLISH_MODE.publish,
|
|
59
|
-
},
|
|
60
|
-
]);
|
|
58
|
+
const cmsPublishMode = await (0, promptUtils_1.listPrompt)(en_1.lib.configOptions.setDefaultCmsPublishMode.promptMessage, {
|
|
59
|
+
choices: ALL_CMS_PUBLISH_MODES,
|
|
60
|
+
defaultAnswer: files_1.CMS_PUBLISH_MODE.publish,
|
|
61
|
+
});
|
|
61
62
|
return cmsPublishMode;
|
|
62
63
|
}
|
|
63
64
|
async function setDefaultCmsPublishMode({ accountId, defaultCmsPublishMode, }) {
|
|
@@ -71,21 +72,17 @@ async function setDefaultCmsPublishMode({ accountId, defaultCmsPublishMode, }) {
|
|
|
71
72
|
newDefault = defaultCmsPublishMode;
|
|
72
73
|
}
|
|
73
74
|
else {
|
|
74
|
-
logger_1.
|
|
75
|
-
validModes: (0, text_1.commaSeparatedValues)(ALL_CMS_PUBLISH_MODES),
|
|
76
|
-
}));
|
|
75
|
+
logger_1.uiLogger.error(en_1.lib.configOptions.setDefaultCmsPublishMode.error((0, text_1.commaSeparatedValues)(ALL_CMS_PUBLISH_MODES)));
|
|
77
76
|
newDefault = await selectCmsPublishMode();
|
|
78
77
|
}
|
|
79
78
|
(0, config_1.updateDefaultCmsPublishMode)(newDefault);
|
|
80
|
-
logger_1.
|
|
81
|
-
mode: newDefault,
|
|
82
|
-
}));
|
|
79
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setDefaultCmsPublishMode.success(newDefault));
|
|
83
80
|
}
|
|
84
81
|
async function enterTimeout() {
|
|
85
82
|
const { timeout } = await (0, promptUtils_1.promptUser)([
|
|
86
83
|
{
|
|
87
84
|
name: 'timeout',
|
|
88
|
-
message:
|
|
85
|
+
message: en_1.lib.configOptions.setHttpTimeout.promptMessage,
|
|
89
86
|
type: 'input',
|
|
90
87
|
default: 30000,
|
|
91
88
|
},
|
|
@@ -102,7 +99,5 @@ async function setHttpTimeout({ accountId, httpTimeout, }) {
|
|
|
102
99
|
newHttpTimeout = httpTimeout;
|
|
103
100
|
}
|
|
104
101
|
(0, config_1.updateHttpTimeout)(newHttpTimeout);
|
|
105
|
-
logger_1.
|
|
106
|
-
timeout: newHttpTimeout,
|
|
107
|
-
}));
|
|
102
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setHttpTimeout.success(newHttpTimeout));
|
|
108
103
|
}
|
package/lib/constants.d.ts
CHANGED
|
@@ -78,3 +78,9 @@ export declare const FEATURES: {
|
|
|
78
78
|
readonly UNIFIED_THEME_PREVIEW: "cms:react:unifiedThemePreview";
|
|
79
79
|
readonly UNIFIED_APPS: "Developers:UnifiedApps:PrivateBeta";
|
|
80
80
|
};
|
|
81
|
+
export declare const LOCAL_DEV_UI_WEBSOCKET_MESSAGE_TYPES: {
|
|
82
|
+
readonly UPLOAD: "upload";
|
|
83
|
+
readonly INSTALL_DEPS: "installDeps";
|
|
84
|
+
readonly APP_INSTALLED: "appInstalled";
|
|
85
|
+
readonly UPDATE_PROJECT_NODES: "updateProjectNodes";
|
|
86
|
+
};
|
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FEATURES = exports.APP_AUTH_TYPES = exports.APP_DISTRIBUTION_TYPES = exports.IR_COMPONENT_TYPES = exports.PLATFORM_VERSION_ERROR_TYPES = exports.PROJECT_COMPONENT_TYPES = exports.PROJECT_TASK_TYPES = exports.PROJECT_ERROR_TYPES = exports.PROJECT_DEPLOY_TEXT = exports.PROJECT_BUILD_TEXT = exports.PROJECT_DEPLOY_STATES = exports.PROJECT_BUILD_STATES = exports.PROJECT_CONFIG_FILE = exports.DEFAULT_POLLING_DELAY = exports.MARKETPLACE_FOLDER = exports.HUBSPOT_FOLDER = exports.FEEDBACK_INTERVAL = exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = void 0;
|
|
3
|
+
exports.LOCAL_DEV_UI_WEBSOCKET_MESSAGE_TYPES = exports.FEATURES = exports.APP_AUTH_TYPES = exports.APP_DISTRIBUTION_TYPES = exports.IR_COMPONENT_TYPES = exports.PLATFORM_VERSION_ERROR_TYPES = exports.PROJECT_COMPONENT_TYPES = exports.PROJECT_TASK_TYPES = exports.PROJECT_ERROR_TYPES = exports.PROJECT_DEPLOY_TEXT = exports.PROJECT_BUILD_TEXT = exports.PROJECT_DEPLOY_STATES = exports.PROJECT_BUILD_STATES = exports.PROJECT_CONFIG_FILE = exports.DEFAULT_POLLING_DELAY = exports.MARKETPLACE_FOLDER = exports.HUBSPOT_FOLDER = exports.FEEDBACK_INTERVAL = exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = void 0;
|
|
4
4
|
exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = 'HubSpot/hubspot-project-components';
|
|
5
5
|
exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = 'main';
|
|
6
6
|
exports.FEEDBACK_INTERVAL = 10;
|
|
@@ -73,3 +73,9 @@ exports.FEATURES = {
|
|
|
73
73
|
UNIFIED_THEME_PREVIEW: 'cms:react:unifiedThemePreview',
|
|
74
74
|
UNIFIED_APPS: 'Developers:UnifiedApps:PrivateBeta',
|
|
75
75
|
};
|
|
76
|
+
exports.LOCAL_DEV_UI_WEBSOCKET_MESSAGE_TYPES = {
|
|
77
|
+
UPLOAD: 'upload',
|
|
78
|
+
INSTALL_DEPS: 'installDeps',
|
|
79
|
+
APP_INSTALLED: 'appInstalled',
|
|
80
|
+
UPDATE_PROJECT_NODES: 'updateProjectNodes',
|
|
81
|
+
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export declare function isGloballyInstalled(command: string): Promise<boolean>;
|
|
2
|
-
export declare function getLatestCliVersion(): Promise<{
|
|
3
|
-
latest: string;
|
|
4
|
-
next: string;
|
|
5
|
-
}>;
|
|
6
1
|
export declare function installPackages({ packages, installLocations, }: {
|
|
7
2
|
packages?: string[];
|
|
8
3
|
installLocations?: string[];
|