@hubspot/cli 7.8.12-experimental.0 → 7.9.0-beta.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 +31 -25
- package/commands/__tests__/auth.test.js +5 -0
- package/commands/__tests__/cms.test.js +44 -1
- package/commands/__tests__/customObject.test.js +22 -1
- package/commands/__tests__/doctor.test.js +16 -16
- package/commands/__tests__/project.test.js +2 -0
- package/commands/account/auth.js +1 -0
- package/commands/account/clean.js +18 -27
- package/commands/account/createOverride.js +13 -31
- package/commands/account/info.js +20 -31
- package/commands/account/list.js +16 -22
- package/commands/account/remove.js +12 -20
- package/commands/account/removeOverride.js +11 -21
- package/commands/account/rename.js +6 -9
- package/commands/account/use.js +12 -26
- package/commands/account.js +2 -2
- package/commands/app/__tests__/migrate.test.js +5 -5
- package/commands/app/migrate.js +13 -18
- package/commands/app.js +1 -6
- package/commands/auth.d.ts +1 -0
- package/commands/auth.js +17 -7
- package/commands/{__tests__/remove.test.js → cms/__tests__/delete.test.js} +8 -8
- package/commands/{__tests__ → cms/__tests__}/fetch.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/function.test.js +7 -3
- package/commands/{__tests__ → cms/__tests__}/lint.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/list.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/mv.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/theme.test.js +9 -2
- package/commands/cms/app/create.d.ts +9 -0
- package/commands/cms/app/create.js +82 -0
- package/commands/cms/app.d.ts +3 -0
- package/commands/cms/app.js +17 -0
- package/commands/cms/convertFields.js +7 -9
- package/commands/cms/delete.d.ts +6 -0
- package/commands/cms/delete.js +43 -0
- package/commands/cms/fetch.d.ts +12 -0
- package/commands/cms/fetch.js +79 -0
- package/commands/{__tests__ → cms/function/__tests__}/logs.test.js +4 -5
- package/commands/cms/function/create.d.ts +12 -0
- package/commands/cms/function/create.js +84 -0
- package/commands/cms/function/deploy.d.ts +6 -0
- package/commands/cms/function/deploy.js +89 -0
- package/commands/cms/function/list.d.ts +6 -0
- package/commands/cms/function/list.js +60 -0
- package/commands/cms/function/logs.d.ts +10 -0
- package/commands/cms/function/logs.js +135 -0
- package/commands/cms/function/server.d.ts +10 -0
- package/commands/cms/function/server.js +69 -0
- package/commands/cms/function.d.ts +3 -0
- package/commands/cms/function.js +27 -0
- package/commands/cms/getReactModule.js +9 -14
- package/commands/cms/lighthouseScore.js +33 -36
- package/commands/cms/lint.d.ts +6 -0
- package/commands/cms/lint.js +83 -0
- package/commands/cms/list.d.ts +6 -0
- package/commands/cms/list.js +96 -0
- package/commands/cms/module/create.d.ts +11 -0
- package/commands/cms/module/create.js +84 -0
- package/commands/cms/module/marketplace-validate.d.ts +6 -0
- package/commands/cms/module/marketplace-validate.js +45 -0
- package/commands/cms/module.d.ts +3 -0
- package/commands/cms/module.js +17 -0
- package/commands/cms/mv.d.ts +7 -0
- package/commands/cms/mv.js +60 -0
- package/commands/cms/template/create.d.ts +9 -0
- package/commands/cms/template/create.js +72 -0
- package/commands/cms/template.d.ts +3 -0
- package/commands/cms/template.js +17 -0
- package/commands/{theme → cms/theme}/__tests__/marketplace-validate.test.js +2 -2
- package/commands/{theme → cms/theme}/__tests__/preview.test.js +2 -2
- package/commands/cms/theme/create.d.ts +6 -0
- package/commands/cms/theme/create.js +58 -0
- package/commands/cms/theme/generate-selectors.d.ts +6 -0
- package/commands/cms/theme/generate-selectors.js +171 -0
- package/commands/cms/theme/marketplace-validate.d.ts +6 -0
- package/commands/cms/theme/marketplace-validate.js +46 -0
- package/commands/cms/theme/preview.d.ts +12 -0
- package/commands/cms/theme/preview.js +224 -0
- package/commands/cms/theme.d.ts +3 -0
- package/commands/cms/theme.js +25 -0
- package/commands/cms/upload.d.ts +12 -0
- package/commands/cms/upload.js +212 -0
- package/commands/cms/watch.d.ts +14 -0
- package/commands/cms/watch.js +138 -0
- package/commands/cms/webpack/create.d.ts +6 -0
- package/commands/cms/webpack/create.js +58 -0
- package/commands/cms/webpack.d.ts +3 -0
- package/commands/cms/webpack.js +17 -0
- package/commands/cms.js +28 -2
- package/commands/completion.js +3 -3
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +64 -36
- package/commands/config.js +2 -2
- package/commands/create.js +6 -4
- package/commands/customObject/{schema/__tests__/create.test.js → __tests__/createSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/delete.test.js → __tests__/deleteSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/fetch-all.test.js → __tests__/fetch-all-schemas.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/fetch.test.js → __tests__/fetchSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/list.test.js → __tests__/listSchemas.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/update.test.js → __tests__/updateSchema.test.js} +5 -5
- package/commands/customObject/create.js +10 -12
- package/commands/customObject/createSchema.d.ts +6 -0
- package/commands/customObject/createSchema.js +56 -0
- package/commands/customObject/deleteSchema.d.ts +7 -0
- package/commands/customObject/deleteSchema.js +69 -0
- package/commands/customObject/fetchAllSchemas.d.ts +6 -0
- package/commands/customObject/fetchAllSchemas.js +57 -0
- package/commands/customObject/fetchSchema.d.ts +7 -0
- package/commands/customObject/fetchSchema.js +67 -0
- package/commands/customObject/listSchemas.d.ts +4 -0
- package/commands/customObject/listSchemas.js +35 -0
- package/commands/customObject/schema/create.d.ts +4 -6
- package/commands/customObject/schema/create.js +13 -38
- package/commands/customObject/schema/delete.d.ts +4 -7
- package/commands/customObject/schema/delete.js +15 -50
- package/commands/customObject/schema/fetch-all.d.ts +4 -6
- package/commands/customObject/schema/fetch-all.js +14 -40
- package/commands/customObject/schema/fetch.d.ts +4 -7
- package/commands/customObject/schema/fetch.js +14 -49
- package/commands/customObject/schema/list.d.ts +4 -4
- package/commands/customObject/schema/list.js +10 -19
- package/commands/customObject/schema/update.d.ts +4 -7
- package/commands/customObject/schema/update.js +15 -50
- package/commands/customObject/schema.js +5 -3
- package/commands/customObject/updateSchema.d.ts +7 -0
- package/commands/customObject/updateSchema.js +71 -0
- package/commands/customObject.js +22 -8
- package/commands/doctor.js +8 -11
- package/commands/feedback.js +7 -12
- package/commands/fetch.d.ts +4 -12
- package/commands/fetch.js +20 -47
- package/commands/filemanager/fetch.js +7 -7
- package/commands/filemanager/upload.js +15 -34
- package/commands/filemanager.js +2 -2
- package/commands/function/deploy.d.ts +4 -6
- package/commands/function/deploy.js +14 -89
- package/commands/function/list.d.ts +4 -6
- package/commands/function/list.js +14 -40
- package/commands/function/server.d.ts +4 -10
- package/commands/function/server.js +22 -31
- package/commands/function.d.ts +2 -4
- package/commands/function.js +25 -14
- package/commands/getStarted.js +2 -2
- package/commands/hubdb/clear.js +7 -15
- package/commands/hubdb/create.js +9 -15
- package/commands/hubdb/delete.js +8 -15
- package/commands/hubdb/fetch.js +6 -9
- package/commands/hubdb.d.ts +1 -1
- package/commands/hubdb.js +2 -2
- package/commands/init.js +2 -3
- package/commands/lint.d.ts +4 -6
- package/commands/lint.js +13 -65
- package/commands/list.d.ts +4 -6
- package/commands/list.js +14 -81
- package/commands/logs.d.ts +4 -10
- package/commands/logs.js +25 -94
- package/commands/module/marketplace-validate.d.ts +4 -6
- package/commands/module/marketplace-validate.js +15 -27
- package/commands/module.d.ts +2 -2
- package/commands/module.js +17 -15
- package/commands/mv.d.ts +4 -7
- package/commands/mv.js +14 -51
- package/commands/open.js +5 -5
- package/commands/project/__tests__/add.test.js +15 -13
- package/commands/project/__tests__/deploy.test.js +3 -4
- package/commands/project/__tests__/devUnifiedFlow.test.js +32 -0
- package/commands/project/__tests__/installDeps.test.js +8 -8
- package/commands/project/__tests__/list.test.js +31 -0
- package/commands/project/__tests__/logs.test.js +1 -1
- package/commands/project/__tests__/migrate.test.js +6 -5
- package/commands/project/__tests__/migrateApp.test.js +2 -5
- package/commands/project/__tests__/validate.test.js +98 -0
- package/commands/project/add.d.ts +2 -2
- package/commands/project/add.js +6 -5
- package/commands/project/cloneApp.js +14 -19
- package/commands/project/create.js +1 -2
- package/commands/project/deploy.js +3 -3
- package/commands/project/dev/deprecatedFlow.js +9 -18
- package/commands/project/dev/index.js +19 -17
- package/commands/project/dev/unifiedFlow.js +11 -4
- package/commands/project/download.js +15 -15
- package/commands/project/installDeps.d.ts +2 -2
- package/commands/project/installDeps.js +9 -8
- package/commands/project/list.d.ts +4 -0
- package/commands/project/list.js +62 -0
- package/commands/project/listBuilds.js +11 -20
- package/commands/project/logs.js +21 -24
- package/commands/project/migrate.js +5 -2
- package/commands/project/migrateApp.js +9 -15
- package/commands/project/open.js +6 -13
- package/commands/project/upload.d.ts +2 -2
- package/commands/project/upload.js +17 -26
- package/commands/project/validate.js +6 -6
- package/commands/project/watch.js +13 -22
- package/commands/project.js +4 -2
- package/commands/remove.d.ts +4 -6
- package/commands/remove.js +12 -24
- package/commands/sandbox/__tests__/create.test.js +5 -5
- package/commands/sandbox/create.js +22 -32
- package/commands/sandbox/delete.js +38 -63
- package/commands/sandbox.js +2 -2
- package/commands/secret/addSecret.js +7 -17
- package/commands/secret/deleteSecret.js +10 -20
- package/commands/secret/listSecret.js +8 -10
- package/commands/secret/updateSecret.js +9 -17
- package/commands/secret.js +2 -2
- package/commands/testAccount/__tests__/delete.test.js +2 -4
- package/commands/testAccount/create.js +2 -5
- package/commands/testAccount/delete.d.ts +4 -3
- package/commands/testAccount/delete.js +155 -14
- package/commands/theme/generate-selectors.d.ts +4 -6
- package/commands/theme/generate-selectors.js +14 -152
- package/commands/theme/marketplace-validate.d.ts +4 -6
- package/commands/theme/marketplace-validate.js +14 -25
- package/commands/theme/preview.d.ts +4 -12
- package/commands/theme/preview.js +18 -183
- package/commands/theme.d.ts +2 -2
- package/commands/theme.js +19 -13
- package/commands/upload.d.ts +4 -12
- package/commands/upload.js +19 -169
- package/commands/watch.d.ts +4 -14
- package/commands/watch.js +23 -88
- package/lang/en.d.ts +863 -542
- package/lang/en.js +912 -595
- package/lang/en.lyaml +4 -4
- package/lib/__tests__/buildAccount.test.js +4 -3
- package/lib/__tests__/commonOpts.test.js +1 -1
- package/lib/__tests__/dependencyManagement.test.js +1 -1
- package/lib/__tests__/developerTestAccounts.test.js +3 -3
- package/lib/__tests__/npm.test.js +1 -1
- package/lib/__tests__/oauth.test.js +4 -4
- package/lib/__tests__/process.test.js +10 -5
- package/lib/__tests__/sandboxSync.test.js +8 -8
- package/lib/__tests__/sandboxes.test.js +8 -8
- package/lib/__tests__/serverlessLogs.test.js +1 -1
- package/lib/__tests__/usageTracking.test.js +5 -5
- package/lib/__tests__/validation.test.js +2 -1
- package/lib/__tests__/yargsUtils.test.js +83 -9
- package/lib/app/__tests__/migrate.test.js +5 -5
- package/lib/app/__tests__/migrate_legacy.test.js +1 -1
- package/lib/app/migrate.js +1 -1
- package/lib/app/migrate_legacy.js +20 -24
- package/lib/buildAccount.d.ts +2 -2
- package/lib/buildAccount.js +32 -64
- package/lib/commonOpts.d.ts +1 -1
- package/lib/commonOpts.js +25 -22
- package/lib/configMigrate.js +88 -9
- package/lib/configOptions.js +7 -0
- package/lib/constants.d.ts +15 -1
- package/lib/constants.js +19 -1
- package/lib/dependencyManagement.js +9 -27
- package/lib/developerTestAccounts.js +9 -23
- package/lib/doctor/Diagnosis.js +11 -23
- package/lib/doctor/DiagnosticInfoBuilder.js +12 -11
- package/lib/doctor/Doctor.js +42 -90
- package/lib/doctor/__tests__/Doctor.test.js +4 -4
- package/lib/errorHandlers/index.js +12 -20
- package/lib/errorHandlers/suppressError.js +11 -18
- package/lib/generateSelectors.js +1 -1
- package/lib/lang.js +6 -5
- package/lib/links.js +4 -4
- package/lib/middleware/__test__/commandTargetingUtils.test.js +99 -0
- package/lib/middleware/__test__/configMiddleware.test.js +11 -11
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +6 -8
- package/lib/middleware/autoUpdateMiddleware.d.ts +2 -1
- package/lib/middleware/autoUpdateMiddleware.js +12 -2
- package/lib/middleware/commandTargetingUtils.d.ts +8 -0
- package/lib/middleware/commandTargetingUtils.js +74 -0
- package/lib/middleware/configMiddleware.d.ts +1 -1
- package/lib/middleware/configMiddleware.js +21 -81
- package/lib/middleware/gitMiddleware.js +5 -1
- package/lib/middleware/notificationsMiddleware.js +5 -11
- package/lib/middleware/yargsChecksMiddleware.js +6 -9
- package/lib/npm.js +2 -2
- package/lib/oauth.js +5 -5
- package/lib/process.js +5 -4
- package/lib/projectProfiles.d.ts +1 -1
- package/lib/projectProfiles.js +2 -10
- package/lib/projects/__tests__/AppDevModeInterface.test.js +101 -135
- package/lib/projects/__tests__/DevServerManager.test.js +183 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +6 -5
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +76 -45
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +161 -0
- package/lib/projects/__tests__/deploy.test.js +9 -9
- package/lib/projects/__tests__/localDevProjectHelpers.test.js +2 -0
- package/lib/projects/__tests__/platformVersion.test.js +8 -8
- package/lib/projects/__tests__/projects.test.js +12 -12
- package/lib/projects/__tests__/structure.test.js +3 -3
- package/lib/projects/__tests__/upload.test.d.ts +1 -0
- package/lib/projects/__tests__/upload.test.js +82 -0
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +6 -6
- package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/{v3AddComponent.test.js → v2AddComponent.test.js} +39 -39
- package/lib/projects/add/{v3AddComponent.d.ts → v2AddComponent.d.ts} +1 -1
- package/lib/projects/add/{v3AddComponent.js → v2AddComponent.js} +5 -5
- package/lib/projects/create/__tests__/legacy.test.js +5 -5
- package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
- package/lib/projects/create/__tests__/{v3.test.js → v2.test.js} +3 -3
- package/lib/projects/create/index.js +4 -4
- package/lib/projects/create/legacy.js +2 -2
- package/lib/projects/create/{v3.d.ts → v2.d.ts} +3 -3
- package/lib/projects/create/{v3.js → v2.js} +5 -5
- package/lib/projects/deploy.d.ts +1 -1
- package/lib/projects/deploy.js +2 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +11 -3
- package/lib/projects/localDev/AppDevModeInterface.js +128 -115
- package/lib/projects/localDev/DevServerManager.d.ts +10 -29
- package/lib/projects/localDev/DevServerManager.js +20 -76
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +40 -0
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +120 -0
- package/lib/projects/localDev/LocalDevLogger.js +10 -11
- package/lib/projects/localDev/{LocalDevManager.js → LocalDevManager_DEPRECATED.js} +10 -11
- package/lib/projects/localDev/LocalDevProcess.js +3 -2
- package/lib/projects/localDev/LocalDevState.d.ts +3 -0
- package/lib/projects/localDev/LocalDevState.js +9 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +4 -1
- package/lib/projects/localDev/LocalDevWebsocketServer.js +46 -16
- package/lib/projects/localDev/UIExtensionsDevModeInterface.d.ts +13 -0
- package/lib/projects/localDev/UIExtensionsDevModeInterface.js +37 -0
- package/lib/projects/localDev/helpers/account.d.ts +1 -1
- package/lib/projects/localDev/helpers/account.js +2 -2
- package/lib/projects/localDev/helpers/process.d.ts +1 -0
- package/lib/projects/localDev/helpers/process.js +15 -0
- package/lib/projects/localDev/helpers/project.d.ts +1 -0
- package/lib/projects/localDev/helpers/project.js +39 -3
- package/lib/projects/localDev/localDevWebsocketServerUtils.d.ts +3 -0
- package/lib/projects/localDev/localDevWebsocketServerUtils.js +9 -0
- package/lib/projects/platformVersion.d.ts +1 -1
- package/lib/projects/platformVersion.js +1 -1
- package/lib/projects/structure.d.ts +2 -2
- package/lib/projects/structure.js +6 -6
- package/lib/projects/upload.d.ts +2 -3
- package/lib/projects/upload.js +17 -9
- package/lib/projects/urls.d.ts +0 -1
- package/lib/projects/urls.js +0 -3
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +1 -0
- package/lib/prompts/__tests__/projectAddPrompt.test.js +10 -10
- package/lib/prompts/accountNamePrompt.js +14 -19
- package/lib/prompts/accountsPrompt.js +2 -2
- package/lib/prompts/cmsFieldPrompt.js +2 -2
- package/lib/prompts/createApiSamplePrompt.js +5 -5
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +10 -1
- package/lib/prompts/createFunctionPrompt.js +14 -14
- package/lib/prompts/createModulePrompt.js +9 -9
- package/lib/prompts/createTemplatePrompt.js +2 -2
- package/lib/prompts/downloadProjectPrompt.js +5 -8
- package/lib/prompts/installAppPrompt.d.ts +1 -6
- package/lib/prompts/installAppPrompt.js +1 -6
- package/lib/prompts/personalAccessKeyPrompt.js +3 -3
- package/lib/prompts/previewPrompt.js +6 -6
- package/lib/prompts/projectAddPrompt.d.ts +2 -2
- package/lib/prompts/projectAddPrompt.js +7 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +20 -32
- package/lib/prompts/projectNamePrompt.js +4 -8
- package/lib/prompts/projectsLogsPrompt.js +2 -4
- package/lib/prompts/promptUtils.js +27 -9
- package/lib/prompts/sandboxesPrompt.js +7 -7
- package/lib/prompts/secretPrompt.js +3 -3
- package/lib/prompts/selectAppPrompt.js +3 -3
- package/lib/prompts/selectHubDBTablePrompt.js +9 -13
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +15 -19
- package/lib/prompts/setAsDefaultAccountPrompt.js +4 -8
- package/lib/prompts/uploadPrompt.js +5 -5
- package/lib/sandboxSync.js +24 -41
- package/lib/sandboxes.js +19 -47
- package/lib/schema.js +3 -3
- package/lib/serverlessLogs.js +11 -13
- package/lib/theme/__tests__/migrate.test.js +6 -6
- package/lib/theme/migrate.js +2 -2
- package/lib/ui/SpinniesManager.d.ts +2 -0
- package/lib/ui/SpinniesManager.js +7 -0
- package/lib/ui/boxen.js +1 -2
- package/lib/ui/git.js +13 -10
- package/lib/ui/index.d.ts +6 -0
- package/lib/ui/index.js +55 -38
- package/lib/ui/serverlessFunctionLogs.js +9 -7
- package/lib/ui/uiMessages.d.ts +73 -0
- package/lib/ui/uiMessages.js +76 -0
- package/lib/usageTracking.js +7 -7
- package/lib/validation.js +20 -23
- package/lib/yargsUtils.d.ts +1 -1
- package/lib/yargsUtils.js +12 -5
- package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +4 -4
- package/mcp-server/tools/index.js +4 -0
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +23 -0
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.js +68 -0
- package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +11 -0
- package/mcp-server/tools/project/GetApplicationInfoTool.js +49 -0
- package/mcp-server/tools/project/GetConfigValuesTool.js +2 -2
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +2 -2
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +1 -1
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApiUsagePatternsByAppIdTool.test.js +169 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.d.ts +1 -0
- package/mcp-server/tools/project/__tests__/GetApplicationInfoTool.test.js +115 -0
- package/mcp-server/utils/toolUsageTracking.js +2 -2
- package/package.json +8 -7
- package/types/Cms.d.ts +6 -6
- package/types/Yargs.d.ts +1 -1
- package/commands/app/__tests__/install.test.js +0 -47
- package/commands/app/install.d.ts +0 -8
- package/commands/app/install.js +0 -122
- package/lib/middleware/__test__/utils.test.js +0 -51
- package/lib/middleware/utils.d.ts +0 -8
- package/lib/middleware/utils.js +0 -14
- package/lib/projects/localDev/DevServerManagerV2.d.ts +0 -22
- package/lib/projects/localDev/DevServerManagerV2.js +0 -81
- /package/commands/{customObject/schema → cms}/__tests__/delete.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/fetch.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/function.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/lint.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/list.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/mv.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/theme.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/function/__tests__}/logs.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/generate-selectors.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/generate-selectors.test.js +0 -0
- /package/commands/{theme → cms/theme}/__tests__/marketplace-validate.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/preview.test.d.ts +0 -0
- /package/commands/{__tests__/remove.test.d.ts → customObject/__tests__/createSchema.test.d.ts} +0 -0
- /package/commands/{app/__tests__/install.test.d.ts → customObject/__tests__/deleteSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/create.test.d.ts → __tests__/fetch-all-schemas.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/fetch-all.test.d.ts → __tests__/fetchSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/fetch.test.d.ts → __tests__/listSchemas.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/list.test.d.ts → __tests__/updateSchema.test.d.ts} +0 -0
- /package/commands/{customObject/schema/__tests__/update.test.d.ts → project/__tests__/list.test.d.ts} +0 -0
- /package/{lib/middleware/__test__/utils.test.d.ts → commands/project/__tests__/validate.test.d.ts} +0 -0
- /package/{commands/create → lib/cmsAssets}/api-sample.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/api-sample.js +0 -0
- /package/{commands/create → lib/cmsAssets}/app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/function.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/function.js +0 -0
- /package/{commands/create → lib/cmsAssets}/index.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/index.js +0 -0
- /package/{commands/create → lib/cmsAssets}/module.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/module.js +0 -0
- /package/{commands/create → lib/cmsAssets}/react-app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/react-app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/template.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/template.js +0 -0
- /package/{commands/create → lib/cmsAssets}/vue-app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/vue-app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/webpack-serverless.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/webpack-serverless.js +0 -0
- /package/{commands/create → lib/cmsAssets}/website-theme.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/website-theme.js +0 -0
- /package/lib/{projects/add/__tests__/v3AddComponent.test.d.ts → middleware/__test__/commandTargetingUtils.test.d.ts} +0 -0
- /package/lib/projects/{create/__tests__/v3.test.d.ts → __tests__/DevServerManager.test.d.ts} +0 -0
- /package/lib/projects/localDev/{LocalDevManager.d.ts → LocalDevManager_DEPRECATED.d.ts} +0 -0
package/commands/customObject.js
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import schemaCommand from './customObject/schema.js';
|
|
2
2
|
import createCommand from './customObject/create.js';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import createSchemaCommand from './customObject/createSchema.js';
|
|
4
|
+
import deleteSchemaCommand from './customObject/deleteSchema.js';
|
|
5
|
+
import fetchSchemaCommand from './customObject/fetchSchema.js';
|
|
6
|
+
import fetchAllSchemasCommand from './customObject/fetchAllSchemas.js';
|
|
7
|
+
import listSchemasCommand from './customObject/listSchemas.js';
|
|
8
|
+
import updateSchemaCommand from './customObject/updateSchema.js';
|
|
9
|
+
import { commands } from '../lang/en.js';
|
|
10
|
+
import { uiBetaTag } from '../lib/ui/index.js';
|
|
6
11
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
12
|
+
import { uiLogger } from '../lib/ui/logger.js';
|
|
7
13
|
const command = ['custom-object', 'custom-objects', 'co'];
|
|
8
|
-
const describe = uiBetaTag(
|
|
14
|
+
const describe = uiBetaTag(commands.customObject.describe, false);
|
|
9
15
|
function logBetaMessage() {
|
|
10
|
-
uiBetaTag(
|
|
11
|
-
|
|
12
|
-
logger.log();
|
|
16
|
+
uiBetaTag(commands.customObject.betaMessage);
|
|
17
|
+
uiLogger.log(commands.customObject.seeMoreLink);
|
|
13
18
|
}
|
|
14
19
|
function customObjectBuilder(yargs) {
|
|
15
20
|
yargs.middleware([logBetaMessage]);
|
|
16
|
-
yargs
|
|
21
|
+
yargs
|
|
22
|
+
.command(schemaCommand)
|
|
23
|
+
.command(createCommand)
|
|
24
|
+
.command(createSchemaCommand)
|
|
25
|
+
.command(deleteSchemaCommand)
|
|
26
|
+
.command(fetchSchemaCommand)
|
|
27
|
+
.command(fetchAllSchemasCommand)
|
|
28
|
+
.command(listSchemasCommand)
|
|
29
|
+
.command(updateSchemaCommand)
|
|
30
|
+
.demandCommand(1, '');
|
|
17
31
|
return yargs;
|
|
18
32
|
}
|
|
19
33
|
const builder = makeYargsBuilder(customObjectBuilder, command, describe);
|
package/commands/doctor.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { trackCommandMetadataUsage, trackCommandUsage, } from '../lib/usageTracking.js';
|
|
4
|
-
import { logger } from '@hubspot/local-dev-lib/logger';
|
|
5
4
|
import { Doctor } from '../lib/doctor/Doctor.js';
|
|
6
5
|
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
7
6
|
import { getCwd } from '@hubspot/local-dev-lib/path';
|
|
8
7
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
9
|
-
import {
|
|
8
|
+
import { uiLogger } from '../lib/ui/logger.js';
|
|
9
|
+
import { commands } from '../lang/en.js';
|
|
10
10
|
const command = 'doctor';
|
|
11
|
-
const describe =
|
|
11
|
+
const describe = commands.doctor.describe;
|
|
12
12
|
const handler = async (args) => {
|
|
13
13
|
const { outputDir } = args;
|
|
14
14
|
const doctor = new Doctor();
|
|
@@ -20,10 +20,10 @@ const handler = async (args) => {
|
|
|
20
20
|
}
|
|
21
21
|
if (!outputDir) {
|
|
22
22
|
if (output?.diagnosis) {
|
|
23
|
-
|
|
23
|
+
uiLogger.log(output.diagnosis);
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
|
-
|
|
26
|
+
uiLogger.error(commands.doctor.errors.generatingDiagnosis);
|
|
27
27
|
return process.exit(EXIT_CODES.ERROR);
|
|
28
28
|
}
|
|
29
29
|
return process.exit(EXIT_CODES.SUCCESS);
|
|
@@ -35,20 +35,17 @@ const handler = async (args) => {
|
|
|
35
35
|
const outputFile = path.join(outputDirPath, `hubspot-doctor-${new Date().toISOString()}.json`);
|
|
36
36
|
try {
|
|
37
37
|
fs.writeFileSync(outputFile, JSON.stringify(output, null, 4));
|
|
38
|
-
|
|
38
|
+
uiLogger.success(commands.doctor.outputWritten(outputFile));
|
|
39
39
|
}
|
|
40
40
|
catch (e) {
|
|
41
|
-
|
|
42
|
-
file: outputFile,
|
|
43
|
-
errorMessage: e instanceof Error ? e.message : e,
|
|
44
|
-
}));
|
|
41
|
+
uiLogger.error(commands.doctor.errors.unableToWriteOutputFile(outputFile, e instanceof Error ? e.message : e));
|
|
45
42
|
return process.exit(EXIT_CODES.ERROR);
|
|
46
43
|
}
|
|
47
44
|
return process.exit(EXIT_CODES.SUCCESS);
|
|
48
45
|
};
|
|
49
46
|
function doctorBuilder(yargs) {
|
|
50
47
|
yargs.option('output-dir', {
|
|
51
|
-
describe:
|
|
48
|
+
describe: commands.doctor.options.outputDir,
|
|
52
49
|
type: 'string',
|
|
53
50
|
});
|
|
54
51
|
return yargs;
|
package/commands/feedback.js
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
import open from 'open';
|
|
2
|
-
import { i18n } from '../lib/lang.js';
|
|
3
|
-
import { logger } from '@hubspot/local-dev-lib/logger';
|
|
4
2
|
import { confirmPrompt } from '../lib/prompts/promptUtils.js';
|
|
5
3
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
6
4
|
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
7
|
-
import {
|
|
5
|
+
import { commands } from '../lang/en.js';
|
|
6
|
+
import { uiLogger } from '../lib/ui/logger.js';
|
|
8
7
|
const FEEDBACK_URL = 'https://developers.hubspot.com/feedback';
|
|
9
8
|
const command = 'feedback';
|
|
10
|
-
const describe =
|
|
9
|
+
const describe = commands.project.feedback.describe;
|
|
11
10
|
async function handler() {
|
|
12
|
-
const shouldOpen = await confirmPrompt(
|
|
11
|
+
const shouldOpen = await confirmPrompt(commands.project.feedback.openPrompt);
|
|
13
12
|
if (!shouldOpen) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}));
|
|
17
|
-
process.exit(EXIT_CODES.ERROR);
|
|
13
|
+
uiLogger.log(commands.project.feedback.error(FEEDBACK_URL));
|
|
14
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
18
15
|
}
|
|
19
16
|
open(FEEDBACK_URL, { url: true });
|
|
20
|
-
|
|
21
|
-
url: uiLink('the developer feedback form', FEEDBACK_URL),
|
|
22
|
-
}));
|
|
17
|
+
uiLogger.success(commands.project.feedback.success(FEEDBACK_URL));
|
|
23
18
|
process.exit(EXIT_CODES.SUCCESS);
|
|
24
19
|
}
|
|
25
20
|
function feedbackBuilder(yargs) {
|
package/commands/fetch.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
dest?: string;
|
|
6
|
-
cmsPublishMode?: CmsPublishMode;
|
|
7
|
-
staging?: boolean;
|
|
8
|
-
assetVersion?: number;
|
|
9
|
-
overwrite?: boolean;
|
|
10
|
-
} & ConfigArgs & AccountArgs & EnvironmentArgs & CommonArgs;
|
|
11
|
-
declare const fetchCommand: YargsCommandModule<unknown, FetchCommandArgs>;
|
|
12
|
-
export default fetchCommand;
|
|
1
|
+
import { YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
import { FetchCommandArgs } from './cms/fetch.js';
|
|
3
|
+
declare const deprecatedCmsFetchCommand: YargsCommandModule<unknown, FetchCommandArgs>;
|
|
4
|
+
export default deprecatedCmsFetchCommand;
|
package/commands/fetch.js
CHANGED
|
@@ -1,53 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { addCmsPublishModeOptions, addOverwriteOptions, getCmsPublishMode, } from '../lib/commonOpts.js';
|
|
4
|
-
import { resolveLocalPath } from '../lib/filesystem.js';
|
|
5
|
-
import { validateCmsPublishMode } from '../lib/validation.js';
|
|
6
|
-
import { trackCommandUsage } from '../lib/usageTracking.js';
|
|
7
|
-
import { i18n } from '../lib/lang.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import cmsFetchCommand from './cms/fetch.js';
|
|
8
3
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { commands } from '../lang/en.js';
|
|
5
|
+
import { addCmsPublishModeOptions, addOverwriteOptions, } from '../lib/commonOpts.js';
|
|
11
6
|
const command = 'fetch <src> [dest]';
|
|
12
|
-
const describe =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (typeof src !== 'string') {
|
|
19
|
-
logger.error(i18n('commands.fetch.errors.sourceRequired'));
|
|
20
|
-
process.exit(EXIT_CODES.ERROR);
|
|
21
|
-
}
|
|
22
|
-
const { derivedAccountId } = options;
|
|
23
|
-
const cmsPublishMode = getCmsPublishMode(options);
|
|
24
|
-
trackCommandUsage('fetch', { mode: cmsPublishMode }, derivedAccountId);
|
|
25
|
-
const { assetVersion, staging, overwrite } = options;
|
|
26
|
-
try {
|
|
27
|
-
// Fetch and write file/folder.
|
|
28
|
-
await downloadFileOrFolder(derivedAccountId, src, resolveLocalPath(dest), cmsPublishMode, {
|
|
29
|
-
assetVersion: assetVersion !== undefined ? `${assetVersion}` : assetVersion,
|
|
30
|
-
staging,
|
|
31
|
-
overwrite,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
logError(err);
|
|
36
|
-
process.exit(EXIT_CODES.ERROR);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const fetchBuilder = (yargs) => {
|
|
7
|
+
const describe = uiDeprecatedTag(cmsFetchCommand.describe, false);
|
|
8
|
+
async function handler(args) {
|
|
9
|
+
uiCommandRelocatedMessage('hs cms fetch');
|
|
10
|
+
await cmsFetchCommand.handler(args);
|
|
11
|
+
}
|
|
12
|
+
function deprecatedCmsFetchBuilder(yargs) {
|
|
40
13
|
yargs.positional('src', {
|
|
41
|
-
describe:
|
|
14
|
+
describe: commands.cms.subcommands.fetch.positionals.src.describe,
|
|
42
15
|
type: 'string',
|
|
43
16
|
});
|
|
44
17
|
yargs.positional('dest', {
|
|
45
|
-
describe:
|
|
18
|
+
describe: commands.cms.subcommands.fetch.positionals.dest.describe,
|
|
46
19
|
type: 'string',
|
|
47
20
|
});
|
|
48
21
|
yargs.options({
|
|
49
22
|
staging: {
|
|
50
|
-
describe:
|
|
23
|
+
describe: commands.cms.subcommands.fetch.options.staging.describe,
|
|
51
24
|
type: 'boolean',
|
|
52
25
|
default: false,
|
|
53
26
|
hidden: true,
|
|
@@ -56,24 +29,24 @@ const fetchBuilder = (yargs) => {
|
|
|
56
29
|
yargs.options({
|
|
57
30
|
assetVersion: {
|
|
58
31
|
type: 'number',
|
|
59
|
-
describe:
|
|
32
|
+
describe: commands.cms.subcommands.fetch.options.assetVersion.describe,
|
|
60
33
|
},
|
|
61
34
|
});
|
|
62
35
|
addCmsPublishModeOptions(yargs, { read: true });
|
|
63
36
|
addOverwriteOptions(yargs);
|
|
64
37
|
return yargs;
|
|
65
|
-
}
|
|
66
|
-
const
|
|
38
|
+
}
|
|
39
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFetchCommand.describe, 'hs cms fetch');
|
|
40
|
+
const builder = makeYargsBuilder(deprecatedCmsFetchBuilder, command, verboseDescribe, {
|
|
67
41
|
useConfigOptions: true,
|
|
68
42
|
useAccountOptions: true,
|
|
69
43
|
useGlobalOptions: true,
|
|
70
44
|
useEnvironmentOptions: true,
|
|
71
|
-
useTestingOptions: false,
|
|
72
45
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
46
|
+
const deprecatedCmsFetchCommand = {
|
|
47
|
+
...cmsFetchCommand,
|
|
75
48
|
describe,
|
|
76
49
|
handler,
|
|
77
50
|
builder,
|
|
78
51
|
};
|
|
79
|
-
export default
|
|
52
|
+
export default deprecatedCmsFetchCommand;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { downloadFileOrFolder } from '@hubspot/local-dev-lib/fileManager';
|
|
2
|
-
import {
|
|
2
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
3
3
|
import { resolveLocalPath } from '../../lib/filesystem.js';
|
|
4
4
|
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
5
|
-
import {
|
|
5
|
+
import { commands } from '../../lang/en.js';
|
|
6
6
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
7
7
|
import { logError } from '../../lib/errorHandlers/index.js';
|
|
8
8
|
import { addOverwriteOptions } from '../../lib/commonOpts.js';
|
|
9
9
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
10
10
|
const command = 'fetch <src> [dest]';
|
|
11
|
-
const describe =
|
|
11
|
+
const describe = commands.filemanager.subcommands.fetch.describe;
|
|
12
12
|
async function handler(args) {
|
|
13
13
|
const { src, includeArchived, derivedAccountId, overwrite } = args;
|
|
14
14
|
if (typeof src !== 'string') {
|
|
15
|
-
|
|
15
|
+
uiLogger.error(commands.filemanager.subcommands.fetch.errors.sourceRequired);
|
|
16
16
|
process.exit(EXIT_CODES.ERROR);
|
|
17
17
|
}
|
|
18
18
|
const dest = resolveLocalPath(args.dest);
|
|
@@ -29,16 +29,16 @@ async function handler(args) {
|
|
|
29
29
|
function fileManagerFetchBuilder(yargs) {
|
|
30
30
|
addOverwriteOptions(yargs);
|
|
31
31
|
yargs.positional('src', {
|
|
32
|
-
describe:
|
|
32
|
+
describe: commands.filemanager.subcommands.fetch.positionals.src.describe,
|
|
33
33
|
type: 'string',
|
|
34
34
|
});
|
|
35
35
|
yargs.positional('dest', {
|
|
36
|
-
describe:
|
|
36
|
+
describe: commands.filemanager.subcommands.fetch.positionals.dest.describe,
|
|
37
37
|
type: 'string',
|
|
38
38
|
});
|
|
39
39
|
yargs.option('include-archived', {
|
|
40
40
|
alias: ['i'],
|
|
41
|
-
describe:
|
|
41
|
+
describe: commands.filemanager.subcommands.fetch.options.includeArchived.describe,
|
|
42
42
|
type: 'boolean',
|
|
43
43
|
});
|
|
44
44
|
return yargs;
|
|
@@ -3,16 +3,16 @@ import path from 'path';
|
|
|
3
3
|
import { uploadFolder } from '@hubspot/local-dev-lib/fileManager';
|
|
4
4
|
import { uploadFile } from '@hubspot/local-dev-lib/api/fileManager';
|
|
5
5
|
import { getCwd, convertToUnixPath } from '@hubspot/local-dev-lib/path';
|
|
6
|
-
import {
|
|
6
|
+
import { uiLogger } from '../../lib/ui/logger.js';
|
|
7
7
|
import { validateSrcAndDestPaths } from '@hubspot/local-dev-lib/cms/modules';
|
|
8
8
|
import { shouldIgnoreFile } from '@hubspot/local-dev-lib/ignoreRules';
|
|
9
9
|
import { ApiErrorContext, logError } from '../../lib/errorHandlers/index.js';
|
|
10
10
|
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
11
|
-
import {
|
|
11
|
+
import { commands } from '../../lang/en.js';
|
|
12
12
|
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
13
13
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
14
14
|
const command = 'upload <src> <dest>';
|
|
15
|
-
const describe =
|
|
15
|
+
const describe = commands.filemanager.subcommands.upload.describe;
|
|
16
16
|
async function handler(args) {
|
|
17
17
|
const { src, dest, derivedAccountId } = args;
|
|
18
18
|
const absoluteSrcPath = path.resolve(getCwd(), src);
|
|
@@ -20,49 +20,36 @@ async function handler(args) {
|
|
|
20
20
|
try {
|
|
21
21
|
stats = fs.statSync(absoluteSrcPath);
|
|
22
22
|
if (!stats.isFile() && !stats.isDirectory()) {
|
|
23
|
-
|
|
24
|
-
path: src,
|
|
25
|
-
}));
|
|
23
|
+
uiLogger.error(commands.filemanager.subcommands.upload.errors.invalidPath(src));
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
catch (e) {
|
|
30
|
-
|
|
31
|
-
path: src,
|
|
32
|
-
}));
|
|
28
|
+
uiLogger.error(commands.filemanager.subcommands.upload.errors.invalidPath(src));
|
|
33
29
|
return;
|
|
34
30
|
}
|
|
35
31
|
if (!dest) {
|
|
36
|
-
|
|
32
|
+
uiLogger.error(commands.filemanager.subcommands.upload.errors.destinationRequired);
|
|
37
33
|
return;
|
|
38
34
|
}
|
|
39
35
|
const normalizedDest = convertToUnixPath(dest);
|
|
40
36
|
trackCommandUsage('filemanager-upload', { type: stats.isFile() ? 'file' : 'folder' }, derivedAccountId);
|
|
41
37
|
const srcDestIssues = await validateSrcAndDestPaths({ isLocal: true, path: src }, { isHubSpot: true, path: dest });
|
|
42
38
|
if (srcDestIssues.length) {
|
|
43
|
-
srcDestIssues.forEach(({ message }) =>
|
|
39
|
+
srcDestIssues.forEach(({ message }) => uiLogger.error(message));
|
|
44
40
|
process.exit(EXIT_CODES.ERROR);
|
|
45
41
|
}
|
|
46
42
|
if (stats.isFile()) {
|
|
47
43
|
if (shouldIgnoreFile(absoluteSrcPath)) {
|
|
48
|
-
|
|
49
|
-
path: src,
|
|
50
|
-
}));
|
|
44
|
+
uiLogger.error(commands.filemanager.subcommands.upload.errors.fileIgnored(src));
|
|
51
45
|
return;
|
|
52
46
|
}
|
|
53
47
|
uploadFile(derivedAccountId, absoluteSrcPath, normalizedDest)
|
|
54
48
|
.then(() => {
|
|
55
|
-
|
|
56
|
-
accountId: derivedAccountId,
|
|
57
|
-
dest: normalizedDest,
|
|
58
|
-
src,
|
|
59
|
-
}));
|
|
49
|
+
uiLogger.success(commands.filemanager.subcommands.upload.success.upload(src, normalizedDest, derivedAccountId));
|
|
60
50
|
})
|
|
61
51
|
.catch(error => {
|
|
62
|
-
|
|
63
|
-
dest: normalizedDest,
|
|
64
|
-
src,
|
|
65
|
-
}));
|
|
52
|
+
uiLogger.error(commands.filemanager.subcommands.upload.errors.upload(src, normalizedDest));
|
|
66
53
|
logError(error, new ApiErrorContext({
|
|
67
54
|
accountId: derivedAccountId,
|
|
68
55
|
request: normalizedDest,
|
|
@@ -71,19 +58,13 @@ async function handler(args) {
|
|
|
71
58
|
});
|
|
72
59
|
}
|
|
73
60
|
else {
|
|
74
|
-
|
|
75
|
-
accountId: derivedAccountId,
|
|
76
|
-
dest,
|
|
77
|
-
src,
|
|
78
|
-
}));
|
|
61
|
+
uiLogger.log(commands.filemanager.subcommands.upload.logs.uploading(src, dest, derivedAccountId));
|
|
79
62
|
uploadFolder(derivedAccountId, absoluteSrcPath, dest)
|
|
80
63
|
.then(() => {
|
|
81
|
-
|
|
82
|
-
dest,
|
|
83
|
-
}));
|
|
64
|
+
uiLogger.success(commands.filemanager.subcommands.upload.success.uploadComplete(dest));
|
|
84
65
|
})
|
|
85
66
|
.catch(error => {
|
|
86
|
-
|
|
67
|
+
uiLogger.error(commands.filemanager.subcommands.upload.errors.uploadingFailed);
|
|
87
68
|
logError(error, {
|
|
88
69
|
accountId: derivedAccountId,
|
|
89
70
|
});
|
|
@@ -92,11 +73,11 @@ async function handler(args) {
|
|
|
92
73
|
}
|
|
93
74
|
function fileManagerUploadBuilder(yargs) {
|
|
94
75
|
yargs.positional('src', {
|
|
95
|
-
describe:
|
|
76
|
+
describe: commands.filemanager.subcommands.upload.positionals.src.describe,
|
|
96
77
|
type: 'string',
|
|
97
78
|
});
|
|
98
79
|
yargs.positional('dest', {
|
|
99
|
-
describe:
|
|
80
|
+
describe: commands.filemanager.subcommands.upload.positionals.dest.describe,
|
|
100
81
|
type: 'string',
|
|
101
82
|
});
|
|
102
83
|
return yargs;
|
package/commands/filemanager.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import upload from './filemanager/upload.js';
|
|
2
2
|
import fetch from './filemanager/fetch.js';
|
|
3
|
-
import {
|
|
3
|
+
import { commands } from '../lang/en.js';
|
|
4
4
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
5
5
|
const command = 'filemanager';
|
|
6
|
-
const describe =
|
|
6
|
+
const describe = commands.filemanager.describe;
|
|
7
7
|
function fileManagerBuilder(yargs) {
|
|
8
8
|
yargs.command(upload).command(fetch).demandCommand(1, '');
|
|
9
9
|
return yargs;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const functionDeployCommand: YargsCommandModule<unknown, FunctionDeployArgs>;
|
|
6
|
-
export default functionDeployCommand;
|
|
1
|
+
import { YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
import { FunctionDeployArgs } from '../cms/function/deploy.js';
|
|
3
|
+
declare const deprecatedFunctionDeployCommand: YargsCommandModule<unknown, FunctionDeployArgs>;
|
|
4
|
+
export default deprecatedFunctionDeployCommand;
|
|
@@ -1,106 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
4
|
-
import SpinniesManager from '../../lib/ui/SpinniesManager.js';
|
|
5
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
6
|
-
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
7
|
-
import { uiAccountDescription } from '../../lib/ui/index.js';
|
|
8
|
-
import { poll } from '../../lib/polling.js';
|
|
9
|
-
import { outputBuildLog } from '../../lib/serverlessLogs.js';
|
|
10
|
-
import { i18n } from '../../lib/lang.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../../lib/ui/index.js';
|
|
2
|
+
import cmsFunctionDeployCommand from '../cms/function/deploy.js';
|
|
11
3
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
12
|
-
|
|
13
|
-
return (typeof e === 'object' && e !== null && 'status' in e && e.status === 'ERROR');
|
|
14
|
-
}
|
|
4
|
+
import { commands } from '../../lang/en.js';
|
|
15
5
|
const command = 'deploy <path>';
|
|
16
|
-
const describe =
|
|
6
|
+
const describe = uiDeprecatedTag(cmsFunctionDeployCommand.describe, false);
|
|
17
7
|
async function handler(args) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
trackCommandUsage('function-deploy', undefined, derivedAccountId);
|
|
21
|
-
if (!splitFunctionPath.length ||
|
|
22
|
-
splitFunctionPath[splitFunctionPath.length - 1] !== 'functions') {
|
|
23
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.notFunctionsFolder', {
|
|
24
|
-
functionPath,
|
|
25
|
-
}));
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
logger.debug(i18n('commands.function.subcommands.deploy.debug.startingBuildAndDeploy', {
|
|
29
|
-
functionPath,
|
|
30
|
-
}));
|
|
31
|
-
SpinniesManager.init();
|
|
32
|
-
SpinniesManager.add('loading', {
|
|
33
|
-
text: i18n('commands.function.subcommands.deploy.loading', {
|
|
34
|
-
account: uiAccountDescription(derivedAccountId),
|
|
35
|
-
functionPath,
|
|
36
|
-
}),
|
|
37
|
-
});
|
|
38
|
-
try {
|
|
39
|
-
const { data: buildId } = await buildPackage(derivedAccountId, functionPath);
|
|
40
|
-
const successResp = await poll(() => getBuildStatus(derivedAccountId, Number(buildId)));
|
|
41
|
-
if (successResp) {
|
|
42
|
-
const buildTimeSeconds = successResp.buildTime
|
|
43
|
-
? (successResp.buildTime / 1000).toFixed(2)
|
|
44
|
-
: 0;
|
|
45
|
-
SpinniesManager.succeed('loading');
|
|
46
|
-
if (successResp.cdnUrl) {
|
|
47
|
-
await outputBuildLog(successResp.cdnUrl);
|
|
48
|
-
}
|
|
49
|
-
logger.success(i18n('commands.function.subcommands.deploy.success.deployed', {
|
|
50
|
-
accountId: derivedAccountId,
|
|
51
|
-
buildTimeSeconds,
|
|
52
|
-
functionPath,
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
SpinniesManager.fail('loading', {
|
|
58
|
-
text: i18n('commands.function.subcommands.deploy.loadingFailed', {
|
|
59
|
-
account: uiAccountDescription(derivedAccountId),
|
|
60
|
-
functionPath,
|
|
61
|
-
}),
|
|
62
|
-
});
|
|
63
|
-
if (isHubSpotHttpError(e) && e.status === 404) {
|
|
64
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.noPackageJson', {
|
|
65
|
-
functionPath,
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
else if (isFunctionBuildError(e)) {
|
|
69
|
-
await outputBuildLog(e.cdnUrl);
|
|
70
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.buildError', {
|
|
71
|
-
details: String(e.errorReason),
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
logError(e, new ApiErrorContext({
|
|
76
|
-
accountId: derivedAccountId,
|
|
77
|
-
request: functionPath,
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
8
|
+
uiCommandRelocatedMessage('hs cms function deploy');
|
|
9
|
+
await cmsFunctionDeployCommand.handler(args);
|
|
81
10
|
}
|
|
82
|
-
function
|
|
11
|
+
function deprecatedFunctionDeployBuilder(yargs) {
|
|
83
12
|
yargs.positional('path', {
|
|
84
|
-
describe:
|
|
13
|
+
describe: commands.cms.subcommands.function.subcommands.deploy.positionals.path
|
|
14
|
+
.describe,
|
|
85
15
|
type: 'string',
|
|
86
16
|
});
|
|
87
|
-
yargs.example([
|
|
88
|
-
[
|
|
89
|
-
'$0 functions deploy myFunctionFolder.functions',
|
|
90
|
-
i18n('commands.function.subcommands.deploy.examples.default'),
|
|
91
|
-
],
|
|
92
|
-
]);
|
|
93
17
|
return yargs;
|
|
94
18
|
}
|
|
95
|
-
const
|
|
19
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionDeployCommand.describe, 'hs cms function deploy');
|
|
20
|
+
const builder = makeYargsBuilder(deprecatedFunctionDeployBuilder, command, verboseDescribe, {
|
|
96
21
|
useConfigOptions: true,
|
|
97
22
|
useAccountOptions: true,
|
|
98
23
|
useEnvironmentOptions: true,
|
|
99
24
|
});
|
|
100
|
-
const
|
|
101
|
-
|
|
25
|
+
const deprecatedFunctionDeployCommand = {
|
|
26
|
+
...cmsFunctionDeployCommand,
|
|
102
27
|
describe,
|
|
103
28
|
handler,
|
|
104
29
|
builder,
|
|
105
30
|
};
|
|
106
|
-
export default
|
|
31
|
+
export default deprecatedFunctionDeployCommand;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const functionListCommand: YargsCommandModule<unknown, FunctionListArgs>;
|
|
6
|
-
export default functionListCommand;
|
|
1
|
+
import { YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
import { FunctionListArgs } from '../cms/function/list.js';
|
|
3
|
+
declare const deprecatedFunctionListCommand: YargsCommandModule<unknown, FunctionListArgs>;
|
|
4
|
+
export default deprecatedFunctionListCommand;
|
|
@@ -1,59 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { logger } from '@hubspot/local-dev-lib/logger';
|
|
4
|
-
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
5
|
-
import { getTableContents, getTableHeader } from '../../lib/ui/table.js';
|
|
6
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
7
|
-
import { i18n } from '../../lib/lang.js';
|
|
8
|
-
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../../lib/ui/index.js';
|
|
2
|
+
import cmsFunctionListCommand from '../cms/function/list.js';
|
|
9
3
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
4
|
+
import { commands } from '../../lang/en.js';
|
|
10
5
|
const command = ['list', 'ls'];
|
|
11
|
-
const describe =
|
|
6
|
+
const describe = uiDeprecatedTag(cmsFunctionListCommand.describe, false);
|
|
12
7
|
async function handler(args) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
logger.debug(i18n('commands.function.subcommands.list.debug.gettingFunctions'));
|
|
16
|
-
const { data: routesResp } = await getRoutes(derivedAccountId).catch(async (e) => {
|
|
17
|
-
logError(e, new ApiErrorContext({ accountId: derivedAccountId }));
|
|
18
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
19
|
-
});
|
|
20
|
-
if (!routesResp.objects.length) {
|
|
21
|
-
return logger.info(i18n('commands.function.subcommands.list.info.noFunctions'));
|
|
22
|
-
}
|
|
23
|
-
if (args.json) {
|
|
24
|
-
return logger.log(routesResp.objects);
|
|
25
|
-
}
|
|
26
|
-
const functionsAsArrays = routesResp.objects.map(func => {
|
|
27
|
-
const { route, method, created, updated, secretNames } = func;
|
|
28
|
-
return [
|
|
29
|
-
route,
|
|
30
|
-
method,
|
|
31
|
-
secretNames.join(', '),
|
|
32
|
-
moment(created).format(),
|
|
33
|
-
moment(updated).format(),
|
|
34
|
-
];
|
|
35
|
-
});
|
|
36
|
-
functionsAsArrays.unshift(getTableHeader(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
|
|
37
|
-
return logger.log(getTableContents(functionsAsArrays));
|
|
8
|
+
uiCommandRelocatedMessage('hs cms function list');
|
|
9
|
+
await cmsFunctionListCommand.handler(args);
|
|
38
10
|
}
|
|
39
|
-
function
|
|
11
|
+
function deprecatedFunctionListBuilder(yargs) {
|
|
40
12
|
yargs.options({
|
|
41
13
|
json: {
|
|
42
|
-
describe:
|
|
14
|
+
describe: commands.cms.subcommands.function.subcommands.list.options.json
|
|
15
|
+
.describe,
|
|
43
16
|
type: 'boolean',
|
|
44
17
|
},
|
|
45
18
|
});
|
|
46
19
|
return yargs;
|
|
47
20
|
}
|
|
48
|
-
const
|
|
21
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionListCommand.describe, 'hs cms function list');
|
|
22
|
+
const builder = makeYargsBuilder(deprecatedFunctionListBuilder, command, verboseDescribe, {
|
|
49
23
|
useConfigOptions: true,
|
|
50
24
|
useAccountOptions: true,
|
|
51
25
|
useEnvironmentOptions: true,
|
|
52
26
|
});
|
|
53
|
-
const
|
|
54
|
-
|
|
27
|
+
const deprecatedFunctionListCommand = {
|
|
28
|
+
...cmsFunctionListCommand,
|
|
55
29
|
describe,
|
|
56
30
|
handler,
|
|
57
31
|
builder,
|
|
58
32
|
};
|
|
59
|
-
export default
|
|
33
|
+
export default deprecatedFunctionListCommand;
|