@hubspot/cli 7.4.7-experimental.0 → 7.4.7
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/migrate.d.ts +14 -4
- package/api/migrate.js +16 -2
- package/bin/cli.js +8 -183
- package/commands/account/auth.d.ts +10 -0
- package/commands/account/auth.js +188 -0
- package/commands/account/clean.js +38 -5
- package/commands/account/createOverride.d.ts +10 -0
- package/commands/account/createOverride.js +104 -0
- package/commands/account/info.js +38 -4
- package/commands/account/list.js +23 -5
- package/commands/account/remove.js +36 -2
- package/commands/account/removeOverride.d.ts +10 -0
- package/commands/account/removeOverride.js +76 -0
- package/commands/account/use.js +25 -3
- package/commands/account.js +7 -2
- package/commands/app/migrate.d.ts +6 -6
- package/commands/app/migrate.js +62 -45
- package/commands/app.js +0 -2
- package/commands/auth.js +14 -11
- package/commands/cms/lighthouseScore.js +7 -3
- package/commands/cms.js +1 -2
- package/commands/completion.js +2 -3
- package/commands/config/migrate.d.ts +10 -0
- package/commands/config/migrate.js +84 -0
- package/commands/config/set.d.ts +10 -0
- package/commands/config/set.js +34 -29
- package/commands/config.d.ts +4 -1
- package/commands/config.js +45 -11
- package/commands/create/api-sample.js +3 -1
- package/commands/create/website-theme.js +1 -1
- package/commands/create.js +7 -8
- package/commands/customObject/schema/delete.js +4 -1
- package/commands/customObject/schema/fetch-all.js +2 -1
- package/commands/customObject/schema/fetch.js +2 -1
- package/commands/customObject.js +3 -4
- package/commands/doctor.js +5 -6
- package/commands/feedback.js +7 -8
- package/commands/fetch.js +6 -7
- package/commands/filemanager.js +1 -2
- package/commands/function.js +1 -2
- package/commands/hubdb/clear.js +5 -6
- package/commands/hubdb/create.js +7 -8
- package/commands/hubdb/delete.js +8 -7
- package/commands/hubdb/fetch.js +4 -5
- package/commands/hubdb.js +1 -2
- package/commands/init.js +18 -20
- package/commands/lint.js +3 -4
- package/commands/list.js +5 -6
- package/commands/logs.js +12 -13
- package/commands/module/marketplace-validate.js +5 -6
- package/commands/module.js +1 -3
- package/commands/mv.js +4 -5
- package/commands/open.js +4 -5
- package/commands/project/add.d.ts +3 -7
- package/commands/project/add.js +28 -23
- package/commands/project/cloneApp.d.ts +6 -8
- package/commands/project/cloneApp.js +49 -45
- package/commands/project/create.d.ts +10 -1
- package/commands/project/create.js +85 -63
- package/commands/project/deploy.d.ts +3 -6
- package/commands/project/deploy.js +27 -25
- package/commands/project/dev/deprecatedFlow.js +32 -25
- package/commands/project/dev/index.d.ts +4 -2
- package/commands/project/dev/index.js +31 -18
- package/commands/project/dev/unifiedFlow.js +10 -11
- package/commands/project/download.d.ts +3 -7
- package/commands/project/download.js +18 -19
- package/commands/project/installDeps.d.ts +6 -1
- package/commands/project/installDeps.js +48 -32
- package/commands/project/listBuilds.d.ts +3 -7
- package/commands/project/listBuilds.js +32 -27
- package/commands/project/logs.d.ts +10 -1
- package/commands/project/logs.js +73 -65
- package/commands/project/migrate.d.ts +6 -0
- package/commands/project/migrate.js +71 -0
- package/commands/project/migrateApp.d.ts +3 -8
- package/commands/project/migrateApp.js +23 -20
- package/commands/project/open.d.ts +3 -7
- package/commands/project/open.js +29 -21
- package/commands/project/upload.d.ts +9 -1
- package/commands/project/upload.js +78 -54
- package/commands/project/watch.d.ts +6 -1
- package/commands/project/watch.js +95 -61
- package/commands/project.d.ts +3 -1
- package/commands/project.js +47 -35
- package/commands/remove.js +7 -5
- package/commands/sandbox/create.js +10 -11
- package/commands/sandbox/delete.js +18 -19
- package/commands/sandbox.js +1 -2
- package/commands/secret/addSecret.js +5 -6
- package/commands/secret/deleteSecret.js +12 -9
- package/commands/secret/listSecret.js +3 -4
- package/commands/secret/updateSecret.js +9 -8
- package/commands/secret.js +1 -2
- package/commands/theme/generate-selectors.js +5 -6
- package/commands/theme/marketplace-validate.js +5 -6
- package/commands/theme/preview.js +16 -16
- package/commands/theme.js +1 -2
- package/commands/upload.js +23 -24
- package/commands/watch.js +18 -19
- package/lang/en.d.ts +2806 -0
- package/lang/en.js +2659 -3300
- package/lang/en.lyaml +98 -41
- package/lib/accountTypes.d.ts +1 -0
- package/lib/accountTypes.js +12 -0
- package/lib/app/migrate.d.ts +10 -4
- package/lib/app/migrate.js +208 -94
- package/lib/app/migrate_legacy.d.ts +2 -2
- package/lib/app/migrate_legacy.js +10 -7
- package/lib/buildAccount.d.ts +1 -2
- package/lib/buildAccount.js +11 -10
- package/lib/commonOpts.d.ts +3 -4
- package/lib/commonOpts.js +46 -18
- package/lib/configMigrate.d.ts +2 -0
- package/lib/configMigrate.js +104 -0
- package/lib/configOptions.js +11 -10
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +5 -1
- package/lib/dependencyManagement.js +2 -2
- package/lib/doctor/Diagnosis.d.ts +1 -2
- package/lib/doctor/Diagnosis.js +19 -16
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +2 -1
- package/lib/doctor/DiagnosticInfoBuilder.js +10 -9
- package/lib/doctor/Doctor.d.ts +1 -0
- package/lib/doctor/Doctor.js +57 -44
- package/lib/errorHandlers/index.js +6 -7
- package/lib/errorHandlers/suppressError.js +6 -7
- package/lib/generateSelectors.js +1 -2
- package/lib/hasFeature.d.ts +3 -1
- package/lib/middleware/__test__/configMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/configMiddleware.test.js +194 -0
- package/lib/middleware/__test__/gitMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/gitMiddleware.test.js +76 -0
- package/lib/middleware/__test__/notificationsMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/notificationsMiddleware.test.js +10 -0
- package/lib/middleware/__test__/requestMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/requestMiddleware.test.js +20 -0
- package/lib/middleware/__test__/utils.test.d.ts +1 -0
- package/lib/middleware/__test__/utils.test.js +53 -0
- package/lib/middleware/__test__/yargsChecksMiddleware.test.d.ts +1 -0
- package/lib/middleware/__test__/yargsChecksMiddleware.test.js +81 -0
- package/lib/middleware/configMiddleware.d.ts +13 -0
- package/lib/middleware/configMiddleware.js +116 -0
- package/lib/middleware/fireAlarmMiddleware.d.ts +4 -0
- package/lib/middleware/fireAlarmMiddleware.js +123 -0
- package/lib/middleware/gitMiddleware.d.ts +2 -0
- package/lib/middleware/gitMiddleware.js +14 -0
- package/lib/middleware/notificationsMiddleware.d.ts +1 -0
- package/lib/middleware/notificationsMiddleware.js +38 -0
- package/lib/middleware/requestMiddleware.d.ts +1 -0
- package/lib/middleware/requestMiddleware.js +11 -0
- package/lib/middleware/utils.d.ts +8 -0
- package/lib/middleware/utils.js +17 -0
- package/lib/middleware/yargsChecksMiddleware.d.ts +4 -0
- package/lib/middleware/yargsChecksMiddleware.js +24 -0
- package/lib/oauth.js +1 -2
- package/lib/process.js +1 -2
- package/lib/projects/ProjectLogsManager.d.ts +1 -1
- package/lib/projects/ProjectLogsManager.js +16 -21
- package/lib/projects/buildAndDeploy.js +28 -39
- package/lib/projects/config.d.ts +9 -0
- package/lib/projects/config.js +79 -0
- package/lib/projects/create.js +5 -6
- package/lib/projects/ensureProjectExists.d.ts +11 -0
- package/lib/projects/ensureProjectExists.js +97 -0
- package/lib/{DevServerManager.d.ts → projects/localDev/DevServerManager.d.ts} +1 -1
- package/lib/{DevServerManager.js → projects/localDev/DevServerManager.js} +6 -6
- package/lib/{DevServerManagerV2.d.ts → projects/localDev/DevServerManagerV2.d.ts} +1 -1
- package/lib/{DevServerManagerV2.js → projects/localDev/DevServerManagerV2.js} +3 -4
- package/lib/{LocalDevManager.d.ts → projects/localDev/LocalDevManager.d.ts} +1 -1
- package/lib/{LocalDevManager.js → projects/localDev/LocalDevManager.js} +49 -82
- package/lib/{LocalDevManagerV2.d.ts → projects/localDev/LocalDevManagerV2.d.ts} +2 -2
- package/lib/{LocalDevManagerV2.js → projects/localDev/LocalDevManagerV2.js} +43 -75
- package/lib/{localDev.d.ts → projects/localDev/helpers.d.ts} +5 -4
- package/lib/{localDev.js → projects/localDev/helpers.js} +97 -114
- package/lib/projects/ui.d.ts +1 -0
- package/lib/projects/ui.js +15 -0
- package/lib/projects/upload.d.ts +13 -2
- package/lib/projects/upload.js +18 -34
- package/lib/projects/urls.d.ts +1 -0
- package/lib/projects/urls.js +6 -0
- package/lib/projects/watch.d.ts +1 -1
- package/lib/projects/watch.js +21 -18
- package/lib/prompts/accountNamePrompt.js +16 -13
- package/lib/prompts/accountsPrompt.js +1 -2
- package/lib/prompts/cmsFieldPrompt.js +1 -2
- package/lib/prompts/createApiSamplePrompt.js +4 -5
- package/lib/prompts/createFunctionPrompt.js +13 -14
- package/lib/prompts/createModulePrompt.js +8 -9
- package/lib/prompts/createProjectPrompt.d.ts +11 -4
- package/lib/prompts/createProjectPrompt.js +14 -9
- package/lib/prompts/createTemplatePrompt.js +1 -2
- package/lib/prompts/downloadProjectPrompt.js +3 -4
- package/lib/prompts/installPublicAppPrompt.js +6 -5
- package/lib/prompts/personalAccessKeyPrompt.js +17 -18
- package/lib/prompts/previewPrompt.js +5 -6
- package/lib/prompts/projectAddPrompt.js +4 -5
- package/lib/prompts/projectDevTargetAccountPrompt.js +11 -12
- package/lib/prompts/projectNamePrompt.js +5 -6
- package/lib/prompts/projectsLogsPrompt.js +3 -2
- package/lib/prompts/promptUtils.d.ts +1 -1
- package/lib/prompts/sandboxesPrompt.js +5 -6
- package/lib/prompts/secretPrompt.js +2 -3
- package/lib/prompts/selectHubDBTablePrompt.js +11 -8
- package/lib/prompts/selectPublicAppPrompt.js +6 -7
- package/lib/prompts/setAsDefaultAccountPrompt.js +1 -2
- package/lib/prompts/uploadPrompt.js +4 -5
- package/lib/sandboxSync.js +15 -14
- package/lib/sandboxes.js +12 -13
- package/lib/serverlessLogs.js +4 -6
- package/lib/ui/SpinniesManager.d.ts +1 -1
- package/lib/ui/boxen.d.ts +5 -0
- package/lib/ui/boxen.js +30 -0
- package/lib/ui/git.js +8 -9
- package/lib/ui/index.d.ts +4 -2
- package/lib/ui/index.js +16 -16
- package/lib/ui/logger.d.ts +10 -0
- package/lib/ui/logger.js +15 -0
- package/lib/ui/serverlessFunctionLogs.js +2 -3
- package/lib/ui/spinniesUtils.d.ts +5 -5
- package/lib/yargsUtils.d.ts +1 -1
- package/package.json +7 -6
- package/types/Yargs.d.ts +5 -11
- package/lib/projects/index.d.ts +0 -20
- package/lib/projects/index.js +0 -195
package/lib/sandboxSync.js
CHANGED
|
@@ -17,7 +17,6 @@ const index_2 = require("./errorHandlers/index");
|
|
|
17
17
|
const sandboxes_2 = require("./sandboxes");
|
|
18
18
|
const ui_1 = require("./ui");
|
|
19
19
|
const accountTypes_1 = require("./accountTypes");
|
|
20
|
-
const i18nKey = 'lib.sandbox.sync';
|
|
21
20
|
async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, slimInfoMessage = false) {
|
|
22
21
|
const id = (0, getAccountIdentifier_1.getAccountIdentifier)(accountConfig);
|
|
23
22
|
const accountId = (0, config_1.getAccountId)(id);
|
|
@@ -25,7 +24,7 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
25
24
|
const parentAccountId = (0, config_1.getAccountId)(parentId);
|
|
26
25
|
const isDevSandbox = (0, accountTypes_1.isDevelopmentSandbox)(accountConfig);
|
|
27
26
|
if (!accountId || !parentAccountId) {
|
|
28
|
-
throw new Error((0, lang_1.i18n)(
|
|
27
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.sync.failure.invalidUser`, {
|
|
29
28
|
accountName: accountId
|
|
30
29
|
? (0, ui_1.uiAccountDescription)(accountId)
|
|
31
30
|
: id.toString(),
|
|
@@ -48,23 +47,25 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
48
47
|
availableSyncTasks = await (0, sandboxes_1.getAvailableSyncTypes)(parentAccountConfig, accountConfig);
|
|
49
48
|
}
|
|
50
49
|
SpinniesManager_1.default.add('sandboxSync', {
|
|
51
|
-
text: (0, lang_1.i18n)(
|
|
50
|
+
text: (0, lang_1.i18n)(`lib.sandbox.sync.loading.startSync`),
|
|
52
51
|
});
|
|
53
52
|
await (0, sandboxSync_1.initiateSync)(parentAccountId, accountId, availableSyncTasks, accountId);
|
|
54
53
|
const spinniesText = isDevSandbox
|
|
55
|
-
?
|
|
56
|
-
:
|
|
54
|
+
? `lib.sandbox.sync.loading.succeedDevSb`
|
|
55
|
+
: `lib.sandbox.sync.loading.succeed`;
|
|
57
56
|
SpinniesManager_1.default.succeed('sandboxSync', {
|
|
58
|
-
text: (0, lang_1.i18n)(slimInfoMessage
|
|
57
|
+
text: (0, lang_1.i18n)(slimInfoMessage
|
|
58
|
+
? `lib.sandbox.sync.loading.successDevSbInfo`
|
|
59
|
+
: spinniesText, {
|
|
59
60
|
accountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
60
|
-
url: (0, ui_1.uiLink)((0, lang_1.i18n)(
|
|
61
|
+
url: (0, ui_1.uiLink)((0, lang_1.i18n)(`lib.sandbox.sync.info.syncStatusDetailsLinkText`), syncStatusUrl),
|
|
61
62
|
}),
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
catch (err) {
|
|
65
66
|
(0, index_2.debugError)(err);
|
|
66
67
|
SpinniesManager_1.default.fail('sandboxSync', {
|
|
67
|
-
text: (0, lang_1.i18n)(
|
|
68
|
+
text: (0, lang_1.i18n)(`lib.sandbox.sync.loading.fail`),
|
|
68
69
|
});
|
|
69
70
|
logger_1.logger.log('');
|
|
70
71
|
if ((0, index_1.isSpecifiedError)(err, {
|
|
@@ -72,7 +73,7 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
72
73
|
category: 'BANNED',
|
|
73
74
|
subCategory: 'sandboxes-sync-api.SYNC_NOT_ALLOWED_INVALID_USER',
|
|
74
75
|
})) {
|
|
75
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
76
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.sync.failure.invalidUser`, {
|
|
76
77
|
accountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
77
78
|
parentAccountName: (0, ui_1.uiAccountDescription)(parentAccountId),
|
|
78
79
|
}));
|
|
@@ -82,7 +83,7 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
82
83
|
category: 'RATE_LIMITS',
|
|
83
84
|
subCategory: 'sandboxes-sync-api.SYNC_IN_PROGRESS',
|
|
84
85
|
})) {
|
|
85
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
86
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.sync.failure.syncInProgress`, {
|
|
86
87
|
url: `${baseUrl}/sandboxes-developer/${parentAccountId}/syncactivitylog`,
|
|
87
88
|
}));
|
|
88
89
|
}
|
|
@@ -92,7 +93,7 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
92
93
|
subCategory: 'sandboxes-sync-api.SYNC_NOT_ALLOWED_INVALID_USERID',
|
|
93
94
|
})) {
|
|
94
95
|
// This will only trigger if a user is not a super admin of the target account.
|
|
95
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
96
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.sync.failure.notSuperAdmin`, {
|
|
96
97
|
account: (0, ui_1.uiAccountDescription)(accountId),
|
|
97
98
|
}));
|
|
98
99
|
}
|
|
@@ -101,7 +102,7 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
101
102
|
category: 'OBJECT_NOT_FOUND',
|
|
102
103
|
subCategory: 'SandboxErrors.SANDBOX_NOT_FOUND',
|
|
103
104
|
})) {
|
|
104
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
105
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.sync.failure.objectNotFound`, {
|
|
105
106
|
account: (0, ui_1.uiAccountDescription)(accountId),
|
|
106
107
|
}));
|
|
107
108
|
}
|
|
@@ -122,8 +123,8 @@ async function syncSandbox(accountConfig, parentAccountConfig, env, syncTasks, s
|
|
|
122
123
|
if (!slimInfoMessage) {
|
|
123
124
|
logger_1.logger.log();
|
|
124
125
|
(0, ui_1.uiLine)();
|
|
125
|
-
logger_1.logger.info((0, lang_1.i18n)(
|
|
126
|
-
url: (0, ui_1.uiLink)((0, lang_1.i18n)(
|
|
126
|
+
logger_1.logger.info((0, lang_1.i18n)(`lib.sandbox.sync.info.${isDevSandbox ? 'syncMessageDevSb' : 'syncMessage'}`, {
|
|
127
|
+
url: (0, ui_1.uiLink)((0, lang_1.i18n)(`lib.sandbox.sync.info.syncStatusDetailsLinkText`), syncStatusUrl),
|
|
127
128
|
}));
|
|
128
129
|
(0, ui_1.uiLine)();
|
|
129
130
|
logger_1.logger.log();
|
package/lib/sandboxes.js
CHANGED
|
@@ -17,7 +17,6 @@ const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
|
17
17
|
const lang_1 = require("./lang");
|
|
18
18
|
const ui_1 = require("./ui");
|
|
19
19
|
const index_2 = require("./errorHandlers/index");
|
|
20
|
-
const i18nKey = 'lib.sandbox';
|
|
21
20
|
exports.SYNC_TYPES = {
|
|
22
21
|
OBJECT_RECORDS: 'object-records',
|
|
23
22
|
};
|
|
@@ -59,11 +58,11 @@ async function getAvailableSyncTypes(parentAccountConfig, config) {
|
|
|
59
58
|
const id = (0, getAccountIdentifier_1.getAccountIdentifier)(config);
|
|
60
59
|
const portalId = (0, config_1.getAccountId)(id);
|
|
61
60
|
if (!parentPortalId || !portalId) {
|
|
62
|
-
throw new Error((0, lang_1.i18n)(
|
|
61
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.sync.failure.syncTypeFetch`));
|
|
63
62
|
}
|
|
64
63
|
const { data: { results: syncTypes }, } = await (0, sandboxSync_1.fetchTypes)(parentPortalId, portalId);
|
|
65
64
|
if (!syncTypes) {
|
|
66
|
-
throw new Error((0, lang_1.i18n)(
|
|
65
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.sync.failure.syncTypeFetch`));
|
|
67
66
|
}
|
|
68
67
|
return syncTypes.map(t => ({ type: t.name }));
|
|
69
68
|
}
|
|
@@ -71,11 +70,11 @@ async function validateSandboxUsageLimits(accountConfig, sandboxType, env) {
|
|
|
71
70
|
const id = (0, getAccountIdentifier_1.getAccountIdentifier)(accountConfig);
|
|
72
71
|
const accountId = (0, config_1.getAccountId)(id);
|
|
73
72
|
if (!accountId) {
|
|
74
|
-
throw new Error((0, lang_1.i18n)(
|
|
73
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.create.failure.usageLimitFetch`));
|
|
75
74
|
}
|
|
76
75
|
const { data: { usage }, } = await (0, sandboxHubs_1.getSandboxUsageLimits)(accountId);
|
|
77
76
|
if (!usage) {
|
|
78
|
-
throw new Error((0, lang_1.i18n)(
|
|
77
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.create.failure.usageLimitFetch`));
|
|
79
78
|
}
|
|
80
79
|
if (sandboxType === config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX) {
|
|
81
80
|
if (usage['DEVELOPER'].available === 0) {
|
|
@@ -83,14 +82,14 @@ async function validateSandboxUsageLimits(accountConfig, sandboxType, env) {
|
|
|
83
82
|
const plural = devSandboxLimit !== 1;
|
|
84
83
|
const hasDevelopmentSandboxes = getHasSandboxesByType(accountConfig, config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
|
|
85
84
|
if (hasDevelopmentSandboxes) {
|
|
86
|
-
throw new Error((0, lang_1.i18n)(
|
|
85
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.create.failure.alreadyInConfig.developer.${plural ? 'other' : 'one'}`, {
|
|
87
86
|
accountName: accountConfig.name || accountId,
|
|
88
87
|
limit: devSandboxLimit,
|
|
89
88
|
}));
|
|
90
89
|
}
|
|
91
90
|
else {
|
|
92
91
|
const baseUrl = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
93
|
-
throw new Error((0, lang_1.i18n)(
|
|
92
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.create.failure.limit.developer.${plural ? 'other' : 'one'}`, {
|
|
94
93
|
accountName: accountConfig.name || accountId,
|
|
95
94
|
limit: devSandboxLimit,
|
|
96
95
|
link: `${baseUrl}/sandboxes-developer/${accountId}/development`,
|
|
@@ -104,14 +103,14 @@ async function validateSandboxUsageLimits(accountConfig, sandboxType, env) {
|
|
|
104
103
|
const plural = standardSandboxLimit !== 1;
|
|
105
104
|
const hasStandardSandboxes = getHasSandboxesByType(accountConfig, config_2.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
|
|
106
105
|
if (hasStandardSandboxes) {
|
|
107
|
-
throw new Error((0, lang_1.i18n)(
|
|
106
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.create.failure.alreadyInConfig.standard.${plural ? 'other' : 'one'}`, {
|
|
108
107
|
accountName: accountConfig.name || accountId,
|
|
109
108
|
limit: standardSandboxLimit,
|
|
110
109
|
}));
|
|
111
110
|
}
|
|
112
111
|
else {
|
|
113
112
|
const baseUrl = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
114
|
-
throw new Error((0, lang_1.i18n)(
|
|
113
|
+
throw new Error((0, lang_1.i18n)(`lib.sandbox.create.failure.limit.standard.${plural ? 'other' : 'one'}`, {
|
|
115
114
|
accountName: accountConfig.name || accountId,
|
|
116
115
|
limit: standardSandboxLimit,
|
|
117
116
|
link: `${baseUrl}/sandboxes-developer/${accountId}/standard`,
|
|
@@ -122,12 +121,12 @@ async function validateSandboxUsageLimits(accountConfig, sandboxType, env) {
|
|
|
122
121
|
}
|
|
123
122
|
function handleSandboxCreateError(err, env, name, accountId) {
|
|
124
123
|
if ((0, index_1.isMissingScopeError)(err)) {
|
|
125
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
124
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.create.failure.scopes.message`, {
|
|
126
125
|
accountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
127
126
|
}));
|
|
128
127
|
const websiteOrigin = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
129
128
|
const url = `${websiteOrigin}/personal-access-key/${accountId}`;
|
|
130
|
-
logger_1.logger.info((0, lang_1.i18n)(
|
|
129
|
+
logger_1.logger.info((0, lang_1.i18n)(`lib.sandbox.create.failure.scopes.instructions`, {
|
|
131
130
|
accountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
132
131
|
url,
|
|
133
132
|
}));
|
|
@@ -138,7 +137,7 @@ function handleSandboxCreateError(err, env, name, accountId) {
|
|
|
138
137
|
subCategory: 'SandboxErrors.USER_ACCESS_NOT_ALLOWED',
|
|
139
138
|
})) {
|
|
140
139
|
logger_1.logger.log('');
|
|
141
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
140
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.create.failure.invalidUser`, {
|
|
142
141
|
accountName: name,
|
|
143
142
|
parentAccountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
144
143
|
}));
|
|
@@ -150,7 +149,7 @@ function handleSandboxCreateError(err, env, name, accountId) {
|
|
|
150
149
|
subCategory: 'SandboxErrors.DEVELOPMENT_SANDBOX_ACCESS_NOT_ALLOWED',
|
|
151
150
|
})) {
|
|
152
151
|
logger_1.logger.log('');
|
|
153
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
152
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.sandbox.create.failure.403Gating`, {
|
|
154
153
|
accountName: name,
|
|
155
154
|
parentAccountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
156
155
|
accountId,
|
package/lib/serverlessLogs.js
CHANGED
|
@@ -44,8 +44,6 @@ async function verifyAccessKeyAndUserAccess(accountId, scopeGroup) {
|
|
|
44
44
|
if (!accountConfig) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
// TODO[JOE]: Update this i18n key
|
|
48
|
-
const i18nKey = 'lib.serverless';
|
|
49
47
|
const { authType } = accountConfig;
|
|
50
48
|
if (authType !== auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value) {
|
|
51
49
|
return;
|
|
@@ -56,7 +54,7 @@ async function verifyAccessKeyAndUserAccess(accountId, scopeGroup) {
|
|
|
56
54
|
scopesData = resp.data;
|
|
57
55
|
}
|
|
58
56
|
catch (e) {
|
|
59
|
-
logger_1.logger.debug((0, lang_1.i18n)(
|
|
57
|
+
logger_1.logger.debug((0, lang_1.i18n)(`lib.serverless.verifyAccessKeyAndUserAccess.fetchScopeDataError`, {
|
|
60
58
|
scopeGroup,
|
|
61
59
|
}));
|
|
62
60
|
logger_1.logger.debug(e);
|
|
@@ -64,14 +62,14 @@ async function verifyAccessKeyAndUserAccess(accountId, scopeGroup) {
|
|
|
64
62
|
}
|
|
65
63
|
const { portalScopesInGroup, userScopesInGroup } = scopesData;
|
|
66
64
|
if (!portalScopesInGroup.length) {
|
|
67
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
65
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.serverless.verifyAccessKeyAndUserAccess.portalMissingScope`));
|
|
68
66
|
return;
|
|
69
67
|
}
|
|
70
68
|
if (!portalScopesInGroup.every(s => userScopesInGroup.includes(s))) {
|
|
71
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
69
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.serverless.verifyAccessKeyAndUserAccess.userMissingScope`));
|
|
72
70
|
}
|
|
73
71
|
else {
|
|
74
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
72
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.serverless.verifyAccessKeyAndUserAccess.genericMissingScope`));
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
async function tailLogs(accountId, name, fetchLatest, tailCall, compact = false) {
|
|
@@ -22,7 +22,7 @@ declare class SpinniesManager {
|
|
|
22
22
|
succeed(name: string, options?: Partial<SpinnerState>): SpinnerState;
|
|
23
23
|
fail(name: string, options?: Partial<SpinnerState>): SpinnerState;
|
|
24
24
|
remove(name: string): SpinnerState;
|
|
25
|
-
stopAll(newStatus?: typeof VALID_STATUSES[number]): {
|
|
25
|
+
stopAll(newStatus?: (typeof VALID_STATUSES)[number]): {
|
|
26
26
|
[key: string]: SpinnerState;
|
|
27
27
|
};
|
|
28
28
|
private hasAnySpinners;
|
package/lib/ui/boxen.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logInBox = logInBox;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
5
|
+
const index_1 = require("./index");
|
|
6
|
+
const logger_2 = require("@hubspot/local-dev-lib/logger");
|
|
7
|
+
const en_1 = require("../../lang/en");
|
|
8
|
+
const defaultOptions = {
|
|
9
|
+
titleAlignment: 'left',
|
|
10
|
+
borderColor: index_1.UI_COLORS.MARIGOLD,
|
|
11
|
+
margin: 1,
|
|
12
|
+
padding: 1,
|
|
13
|
+
textAlignment: 'left',
|
|
14
|
+
borderStyle: 'round',
|
|
15
|
+
};
|
|
16
|
+
async function logInBox({ contents, options, }) {
|
|
17
|
+
try {
|
|
18
|
+
const boxen = (await import('boxen')).default;
|
|
19
|
+
logger_1.uiLogger.log(boxen(contents, { ...defaultOptions, ...options }));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
logger_2.logger.debug(en_1.lib.boxen.failedToLoad);
|
|
24
|
+
if (options?.title) {
|
|
25
|
+
logger_1.uiLogger.log(options.title);
|
|
26
|
+
logger_1.uiLogger.log('');
|
|
27
|
+
}
|
|
28
|
+
logger_1.uiLogger.log(contents);
|
|
29
|
+
}
|
|
30
|
+
}
|
package/lib/ui/git.js
CHANGED
|
@@ -8,22 +8,21 @@ const os_1 = __importDefault(require("os"));
|
|
|
8
8
|
const gitignore_1 = require("@hubspot/local-dev-lib/gitignore");
|
|
9
9
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
10
|
const lang_1 = require("../lang");
|
|
11
|
-
const i18nKey = 'lib.ui.git';
|
|
12
11
|
function checkAndWarnGitInclusion(configPath) {
|
|
13
12
|
try {
|
|
14
13
|
const { inGit, configIgnored } = (0, gitignore_1.checkGitInclusion)(configPath);
|
|
15
14
|
if (!inGit || configIgnored)
|
|
16
15
|
return;
|
|
17
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
18
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
19
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
20
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
21
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
22
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
23
|
-
logger_1.logger.warn((0, lang_1.i18n)(
|
|
16
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.securityIssue`));
|
|
17
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.configFileTracked`));
|
|
18
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.fileName`, { configPath }));
|
|
19
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.remediate`));
|
|
20
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.moveConfig`, { homeDir: os_1.default.homedir() }));
|
|
21
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.addGitignore`, { configPath }));
|
|
22
|
+
logger_1.logger.warn((0, lang_1.i18n)(`lib.ui.git.noRemote`));
|
|
24
23
|
}
|
|
25
24
|
catch (e) {
|
|
26
25
|
// fail silently
|
|
27
|
-
logger_1.logger.debug((0, lang_1.i18n)(
|
|
26
|
+
logger_1.logger.debug((0, lang_1.i18n)(`lib.ui.git.checkFailed`));
|
|
28
27
|
}
|
|
29
28
|
}
|
package/lib/ui/index.d.ts
CHANGED
|
@@ -11,7 +11,9 @@ export declare function uiCommandReference(command: string, withQuotes?: boolean
|
|
|
11
11
|
export declare function uiFeatureHighlight(features: string[], title?: string): void;
|
|
12
12
|
export declare function uiBetaTag(message: string, log?: true): undefined;
|
|
13
13
|
export declare function uiBetaTag(message: string, log: false): string;
|
|
14
|
-
export declare function uiDeprecatedTag(message: string, log?:
|
|
14
|
+
export declare function uiDeprecatedTag(message: string, log?: true): undefined;
|
|
15
|
+
export declare function uiDeprecatedTag(message: string, log: false): string;
|
|
15
16
|
export declare function uiCommandDisabledBanner(command: string, url?: string, message?: string): void;
|
|
16
|
-
export declare function uiDeprecatedDescription(message: string, command: string, url?: string):
|
|
17
|
+
export declare function uiDeprecatedDescription(message: string, command: string, url?: string): undefined;
|
|
17
18
|
export declare function uiDeprecatedMessage(command: string, url?: string, message?: string): void;
|
|
19
|
+
export declare function indent(level: number): string;
|
package/lib/ui/index.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.uiDeprecatedTag = uiDeprecatedTag;
|
|
|
15
15
|
exports.uiCommandDisabledBanner = uiCommandDisabledBanner;
|
|
16
16
|
exports.uiDeprecatedDescription = uiDeprecatedDescription;
|
|
17
17
|
exports.uiDeprecatedMessage = uiDeprecatedMessage;
|
|
18
|
+
exports.indent = indent;
|
|
18
19
|
const chalk_1 = __importDefault(require("chalk"));
|
|
19
20
|
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
20
21
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
@@ -78,10 +79,9 @@ function uiCommandReference(command, withQuotes = true) {
|
|
|
78
79
|
: commandReference);
|
|
79
80
|
}
|
|
80
81
|
function uiFeatureHighlight(features, title) {
|
|
81
|
-
|
|
82
|
-
uiInfoSection(title ? title : (0, lang_1.i18n)(`${i18nKey}.defaultTitle`), () => {
|
|
82
|
+
uiInfoSection(title ? title : (0, lang_1.i18n)(`lib.ui.featureHighlight.defaultTitle`), () => {
|
|
83
83
|
features.forEach((c, i) => {
|
|
84
|
-
const featureKey =
|
|
84
|
+
const featureKey = `lib.ui.featureHighlight.featureKeys.${c}`;
|
|
85
85
|
const message = (0, lang_1.i18n)(`${featureKey}.message`, {
|
|
86
86
|
command: uiCommandReference((0, lang_1.i18n)(`${featureKey}.command`)),
|
|
87
87
|
link: uiLink((0, lang_1.i18n)(`${featureKey}.linkText`), (0, lang_1.i18n)(`${featureKey}.url`)),
|
|
@@ -94,9 +94,8 @@ function uiFeatureHighlight(features, title) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
function uiBetaTag(message, log = true) {
|
|
97
|
-
const i18nKey = 'lib.ui';
|
|
98
97
|
const terminalUISupport = getTerminalUISupport();
|
|
99
|
-
const tag = (0, lang_1.i18n)(
|
|
98
|
+
const tag = (0, lang_1.i18n)(`lib.ui.betaTag`);
|
|
100
99
|
const result = `${terminalUISupport.color ? chalk_1.default.hex(exports.UI_COLORS.SORBET)(tag) : tag} ${message}`;
|
|
101
100
|
if (log) {
|
|
102
101
|
logger_1.logger.log(result);
|
|
@@ -105,21 +104,20 @@ function uiBetaTag(message, log = true) {
|
|
|
105
104
|
return result;
|
|
106
105
|
}
|
|
107
106
|
function uiDeprecatedTag(message, log = true) {
|
|
108
|
-
const i18nKey = 'lib.ui';
|
|
109
107
|
const terminalUISupport = getTerminalUISupport();
|
|
110
|
-
const tag = (0, lang_1.i18n)(
|
|
108
|
+
const tag = (0, lang_1.i18n)(`lib.ui.deprecatedTag`);
|
|
111
109
|
const result = `${terminalUISupport.color ? chalk_1.default.yellow(tag) : tag} ${message}`;
|
|
112
110
|
if (log) {
|
|
113
111
|
logger_1.logger.log(result);
|
|
112
|
+
return;
|
|
114
113
|
}
|
|
115
114
|
return result;
|
|
116
115
|
}
|
|
117
116
|
function uiCommandDisabledBanner(command, url, message) {
|
|
118
|
-
const i18nKey = 'lib.ui';
|
|
119
117
|
const tag = message ||
|
|
120
|
-
(0, lang_1.i18n)(
|
|
118
|
+
(0, lang_1.i18n)(`lib.ui.disabledMessage`, {
|
|
121
119
|
command: uiCommandReference(command),
|
|
122
|
-
url: url ? uiLink((0, lang_1.i18n)(
|
|
120
|
+
url: url ? uiLink((0, lang_1.i18n)(`lib.ui.disabledUrlText`), url) : '',
|
|
123
121
|
npmCommand: uiCommandReference('npm i -g @hubspot/cli@latest'),
|
|
124
122
|
});
|
|
125
123
|
logger_1.logger.log();
|
|
@@ -129,22 +127,24 @@ function uiCommandDisabledBanner(command, url, message) {
|
|
|
129
127
|
logger_1.logger.log();
|
|
130
128
|
}
|
|
131
129
|
function uiDeprecatedDescription(message, command, url) {
|
|
132
|
-
const
|
|
133
|
-
const tag = (0, lang_1.i18n)(`${i18nKey}.deprecatedDescription`, {
|
|
130
|
+
const tag = (0, lang_1.i18n)(`lib.ui.deprecatedDescription`, {
|
|
134
131
|
message,
|
|
135
132
|
command: uiCommandReference(command),
|
|
136
|
-
url: url ? uiLink((0, lang_1.i18n)(
|
|
133
|
+
url: url ? uiLink((0, lang_1.i18n)(`lib.ui.deprecatedUrlText`), url) : '',
|
|
137
134
|
});
|
|
138
135
|
return uiDeprecatedTag(tag);
|
|
139
136
|
}
|
|
140
137
|
function uiDeprecatedMessage(command, url, message) {
|
|
141
|
-
const i18nKey = 'lib.ui';
|
|
142
138
|
const tag = message ||
|
|
143
|
-
(0, lang_1.i18n)(
|
|
139
|
+
(0, lang_1.i18n)(`lib.ui.deprecatedMessage`, {
|
|
144
140
|
command: uiCommandReference(command),
|
|
145
|
-
url: url ? uiLink((0, lang_1.i18n)(
|
|
141
|
+
url: url ? uiLink((0, lang_1.i18n)(`lib.ui.deprecatedUrlText`), url) : '',
|
|
146
142
|
});
|
|
147
143
|
logger_1.logger.log();
|
|
148
144
|
uiDeprecatedTag(tag);
|
|
149
145
|
logger_1.logger.log();
|
|
150
146
|
}
|
|
147
|
+
function indent(level) {
|
|
148
|
+
const indentation = ' ';
|
|
149
|
+
return indentation.repeat(level);
|
|
150
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const uiLogger: {
|
|
2
|
+
log: (message: string) => void;
|
|
3
|
+
error: (message: string) => void;
|
|
4
|
+
warn: (message: string) => void;
|
|
5
|
+
success: (message: string) => void;
|
|
6
|
+
info: (message: string) => void;
|
|
7
|
+
debug: (...args: any[]) => void;
|
|
8
|
+
group: (message: string) => void;
|
|
9
|
+
groupEnd: () => void;
|
|
10
|
+
};
|
package/lib/ui/logger.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiLogger = void 0;
|
|
4
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
5
|
+
// Wrapper around LDL logger to provide type checking
|
|
6
|
+
exports.uiLogger = {
|
|
7
|
+
log: (message) => logger_1.logger.log(message),
|
|
8
|
+
error: (message) => logger_1.logger.error(message),
|
|
9
|
+
warn: (message) => logger_1.logger.warn(message),
|
|
10
|
+
success: (message) => logger_1.logger.success(message),
|
|
11
|
+
info: (message) => logger_1.logger.info(message),
|
|
12
|
+
debug: logger_1.logger.debug,
|
|
13
|
+
group: (message) => logger_1.logger.group(message),
|
|
14
|
+
groupEnd: () => logger_1.logger.groupEnd(),
|
|
15
|
+
};
|
|
@@ -8,7 +8,6 @@ const moment_1 = __importDefault(require("moment"));
|
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
10
|
const lang_1 = require("../lang");
|
|
11
|
-
const i18nKey = 'lib.ui.serverlessFunctionLogs';
|
|
12
11
|
const SEPARATOR = ' - ';
|
|
13
12
|
const LOG_STATUS_COLORS = {
|
|
14
13
|
SUCCESS: logger_1.Styles.success,
|
|
@@ -63,7 +62,7 @@ function processLog(log, options) {
|
|
|
63
62
|
return logHandler[log.status](log, options);
|
|
64
63
|
}
|
|
65
64
|
catch (e) {
|
|
66
|
-
logger_1.logger.error((0, lang_1.i18n)(
|
|
65
|
+
logger_1.logger.error((0, lang_1.i18n)(`lib.ui.serverlessFunctionLogs.unableToProcessLog`, {
|
|
67
66
|
log: JSON.stringify(log),
|
|
68
67
|
}));
|
|
69
68
|
}
|
|
@@ -77,7 +76,7 @@ function isLogsResponse(logsResp) {
|
|
|
77
76
|
function processLogs(logsResp, options) {
|
|
78
77
|
const isLogsResp = isLogsResponse(logsResp);
|
|
79
78
|
if (!logsResp || (isLogsResp && logsResp.results.length === 0)) {
|
|
80
|
-
return (0, lang_1.i18n)(
|
|
79
|
+
return (0, lang_1.i18n)(`lib.ui.serverlessFunctionLogs.noLogsFound`);
|
|
81
80
|
}
|
|
82
81
|
else if (isLogsResp) {
|
|
83
82
|
return logsResp
|
|
@@ -6,14 +6,14 @@ export type Spinner = {
|
|
|
6
6
|
};
|
|
7
7
|
export type SpinnerOptions = {
|
|
8
8
|
text?: string;
|
|
9
|
-
status?: typeof VALID_STATUSES[number];
|
|
9
|
+
status?: (typeof VALID_STATUSES)[number];
|
|
10
10
|
indent?: number;
|
|
11
11
|
spinner?: Partial<Spinner>;
|
|
12
12
|
disableSpins?: boolean;
|
|
13
|
-
color?: typeof VALID_COLORS[number];
|
|
14
|
-
spinnerColor?: typeof VALID_COLORS[number];
|
|
15
|
-
succeedColor?: typeof VALID_COLORS[number];
|
|
16
|
-
failColor?: typeof VALID_COLORS[number];
|
|
13
|
+
color?: (typeof VALID_COLORS)[number];
|
|
14
|
+
spinnerColor?: (typeof VALID_COLORS)[number];
|
|
15
|
+
succeedColor?: (typeof VALID_COLORS)[number];
|
|
16
|
+
failColor?: (typeof VALID_COLORS)[number];
|
|
17
17
|
succeedPrefix?: string;
|
|
18
18
|
failPrefix?: string;
|
|
19
19
|
};
|
package/lib/yargsUtils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Argv } from 'yargs';
|
|
2
2
|
export declare function hasFlag(flag: string, argv?: string[]): boolean;
|
|
3
|
-
export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>, command: string, describe
|
|
3
|
+
export declare function makeYargsBuilder<T>(callback: (yargs: Argv) => Argv<T>, command: string | string[], describe?: string, options?: {
|
|
4
4
|
useGlobalOptions?: boolean;
|
|
5
5
|
useAccountOptions?: boolean;
|
|
6
6
|
useConfigOptions?: boolean;
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.4.7
|
|
3
|
+
"version": "7.4.7",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "3.5.
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.1.
|
|
8
|
+
"@hubspot/local-dev-lib": "3.5.4",
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.1.7",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.2",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.8.52",
|
|
13
13
|
"archiver": "7.0.1",
|
|
14
|
+
"boxen": "8.0.1",
|
|
14
15
|
"chalk": "4.1.2",
|
|
15
16
|
"chokidar": "3.6.0",
|
|
16
17
|
"cli-cursor": "3.1.0",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"@types/semver": "^7.5.8",
|
|
42
43
|
"@types/tmp": "^0.2.6",
|
|
43
44
|
"@types/yargs": "^17.0.33",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.30.1",
|
|
45
46
|
"@typescript-eslint/parser": "^8.11.0",
|
|
46
47
|
"axios": "^1.7.2",
|
|
47
48
|
"eslint": "^8.56.0",
|
|
@@ -62,9 +63,9 @@
|
|
|
62
63
|
},
|
|
63
64
|
"scripts": {
|
|
64
65
|
"build": "ts-node ./scripts/build.ts",
|
|
65
|
-
"lint": "eslint . && prettier --list-different ./**/*.{js,json}",
|
|
66
|
+
"lint": "eslint . && prettier --list-different './**/*.{ts,js,json}'",
|
|
66
67
|
"list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
|
|
67
|
-
"prettier:write": "prettier --write ./**/*.{ts,js,json}",
|
|
68
|
+
"prettier:write": "prettier --write './**/*.{ts,js,json}'",
|
|
68
69
|
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
|
69
70
|
"test-cli": "yarn build && yarn --cwd 'acceptance-tests' test-ci",
|
|
70
71
|
"test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
|
package/types/Yargs.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Options } from 'yargs';
|
|
1
|
+
import { Options, CommandModule, Argv } from 'yargs';
|
|
2
2
|
export type CommonArgs = {
|
|
3
3
|
derivedAccountId: number;
|
|
4
4
|
providedAccountId?: number;
|
|
@@ -27,13 +27,7 @@ export type ProjectDevArgs = CommonArgs & ConfigArgs & EnvironmentArgs;
|
|
|
27
27
|
export type TestingArgs = {
|
|
28
28
|
qa?: boolean;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
platformVersion: string;
|
|
35
|
-
};
|
|
36
|
-
export type CloneAppArgs = ConfigArgs & EnvironmentArgs & AccountArgs & CommonArgs & {
|
|
37
|
-
dest: string;
|
|
38
|
-
appId: number;
|
|
39
|
-
};
|
|
30
|
+
export interface YargsCommandModule<T, U> extends CommandModule<T, U> {
|
|
31
|
+
builder: (yargs: Argv) => Promise<Argv<U>>;
|
|
32
|
+
}
|
|
33
|
+
export type YargsCommandModuleBucket = YargsCommandModule<unknown, object>;
|
package/lib/projects/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Project } from '@hubspot/local-dev-lib/types/Project';
|
|
2
|
-
import { ProjectConfig } from '../../types/Projects';
|
|
3
|
-
export declare function writeProjectConfig(configPath: string, config: ProjectConfig): boolean;
|
|
4
|
-
export declare function getIsInProject(dir?: string): boolean;
|
|
5
|
-
export declare function getProjectConfig(dir?: string): Promise<{
|
|
6
|
-
projectDir: string | null;
|
|
7
|
-
projectConfig: ProjectConfig | null;
|
|
8
|
-
}>;
|
|
9
|
-
export declare function validateProjectConfig(projectConfig: ProjectConfig | null, projectDir: string | null): void;
|
|
10
|
-
export declare function ensureProjectExists(accountId: number, projectName: string, { forceCreate, allowCreate, noLogs, withPolling, uploadCommand, }?: {
|
|
11
|
-
forceCreate?: boolean | undefined;
|
|
12
|
-
allowCreate?: boolean | undefined;
|
|
13
|
-
noLogs?: boolean | undefined;
|
|
14
|
-
withPolling?: boolean | undefined;
|
|
15
|
-
uploadCommand?: boolean | undefined;
|
|
16
|
-
}): Promise<{
|
|
17
|
-
projectExists: boolean;
|
|
18
|
-
project?: Project;
|
|
19
|
-
}>;
|
|
20
|
-
export declare function logFeedbackMessage(buildId: number): void;
|