@hubspot/cli 7.7.21-experimental.0 → 7.7.21-experimental.1
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/api/__tests__/migrate.test.js +29 -27
- package/api/migrate.js +22 -14
- package/bin/cli.js +101 -92
- package/bin/hs +2 -2
- package/bin/hscms +2 -2
- package/bin/silenceErrors.js +2 -1
- package/commands/__tests__/account.test.js +34 -29
- package/commands/__tests__/auth.test.js +16 -11
- package/commands/__tests__/cms.test.js +20 -15
- package/commands/__tests__/config.test.js +19 -14
- package/commands/__tests__/create.test.js +15 -10
- package/commands/__tests__/customObject.test.js +19 -14
- package/commands/__tests__/doctor.test.js +48 -43
- package/commands/__tests__/feedback.test.js +45 -7
- package/commands/__tests__/fetch.test.js +28 -29
- package/commands/__tests__/filemanager.test.js +19 -14
- package/commands/__tests__/function.test.js +21 -16
- package/commands/__tests__/getStarted.test.js +50 -55
- package/commands/__tests__/hubdb.test.js +22 -17
- package/commands/__tests__/init.test.js +17 -12
- package/commands/__tests__/lint.test.js +18 -13
- package/commands/__tests__/list.test.js +23 -18
- package/commands/__tests__/logs.test.js +27 -28
- package/commands/__tests__/mcp.test.js +19 -14
- package/commands/__tests__/mv.test.js +52 -14
- package/commands/__tests__/open.test.js +51 -13
- package/commands/__tests__/project.test.js +49 -44
- package/commands/__tests__/remove.test.js +51 -13
- package/commands/__tests__/sandbox.test.js +19 -14
- package/commands/__tests__/secret.test.js +21 -16
- package/commands/__tests__/testAccount.test.js +21 -16
- package/commands/__tests__/theme.test.js +20 -15
- package/commands/account/__tests__/auth.test.js +16 -11
- package/commands/account/__tests__/clean.test.js +17 -12
- package/commands/account/__tests__/createOverride.test.js +15 -10
- package/commands/account/__tests__/info.test.js +16 -11
- package/commands/account/__tests__/list.test.js +16 -11
- package/commands/account/__tests__/remove.test.js +18 -13
- package/commands/account/__tests__/removeOverride.js +13 -8
- package/commands/account/__tests__/rename.test.js +20 -15
- package/commands/account/__tests__/use.test.js +15 -10
- package/commands/account/auth.d.ts +1 -1
- package/commands/account/auth.js +67 -65
- package/commands/account/clean.d.ts +1 -1
- package/commands/account/clean.js +60 -55
- package/commands/account/createOverride.d.ts +1 -1
- package/commands/account/createOverride.js +57 -52
- package/commands/account/info.d.ts +1 -1
- package/commands/account/info.js +35 -33
- package/commands/account/list.d.ts +1 -1
- package/commands/account/list.js +45 -43
- package/commands/account/remove.d.ts +1 -1
- package/commands/account/remove.js +42 -37
- package/commands/account/removeOverride.d.ts +1 -1
- package/commands/account/removeOverride.js +43 -38
- package/commands/account/rename.d.ts +1 -1
- package/commands/account/rename.js +20 -18
- package/commands/account/use.d.ts +1 -1
- package/commands/account/use.js +31 -29
- package/commands/account.d.ts +1 -1
- package/commands/account.js +28 -23
- package/commands/app/__tests__/install.test.js +52 -0
- package/commands/app/__tests__/migrate.test.js +34 -29
- package/commands/app/install.d.ts +8 -0
- package/commands/app/install.js +127 -0
- package/commands/app/migrate.d.ts +2 -2
- package/commands/app/migrate.js +43 -40
- package/commands/app/secret/__tests__/add.test.js +11 -6
- package/commands/app/secret/__tests__/delete.test.js +11 -6
- package/commands/app/secret/__tests__/list.test.js +11 -6
- package/commands/app/secret/__tests__/update.test.js +11 -6
- package/commands/app/secret/add.d.ts +1 -1
- package/commands/app/secret/add.js +30 -28
- package/commands/app/secret/delete.d.ts +1 -1
- package/commands/app/secret/delete.js +36 -34
- package/commands/app/secret/list.d.ts +1 -1
- package/commands/app/secret/list.js +27 -25
- package/commands/app/secret/update.d.ts +1 -1
- package/commands/app/secret/update.js +34 -32
- package/commands/app/secret.d.ts +1 -1
- package/commands/app/secret.js +17 -12
- package/commands/app.d.ts +1 -1
- package/commands/app.js +16 -6
- package/commands/auth.d.ts +1 -1
- package/commands/auth.js +72 -70
- package/commands/cms/convertFields.d.ts +1 -1
- package/commands/cms/convertFields.js +39 -34
- package/commands/cms/getReactModule.d.ts +1 -1
- package/commands/cms/getReactModule.js +37 -32
- package/commands/cms/lighthouseScore.d.ts +1 -1
- package/commands/cms/lighthouseScore.js +72 -67
- package/commands/cms.d.ts +1 -1
- package/commands/cms.js +16 -11
- package/commands/completion.d.ts +1 -1
- package/commands/completion.js +15 -10
- package/commands/config/migrate.d.ts +1 -1
- package/commands/config/migrate.js +32 -27
- package/commands/config/set.d.ts +1 -1
- package/commands/config/set.js +25 -23
- package/commands/config.d.ts +1 -1
- package/commands/config.js +13 -8
- package/commands/create/api-sample.d.ts +1 -1
- package/commands/create/api-sample.js +33 -28
- package/commands/create/app.d.ts +1 -1
- package/commands/create/app.js +5 -3
- package/commands/create/function.d.ts +1 -1
- package/commands/create/function.js +11 -9
- package/commands/create/index.d.ts +1 -1
- package/commands/create/index.js +24 -19
- package/commands/create/module.d.ts +1 -1
- package/commands/create/module.js +14 -12
- package/commands/create/react-app.d.ts +1 -1
- package/commands/create/react-app.js +5 -3
- package/commands/create/template.d.ts +1 -1
- package/commands/create/template.js +14 -12
- package/commands/create/vue-app.d.ts +1 -1
- package/commands/create/vue-app.js +5 -3
- package/commands/create/webpack-serverless.d.ts +1 -1
- package/commands/create/webpack-serverless.js +5 -3
- package/commands/create/website-theme.d.ts +1 -1
- package/commands/create/website-theme.js +7 -5
- package/commands/create.d.ts +2 -2
- package/commands/create.js +35 -30
- package/commands/customObject/__tests__/create.test.js +18 -13
- package/commands/customObject/__tests__/schema.test.js +23 -18
- package/commands/customObject/create.d.ts +1 -1
- package/commands/customObject/create.js +30 -28
- package/commands/customObject/schema/__tests__/create.test.js +18 -13
- package/commands/customObject/schema/__tests__/delete.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch-all.test.js +18 -13
- package/commands/customObject/schema/__tests__/fetch.test.js +18 -13
- package/commands/customObject/schema/__tests__/list.test.js +18 -13
- package/commands/customObject/schema/__tests__/update.test.js +18 -13
- package/commands/customObject/schema/create.d.ts +1 -1
- package/commands/customObject/schema/create.js +30 -28
- package/commands/customObject/schema/delete.d.ts +1 -1
- package/commands/customObject/schema/delete.js +26 -24
- package/commands/customObject/schema/fetch-all.d.ts +1 -1
- package/commands/customObject/schema/fetch-all.js +24 -22
- package/commands/customObject/schema/fetch.d.ts +1 -1
- package/commands/customObject/schema/fetch.js +26 -24
- package/commands/customObject/schema/list.d.ts +1 -1
- package/commands/customObject/schema/list.js +15 -13
- package/commands/customObject/schema/update.d.ts +1 -1
- package/commands/customObject/schema/update.js +34 -32
- package/commands/customObject/schema.d.ts +1 -1
- package/commands/customObject/schema.js +22 -17
- package/commands/customObject.d.ts +1 -1
- package/commands/customObject.js +18 -13
- package/commands/doctor.d.ts +1 -1
- package/commands/doctor.js +33 -28
- package/commands/feedback.d.ts +1 -1
- package/commands/feedback.js +24 -19
- package/commands/fetch.d.ts +1 -1
- package/commands/fetch.js +30 -28
- package/commands/filemanager/__tests__/fetch.test.js +22 -17
- package/commands/filemanager/__tests__/upload.test.js +20 -15
- package/commands/filemanager/fetch.d.ts +1 -1
- package/commands/filemanager/fetch.js +25 -23
- package/commands/filemanager/upload.d.ts +1 -1
- package/commands/filemanager/upload.js +44 -39
- package/commands/filemanager.d.ts +1 -1
- package/commands/filemanager.js +13 -8
- package/commands/function/deploy.d.ts +1 -1
- package/commands/function/deploy.js +40 -35
- package/commands/function/list.d.ts +1 -1
- package/commands/function/list.js +29 -24
- package/commands/function/server.d.ts +1 -1
- package/commands/function/server.js +17 -15
- package/commands/function.d.ts +1 -1
- package/commands/function.js +18 -12
- package/commands/getStarted.d.ts +1 -1
- package/commands/getStarted.js +131 -140
- package/commands/hubdb/__tests__/clear.test.js +18 -13
- package/commands/hubdb/__tests__/create.test.js +18 -13
- package/commands/hubdb/__tests__/delete.test.js +18 -13
- package/commands/hubdb/__tests__/fetch.test.js +18 -13
- package/commands/hubdb/__tests__/list.test.js +28 -23
- package/commands/hubdb/clear.d.ts +1 -1
- package/commands/hubdb/clear.js +22 -20
- package/commands/hubdb/create.d.ts +1 -1
- package/commands/hubdb/create.js +35 -30
- package/commands/hubdb/delete.d.ts +1 -1
- package/commands/hubdb/delete.js +26 -24
- package/commands/hubdb/fetch.d.ts +1 -1
- package/commands/hubdb/fetch.js +19 -17
- package/commands/hubdb/list.d.ts +1 -1
- package/commands/hubdb/list.js +35 -33
- package/commands/hubdb.d.ts +1 -1
- package/commands/hubdb.js +24 -18
- package/commands/init.d.ts +1 -1
- package/commands/init.js +88 -83
- package/commands/lint.d.ts +1 -1
- package/commands/lint.js +26 -24
- package/commands/list.d.ts +1 -1
- package/commands/list.js +37 -32
- package/commands/logs.d.ts +1 -1
- package/commands/logs.js +37 -35
- package/commands/mcp/__tests__/setup.test.js +12 -7
- package/commands/mcp/__tests__/start.test.js +12 -7
- package/commands/mcp/setup.d.ts +1 -1
- package/commands/mcp/setup.js +20 -17
- package/commands/mcp/start.d.ts +5 -2
- package/commands/mcp/start.js +41 -31
- package/commands/mcp.d.ts +1 -1
- package/commands/mcp.js +12 -7
- package/commands/module/marketplace-validate.d.ts +1 -1
- package/commands/module/marketplace-validate.js +26 -21
- package/commands/module.d.ts +1 -1
- package/commands/module.js +13 -7
- package/commands/mv.d.ts +1 -1
- package/commands/mv.js +22 -20
- package/commands/open.d.ts +1 -1
- package/commands/open.js +21 -19
- package/commands/project/__tests__/add.test.js +15 -10
- package/commands/project/__tests__/create.test.js +19 -14
- package/commands/project/__tests__/deploy.test.js +143 -103
- package/commands/project/__tests__/devUnifiedFlow.test.js +157 -148
- package/commands/project/__tests__/download.test.js +19 -14
- package/commands/project/__tests__/installDeps.test.js +70 -32
- package/commands/project/__tests__/listBuilds.test.js +19 -14
- package/commands/project/__tests__/logs.test.js +94 -56
- package/commands/project/__tests__/migrate.test.js +30 -25
- package/commands/project/__tests__/migrateApp.test.js +22 -17
- package/commands/project/__tests__/open.test.js +21 -16
- package/commands/project/__tests__/profile.test.js +19 -14
- package/commands/project/__tests__/upload.test.js +23 -18
- package/commands/project/__tests__/watch.test.js +19 -14
- package/commands/project/add.d.ts +1 -1
- package/commands/project/add.js +36 -34
- package/commands/project/cloneApp.d.ts +1 -1
- package/commands/project/cloneApp.js +72 -67
- package/commands/project/create.d.ts +2 -2
- package/commands/project/create.js +68 -63
- package/commands/project/deploy.d.ts +3 -2
- package/commands/project/deploy.js +102 -91
- package/commands/project/dev/deprecatedFlow.d.ts +2 -2
- package/commands/project/dev/deprecatedFlow.js +58 -52
- package/commands/project/dev/index.d.ts +1 -1
- package/commands/project/dev/index.js +47 -44
- package/commands/project/dev/unifiedFlow.d.ts +3 -3
- package/commands/project/dev/unifiedFlow.js +74 -67
- package/commands/project/download.d.ts +1 -1
- package/commands/project/download.js +40 -35
- package/commands/project/installDeps.d.ts +1 -1
- package/commands/project/installDeps.js +34 -29
- package/commands/project/listBuilds.d.ts +1 -1
- package/commands/project/listBuilds.js +45 -40
- package/commands/project/logs.d.ts +1 -1
- package/commands/project/logs.js +54 -52
- package/commands/project/migrate.d.ts +1 -1
- package/commands/project/migrate.js +26 -24
- package/commands/project/migrateApp.d.ts +2 -2
- package/commands/project/migrateApp.js +20 -18
- package/commands/project/open.d.ts +1 -1
- package/commands/project/open.js +30 -25
- package/commands/project/profile/add.d.ts +1 -1
- package/commands/project/profile/add.js +73 -68
- package/commands/project/profile/delete.d.ts +1 -1
- package/commands/project/profile/delete.js +56 -51
- package/commands/project/profile.d.ts +1 -1
- package/commands/project/profile.js +14 -9
- package/commands/project/upload.d.ts +1 -1
- package/commands/project/upload.js +55 -50
- package/commands/project/validate.d.ts +1 -1
- package/commands/project/validate.js +40 -35
- package/commands/project/watch.d.ts +1 -1
- package/commands/project/watch.js +61 -59
- package/commands/project.d.ts +1 -1
- package/commands/project.js +43 -38
- package/commands/remove.d.ts +1 -1
- package/commands/remove.js +17 -15
- package/commands/sandbox/__tests__/create.test.js +20 -15
- package/commands/sandbox/__tests__/delete.test.js +20 -15
- package/commands/sandbox/create.d.ts +1 -1
- package/commands/sandbox/create.js +69 -67
- package/commands/sandbox/delete.d.ts +1 -1
- package/commands/sandbox/delete.js +96 -94
- package/commands/sandbox.d.ts +1 -1
- package/commands/sandbox.js +14 -9
- package/commands/secret/__tests__/addSecret.test.js +18 -13
- package/commands/secret/__tests__/deleteSecret.test.js +18 -13
- package/commands/secret/__tests__/listSecret.test.js +18 -13
- package/commands/secret/__tests__/updateSecret.test.js +18 -13
- package/commands/secret/addSecret.d.ts +1 -1
- package/commands/secret/addSecret.js +28 -26
- package/commands/secret/deleteSecret.d.ts +1 -1
- package/commands/secret/deleteSecret.js +29 -27
- package/commands/secret/listSecret.d.ts +1 -1
- package/commands/secret/listSecret.js +21 -19
- package/commands/secret/updateSecret.d.ts +1 -1
- package/commands/secret/updateSecret.js +27 -25
- package/commands/secret.d.ts +1 -1
- package/commands/secret.js +18 -13
- package/commands/testAccount/__tests__/create.test.js +22 -17
- package/commands/testAccount/__tests__/createConfig.test.js +11 -9
- package/commands/testAccount/__tests__/delete.test.js +20 -15
- package/commands/testAccount/create.d.ts +1 -1
- package/commands/testAccount/create.js +57 -62
- package/commands/testAccount/createConfig.d.ts +1 -3
- package/commands/testAccount/createConfig.js +47 -43
- package/commands/testAccount/delete.d.ts +1 -1
- package/commands/testAccount/delete.js +19 -17
- package/commands/testAccount.d.ts +1 -1
- package/commands/testAccount.js +15 -10
- package/commands/theme/__tests__/generate-selectors.test.js +12 -7
- package/commands/theme/__tests__/marketplace-validate.test.js +19 -14
- package/commands/theme/__tests__/preview.test.js +17 -12
- package/commands/theme/generate-selectors.d.ts +1 -1
- package/commands/theme/generate-selectors.js +28 -23
- package/commands/theme/marketplace-validate.d.ts +1 -1
- package/commands/theme/marketplace-validate.js +24 -19
- package/commands/theme/preview.d.ts +1 -1
- package/commands/theme/preview.js +65 -60
- package/commands/theme.d.ts +1 -1
- package/commands/theme.js +16 -11
- package/commands/upload.d.ts +1 -1
- package/commands/upload.js +82 -77
- package/commands/watch.d.ts +1 -1
- package/commands/watch.js +51 -45
- package/lang/en.d.ts +62 -23
- package/lang/en.js +434 -389
- package/lang/en.lyaml +0 -26
- package/lib/__tests__/accountTypes.test.js +22 -20
- package/lib/__tests__/buildAccount.test.js +90 -27
- package/lib/__tests__/commonOpts.test.js +22 -20
- package/lib/__tests__/dependencyManagement.test.js +51 -46
- package/lib/__tests__/developerTestAccounts.test.js +62 -27
- package/lib/__tests__/hasFeature.test.js +8 -6
- package/lib/__tests__/npm.test.js +20 -15
- package/lib/__tests__/oauth.test.js +28 -23
- package/lib/__tests__/parsing.test.js +20 -18
- package/lib/__tests__/polling.test.js +26 -24
- package/lib/__tests__/process.test.js +19 -14
- package/lib/__tests__/projectProfiles.test.js +39 -34
- package/lib/__tests__/sandboxSync.test.js +35 -30
- package/lib/__tests__/sandboxes.test.js +31 -29
- package/lib/__tests__/serverlessLogs.test.js +13 -8
- package/lib/__tests__/usageTracking.test.js +42 -47
- package/lib/__tests__/validation.test.js +20 -18
- package/lib/__tests__/yargsUtils.test.js +41 -6
- package/lib/accountTypes.js +34 -24
- package/lib/app/__tests__/migrate.test.js +99 -94
- package/lib/app/__tests__/migrate_legacy.test.js +31 -29
- package/lib/app/migrate.d.ts +3 -3
- package/lib/app/migrate.js +145 -127
- package/lib/app/migrate_legacy.d.ts +1 -1
- package/lib/app/migrate_legacy.js +78 -72
- package/lib/app/urls.js +9 -5
- package/lib/buildAccount.d.ts +8 -2
- package/lib/buildAccount.js +119 -61
- package/lib/commonOpts.d.ts +1 -1
- package/lib/commonOpts.js +59 -42
- package/lib/configMigrate.js +38 -34
- package/lib/configOptions.js +40 -34
- package/lib/constants.js +34 -31
- package/lib/customObject.js +6 -2
- package/lib/dependencyManagement.js +45 -37
- package/lib/developerTestAccounts.d.ts +1 -1
- package/lib/developerTestAccounts.js +39 -34
- package/lib/doctor/Diagnosis.d.ts +1 -1
- package/lib/doctor/Diagnosis.js +29 -25
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +37 -30
- package/lib/doctor/Doctor.d.ts +1 -1
- package/lib/doctor/Doctor.js +101 -94
- package/lib/doctor/__tests__/Diagnosis.test.js +14 -9
- package/lib/doctor/__tests__/DiagnosticInfoBuilder.test.js +34 -29
- package/lib/doctor/__tests__/Doctor.test.js +26 -24
- package/lib/enums/exitCodes.js +4 -1
- package/lib/errorHandlers/index.js +41 -32
- package/lib/errorHandlers/suppressError.d.ts +1 -1
- package/lib/errorHandlers/suppressError.js +31 -28
- package/lib/filesystem.js +15 -8
- package/lib/generateSelectors.js +29 -18
- package/lib/hasFeature.d.ts +1 -1
- package/lib/hasFeature.js +6 -3
- package/lib/interpolation.js +18 -11
- package/lib/lang.d.ts +1 -1
- package/lib/lang.js +27 -22
- package/lib/links.js +24 -16
- package/lib/marketplaceValidate.js +39 -29
- package/lib/mcp/setup.js +105 -72
- package/lib/middleware/__test__/configMiddleware.test.js +55 -20
- package/lib/middleware/__test__/gitMiddleware.test.js +42 -7
- package/lib/middleware/__test__/notificationsMiddleware.test.js +4 -2
- package/lib/middleware/__test__/requestMiddleware.test.js +11 -6
- package/lib/middleware/__test__/utils.test.js +11 -9
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +44 -9
- package/lib/middleware/autoUpdateMiddleware.js +40 -33
- package/lib/middleware/configMiddleware.js +42 -36
- package/lib/middleware/fireAlarmMiddleware.js +18 -12
- package/lib/middleware/gitMiddleware.js +8 -5
- package/lib/middleware/notificationsMiddleware.js +23 -16
- package/lib/middleware/requestMiddleware.js +10 -4
- package/lib/middleware/utils.js +4 -1
- package/lib/middleware/yargsChecksMiddleware.js +13 -10
- package/lib/npm.js +23 -14
- package/lib/oauth.js +35 -29
- package/lib/parsing.js +6 -3
- package/lib/polling.js +15 -11
- package/lib/process.js +19 -11
- package/lib/projectProfiles.d.ts +2 -2
- package/lib/projectProfiles.js +42 -32
- package/lib/projects/ProjectLogsManager.js +21 -18
- package/lib/projects/__tests__/AppDevModeInterface.test.js +145 -140
- package/lib/projects/__tests__/LocalDevProcess.test.js +73 -68
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +37 -32
- package/lib/projects/__tests__/ProjectLogsManager.test.js +58 -56
- package/lib/projects/__tests__/buildAndDeploy.test.js +9 -7
- package/lib/projects/__tests__/components.test.js +14 -9
- package/lib/projects/__tests__/projects.test.js +40 -35
- package/lib/projects/__tests__/structure.test.js +81 -43
- package/lib/projects/add/__tests__/legacyAddComponent.test.js +28 -26
- package/lib/projects/add/__tests__/v3AddComponent.test.js +30 -25
- package/lib/projects/add/legacyAddComponent.d.ts +1 -1
- package/lib/projects/add/legacyAddComponent.js +30 -24
- package/lib/projects/add/v3AddComponent.d.ts +1 -1
- package/lib/projects/add/v3AddComponent.js +42 -36
- package/lib/projects/buildAndDeploy.d.ts +1 -1
- package/lib/projects/buildAndDeploy.js +97 -88
- package/lib/projects/components.js +25 -19
- package/lib/projects/config.d.ts +1 -1
- package/lib/projects/config.js +41 -32
- package/lib/projects/create/__tests__/legacy.test.js +57 -22
- package/lib/projects/create/__tests__/v3.test.js +7 -5
- package/lib/projects/create/index.d.ts +3 -3
- package/lib/projects/create/index.js +22 -19
- package/lib/projects/create/legacy.d.ts +1 -1
- package/lib/projects/create/legacy.js +31 -25
- package/lib/projects/create/v3.d.ts +3 -3
- package/lib/projects/create/v3.js +59 -49
- package/lib/projects/ensureProjectExists.js +37 -31
- package/lib/projects/localDev/AppDevModeInterface.d.ts +3 -3
- package/lib/projects/localDev/AppDevModeInterface.js +60 -58
- package/lib/projects/localDev/DevServerManager.d.ts +1 -1
- package/lib/projects/localDev/DevServerManager.js +24 -24
- package/lib/projects/localDev/DevServerManagerV2.d.ts +2 -2
- package/lib/projects/localDev/DevServerManagerV2.js +20 -17
- package/lib/projects/localDev/LocalDevLogger.d.ts +1 -1
- package/lib/projects/localDev/LocalDevLogger.js +64 -59
- package/lib/projects/localDev/LocalDevManager.d.ts +1 -1
- package/lib/projects/localDev/LocalDevManager.js +111 -106
- package/lib/projects/localDev/LocalDevProcess.d.ts +4 -4
- package/lib/projects/localDev/LocalDevProcess.js +30 -25
- package/lib/projects/localDev/LocalDevState.d.ts +3 -3
- package/lib/projects/localDev/LocalDevState.js +5 -3
- package/lib/projects/localDev/LocalDevWatcher.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWatcher.js +11 -6
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +1 -1
- package/lib/projects/localDev/LocalDevWebsocketServer.js +27 -25
- package/lib/projects/localDev/helpers.d.ts +4 -4
- package/lib/projects/localDev/helpers.js +174 -156
- package/lib/projects/structure.d.ts +4 -4
- package/lib/projects/structure.js +78 -32
- package/lib/projects/ui.js +13 -10
- package/lib/projects/upload.d.ts +3 -2
- package/lib/projects/upload.js +65 -55
- package/lib/projects/urls.js +24 -14
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +54 -48
- package/lib/prompts/__tests__/downloadProjectPrompt.test.js +11 -9
- package/lib/prompts/__tests__/projectsLogsPrompt.test.js +16 -11
- package/lib/prompts/accountNamePrompt.d.ts +1 -1
- package/lib/prompts/accountNamePrompt.js +31 -26
- package/lib/prompts/accountsPrompt.js +15 -12
- package/lib/prompts/cmsFieldPrompt.js +19 -13
- package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
- package/lib/prompts/createApiSamplePrompt.js +12 -9
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.d.ts +11 -10
- package/lib/prompts/createDeveloperTestAccountConfigPrompt.js +88 -43
- package/lib/prompts/createFunctionPrompt.js +20 -17
- package/lib/prompts/createModulePrompt.js +15 -12
- package/lib/prompts/createTemplatePrompt.js +8 -5
- package/lib/prompts/downloadProjectPrompt.js +20 -17
- package/lib/prompts/installAppPrompt.js +26 -19
- package/lib/prompts/personalAccessKeyPrompt.d.ts +2 -2
- package/lib/prompts/personalAccessKeyPrompt.js +47 -40
- package/lib/prompts/previewPrompt.js +22 -15
- package/lib/prompts/projectAddPrompt.d.ts +1 -1
- package/lib/prompts/projectAddPrompt.js +18 -14
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -1
- package/lib/prompts/projectDevTargetAccountPrompt.js +54 -48
- package/lib/prompts/projectNameAndDestPrompt.d.ts +1 -1
- package/lib/prompts/projectNameAndDestPrompt.js +29 -22
- package/lib/prompts/projectNamePrompt.js +14 -11
- package/lib/prompts/projectsLogsPrompt.js +8 -5
- package/lib/prompts/promptUtils.d.ts +1 -1
- package/lib/prompts/promptUtils.js +87 -70
- package/lib/prompts/sandboxesPrompt.d.ts +1 -1
- package/lib/prompts/sandboxesPrompt.js +30 -26
- package/lib/prompts/secretPrompt.js +15 -10
- package/lib/prompts/selectAppPrompt.js +14 -11
- package/lib/prompts/selectHubDBTablePrompt.js +30 -24
- package/lib/prompts/selectProjectTemplatePrompt.d.ts +1 -1
- package/lib/prompts/selectProjectTemplatePrompt.js +13 -10
- package/lib/prompts/selectPublicAppForMigrationPrompt.js +25 -22
- package/lib/prompts/setAsDefaultAccountPrompt.js +16 -13
- package/lib/prompts/uploadPrompt.js +17 -11
- package/lib/sandboxSync.d.ts +1 -1
- package/lib/sandboxSync.js +65 -58
- package/lib/sandboxes.d.ts +1 -1
- package/lib/sandboxes.js +76 -68
- package/lib/schema.js +23 -12
- package/lib/serverlessLogs.js +52 -45
- package/lib/testUtils.js +8 -4
- package/lib/ui/SpinniesManager.d.ts +1 -1
- package/lib/ui/SpinniesManager.js +34 -29
- package/lib/ui/boxen.js +14 -11
- package/lib/ui/git.js +20 -14
- package/lib/ui/index.js +74 -56
- package/lib/ui/logger.js +13 -10
- package/lib/ui/serverlessFunctionLogs.js +20 -14
- package/lib/ui/spinniesUtils.js +39 -24
- package/lib/ui/supportHyperlinks.js +6 -3
- package/lib/ui/supportsColor.js +17 -11
- package/lib/ui/table.js +13 -6
- package/lib/upload.js +21 -15
- package/lib/usageTracking.d.ts +11 -0
- package/lib/usageTracking.js +95 -95
- package/lib/utils/hasFlag.js +8 -2
- package/lib/validation.js +87 -48
- package/lib/yargsUtils.d.ts +1 -1
- package/lib/yargsUtils.js +16 -13
- package/mcp-server/server.js +8 -6
- package/mcp-server/tools/index.js +16 -13
- package/mcp-server/tools/project/AddFeatureToProject.d.ts +1 -1
- package/mcp-server/tools/project/AddFeatureToProject.js +41 -34
- package/mcp-server/tools/project/CreateProjectTool.d.ts +3 -3
- package/mcp-server/tools/project/CreateProjectTool.js +52 -45
- package/mcp-server/tools/project/DeployProject.d.ts +1 -1
- package/mcp-server/tools/project/DeployProject.js +24 -17
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +1 -1
- package/mcp-server/tools/project/GuidedWalkthroughTool.js +27 -20
- package/mcp-server/tools/project/UploadProjectTools.d.ts +1 -1
- package/mcp-server/tools/project/UploadProjectTools.js +21 -11
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +1 -1
- package/mcp-server/tools/project/ValidateProjectTool.js +19 -12
- package/mcp-server/tools/project/__tests__/AddFeatureToProject.test.js +15 -12
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +16 -13
- package/mcp-server/tools/project/__tests__/DeployProject.test.js +9 -6
- package/mcp-server/tools/project/__tests__/GuidedWalkthroughTool.test.js +7 -4
- package/mcp-server/tools/project/__tests__/UploadProjectTools.test.js +7 -4
- package/mcp-server/tools/project/__tests__/ValidateProjectTool.test.js +7 -4
- package/mcp-server/tools/project/constants.js +9 -3
- package/mcp-server/types.js +5 -1
- package/mcp-server/utils/__tests__/command.test.js +11 -9
- package/mcp-server/utils/__tests__/project.test.js +26 -18
- package/mcp-server/utils/command.d.ts +1 -1
- package/mcp-server/utils/command.js +11 -4
- package/mcp-server/utils/content.d.ts +1 -1
- package/mcp-server/utils/content.js +6 -2
- package/mcp-server/utils/project.js +17 -8
- package/mcp-server/utils/toolUsageTracking.d.ts +1 -0
- package/mcp-server/utils/toolUsageTracking.js +25 -0
- package/package.json +13 -17
- package/types/{cms.d.ts → Cms.d.ts} +1 -1
- package/types/Cms.js +2 -0
- package/types/LocalDev.d.ts +4 -4
- package/types/LocalDev.js +2 -1
- package/types/ProjectComponents.d.ts +2 -2
- package/types/ProjectComponents.js +2 -1
- package/types/Projects.d.ts +1 -1
- package/types/Projects.js +5 -2
- package/types/Prompts.js +2 -1
- package/types/Sandboxes.js +2 -0
- package/types/Yargs.js +2 -1
- package/types/sandboxes.js +0 -1
- /package/{types/cms.js → commands/app/__tests__/install.test.d.ts} +0 -0
- /package/types/{sandboxes.d.ts → Sandboxes.d.ts} +0 -0
|
@@ -1,69 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fileManager_1 = require("@hubspot/local-dev-lib/fileManager");
|
|
9
|
+
const fileManager_2 = require("@hubspot/local-dev-lib/api/fileManager");
|
|
10
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
11
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
12
|
+
const modules_1 = require("@hubspot/local-dev-lib/cms/modules");
|
|
13
|
+
const ignoreRules_1 = require("@hubspot/local-dev-lib/ignoreRules");
|
|
14
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
15
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
16
|
+
const lang_1 = require("../../lib/lang");
|
|
17
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
18
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
14
19
|
const command = 'upload <src> <dest>';
|
|
15
|
-
const describe = i18n(`commands.filemanager.subcommands.upload.describe`);
|
|
20
|
+
const describe = (0, lang_1.i18n)(`commands.filemanager.subcommands.upload.describe`);
|
|
16
21
|
async function handler(args) {
|
|
17
22
|
const { src, dest, derivedAccountId } = args;
|
|
18
|
-
const absoluteSrcPath =
|
|
23
|
+
const absoluteSrcPath = path_1.default.resolve((0, path_2.getCwd)(), src);
|
|
19
24
|
let stats;
|
|
20
25
|
try {
|
|
21
|
-
stats =
|
|
26
|
+
stats = fs_1.default.statSync(absoluteSrcPath);
|
|
22
27
|
if (!stats.isFile() && !stats.isDirectory()) {
|
|
23
|
-
logger.error(i18n(`commands.filemanager.subcommands.upload.errors.invalidPath`, {
|
|
28
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.errors.invalidPath`, {
|
|
24
29
|
path: src,
|
|
25
30
|
}));
|
|
26
31
|
return;
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
catch (e) {
|
|
30
|
-
logger.error(i18n(`commands.filemanager.subcommands.upload.errors.invalidPath`, {
|
|
35
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.errors.invalidPath`, {
|
|
31
36
|
path: src,
|
|
32
37
|
}));
|
|
33
38
|
return;
|
|
34
39
|
}
|
|
35
40
|
if (!dest) {
|
|
36
|
-
logger.error(i18n(`commands.filemanager.subcommands.upload.errors.destinationRequired`));
|
|
41
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.errors.destinationRequired`));
|
|
37
42
|
return;
|
|
38
43
|
}
|
|
39
|
-
const normalizedDest = convertToUnixPath(dest);
|
|
40
|
-
trackCommandUsage('filemanager-upload', { type: stats.isFile() ? 'file' : 'folder' }, derivedAccountId);
|
|
41
|
-
const srcDestIssues = await validateSrcAndDestPaths({ isLocal: true, path: src }, { isHubSpot: true, path: dest });
|
|
44
|
+
const normalizedDest = (0, path_2.convertToUnixPath)(dest);
|
|
45
|
+
(0, usageTracking_1.trackCommandUsage)('filemanager-upload', { type: stats.isFile() ? 'file' : 'folder' }, derivedAccountId);
|
|
46
|
+
const srcDestIssues = await (0, modules_1.validateSrcAndDestPaths)({ isLocal: true, path: src }, { isHubSpot: true, path: dest });
|
|
42
47
|
if (srcDestIssues.length) {
|
|
43
|
-
srcDestIssues.forEach(({ message }) => logger.error(message));
|
|
44
|
-
process.exit(EXIT_CODES.ERROR);
|
|
48
|
+
srcDestIssues.forEach(({ message }) => logger_1.logger.error(message));
|
|
49
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
45
50
|
}
|
|
46
51
|
if (stats.isFile()) {
|
|
47
|
-
if (shouldIgnoreFile(absoluteSrcPath)) {
|
|
48
|
-
logger.error(i18n(`commands.filemanager.subcommands.upload.errors.fileIgnored`, {
|
|
52
|
+
if ((0, ignoreRules_1.shouldIgnoreFile)(absoluteSrcPath)) {
|
|
53
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.errors.fileIgnored`, {
|
|
49
54
|
path: src,
|
|
50
55
|
}));
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
|
-
uploadFile(derivedAccountId, absoluteSrcPath, normalizedDest)
|
|
58
|
+
(0, fileManager_2.uploadFile)(derivedAccountId, absoluteSrcPath, normalizedDest)
|
|
54
59
|
.then(() => {
|
|
55
|
-
logger.success(i18n(`commands.filemanager.subcommands.upload.success.upload`, {
|
|
60
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.success.upload`, {
|
|
56
61
|
accountId: derivedAccountId,
|
|
57
62
|
dest: normalizedDest,
|
|
58
63
|
src,
|
|
59
64
|
}));
|
|
60
65
|
})
|
|
61
66
|
.catch(error => {
|
|
62
|
-
logger.error(i18n(`commands.filemanager.subcommands.upload.errors.upload`, {
|
|
67
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.errors.upload`, {
|
|
63
68
|
dest: normalizedDest,
|
|
64
69
|
src,
|
|
65
70
|
}));
|
|
66
|
-
logError(error, new ApiErrorContext({
|
|
71
|
+
(0, index_1.logError)(error, new index_1.ApiErrorContext({
|
|
67
72
|
accountId: derivedAccountId,
|
|
68
73
|
request: normalizedDest,
|
|
69
74
|
payload: src,
|
|
@@ -71,20 +76,20 @@ async function handler(args) {
|
|
|
71
76
|
});
|
|
72
77
|
}
|
|
73
78
|
else {
|
|
74
|
-
logger.log(i18n(`commands.filemanager.subcommands.upload.logs.uploading`, {
|
|
79
|
+
logger_1.logger.log((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.logs.uploading`, {
|
|
75
80
|
accountId: derivedAccountId,
|
|
76
81
|
dest,
|
|
77
82
|
src,
|
|
78
83
|
}));
|
|
79
|
-
uploadFolder(derivedAccountId, absoluteSrcPath, dest)
|
|
84
|
+
(0, fileManager_1.uploadFolder)(derivedAccountId, absoluteSrcPath, dest)
|
|
80
85
|
.then(() => {
|
|
81
|
-
logger.success(i18n(`commands.filemanager.subcommands.upload.success.uploadComplete`, {
|
|
86
|
+
logger_1.logger.success((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.success.uploadComplete`, {
|
|
82
87
|
dest,
|
|
83
88
|
}));
|
|
84
89
|
})
|
|
85
90
|
.catch(error => {
|
|
86
|
-
logger.error(i18n(`commands.filemanager.subcommands.upload.errors.uploadingFailed`));
|
|
87
|
-
logError(error, {
|
|
91
|
+
logger_1.logger.error((0, lang_1.i18n)(`commands.filemanager.subcommands.upload.errors.uploadingFailed`));
|
|
92
|
+
(0, index_1.logError)(error, {
|
|
88
93
|
accountId: derivedAccountId,
|
|
89
94
|
});
|
|
90
95
|
});
|
|
@@ -92,16 +97,16 @@ async function handler(args) {
|
|
|
92
97
|
}
|
|
93
98
|
function fileManagerUploadBuilder(yargs) {
|
|
94
99
|
yargs.positional('src', {
|
|
95
|
-
describe: i18n(`commands.filemanager.subcommands.upload.positionals.src.describe`),
|
|
100
|
+
describe: (0, lang_1.i18n)(`commands.filemanager.subcommands.upload.positionals.src.describe`),
|
|
96
101
|
type: 'string',
|
|
97
102
|
});
|
|
98
103
|
yargs.positional('dest', {
|
|
99
|
-
describe: i18n(`commands.filemanager.subcommands.upload.positionals.dest.describe`),
|
|
104
|
+
describe: (0, lang_1.i18n)(`commands.filemanager.subcommands.upload.positionals.dest.describe`),
|
|
100
105
|
type: 'string',
|
|
101
106
|
});
|
|
102
107
|
return yargs;
|
|
103
108
|
}
|
|
104
|
-
const builder = makeYargsBuilder(fileManagerUploadBuilder, command, describe, {
|
|
109
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(fileManagerUploadBuilder, command, describe, {
|
|
105
110
|
useGlobalOptions: true,
|
|
106
111
|
useConfigOptions: true,
|
|
107
112
|
useAccountOptions: true,
|
|
@@ -113,4 +118,4 @@ const fileManagerUploadCommand = {
|
|
|
113
118
|
handler,
|
|
114
119
|
builder,
|
|
115
120
|
};
|
|
116
|
-
|
|
121
|
+
exports.default = fileManagerUploadCommand;
|
package/commands/filemanager.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const upload_1 = __importDefault(require("./filemanager/upload"));
|
|
7
|
+
const fetch_1 = __importDefault(require("./filemanager/fetch"));
|
|
8
|
+
const lang_1 = require("../lib/lang");
|
|
9
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
5
10
|
const command = 'filemanager';
|
|
6
|
-
const describe = i18n(`commands.filemanager.describe`);
|
|
11
|
+
const describe = (0, lang_1.i18n)(`commands.filemanager.describe`);
|
|
7
12
|
function fileManagerBuilder(yargs) {
|
|
8
|
-
yargs.command(
|
|
13
|
+
yargs.command(upload_1.default).command(fetch_1.default).demandCommand(1, '');
|
|
9
14
|
return yargs;
|
|
10
15
|
}
|
|
11
|
-
const builder = makeYargsBuilder(fileManagerBuilder, command, describe);
|
|
16
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(fileManagerBuilder, command, describe);
|
|
12
17
|
const fileManagerCommand = {
|
|
13
18
|
command,
|
|
14
19
|
describe,
|
|
15
20
|
builder,
|
|
16
21
|
handler: () => { },
|
|
17
22
|
};
|
|
18
|
-
|
|
23
|
+
exports.default = fileManagerCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
2
|
type FunctionDeployArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
3
|
path: string;
|
|
4
4
|
};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
7
|
+
const functions_1 = require("@hubspot/local-dev-lib/api/functions");
|
|
8
|
+
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
9
|
+
const SpinniesManager_1 = __importDefault(require("../../lib/ui/SpinniesManager"));
|
|
10
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
11
|
+
const index_2 = require("../../lib/errorHandlers/index");
|
|
12
|
+
const ui_1 = require("../../lib/ui");
|
|
13
|
+
const polling_1 = require("../../lib/polling");
|
|
14
|
+
const serverlessLogs_1 = require("../../lib/serverlessLogs");
|
|
15
|
+
const lang_1 = require("../../lib/lang");
|
|
16
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
12
17
|
function isFunctionBuildError(e) {
|
|
13
18
|
return (typeof e === 'object' && e !== null && 'status' in e && e.status === 'ERROR');
|
|
14
19
|
}
|
|
@@ -17,36 +22,36 @@ const describe = undefined;
|
|
|
17
22
|
async function handler(args) {
|
|
18
23
|
const { path: functionPath, derivedAccountId } = args;
|
|
19
24
|
const splitFunctionPath = functionPath.split('.');
|
|
20
|
-
trackCommandUsage('function-deploy', undefined, derivedAccountId);
|
|
25
|
+
(0, usageTracking_1.trackCommandUsage)('function-deploy', undefined, derivedAccountId);
|
|
21
26
|
if (!splitFunctionPath.length ||
|
|
22
27
|
splitFunctionPath[splitFunctionPath.length - 1] !== 'functions') {
|
|
23
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.notFunctionsFolder', {
|
|
28
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.function.subcommands.deploy.errors.notFunctionsFolder', {
|
|
24
29
|
functionPath,
|
|
25
30
|
}));
|
|
26
31
|
return;
|
|
27
32
|
}
|
|
28
|
-
logger.debug(i18n('commands.function.subcommands.deploy.debug.startingBuildAndDeploy', {
|
|
33
|
+
logger_1.logger.debug((0, lang_1.i18n)('commands.function.subcommands.deploy.debug.startingBuildAndDeploy', {
|
|
29
34
|
functionPath,
|
|
30
35
|
}));
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
text: i18n('commands.function.subcommands.deploy.loading', {
|
|
34
|
-
account: uiAccountDescription(derivedAccountId),
|
|
36
|
+
SpinniesManager_1.default.init();
|
|
37
|
+
SpinniesManager_1.default.add('loading', {
|
|
38
|
+
text: (0, lang_1.i18n)('commands.function.subcommands.deploy.loading', {
|
|
39
|
+
account: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
35
40
|
functionPath,
|
|
36
41
|
}),
|
|
37
42
|
});
|
|
38
43
|
try {
|
|
39
|
-
const { data: buildId } = await buildPackage(derivedAccountId, functionPath);
|
|
40
|
-
const successResp = await poll(() => getBuildStatus(derivedAccountId, Number(buildId)));
|
|
44
|
+
const { data: buildId } = await (0, functions_1.buildPackage)(derivedAccountId, functionPath);
|
|
45
|
+
const successResp = await (0, polling_1.poll)(() => (0, functions_1.getBuildStatus)(derivedAccountId, Number(buildId)));
|
|
41
46
|
if (successResp) {
|
|
42
47
|
const buildTimeSeconds = successResp.buildTime
|
|
43
48
|
? (successResp.buildTime / 1000).toFixed(2)
|
|
44
49
|
: 0;
|
|
45
|
-
|
|
50
|
+
SpinniesManager_1.default.succeed('loading');
|
|
46
51
|
if (successResp.cdnUrl) {
|
|
47
|
-
await outputBuildLog(successResp.cdnUrl);
|
|
52
|
+
await (0, serverlessLogs_1.outputBuildLog)(successResp.cdnUrl);
|
|
48
53
|
}
|
|
49
|
-
logger.success(i18n('commands.function.subcommands.deploy.success.deployed', {
|
|
54
|
+
logger_1.logger.success((0, lang_1.i18n)('commands.function.subcommands.deploy.success.deployed', {
|
|
50
55
|
accountId: derivedAccountId,
|
|
51
56
|
buildTimeSeconds,
|
|
52
57
|
functionPath,
|
|
@@ -54,25 +59,25 @@ async function handler(args) {
|
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
catch (e) {
|
|
57
|
-
|
|
58
|
-
text: i18n('commands.function.subcommands.deploy.loadingFailed', {
|
|
59
|
-
account: uiAccountDescription(derivedAccountId),
|
|
62
|
+
SpinniesManager_1.default.fail('loading', {
|
|
63
|
+
text: (0, lang_1.i18n)('commands.function.subcommands.deploy.loadingFailed', {
|
|
64
|
+
account: (0, ui_1.uiAccountDescription)(derivedAccountId),
|
|
60
65
|
functionPath,
|
|
61
66
|
}),
|
|
62
67
|
});
|
|
63
|
-
if (isHubSpotHttpError(e) && e.status === 404) {
|
|
64
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.noPackageJson', {
|
|
68
|
+
if ((0, index_1.isHubSpotHttpError)(e) && e.status === 404) {
|
|
69
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.function.subcommands.deploy.errors.noPackageJson', {
|
|
65
70
|
functionPath,
|
|
66
71
|
}));
|
|
67
72
|
}
|
|
68
73
|
else if (isFunctionBuildError(e)) {
|
|
69
|
-
await outputBuildLog(e.cdnUrl);
|
|
70
|
-
logger.error(i18n('commands.function.subcommands.deploy.errors.buildError', {
|
|
74
|
+
await (0, serverlessLogs_1.outputBuildLog)(e.cdnUrl);
|
|
75
|
+
logger_1.logger.error((0, lang_1.i18n)('commands.function.subcommands.deploy.errors.buildError', {
|
|
71
76
|
details: String(e.errorReason),
|
|
72
77
|
}));
|
|
73
78
|
}
|
|
74
79
|
else {
|
|
75
|
-
logError(e, new ApiErrorContext({
|
|
80
|
+
(0, index_2.logError)(e, new index_2.ApiErrorContext({
|
|
76
81
|
accountId: derivedAccountId,
|
|
77
82
|
request: functionPath,
|
|
78
83
|
}));
|
|
@@ -81,18 +86,18 @@ async function handler(args) {
|
|
|
81
86
|
}
|
|
82
87
|
function functionDeployBuilder(yargs) {
|
|
83
88
|
yargs.positional('path', {
|
|
84
|
-
describe: i18n('commands.function.subcommands.deploy.positionals.path.describe'),
|
|
89
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.deploy.positionals.path.describe'),
|
|
85
90
|
type: 'string',
|
|
86
91
|
});
|
|
87
92
|
yargs.example([
|
|
88
93
|
[
|
|
89
94
|
'$0 functions deploy myFunctionFolder.functions',
|
|
90
|
-
i18n('commands.function.subcommands.deploy.examples.default'),
|
|
95
|
+
(0, lang_1.i18n)('commands.function.subcommands.deploy.examples.default'),
|
|
91
96
|
],
|
|
92
97
|
]);
|
|
93
98
|
return yargs;
|
|
94
99
|
}
|
|
95
|
-
const builder = makeYargsBuilder(functionDeployBuilder, command, describe, {
|
|
100
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionDeployBuilder, command, describe, {
|
|
96
101
|
useConfigOptions: true,
|
|
97
102
|
useAccountOptions: true,
|
|
98
103
|
useEnvironmentOptions: true,
|
|
@@ -103,4 +108,4 @@ const functionDeployCommand = {
|
|
|
103
108
|
handler,
|
|
104
109
|
builder,
|
|
105
110
|
};
|
|
106
|
-
|
|
111
|
+
exports.default = functionDeployCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
2
|
type FunctionListArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
3
|
json?: boolean;
|
|
4
4
|
};
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const moment_1 = __importDefault(require("moment"));
|
|
7
|
+
const functions_1 = require("@hubspot/local-dev-lib/api/functions");
|
|
8
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
10
|
+
const table_1 = require("../../lib/ui/table");
|
|
11
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
12
|
+
const lang_1 = require("../../lib/lang");
|
|
13
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
14
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
10
15
|
const command = ['list', 'ls'];
|
|
11
|
-
const describe = i18n('commands.function.subcommands.list.describe');
|
|
16
|
+
const describe = (0, lang_1.i18n)('commands.function.subcommands.list.describe');
|
|
12
17
|
async function handler(args) {
|
|
13
18
|
const { derivedAccountId } = args;
|
|
14
|
-
trackCommandUsage('function-list', undefined, derivedAccountId);
|
|
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
|
+
(0, usageTracking_1.trackCommandUsage)('function-list', undefined, derivedAccountId);
|
|
20
|
+
logger_1.logger.debug((0, lang_1.i18n)('commands.function.subcommands.list.debug.gettingFunctions'));
|
|
21
|
+
const { data: routesResp } = await (0, functions_1.getRoutes)(derivedAccountId).catch(async (e) => {
|
|
22
|
+
(0, index_1.logError)(e, new index_1.ApiErrorContext({ accountId: derivedAccountId }));
|
|
23
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
19
24
|
});
|
|
20
25
|
if (!routesResp.objects.length) {
|
|
21
|
-
return logger.info(i18n('commands.function.subcommands.list.info.noFunctions'));
|
|
26
|
+
return logger_1.logger.info((0, lang_1.i18n)('commands.function.subcommands.list.info.noFunctions'));
|
|
22
27
|
}
|
|
23
28
|
if (args.json) {
|
|
24
|
-
return logger.log(routesResp.objects);
|
|
29
|
+
return logger_1.logger.log(routesResp.objects);
|
|
25
30
|
}
|
|
26
31
|
const functionsAsArrays = routesResp.objects.map(func => {
|
|
27
32
|
const { route, method, created, updated, secretNames } = func;
|
|
@@ -29,23 +34,23 @@ async function handler(args) {
|
|
|
29
34
|
route,
|
|
30
35
|
method,
|
|
31
36
|
secretNames.join(', '),
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
(0, moment_1.default)(created).format(),
|
|
38
|
+
(0, moment_1.default)(updated).format(),
|
|
34
39
|
];
|
|
35
40
|
});
|
|
36
|
-
functionsAsArrays.unshift(getTableHeader(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
|
|
37
|
-
return logger.log(getTableContents(functionsAsArrays));
|
|
41
|
+
functionsAsArrays.unshift((0, table_1.getTableHeader)(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
|
|
42
|
+
return logger_1.logger.log((0, table_1.getTableContents)(functionsAsArrays));
|
|
38
43
|
}
|
|
39
44
|
function functionListBuilder(yargs) {
|
|
40
45
|
yargs.options({
|
|
41
46
|
json: {
|
|
42
|
-
describe: i18n('commands.function.subcommands.list.options.json.describe'),
|
|
47
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.list.options.json.describe'),
|
|
43
48
|
type: 'boolean',
|
|
44
49
|
},
|
|
45
50
|
});
|
|
46
51
|
return yargs;
|
|
47
52
|
}
|
|
48
|
-
const builder = makeYargsBuilder(functionListBuilder, command, describe, {
|
|
53
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionListBuilder, command, describe, {
|
|
49
54
|
useConfigOptions: true,
|
|
50
55
|
useAccountOptions: true,
|
|
51
56
|
useEnvironmentOptions: true,
|
|
@@ -56,4 +61,4 @@ const functionListCommand = {
|
|
|
56
61
|
handler,
|
|
57
62
|
builder,
|
|
58
63
|
};
|
|
59
|
-
|
|
64
|
+
exports.default = functionListCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs
|
|
1
|
+
import { CommonArgs, ConfigArgs, AccountArgs, EnvironmentArgs, YargsCommandModule } from '../../types/Yargs';
|
|
2
2
|
type FunctionServerArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|
|
3
3
|
path: string;
|
|
4
4
|
port?: string;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
3
5
|
// This package is not typed, so we need to use require
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const { start: startTestServer } = require('@hubspot/serverless-dev-runtime');
|
|
7
|
+
const lang_1 = require("../../lib/lang");
|
|
8
|
+
const yargsUtils_1 = require("../../lib/yargsUtils");
|
|
7
9
|
const command = 'server <path>';
|
|
8
10
|
const describe = undefined;
|
|
9
11
|
async function handler(args) {
|
|
10
12
|
const { path: functionPath, derivedAccountId } = args;
|
|
11
|
-
trackCommandUsage('functions-server', undefined, derivedAccountId);
|
|
12
|
-
logger.debug(i18n('commands.function.subcommands.server.debug.startingServer', {
|
|
13
|
+
(0, usageTracking_1.trackCommandUsage)('functions-server', undefined, derivedAccountId);
|
|
14
|
+
logger_1.logger.debug((0, lang_1.i18n)('commands.function.subcommands.server.debug.startingServer', {
|
|
13
15
|
functionPath,
|
|
14
16
|
}));
|
|
15
17
|
startTestServer({
|
|
@@ -19,27 +21,27 @@ async function handler(args) {
|
|
|
19
21
|
}
|
|
20
22
|
function functionServerBuilder(yargs) {
|
|
21
23
|
yargs.positional('path', {
|
|
22
|
-
describe: i18n('commands.function.subcommands.server.positionals.path.describe'),
|
|
24
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.positionals.path.describe'),
|
|
23
25
|
type: 'string',
|
|
24
26
|
});
|
|
25
27
|
yargs.options({
|
|
26
28
|
port: {
|
|
27
|
-
describe: i18n('commands.function.subcommands.server.options.port.describe'),
|
|
29
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.port.describe'),
|
|
28
30
|
type: 'string',
|
|
29
31
|
default: 5432,
|
|
30
32
|
},
|
|
31
33
|
contact: {
|
|
32
|
-
describe: i18n('commands.function.subcommands.server.options.contact.describe'),
|
|
34
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.contact.describe'),
|
|
33
35
|
type: 'boolean',
|
|
34
36
|
default: true,
|
|
35
37
|
},
|
|
36
38
|
watch: {
|
|
37
|
-
describe: i18n('commands.function.subcommands.server.options.watch.describe'),
|
|
39
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.watch.describe'),
|
|
38
40
|
type: 'boolean',
|
|
39
41
|
default: true,
|
|
40
42
|
},
|
|
41
43
|
'log-output': {
|
|
42
|
-
describe: i18n('commands.function.subcommands.server.options.logOutput.describe'),
|
|
44
|
+
describe: (0, lang_1.i18n)('commands.function.subcommands.server.options.logOutput.describe'),
|
|
43
45
|
type: 'boolean',
|
|
44
46
|
default: false,
|
|
45
47
|
},
|
|
@@ -47,12 +49,12 @@ function functionServerBuilder(yargs) {
|
|
|
47
49
|
yargs.example([
|
|
48
50
|
[
|
|
49
51
|
'$0 functions server ./tmp/myFunctionFolder.functions',
|
|
50
|
-
i18n('commands.function.subcommands.server.examples.default'),
|
|
52
|
+
(0, lang_1.i18n)('commands.function.subcommands.server.examples.default'),
|
|
51
53
|
],
|
|
52
54
|
]);
|
|
53
55
|
return yargs;
|
|
54
56
|
}
|
|
55
|
-
const builder = makeYargsBuilder(functionServerBuilder, command, describe, {
|
|
57
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionServerBuilder, command, describe, {
|
|
56
58
|
useConfigOptions: true,
|
|
57
59
|
useAccountOptions: true,
|
|
58
60
|
useEnvironmentOptions: true,
|
|
@@ -63,4 +65,4 @@ const functionServerCommand = {
|
|
|
63
65
|
handler,
|
|
64
66
|
builder,
|
|
65
67
|
};
|
|
66
|
-
|
|
68
|
+
exports.default = functionServerCommand;
|
package/commands/function.d.ts
CHANGED
package/commands/function.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.describe = exports.command = void 0;
|
|
7
|
+
const list_1 = __importDefault(require("./function/list"));
|
|
8
|
+
const deploy_1 = __importDefault(require("./function/deploy"));
|
|
9
|
+
const server_1 = __importDefault(require("./function/server"));
|
|
10
|
+
const lang_1 = require("../lib/lang");
|
|
11
|
+
const yargsUtils_1 = require("../lib/yargsUtils");
|
|
12
|
+
exports.command = ['function', 'functions'];
|
|
13
|
+
exports.describe = (0, lang_1.i18n)(`commands.function.describe`);
|
|
8
14
|
function functionBuilder(yargs) {
|
|
9
|
-
yargs.command(
|
|
15
|
+
yargs.command(list_1.default).command(deploy_1.default).command(server_1.default).demandCommand(1, '');
|
|
10
16
|
return yargs;
|
|
11
17
|
}
|
|
12
|
-
const builder = makeYargsBuilder(functionBuilder, command, describe, {
|
|
18
|
+
const builder = (0, yargsUtils_1.makeYargsBuilder)(functionBuilder, exports.command, exports.describe, {
|
|
13
19
|
useGlobalOptions: true,
|
|
14
20
|
});
|
|
15
21
|
const functionCommand = {
|
|
16
|
-
command,
|
|
17
|
-
describe,
|
|
22
|
+
command: exports.command,
|
|
23
|
+
describe: exports.describe,
|
|
18
24
|
builder,
|
|
19
25
|
handler: () => { },
|
|
20
26
|
};
|
|
21
|
-
|
|
27
|
+
exports.default = functionCommand;
|
package/commands/getStarted.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountArgs, YargsCommandModule, CommonArgs, ConfigArgs, EnvironmentArgs } from '../types/Yargs
|
|
1
|
+
import { AccountArgs, YargsCommandModule, CommonArgs, ConfigArgs, EnvironmentArgs } from '../types/Yargs';
|
|
2
2
|
export declare const command = "get-started";
|
|
3
3
|
export declare const describe: undefined;
|
|
4
4
|
type GetStartedArgs = CommonArgs & ConfigArgs & AccountArgs & EnvironmentArgs & {
|