@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
package/lib/commonOpts.js
CHANGED
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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.addGlobalOptions = addGlobalOptions;
|
|
7
|
+
exports.addAccountOptions = addAccountOptions;
|
|
8
|
+
exports.addConfigOptions = addConfigOptions;
|
|
9
|
+
exports.addOverwriteOptions = addOverwriteOptions;
|
|
10
|
+
exports.addCmsPublishModeOptions = addCmsPublishModeOptions;
|
|
11
|
+
exports.addTestingOptions = addTestingOptions;
|
|
12
|
+
exports.addUseEnvironmentOptions = addUseEnvironmentOptions;
|
|
13
|
+
exports.addJSONOutputOptions = addJSONOutputOptions;
|
|
14
|
+
exports.addCustomHelpOutput = addCustomHelpOutput;
|
|
15
|
+
exports.setLogLevel = setLogLevel;
|
|
16
|
+
exports.getCommandName = getCommandName;
|
|
17
|
+
exports.getCmsPublishMode = getCmsPublishMode;
|
|
18
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
19
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
20
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
21
|
+
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
22
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
23
|
+
const errorHandlers_1 = require("./errorHandlers");
|
|
24
|
+
const exitCodes_1 = require("./enums/exitCodes");
|
|
25
|
+
const ui_1 = require("./ui");
|
|
26
|
+
const lang_1 = require("./lang");
|
|
27
|
+
function addGlobalOptions(yargs) {
|
|
11
28
|
yargs.version(false);
|
|
12
29
|
yargs.option('debug', {
|
|
13
30
|
alias: 'd',
|
|
14
31
|
default: false,
|
|
15
|
-
describe: i18n('lib.commonOpts.options.debug.describe'),
|
|
32
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.debug.describe'),
|
|
16
33
|
type: 'boolean',
|
|
17
34
|
});
|
|
18
35
|
yargs.option('network-debug', {
|
|
@@ -22,63 +39,63 @@ export function addGlobalOptions(yargs) {
|
|
|
22
39
|
});
|
|
23
40
|
return yargs;
|
|
24
41
|
}
|
|
25
|
-
|
|
42
|
+
function addAccountOptions(yargs) {
|
|
26
43
|
return yargs.option('account', {
|
|
27
44
|
alias: 'a',
|
|
28
|
-
describe: i18n('lib.commonOpts.options.account.describe'),
|
|
45
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.account.describe'),
|
|
29
46
|
type: 'string',
|
|
30
47
|
});
|
|
31
48
|
}
|
|
32
|
-
|
|
49
|
+
function addConfigOptions(yargs) {
|
|
33
50
|
return yargs.option('config', {
|
|
34
51
|
alias: 'c',
|
|
35
|
-
describe: i18n('lib.commonOpts.options.config.describe'),
|
|
52
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.config.describe'),
|
|
36
53
|
type: 'string',
|
|
37
54
|
});
|
|
38
55
|
}
|
|
39
|
-
|
|
56
|
+
function addOverwriteOptions(yargs) {
|
|
40
57
|
return yargs.option('overwrite', {
|
|
41
58
|
alias: 'o',
|
|
42
|
-
describe: i18n('lib.commonOpts.options.overwrite.describe'),
|
|
59
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.overwrite.describe'),
|
|
43
60
|
type: 'boolean',
|
|
44
61
|
default: false,
|
|
45
62
|
});
|
|
46
63
|
}
|
|
47
|
-
|
|
48
|
-
const cmsPublishModes = `<${Object.values(CMS_PUBLISH_MODE).join(' | ')}>`;
|
|
64
|
+
function addCmsPublishModeOptions(yargs, { read, write }) {
|
|
65
|
+
const cmsPublishModes = `<${Object.values(files_1.CMS_PUBLISH_MODE).join(' | ')}>`;
|
|
49
66
|
return yargs.option('cms-publish-mode', {
|
|
50
67
|
alias: 'm',
|
|
51
|
-
describe: i18n(`lib.commonOpts.options.modes.describe.${read ? 'read' : write ? 'write' : 'default'}`, { modes: cmsPublishModes }),
|
|
68
|
+
describe: (0, lang_1.i18n)(`lib.commonOpts.options.modes.describe.${read ? 'read' : write ? 'write' : 'default'}`, { modes: cmsPublishModes }),
|
|
52
69
|
type: 'string',
|
|
53
70
|
});
|
|
54
71
|
}
|
|
55
|
-
|
|
72
|
+
function addTestingOptions(yargs) {
|
|
56
73
|
return yargs.option('qa', {
|
|
57
|
-
describe: i18n('lib.commonOpts.options.qa.describe'),
|
|
74
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.qa.describe'),
|
|
58
75
|
type: 'boolean',
|
|
59
76
|
default: false,
|
|
60
77
|
hidden: true,
|
|
61
78
|
});
|
|
62
79
|
}
|
|
63
|
-
|
|
80
|
+
function addUseEnvironmentOptions(yargs) {
|
|
64
81
|
yargs.option('use-env', {
|
|
65
|
-
describe: i18n('lib.commonOpts.options.useEnv.describe'),
|
|
82
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.useEnv.describe'),
|
|
66
83
|
type: 'boolean',
|
|
67
84
|
});
|
|
68
85
|
yargs.conflicts('use-env', 'account');
|
|
69
86
|
return yargs;
|
|
70
87
|
}
|
|
71
|
-
|
|
88
|
+
function addJSONOutputOptions(yargs) {
|
|
72
89
|
return yargs.option('json', {
|
|
73
90
|
alias: 'format-output-as-json',
|
|
74
|
-
describe: i18n('lib.commonOpts.options.jsonOutput.describe'),
|
|
91
|
+
describe: (0, lang_1.i18n)('lib.commonOpts.options.jsonOutput.describe'),
|
|
75
92
|
type: 'boolean',
|
|
76
93
|
hidden: true,
|
|
77
94
|
});
|
|
78
95
|
}
|
|
79
|
-
|
|
96
|
+
async function addCustomHelpOutput(yargs, command, describe) {
|
|
80
97
|
try {
|
|
81
|
-
const parsedArgv =
|
|
98
|
+
const parsedArgv = (0, yargs_parser_1.default)(process.argv.slice(2));
|
|
82
99
|
if (parsedArgv && parsedArgv.help) {
|
|
83
100
|
const commandBase = `hs ${parsedArgv._.slice(0, -1).join(' ')}`;
|
|
84
101
|
// Make sure we are targeting the correct command by confirming that
|
|
@@ -99,7 +116,7 @@ export async function addCustomHelpOutput(yargs, command, describe) {
|
|
|
99
116
|
// Format the original help output to be more readable
|
|
100
117
|
let commandHelp = await yargs.getHelp();
|
|
101
118
|
['Options:', 'Commands:', 'Examples:', 'Positionals:'].forEach(header => {
|
|
102
|
-
commandHelp = commandHelp.replace(header,
|
|
119
|
+
commandHelp = commandHelp.replace(header, chalk_1.default.bold(header));
|
|
103
120
|
});
|
|
104
121
|
// Remove "hs <command>" from the help output (this shows up for command buckets)
|
|
105
122
|
commandHelp = commandHelp.replace('hs <command>\n', '');
|
|
@@ -107,35 +124,35 @@ export async function addCustomHelpOutput(yargs, command, describe) {
|
|
|
107
124
|
if (commandHelp.startsWith('\n')) {
|
|
108
125
|
commandHelp = commandHelp.slice(1);
|
|
109
126
|
}
|
|
110
|
-
logger.log(`${uiCommandReference(fullCommand, false)}\n\n${describe ? `${describe}\n\n` : ''}${commandHelp}`);
|
|
111
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
127
|
+
logger_1.logger.log(`${(0, ui_1.uiCommandReference)(fullCommand, false)}\n\n${describe ? `${describe}\n\n` : ''}${commandHelp}`);
|
|
128
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
112
129
|
}
|
|
113
130
|
}
|
|
114
131
|
catch (e) {
|
|
115
132
|
// Ignore error to allow yargs to show the default help output using the command description
|
|
116
|
-
debugError(e);
|
|
133
|
+
(0, errorHandlers_1.debugError)(e);
|
|
117
134
|
}
|
|
118
135
|
}
|
|
119
|
-
|
|
136
|
+
function setLogLevel(options) {
|
|
120
137
|
const { debug, networkDebug, json } = options;
|
|
121
138
|
if (json) {
|
|
122
|
-
|
|
139
|
+
(0, logger_1.setLogLevel)(logger_1.LOG_LEVEL.ERROR);
|
|
123
140
|
}
|
|
124
141
|
else if (debug) {
|
|
125
|
-
|
|
142
|
+
(0, logger_1.setLogLevel)(logger_1.LOG_LEVEL.DEBUG);
|
|
126
143
|
}
|
|
127
144
|
else {
|
|
128
|
-
|
|
145
|
+
(0, logger_1.setLogLevel)(logger_1.LOG_LEVEL.LOG);
|
|
129
146
|
}
|
|
130
147
|
if (networkDebug) {
|
|
131
148
|
process.env.HUBSPOT_NETWORK_LOGGING = 'true';
|
|
132
|
-
|
|
149
|
+
(0, logger_1.setLogLevel)(logger_1.LOG_LEVEL.DEBUG);
|
|
133
150
|
}
|
|
134
151
|
}
|
|
135
|
-
|
|
152
|
+
function getCommandName(argv) {
|
|
136
153
|
return String(argv && argv._ && argv._[0]) || '';
|
|
137
154
|
}
|
|
138
|
-
|
|
155
|
+
function getCmsPublishMode(options) {
|
|
139
156
|
// 1. --cmsPublishMode
|
|
140
157
|
const { cmsPublishMode } = options;
|
|
141
158
|
if (cmsPublishMode && typeof cmsPublishMode === 'string') {
|
|
@@ -143,14 +160,14 @@ export function getCmsPublishMode(options) {
|
|
|
143
160
|
}
|
|
144
161
|
// 2. config[account].defaultCmsPublishMode
|
|
145
162
|
if (options.derivedAccountId) {
|
|
146
|
-
const accountConfig = getAccountConfig(options.derivedAccountId);
|
|
163
|
+
const accountConfig = (0, config_1.getAccountConfig)(options.derivedAccountId);
|
|
147
164
|
if (accountConfig && accountConfig.defaultCmsPublishMode) {
|
|
148
165
|
return accountConfig.defaultCmsPublishMode;
|
|
149
166
|
}
|
|
150
167
|
}
|
|
151
168
|
// 3. config.defaultCmsPublishMode
|
|
152
169
|
// 4. DEFAULT_CMS_PUBLISH_MODE
|
|
153
|
-
const config = getAndLoadConfigIfNeeded();
|
|
170
|
+
const config = (0, config_1.getAndLoadConfigIfNeeded)();
|
|
154
171
|
return ((config && config.defaultCmsPublishMode) ||
|
|
155
|
-
DEFAULT_CMS_PUBLISH_MODE);
|
|
172
|
+
files_1.DEFAULT_CMS_PUBLISH_MODE);
|
|
156
173
|
}
|
package/lib/configMigrate.js
CHANGED
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleMigration = handleMigration;
|
|
4
|
+
exports.handleMerge = handleMerge;
|
|
5
|
+
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
6
|
+
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
7
|
+
const promptUtils_1 = require("./prompts/promptUtils");
|
|
8
|
+
const en_1 = require("../lang/en");
|
|
9
|
+
const logger_1 = require("./ui/logger");
|
|
10
|
+
async function handleMigration(deprecatedConfigPath, hideWarning) {
|
|
7
11
|
if (!hideWarning) {
|
|
8
|
-
uiLogger.warn(lib.configMigrate.deprecatedConfigWarning(deprecatedConfigPath || getConfigPath(undefined, false)));
|
|
9
|
-
uiLogger.log('');
|
|
12
|
+
logger_1.uiLogger.warn(en_1.lib.configMigrate.deprecatedConfigWarning(deprecatedConfigPath || (0, migrate_1.getConfigPath)(undefined, false)));
|
|
13
|
+
logger_1.uiLogger.log('');
|
|
10
14
|
}
|
|
11
|
-
uiLogger.log(lib.configMigrate.handleMigration.description(ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME));
|
|
12
|
-
uiLogger.log('');
|
|
13
|
-
const { shouldMigrateConfig } = await promptUser({
|
|
15
|
+
logger_1.uiLogger.log(en_1.lib.configMigrate.handleMigration.description(config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME));
|
|
16
|
+
logger_1.uiLogger.log('');
|
|
17
|
+
const { shouldMigrateConfig } = await (0, promptUtils_1.promptUser)({
|
|
14
18
|
name: 'shouldMigrateConfig',
|
|
15
19
|
type: 'confirm',
|
|
16
|
-
message: lib.configMigrate.handleMigration.confirmPrompt,
|
|
20
|
+
message: en_1.lib.configMigrate.handleMigration.confirmPrompt,
|
|
17
21
|
});
|
|
18
22
|
if (!shouldMigrateConfig) {
|
|
19
23
|
return false;
|
|
20
24
|
}
|
|
21
|
-
const deprecatedConfig = getDeprecatedConfig(deprecatedConfigPath);
|
|
22
|
-
migrateConfig(deprecatedConfig);
|
|
23
|
-
uiLogger.success(lib.configMigrate.handleMigration.success);
|
|
25
|
+
const deprecatedConfig = (0, migrate_1.getDeprecatedConfig)(deprecatedConfigPath);
|
|
26
|
+
(0, migrate_1.migrateConfig)(deprecatedConfig);
|
|
27
|
+
logger_1.uiLogger.success(en_1.lib.configMigrate.handleMigration.success);
|
|
24
28
|
return true;
|
|
25
29
|
}
|
|
26
30
|
async function handleMergeConfigProperties(globalConfig, deprecatedConfig, force) {
|
|
27
|
-
const { initialConfig, conflicts, } = mergeConfigProperties(globalConfig, deprecatedConfig, force);
|
|
31
|
+
const { initialConfig, conflicts, } = (0, migrate_1.mergeConfigProperties)(globalConfig, deprecatedConfig, force);
|
|
28
32
|
if (conflicts.length > 0) {
|
|
29
33
|
const properties = conflicts.map(c => c.property);
|
|
30
34
|
const propertyList = properties.length <= 2
|
|
31
35
|
? properties.join(' and ')
|
|
32
36
|
: `${properties.slice(0, -1).join(', ')}, and ${properties.at(-1)}`;
|
|
33
|
-
uiLogger.log('');
|
|
34
|
-
uiLogger.warn(lib.configMigrate.handleMergeConfigProperties.mergeConflictMessage(conflicts.length, propertyList));
|
|
37
|
+
logger_1.uiLogger.log('');
|
|
38
|
+
logger_1.uiLogger.warn(en_1.lib.configMigrate.handleMergeConfigProperties.mergeConflictMessage(conflicts.length, propertyList));
|
|
35
39
|
for (const conflict of conflicts) {
|
|
36
40
|
const { property, newValue, oldValue } = conflict;
|
|
37
|
-
const { shouldOverwrite } = await promptUser({
|
|
41
|
+
const { shouldOverwrite } = await (0, promptUtils_1.promptUser)({
|
|
38
42
|
name: 'shouldOverwrite',
|
|
39
43
|
type: 'confirm',
|
|
40
|
-
message: lib.configMigrate.handleMergeConfigProperties.mergeConfigConflictPrompt(property, newValue.toString(), oldValue.toString()),
|
|
44
|
+
message: en_1.lib.configMigrate.handleMergeConfigProperties.mergeConfigConflictPrompt(property, newValue.toString(), oldValue.toString()),
|
|
41
45
|
});
|
|
42
46
|
if (shouldOverwrite) {
|
|
43
47
|
// @ts-expect-error Cannot reconcile CLIConfig_NEW and CLIConfig_DEPRECATED
|
|
@@ -47,33 +51,33 @@ async function handleMergeConfigProperties(globalConfig, deprecatedConfig, force
|
|
|
47
51
|
}
|
|
48
52
|
return initialConfig;
|
|
49
53
|
}
|
|
50
|
-
|
|
54
|
+
async function handleMerge(deprecatedConfigPath, force, hideWarning) {
|
|
51
55
|
if (!hideWarning) {
|
|
52
|
-
uiLogger.warn(lib.configMigrate.deprecatedConfigWarning(deprecatedConfigPath || getConfigPath(undefined, false)));
|
|
53
|
-
uiLogger.log('');
|
|
56
|
+
logger_1.uiLogger.warn(en_1.lib.configMigrate.deprecatedConfigWarning(deprecatedConfigPath || (0, migrate_1.getConfigPath)(undefined, false)));
|
|
57
|
+
logger_1.uiLogger.log('');
|
|
54
58
|
}
|
|
55
|
-
uiLogger.log(lib.configMigrate.handleMerge.description(ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME));
|
|
56
|
-
uiLogger.log('');
|
|
57
|
-
const { shouldMergeConfigs } = await promptUser({
|
|
59
|
+
logger_1.uiLogger.log(en_1.lib.configMigrate.handleMerge.description(config_1.ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME));
|
|
60
|
+
logger_1.uiLogger.log('');
|
|
61
|
+
const { shouldMergeConfigs } = await (0, promptUtils_1.promptUser)({
|
|
58
62
|
name: 'shouldMergeConfigs',
|
|
59
63
|
type: 'confirm',
|
|
60
|
-
message: lib.configMigrate.handleMerge.confirmPrompt,
|
|
64
|
+
message: en_1.lib.configMigrate.handleMerge.confirmPrompt,
|
|
61
65
|
});
|
|
62
66
|
if (!shouldMergeConfigs) {
|
|
63
67
|
return false;
|
|
64
68
|
}
|
|
65
|
-
const deprecatedConfig = getDeprecatedConfig(deprecatedConfigPath);
|
|
66
|
-
const globalConfig = getGlobalConfig();
|
|
69
|
+
const deprecatedConfig = (0, migrate_1.getDeprecatedConfig)(deprecatedConfigPath);
|
|
70
|
+
const globalConfig = (0, migrate_1.getGlobalConfig)();
|
|
67
71
|
if (!deprecatedConfig || !globalConfig) {
|
|
68
72
|
return true;
|
|
69
73
|
}
|
|
70
74
|
const mergedConfig = await handleMergeConfigProperties(globalConfig, deprecatedConfig, force);
|
|
71
|
-
const { skippedAccountIds } = mergeExistingConfigs(mergedConfig, deprecatedConfig);
|
|
75
|
+
const { skippedAccountIds } = (0, migrate_1.mergeExistingConfigs)(mergedConfig, deprecatedConfig);
|
|
72
76
|
if (skippedAccountIds.length > 0) {
|
|
73
|
-
uiLogger.log('');
|
|
74
|
-
uiLogger.log(lib.configMigrate.handleMerge.skippedExistingAccounts(skippedAccountIds));
|
|
75
|
-
uiLogger.log('');
|
|
77
|
+
logger_1.uiLogger.log('');
|
|
78
|
+
logger_1.uiLogger.log(en_1.lib.configMigrate.handleMerge.skippedExistingAccounts(skippedAccountIds));
|
|
79
|
+
logger_1.uiLogger.log('');
|
|
76
80
|
}
|
|
77
|
-
uiLogger.success(lib.configMigrate.handleMerge.success);
|
|
81
|
+
logger_1.uiLogger.success(en_1.lib.configMigrate.handleMerge.success);
|
|
78
82
|
return true;
|
|
79
83
|
}
|
package/lib/configOptions.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setAllowUsageTracking = setAllowUsageTracking;
|
|
4
|
+
exports.setAllowAutoUpdates = setAllowAutoUpdates;
|
|
5
|
+
exports.setDefaultCmsPublishMode = setDefaultCmsPublishMode;
|
|
6
|
+
exports.setHttpTimeout = setHttpTimeout;
|
|
7
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
8
|
+
const files_1 = require("@hubspot/local-dev-lib/constants/files");
|
|
9
|
+
const text_1 = require("@hubspot/local-dev-lib/text");
|
|
10
|
+
const usageTracking_1 = require("./usageTracking");
|
|
11
|
+
const promptUtils_1 = require("./prompts/promptUtils");
|
|
12
|
+
const en_1 = require("../lang/en");
|
|
13
|
+
const logger_1 = require("./ui/logger");
|
|
8
14
|
async function enableOrDisableBooleanFieldPrompt(fieldName) {
|
|
9
|
-
const isEnabled = await listPrompt(lib.configOptions.enableOrDisableBooleanFieldPrompt.message(fieldName), {
|
|
15
|
+
const isEnabled = await (0, promptUtils_1.listPrompt)(en_1.lib.configOptions.enableOrDisableBooleanFieldPrompt.message(fieldName), {
|
|
10
16
|
choices: [
|
|
11
17
|
{
|
|
12
|
-
name: lib.configOptions.enableOrDisableBooleanFieldPrompt.labels
|
|
18
|
+
name: en_1.lib.configOptions.enableOrDisableBooleanFieldPrompt.labels
|
|
13
19
|
.enabled,
|
|
14
20
|
value: true,
|
|
15
21
|
},
|
|
16
22
|
{
|
|
17
|
-
name: lib.configOptions.enableOrDisableBooleanFieldPrompt.labels
|
|
23
|
+
name: en_1.lib.configOptions.enableOrDisableBooleanFieldPrompt.labels
|
|
18
24
|
.disabled,
|
|
19
25
|
value: false,
|
|
20
26
|
},
|
|
@@ -23,40 +29,40 @@ async function enableOrDisableBooleanFieldPrompt(fieldName) {
|
|
|
23
29
|
});
|
|
24
30
|
return isEnabled;
|
|
25
31
|
}
|
|
26
|
-
|
|
27
|
-
trackCommandUsage('config-set-allow-usage-tracking', undefined, accountId);
|
|
32
|
+
async function setAllowUsageTracking({ accountId, allowUsageTracking, }) {
|
|
33
|
+
(0, usageTracking_1.trackCommandUsage)('config-set-allow-usage-tracking', undefined, accountId);
|
|
28
34
|
let isEnabled;
|
|
29
35
|
if (typeof allowUsageTracking === 'boolean') {
|
|
30
36
|
isEnabled = allowUsageTracking;
|
|
31
37
|
}
|
|
32
38
|
else {
|
|
33
|
-
isEnabled = await enableOrDisableBooleanFieldPrompt(lib.configOptions.setAllowUsageTracking.fieldName);
|
|
39
|
+
isEnabled = await enableOrDisableBooleanFieldPrompt(en_1.lib.configOptions.setAllowUsageTracking.fieldName);
|
|
34
40
|
}
|
|
35
|
-
updateAllowUsageTracking(isEnabled);
|
|
36
|
-
uiLogger.success(lib.configOptions.setAllowUsageTracking.success(isEnabled.toString()));
|
|
41
|
+
(0, config_1.updateAllowUsageTracking)(isEnabled);
|
|
42
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setAllowUsageTracking.success(isEnabled.toString()));
|
|
37
43
|
}
|
|
38
|
-
|
|
39
|
-
trackCommandUsage('config-set-allow-auto-updates', undefined, accountId);
|
|
44
|
+
async function setAllowAutoUpdates({ accountId, allowAutoUpdates, }) {
|
|
45
|
+
(0, usageTracking_1.trackCommandUsage)('config-set-allow-auto-updates', undefined, accountId);
|
|
40
46
|
let isEnabled;
|
|
41
47
|
if (typeof allowAutoUpdates === 'boolean') {
|
|
42
48
|
isEnabled = allowAutoUpdates;
|
|
43
49
|
}
|
|
44
50
|
else {
|
|
45
|
-
isEnabled = await enableOrDisableBooleanFieldPrompt(lib.configOptions.setAllowAutoUpdates.fieldName);
|
|
51
|
+
isEnabled = await enableOrDisableBooleanFieldPrompt(en_1.lib.configOptions.setAllowAutoUpdates.fieldName);
|
|
46
52
|
}
|
|
47
|
-
updateAllowAutoUpdates(isEnabled);
|
|
48
|
-
uiLogger.success(lib.configOptions.setAllowAutoUpdates.success(isEnabled.toString()));
|
|
53
|
+
(0, config_1.updateAllowAutoUpdates)(isEnabled);
|
|
54
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setAllowAutoUpdates.success(isEnabled.toString()));
|
|
49
55
|
}
|
|
50
|
-
const ALL_CMS_PUBLISH_MODES = Object.values(CMS_PUBLISH_MODE);
|
|
56
|
+
const ALL_CMS_PUBLISH_MODES = Object.values(files_1.CMS_PUBLISH_MODE);
|
|
51
57
|
async function selectCmsPublishMode() {
|
|
52
|
-
const cmsPublishMode = await listPrompt(lib.configOptions.setDefaultCmsPublishMode.promptMessage, {
|
|
58
|
+
const cmsPublishMode = await (0, promptUtils_1.listPrompt)(en_1.lib.configOptions.setDefaultCmsPublishMode.promptMessage, {
|
|
53
59
|
choices: ALL_CMS_PUBLISH_MODES,
|
|
54
|
-
defaultAnswer: CMS_PUBLISH_MODE.publish,
|
|
60
|
+
defaultAnswer: files_1.CMS_PUBLISH_MODE.publish,
|
|
55
61
|
});
|
|
56
62
|
return cmsPublishMode;
|
|
57
63
|
}
|
|
58
|
-
|
|
59
|
-
trackCommandUsage('config-set-default-mode', undefined, accountId);
|
|
64
|
+
async function setDefaultCmsPublishMode({ accountId, defaultCmsPublishMode, }) {
|
|
65
|
+
(0, usageTracking_1.trackCommandUsage)('config-set-default-mode', undefined, accountId);
|
|
60
66
|
let newDefault;
|
|
61
67
|
if (!defaultCmsPublishMode) {
|
|
62
68
|
newDefault = await selectCmsPublishMode();
|
|
@@ -66,25 +72,25 @@ export async function setDefaultCmsPublishMode({ accountId, defaultCmsPublishMod
|
|
|
66
72
|
newDefault = defaultCmsPublishMode;
|
|
67
73
|
}
|
|
68
74
|
else {
|
|
69
|
-
uiLogger.error(lib.configOptions.setDefaultCmsPublishMode.error(commaSeparatedValues(ALL_CMS_PUBLISH_MODES)));
|
|
75
|
+
logger_1.uiLogger.error(en_1.lib.configOptions.setDefaultCmsPublishMode.error((0, text_1.commaSeparatedValues)(ALL_CMS_PUBLISH_MODES)));
|
|
70
76
|
newDefault = await selectCmsPublishMode();
|
|
71
77
|
}
|
|
72
|
-
updateDefaultCmsPublishMode(newDefault);
|
|
73
|
-
uiLogger.success(lib.configOptions.setDefaultCmsPublishMode.success(newDefault));
|
|
78
|
+
(0, config_1.updateDefaultCmsPublishMode)(newDefault);
|
|
79
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setDefaultCmsPublishMode.success(newDefault));
|
|
74
80
|
}
|
|
75
81
|
async function enterTimeout() {
|
|
76
|
-
const { timeout } = await promptUser([
|
|
82
|
+
const { timeout } = await (0, promptUtils_1.promptUser)([
|
|
77
83
|
{
|
|
78
84
|
name: 'timeout',
|
|
79
|
-
message: lib.configOptions.setHttpTimeout.promptMessage,
|
|
85
|
+
message: en_1.lib.configOptions.setHttpTimeout.promptMessage,
|
|
80
86
|
type: 'input',
|
|
81
87
|
default: 30000,
|
|
82
88
|
},
|
|
83
89
|
]);
|
|
84
90
|
return timeout;
|
|
85
91
|
}
|
|
86
|
-
|
|
87
|
-
trackCommandUsage('config-set-http-timeout', undefined, accountId);
|
|
92
|
+
async function setHttpTimeout({ accountId, httpTimeout, }) {
|
|
93
|
+
(0, usageTracking_1.trackCommandUsage)('config-set-http-timeout', undefined, accountId);
|
|
88
94
|
let newHttpTimeout;
|
|
89
95
|
if (!httpTimeout) {
|
|
90
96
|
newHttpTimeout = await enterTimeout();
|
|
@@ -92,6 +98,6 @@ export async function setHttpTimeout({ accountId, httpTimeout, }) {
|
|
|
92
98
|
else {
|
|
93
99
|
newHttpTimeout = httpTimeout;
|
|
94
100
|
}
|
|
95
|
-
updateHttpTimeout(newHttpTimeout);
|
|
96
|
-
uiLogger.success(lib.configOptions.setHttpTimeout.success(newHttpTimeout));
|
|
101
|
+
(0, config_1.updateHttpTimeout)(newHttpTimeout);
|
|
102
|
+
logger_1.uiLogger.success(en_1.lib.configOptions.setHttpTimeout.success(newHttpTimeout));
|
|
97
103
|
}
|
package/lib/constants.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LOCAL_DEV_SERVER_MESSAGE_TYPES = exports.GET_STARTED_OPTIONS = exports.appComponent = exports.marketplaceDistribution = exports.privateDistribution = exports.oAuth = exports.staticAuth = exports.APP_INSTALLATION_STATES = exports.LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES = exports.LOCAL_DEV_UI_MESSAGE_SEND_TYPES = exports.FEATURES = exports.APP_AUTH_TYPES = exports.APP_DISTRIBUTION_TYPES = exports.IR_COMPONENT_TYPES = exports.PLATFORM_VERSION_ERROR_TYPES = exports.PROJECT_COMPONENT_TYPES = exports.PROJECT_TASK_TYPES = exports.PROJECT_ERROR_TYPES = exports.PROJECT_DEPLOY_TEXT = exports.PROJECT_BUILD_TEXT = exports.PROJECT_DEPLOY_STATES = exports.PROJECT_BUILD_STATES = exports.PROJECT_CONFIG_FILE = exports.DEFAULT_POLLING_DELAY = exports.MARKETPLACE_FOLDER = exports.HUBSPOT_FOLDER = exports.FEEDBACK_INTERVAL = exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = void 0;
|
|
4
|
+
exports.HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = 'HubSpot/hubspot-project-components';
|
|
5
|
+
exports.DEFAULT_PROJECT_TEMPLATE_BRANCH = 'main';
|
|
6
|
+
exports.FEEDBACK_INTERVAL = 10;
|
|
7
|
+
exports.HUBSPOT_FOLDER = '@hubspot';
|
|
8
|
+
exports.MARKETPLACE_FOLDER = '@marketplace';
|
|
9
|
+
exports.DEFAULT_POLLING_DELAY = 2000;
|
|
10
|
+
exports.PROJECT_CONFIG_FILE = 'hsproject.json';
|
|
11
|
+
exports.PROJECT_BUILD_STATES = {
|
|
9
12
|
BUILDING: 'BUILDING',
|
|
10
13
|
ENQUEUED: 'ENQUEUED',
|
|
11
14
|
FAILURE: 'FAILURE',
|
|
12
15
|
PENDING: 'PENDING',
|
|
13
16
|
SUCCESS: 'SUCCESS',
|
|
14
17
|
};
|
|
15
|
-
|
|
18
|
+
exports.PROJECT_DEPLOY_STATES = {
|
|
16
19
|
DEPLOYING: 'DEPLOYING',
|
|
17
20
|
FAILURE: 'FAILURE',
|
|
18
21
|
PENDING: 'PENDING',
|
|
19
22
|
SUCCESS: 'SUCCESS',
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
STATES: { ...PROJECT_BUILD_STATES },
|
|
24
|
+
exports.PROJECT_BUILD_TEXT = {
|
|
25
|
+
STATES: { ...exports.PROJECT_BUILD_STATES },
|
|
23
26
|
STATUS_TEXT: 'Building',
|
|
24
27
|
SUBTASK_KEY: 'subbuildStatuses',
|
|
25
28
|
TYPE_KEY: 'buildType',
|
|
26
29
|
SUBTASK_NAME_KEY: 'buildName',
|
|
27
30
|
};
|
|
28
|
-
|
|
29
|
-
STATES: { ...PROJECT_DEPLOY_STATES },
|
|
31
|
+
exports.PROJECT_DEPLOY_TEXT = {
|
|
32
|
+
STATES: { ...exports.PROJECT_DEPLOY_STATES },
|
|
30
33
|
STATUS_TEXT: 'Deploying',
|
|
31
34
|
SUBTASK_KEY: 'subdeployStatuses',
|
|
32
35
|
TYPE_KEY: 'deployType',
|
|
33
36
|
SUBTASK_NAME_KEY: 'deployName',
|
|
34
37
|
};
|
|
35
|
-
|
|
38
|
+
exports.PROJECT_ERROR_TYPES = {
|
|
36
39
|
PROJECT_LOCKED: 'BuildPipelineErrorType.PROJECT_LOCKED',
|
|
37
40
|
MISSING_PROJECT_PROVISION: 'BuildPipelineErrorType.MISSING_PROJECT_PROVISION',
|
|
38
41
|
BUILD_NOT_IN_PROGRESS: 'BuildPipelineErrorType.BUILD_NOT_IN_PROGRESS',
|
|
@@ -40,62 +43,62 @@ export const PROJECT_ERROR_TYPES = {
|
|
|
40
43
|
SUBDEPLOY_FAILED: 'DeployPipelineErrorType.DEPENDENT_SUBDEPLOY_FAILED',
|
|
41
44
|
DEPLOY_CONTAINS_REMOVALS: 'DeployPipelineErrorType.WARNING_DEPLOY_CONTAINS_REMOVALS',
|
|
42
45
|
};
|
|
43
|
-
|
|
46
|
+
exports.PROJECT_TASK_TYPES = {
|
|
44
47
|
PRIVATE_APP: 'private app',
|
|
45
48
|
PUBLIC_APP: 'public app',
|
|
46
49
|
APP_FUNCTION: 'function',
|
|
47
50
|
CRM_CARD_V2: 'card',
|
|
48
51
|
};
|
|
49
|
-
|
|
52
|
+
exports.PROJECT_COMPONENT_TYPES = {
|
|
50
53
|
PROJECTS: 'projects',
|
|
51
54
|
COMPONENTS: 'components',
|
|
52
55
|
};
|
|
53
|
-
|
|
56
|
+
exports.PLATFORM_VERSION_ERROR_TYPES = {
|
|
54
57
|
PLATFORM_VERSION_NOT_SPECIFIED: 'PlatformVersionErrorType.PLATFORM_VERSION_NOT_SPECIFIED',
|
|
55
58
|
PLATFORM_VERSION_RETIRED: 'PlatformVersionErrorType.PLATFORM_VERSION_RETIRED',
|
|
56
59
|
PLATFORM_VERSION_SPECIFIED_DOES_NOT_EXIST: 'PlatformVersionErrorType.PLATFORM_VERSION_SPECIFIED_DOES_NOT_EXIST',
|
|
57
60
|
};
|
|
58
|
-
|
|
61
|
+
exports.IR_COMPONENT_TYPES = {
|
|
59
62
|
APPLICATION: 'APPLICATION',
|
|
60
63
|
CARD: 'CARD',
|
|
61
64
|
};
|
|
62
|
-
|
|
65
|
+
exports.APP_DISTRIBUTION_TYPES = {
|
|
63
66
|
MARKETPLACE: 'marketplace',
|
|
64
67
|
PRIVATE: 'private',
|
|
65
68
|
};
|
|
66
|
-
|
|
69
|
+
exports.APP_AUTH_TYPES = {
|
|
67
70
|
OAUTH: 'oauth',
|
|
68
71
|
STATIC: 'static',
|
|
69
72
|
};
|
|
70
|
-
|
|
73
|
+
exports.FEATURES = {
|
|
71
74
|
UNIFIED_THEME_PREVIEW: 'cms:react:unifiedThemePreview',
|
|
72
75
|
UNIFIED_APPS: 'Developers:UnifiedApps:PrivateBeta',
|
|
73
76
|
};
|
|
74
|
-
|
|
77
|
+
exports.LOCAL_DEV_UI_MESSAGE_SEND_TYPES = {
|
|
75
78
|
UPLOAD_SUCCESS: 'server:uploadSuccess',
|
|
76
79
|
UPLOAD_FAILURE: 'server:uploadFailure',
|
|
77
80
|
UPDATE_PROJECT_NODES: 'server:updateProjectNodes',
|
|
78
81
|
UPDATE_APP_DATA: 'server:updateAppData',
|
|
79
82
|
UPDATE_PROJECT_DATA: 'server:updateProjectData',
|
|
80
83
|
};
|
|
81
|
-
|
|
84
|
+
exports.LOCAL_DEV_UI_MESSAGE_RECEIVE_TYPES = {
|
|
82
85
|
UPLOAD: 'client:upload',
|
|
83
86
|
};
|
|
84
|
-
|
|
87
|
+
exports.APP_INSTALLATION_STATES = {
|
|
85
88
|
NOT_INSTALLED: 'NOT_INSTALLED',
|
|
86
89
|
INSTALLED: 'INSTALLED',
|
|
87
90
|
INSTALLED_WITH_OUTDATED_SCOPES: 'INSTALLED_WITH_OUTDATED_SCOPES',
|
|
88
91
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
exports.staticAuth = 'static';
|
|
93
|
+
exports.oAuth = 'oauth';
|
|
94
|
+
exports.privateDistribution = 'private';
|
|
95
|
+
exports.marketplaceDistribution = 'marketplace';
|
|
96
|
+
exports.appComponent = 'app';
|
|
97
|
+
exports.GET_STARTED_OPTIONS = {
|
|
95
98
|
APP: 'APP',
|
|
96
99
|
CMS: 'CMS',
|
|
97
100
|
};
|
|
98
|
-
|
|
101
|
+
exports.LOCAL_DEV_SERVER_MESSAGE_TYPES = {
|
|
99
102
|
INITIAL: 'INITIAL',
|
|
100
103
|
WEBSOCKET_SERVER_CONNECTED: 'WEBSOCKET_SERVER_CONNECTED',
|
|
101
104
|
};
|
package/lib/customObject.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSchemaDefinition = isSchemaDefinition;
|
|
4
|
+
exports.isObjectDefinition = isObjectDefinition;
|
|
5
|
+
function isSchemaDefinition(schema) {
|
|
2
6
|
return (typeof schema === 'object' &&
|
|
3
7
|
schema !== null &&
|
|
4
8
|
'labels' in schema &&
|
|
@@ -6,6 +10,6 @@ export function isSchemaDefinition(schema) {
|
|
|
6
10
|
'properties' in schema &&
|
|
7
11
|
'requiredProperties' in schema);
|
|
8
12
|
}
|
|
9
|
-
|
|
13
|
+
function isObjectDefinition(object) {
|
|
10
14
|
return typeof object === 'object' && object !== null && 'inputs' in object;
|
|
11
15
|
}
|