@hubspot/cli 7.2.1-experimental.0 → 7.2.2-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +52 -3
- package/commands/account/auth.d.ts +10 -0
- package/commands/account/auth.js +154 -0
- package/commands/account/createOverride.d.ts +10 -0
- package/commands/account/createOverride.js +62 -0
- package/commands/account/list.js +4 -0
- package/commands/account.js +4 -0
- package/commands/auth.js +9 -5
- package/commands/config/migrate.d.ts +10 -0
- package/commands/config/migrate.js +86 -0
- package/commands/config/set.d.ts +12 -0
- package/commands/config/set.js +30 -29
- package/commands/config.d.ts +4 -1
- package/commands/config.js +45 -10
- package/commands/create/api-sample.js +4 -14
- package/commands/customObject/create.d.ts +0 -11
- package/commands/customObject/create.js +28 -37
- package/commands/customObject/schema/create.d.ts +0 -10
- package/commands/customObject/schema/create.js +42 -40
- package/commands/customObject/schema/delete.d.ts +0 -11
- package/commands/customObject/schema/delete.js +27 -34
- package/commands/customObject/schema/fetch-all.d.ts +0 -10
- package/commands/customObject/schema/fetch-all.js +24 -31
- package/commands/customObject/schema/fetch.d.ts +0 -11
- package/commands/customObject/schema/fetch.js +42 -34
- package/commands/customObject/schema/list.d.ts +0 -7
- package/commands/customObject/schema/list.js +14 -23
- package/commands/customObject/schema/update.d.ts +0 -11
- package/commands/customObject/schema/update.js +46 -44
- package/commands/customObject/schema.d.ts +1 -5
- package/commands/customObject/schema.js +11 -49
- package/commands/customObject.d.ts +1 -4
- package/commands/customObject.js +21 -54
- package/commands/filemanager/fetch.d.ts +0 -12
- package/commands/filemanager/fetch.js +30 -33
- package/commands/filemanager/upload.d.ts +0 -11
- package/commands/filemanager/upload.js +47 -53
- package/commands/filemanager.d.ts +1 -4
- package/commands/filemanager.js +7 -41
- package/commands/init.js +15 -26
- package/commands/project/add.js +16 -62
- package/commands/project/cloneApp.js +3 -3
- package/commands/project/create.js +15 -70
- package/commands/project/dev.d.ts +1 -0
- package/commands/project/dev.js +146 -0
- package/commands/project/migrateApp.js +3 -3
- package/commands/project/upload.js +2 -7
- package/commands/sandbox/create.d.ts +0 -12
- package/commands/sandbox/create.js +72 -90
- package/commands/sandbox/delete.d.ts +0 -11
- package/commands/sandbox/delete.js +95 -112
- package/commands/sandbox.d.ts +1 -4
- package/commands/sandbox.js +10 -44
- package/commands/theme/generate-selectors.d.ts +0 -9
- package/commands/theme/generate-selectors.js +43 -61
- package/commands/theme/marketplace-validate.d.ts +0 -10
- package/commands/theme/marketplace-validate.js +26 -32
- package/commands/theme/preview.d.ts +0 -16
- package/commands/theme/preview.js +97 -104
- package/commands/theme.d.ts +1 -4
- package/commands/theme.js +10 -44
- package/lang/en.lyaml +67 -40
- package/lib/LocalDevManager.d.ts +2 -2
- package/lib/buildAccount.d.ts +3 -2
- package/lib/configMigrate.d.ts +2 -0
- package/lib/configMigrate.js +83 -0
- package/lib/constants.d.ts +3 -12
- package/lib/constants.js +4 -13
- package/lib/doctor/Diagnosis.d.ts +1 -0
- package/lib/doctor/Diagnosis.js +7 -0
- package/lib/doctor/DiagnosticInfoBuilder.d.ts +1 -6
- package/lib/doctor/DiagnosticInfoBuilder.js +1 -5
- package/lib/doctor/Doctor.d.ts +1 -1
- package/lib/doctor/Doctor.js +14 -6
- package/lib/localDev.d.ts +1 -2
- package/lib/marketplaceValidate.d.ts +2 -2
- package/lib/projects/buildAndDeploy.js +1 -4
- package/lib/projects/index.d.ts +5 -1
- package/lib/projects/index.js +62 -1
- package/lib/projects/structure.d.ts +0 -4
- package/lib/projects/structure.js +0 -9
- package/lib/projects/upload.d.ts +1 -1
- package/lib/projects/upload.js +2 -2
- package/lib/prompts/accountNamePrompt.d.ts +1 -1
- package/lib/prompts/createProjectPrompt.d.ts +8 -6
- package/lib/prompts/createProjectPrompt.js +54 -26
- package/lib/prompts/projectAddPrompt.d.ts +3 -3
- package/lib/prompts/projectAddPrompt.js +6 -16
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +2 -3
- package/lib/prompts/sandboxesPrompt.d.ts +2 -3
- package/lib/prompts/sandboxesPrompt.js +1 -1
- package/lib/sandboxSync.js +2 -6
- package/lib/sandboxes.d.ts +5 -2
- package/lib/ui/index.d.ts +1 -1
- package/lib/ui/index.js +0 -1
- package/lib/upload.d.ts +1 -1
- package/lib/upload.js +20 -20
- package/lib/usageTracking.d.ts +1 -1
- package/lib/validation.d.ts +1 -1
- package/package.json +4 -5
- package/types/Projects.d.ts +6 -1
- package/types/Prompts.d.ts +0 -7
- package/types/Sandboxes.d.ts +0 -2
- package/types/Yargs.d.ts +0 -8
- package/commands/project/dev/deprecatedFlow.d.ts +0 -5
- package/commands/project/dev/deprecatedFlow.js +0 -137
- package/commands/project/dev/index.d.ts +0 -6
- package/commands/project/dev/index.js +0 -52
- package/commands/project/dev/unifiedFlow.d.ts +0 -5
- package/commands/project/dev/unifiedFlow.js +0 -112
- package/lib/DevServerManagerV2.d.ts +0 -34
- package/lib/DevServerManagerV2.js +0 -85
- package/lib/LocalDevManagerV2.d.ts +0 -64
- package/lib/LocalDevManagerV2.js +0 -382
- package/lib/customObject.d.ts +0 -3
- package/lib/customObject.js +0 -15
- package/lib/projects/create.d.ts +0 -5
- package/lib/projects/create.js +0 -51
- package/lib/testUtils.d.ts +0 -12
- package/lib/testUtils.js +0 -10
- package/types/ProjectComponents.d.ts +0 -38
- package/types/ProjectComponents.js +0 -3
package/bin/cli.js
CHANGED
|
@@ -6,6 +6,7 @@ const chalk = require('chalk');
|
|
|
6
6
|
const { logger } = require('@hubspot/local-dev-lib/logger');
|
|
7
7
|
const { addUserAgentHeader } = require('@hubspot/local-dev-lib/http');
|
|
8
8
|
const { loadConfig, getAccountId, configFileExists, getConfigPath, validateConfig, } = require('@hubspot/local-dev-lib/config');
|
|
9
|
+
const { DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID, DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND, DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME, } = require('@hubspot/local-dev-lib/constants/config');
|
|
9
10
|
const { logError } = require('../lib/errorHandlers/index');
|
|
10
11
|
const { setLogLevel, getCommandName } = require('../lib/commonOpts');
|
|
11
12
|
const { validateAccount } = require('../lib/validation');
|
|
@@ -137,9 +138,17 @@ const isTargetedCommand = (options, commandMap) => {
|
|
|
137
138
|
};
|
|
138
139
|
return checkCommand(options, commandMap);
|
|
139
140
|
};
|
|
141
|
+
const skipConfigAccountsSubCommands = {
|
|
142
|
+
target: false,
|
|
143
|
+
subCommands: {
|
|
144
|
+
auth: { target: true },
|
|
145
|
+
},
|
|
146
|
+
};
|
|
140
147
|
const SKIP_CONFIG_VALIDATION = {
|
|
141
148
|
init: { target: true },
|
|
142
149
|
auth: { target: true },
|
|
150
|
+
accounts: skipConfigAccountsSubCommands,
|
|
151
|
+
account: skipConfigAccountsSubCommands,
|
|
143
152
|
};
|
|
144
153
|
const handleDeprecatedEnvVariables = options => {
|
|
145
154
|
// HUBSPOT_PORTAL_ID is deprecated, but we'll still support it for now
|
|
@@ -164,9 +173,39 @@ const injectAccountIdMiddleware = async (options) => {
|
|
|
164
173
|
options.derivedAccountId = parseInt(process.env.HUBSPOT_ACCOUNT_ID, 10);
|
|
165
174
|
}
|
|
166
175
|
else {
|
|
167
|
-
|
|
176
|
+
try {
|
|
177
|
+
options.derivedAccountId = getAccountId(account);
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
logError(error);
|
|
181
|
+
if (error.cause === DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID) {
|
|
182
|
+
logger.log(i18n(`${i18nKey}.injectAccountIdMiddleware.invalidAccountId`, {
|
|
183
|
+
overrideCommand: uiCommandReference('hs account create-override'),
|
|
184
|
+
hsAccountFileName: DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME,
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
if (error.cause === DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND) {
|
|
188
|
+
logger.log(i18n(`${i18nKey}.injectAccountIdMiddleware.accountNotFound`, {
|
|
189
|
+
configPath: getConfigPath(),
|
|
190
|
+
authCommand: uiCommandReference('hs account auth'),
|
|
191
|
+
hsAccountFileName: DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME,
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
process.exit(EXIT_CODES.ERROR);
|
|
195
|
+
}
|
|
168
196
|
}
|
|
169
197
|
};
|
|
198
|
+
const skipLoadConfigAccountSubCommands = {
|
|
199
|
+
target: false,
|
|
200
|
+
subCommands: { auth: { target: true } },
|
|
201
|
+
};
|
|
202
|
+
const SKIP_LOAD_CONFIG = {
|
|
203
|
+
account: skipLoadConfigAccountSubCommands,
|
|
204
|
+
accounts: skipLoadConfigAccountSubCommands,
|
|
205
|
+
};
|
|
206
|
+
const SKIP_CONFIG_FLAG_VALIDATION = {
|
|
207
|
+
config: { target: false, subCommands: { migrate: { target: true } } },
|
|
208
|
+
};
|
|
170
209
|
const loadConfigMiddleware = async (options) => {
|
|
171
210
|
// Skip this when no command is provided
|
|
172
211
|
if (!options._.length) {
|
|
@@ -178,13 +217,21 @@ const loadConfigMiddleware = async (options) => {
|
|
|
178
217
|
process.exit(EXIT_CODES.ERROR);
|
|
179
218
|
}
|
|
180
219
|
};
|
|
181
|
-
if (configFileExists(true) &&
|
|
220
|
+
if (configFileExists(true) &&
|
|
221
|
+
options.config &&
|
|
222
|
+
!isTargetedCommand(options, SKIP_CONFIG_FLAG_VALIDATION)) {
|
|
182
223
|
logger.error(i18n(`${i18nKey}.loadConfigMiddleware.configFileExists`, {
|
|
183
224
|
configPath: getConfigPath(),
|
|
184
225
|
}));
|
|
185
226
|
process.exit(EXIT_CODES.ERROR);
|
|
186
227
|
}
|
|
187
|
-
|
|
228
|
+
// There are two commands where we don't load config:
|
|
229
|
+
// 1. `hs init`
|
|
230
|
+
// 2. `hs account auth` only if the global config file does not exist
|
|
231
|
+
if (!isTargetedCommand(options, {
|
|
232
|
+
init: { target: true },
|
|
233
|
+
}) &&
|
|
234
|
+
!(isTargetedCommand(options, SKIP_LOAD_CONFIG) && !configFileExists(true))) {
|
|
188
235
|
const { config: configPath } = options;
|
|
189
236
|
const config = loadConfig(configPath, options);
|
|
190
237
|
// We don't run validateConfig() for auth because users should be able to run it when
|
|
@@ -205,6 +252,7 @@ const checkAndWarnGitInclusionMiddleware = options => {
|
|
|
205
252
|
const accountsSubCommands = {
|
|
206
253
|
target: false,
|
|
207
254
|
subCommands: {
|
|
255
|
+
auth: { target: true },
|
|
208
256
|
clean: { target: true },
|
|
209
257
|
list: { target: true },
|
|
210
258
|
ls: { target: true },
|
|
@@ -220,6 +268,7 @@ const sandboxesSubCommands = {
|
|
|
220
268
|
const SKIP_ACCOUNT_VALIDATION = {
|
|
221
269
|
init: { target: true },
|
|
222
270
|
auth: { target: true },
|
|
271
|
+
config: { target: false, subCommands: { migrate: { target: true } } },
|
|
223
272
|
account: accountsSubCommands,
|
|
224
273
|
accounts: accountsSubCommands,
|
|
225
274
|
sandbox: sandboxesSubCommands,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
+
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
+
export declare const describe: undefined;
|
|
4
|
+
export declare const command = "auth";
|
|
5
|
+
type AccountAuthArgs = CommonArgs & ConfigArgs & {
|
|
6
|
+
disableTracking?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function handler(args: ArgumentsCamelCase<AccountAuthArgs>): Promise<void>;
|
|
9
|
+
export declare function builder(yargs: Argv): Argv<AccountAuthArgs>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.describe = void 0;
|
|
4
|
+
exports.handler = handler;
|
|
5
|
+
exports.builder = builder;
|
|
6
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
7
|
+
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
8
|
+
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
9
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
10
|
+
const personalAccessKey_1 = require("@hubspot/local-dev-lib/personalAccessKey");
|
|
11
|
+
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
12
|
+
const text_1 = require("@hubspot/local-dev-lib/text");
|
|
13
|
+
const auth_1 = require("@hubspot/local-dev-lib/constants/auth");
|
|
14
|
+
const commonOpts_1 = require("../../lib/commonOpts");
|
|
15
|
+
const configMigrate_1 = require("../../lib/configMigrate");
|
|
16
|
+
const process_1 = require("../../lib/process");
|
|
17
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
18
|
+
const lang_1 = require("../../lib/lang");
|
|
19
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
20
|
+
const personalAccessKeyPrompt_1 = require("../../lib/prompts/personalAccessKeyPrompt");
|
|
21
|
+
const accountNamePrompt_1 = require("../../lib/prompts/accountNamePrompt");
|
|
22
|
+
const setAsDefaultAccountPrompt_1 = require("../../lib/prompts/setAsDefaultAccountPrompt");
|
|
23
|
+
const index_2 = require("../../lib/errorHandlers/index");
|
|
24
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
25
|
+
const ui_1 = require("../../lib/ui");
|
|
26
|
+
const i18nKey = 'commands.account.subcommands.auth';
|
|
27
|
+
const TRACKING_STATUS = {
|
|
28
|
+
STARTED: 'started',
|
|
29
|
+
ERROR: 'error',
|
|
30
|
+
COMPLETE: 'complete',
|
|
31
|
+
};
|
|
32
|
+
async function updateConfig(env, doesConfigExist, disableTracking, authType, account) {
|
|
33
|
+
try {
|
|
34
|
+
const { personalAccessKey } = await (0, personalAccessKeyPrompt_1.personalAccessKeyPrompt)({
|
|
35
|
+
env,
|
|
36
|
+
account,
|
|
37
|
+
});
|
|
38
|
+
const token = await (0, personalAccessKey_1.getAccessToken)(personalAccessKey, env);
|
|
39
|
+
const defaultName = token.hubName ? (0, text_1.toKebabCase)(token.hubName) : undefined;
|
|
40
|
+
const name = doesConfigExist
|
|
41
|
+
? undefined
|
|
42
|
+
: (await (0, accountNamePrompt_1.cliAccountNamePrompt)(defaultName)).name;
|
|
43
|
+
const updatedConfig = await (0, personalAccessKey_1.updateConfigWithAccessToken)(token, personalAccessKey, env, name, !doesConfigExist);
|
|
44
|
+
if (!updatedConfig)
|
|
45
|
+
return null;
|
|
46
|
+
if (doesConfigExist && !updatedConfig.name) {
|
|
47
|
+
updatedConfig.name = (await (0, accountNamePrompt_1.cliAccountNamePrompt)(defaultName)).name;
|
|
48
|
+
(0, config_1.updateAccountConfig)({
|
|
49
|
+
...updatedConfig,
|
|
50
|
+
});
|
|
51
|
+
(0, config_1.writeConfig)();
|
|
52
|
+
}
|
|
53
|
+
return updatedConfig;
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
if (!disableTracking) {
|
|
57
|
+
await (0, usageTracking_1.trackAuthAction)('account-auth', authType, TRACKING_STATUS.ERROR);
|
|
58
|
+
}
|
|
59
|
+
(0, index_1.debugError)(e);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.describe = undefined; // i18n(`${i18nKey}.describe`);
|
|
64
|
+
exports.command = 'auth';
|
|
65
|
+
async function handler(args) {
|
|
66
|
+
const { providedAccountId, disableTracking } = args;
|
|
67
|
+
const authType = auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value;
|
|
68
|
+
const deprecatedConfigExists = (0, migrate_1.configFileExists)(false);
|
|
69
|
+
const globalConfigExists = (0, migrate_1.configFileExists)(true);
|
|
70
|
+
if (deprecatedConfigExists) {
|
|
71
|
+
if (globalConfigExists) {
|
|
72
|
+
try {
|
|
73
|
+
await (0, configMigrate_1.handleMerge)();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
(0, index_2.logError)(error);
|
|
77
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
try {
|
|
82
|
+
await (0, configMigrate_1.handleMigration)();
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
(0, index_2.logError)(error);
|
|
86
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!disableTracking) {
|
|
91
|
+
(0, usageTracking_1.trackCommandUsage)('account-auth', {}, providedAccountId);
|
|
92
|
+
await (0, usageTracking_1.trackAuthAction)('account-auth', authType, TRACKING_STATUS.STARTED);
|
|
93
|
+
}
|
|
94
|
+
const env = args.qa ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD;
|
|
95
|
+
const configAlreadyExists = (0, migrate_1.configFileExists)(true);
|
|
96
|
+
if (!configAlreadyExists) {
|
|
97
|
+
(0, config_1.createEmptyConfigFile)({}, true);
|
|
98
|
+
}
|
|
99
|
+
(0, config_1.loadConfig)('');
|
|
100
|
+
(0, process_1.handleExit)(config_1.deleteEmptyConfigFile);
|
|
101
|
+
const updatedConfig = await updateConfig(env, configAlreadyExists, disableTracking, authType, providedAccountId);
|
|
102
|
+
if (!updatedConfig) {
|
|
103
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.errors.failedToUpdateConfig`));
|
|
104
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
105
|
+
}
|
|
106
|
+
const { name } = updatedConfig;
|
|
107
|
+
const accountId = (0, getAccountIdentifier_1.getAccountIdentifier)(updatedConfig);
|
|
108
|
+
// If the config file was just created, we don't need to prompt the user to set as default
|
|
109
|
+
if (!configAlreadyExists) {
|
|
110
|
+
logger_1.logger.log('');
|
|
111
|
+
logger_1.logger.success((0, lang_1.i18n)(`${i18nKey}.success.configFileCreated`, {
|
|
112
|
+
configPath: (0, config_1.getConfigPath)('', true),
|
|
113
|
+
}));
|
|
114
|
+
logger_1.logger.success((0, lang_1.i18n)(`${i18nKey}.success.configFileUpdated`, {
|
|
115
|
+
account: name || accountId || '',
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const setAsDefault = await (0, setAsDefaultAccountPrompt_1.setAsDefaultAccountPrompt)(name);
|
|
120
|
+
logger_1.logger.log('');
|
|
121
|
+
if (setAsDefault) {
|
|
122
|
+
logger_1.logger.success((0, lang_1.i18n)(`lib.prompts.setAsDefaultAccountPrompt.setAsDefaultAccount`, {
|
|
123
|
+
accountName: name,
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
logger_1.logger.info((0, lang_1.i18n)(`lib.prompts.setAsDefaultAccountPrompt.keepingCurrentDefault`, {
|
|
128
|
+
accountName: (0, config_1.getConfigDefaultAccount)(),
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
(0, ui_1.uiFeatureHighlight)(['helpCommand', 'authCommand', 'accountsListCommand']);
|
|
133
|
+
if (!disableTracking) {
|
|
134
|
+
await (0, usageTracking_1.trackAuthAction)('account-auth', authType, TRACKING_STATUS.COMPLETE, accountId);
|
|
135
|
+
}
|
|
136
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
137
|
+
}
|
|
138
|
+
function builder(yargs) {
|
|
139
|
+
yargs.options({
|
|
140
|
+
account: {
|
|
141
|
+
describe: (0, lang_1.i18n)(`${i18nKey}.options.account.describe`),
|
|
142
|
+
type: 'string',
|
|
143
|
+
alias: 'a',
|
|
144
|
+
},
|
|
145
|
+
'disable-tracking': {
|
|
146
|
+
type: 'boolean',
|
|
147
|
+
hidden: true,
|
|
148
|
+
default: false,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
(0, commonOpts_1.addTestingOptions)(yargs);
|
|
152
|
+
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
153
|
+
return yargs;
|
|
154
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
+
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
+
export declare const describe: undefined;
|
|
4
|
+
export declare const command = "create-override [account]";
|
|
5
|
+
type AccountCreateOverrideArgs = CommonArgs & {
|
|
6
|
+
account: string | number;
|
|
7
|
+
};
|
|
8
|
+
export declare function handler(args: ArgumentsCamelCase<AccountCreateOverrideArgs>): Promise<void>;
|
|
9
|
+
export declare function builder(yargs: Argv): Argv<AccountCreateOverrideArgs>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
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.command = exports.describe = void 0;
|
|
7
|
+
exports.handler = handler;
|
|
8
|
+
exports.builder = builder;
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const path_2 = require("@hubspot/local-dev-lib/path");
|
|
12
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
13
|
+
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
14
|
+
const config_2 = require("@hubspot/local-dev-lib/config");
|
|
15
|
+
const lang_1 = require("../../lib/lang");
|
|
16
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
17
|
+
const accountsPrompt_1 = require("../../lib/prompts/accountsPrompt");
|
|
18
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
19
|
+
const i18nKey = 'commands.account.subcommands.createOverride';
|
|
20
|
+
exports.describe = undefined; // i18n(`${i18nKey}.describe`);
|
|
21
|
+
exports.command = 'create-override [account]';
|
|
22
|
+
async function handler(args) {
|
|
23
|
+
let overrideDefaultAccount = args.account;
|
|
24
|
+
if (!overrideDefaultAccount) {
|
|
25
|
+
overrideDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
26
|
+
}
|
|
27
|
+
else if (!(0, config_2.getAccountId)(overrideDefaultAccount)) {
|
|
28
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.errors.accountNotFound`, {
|
|
29
|
+
configPath: (0, config_2.getConfigPath)() || '',
|
|
30
|
+
}));
|
|
31
|
+
overrideDefaultAccount = await (0, accountsPrompt_1.selectAccountFromConfig)();
|
|
32
|
+
}
|
|
33
|
+
const accountId = (0, config_2.getAccountId)(overrideDefaultAccount);
|
|
34
|
+
try {
|
|
35
|
+
const overrideFilePath = path_1.default.join((0, path_2.getCwd)(), config_1.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME);
|
|
36
|
+
await fs_extra_1.default.writeFile(overrideFilePath, accountId.toString(), 'utf8');
|
|
37
|
+
logger_1.logger.success((0, lang_1.i18n)(`${i18nKey}.success`, { overrideFilePath }));
|
|
38
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
(0, index_1.logError)(e);
|
|
42
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function builder(yargs) {
|
|
46
|
+
yargs.positional('account', {
|
|
47
|
+
describe: (0, lang_1.i18n)(`${i18nKey}.options.account.describe`),
|
|
48
|
+
type: 'string',
|
|
49
|
+
});
|
|
50
|
+
yargs.example([
|
|
51
|
+
['$0 account create-override', (0, lang_1.i18n)(`${i18nKey}.examples.default`)],
|
|
52
|
+
[
|
|
53
|
+
'$0 account create-override 12345678',
|
|
54
|
+
(0, lang_1.i18n)(`${i18nKey}.examples.idBased`),
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
'$0 account create-override MyAccount',
|
|
58
|
+
(0, lang_1.i18n)(`${i18nKey}.examples.nameBased`),
|
|
59
|
+
],
|
|
60
|
+
]);
|
|
61
|
+
return yargs;
|
|
62
|
+
}
|
package/commands/account/list.js
CHANGED
|
@@ -73,6 +73,7 @@ async function handler(args) {
|
|
|
73
73
|
const { derivedAccountId } = args;
|
|
74
74
|
(0, usageTracking_1.trackCommandUsage)('accounts-list', undefined, derivedAccountId);
|
|
75
75
|
const configPath = (0, config_1.getConfigPath)();
|
|
76
|
+
const overrideFilePath = (0, config_1.getDefaultAccountOverrideFilePath)();
|
|
76
77
|
const accountsList = (0, config_1.getConfigAccounts)() || [];
|
|
77
78
|
const mappedAccountData = sortAndMapAccounts(accountsList);
|
|
78
79
|
const accountData = getAccountData(mappedAccountData);
|
|
@@ -82,6 +83,9 @@ async function handler(args) {
|
|
|
82
83
|
(0, lang_1.i18n)(`${i18nKey}.labels.authType`),
|
|
83
84
|
]));
|
|
84
85
|
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.configPath`, { configPath: configPath }));
|
|
86
|
+
if (overrideFilePath) {
|
|
87
|
+
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.overrideFilePath`, { overrideFilePath }));
|
|
88
|
+
}
|
|
85
89
|
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.defaultAccount`, {
|
|
86
90
|
account: (0, config_1.getConfigDefaultAccount)(),
|
|
87
91
|
}));
|
package/commands/account.js
CHANGED
|
@@ -37,24 +37,28 @@ exports.describe = exports.command = void 0;
|
|
|
37
37
|
exports.builder = builder;
|
|
38
38
|
const commonOpts_1 = require("../lib/commonOpts");
|
|
39
39
|
const lang_1 = require("../lib/lang");
|
|
40
|
+
const auth = __importStar(require("./account/auth"));
|
|
40
41
|
const list = __importStar(require("./account/list"));
|
|
41
42
|
const rename = __importStar(require("./account/rename"));
|
|
42
43
|
const use = __importStar(require("./account/use"));
|
|
43
44
|
const info = __importStar(require("./account/info"));
|
|
44
45
|
const remove = __importStar(require("./account/remove"));
|
|
45
46
|
const clean = __importStar(require("./account/clean"));
|
|
47
|
+
const createOverride = __importStar(require("./account/createOverride"));
|
|
46
48
|
const i18nKey = 'commands.account';
|
|
47
49
|
exports.command = ['account', 'accounts'];
|
|
48
50
|
exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`);
|
|
49
51
|
function builder(yargs) {
|
|
50
52
|
(0, commonOpts_1.addGlobalOptions)(yargs);
|
|
51
53
|
yargs
|
|
54
|
+
.command(auth)
|
|
52
55
|
.command(list)
|
|
53
56
|
.command(rename)
|
|
54
57
|
.command(use)
|
|
55
58
|
.command(info)
|
|
56
59
|
.command(remove)
|
|
57
60
|
.command(clean)
|
|
61
|
+
.command(createOverride)
|
|
58
62
|
.demandCommand(1, '');
|
|
59
63
|
return yargs;
|
|
60
64
|
}
|
package/commands/auth.js
CHANGED
|
@@ -8,7 +8,7 @@ const { ENVIRONMENTS, } = require('@hubspot/local-dev-lib/constants/environments
|
|
|
8
8
|
const { DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, } = require('@hubspot/local-dev-lib/constants/config');
|
|
9
9
|
const { i18n } = require('../lib/lang');
|
|
10
10
|
const { getAccessToken, updateConfigWithAccessToken, } = require('@hubspot/local-dev-lib/personalAccessKey');
|
|
11
|
-
const { updateAccountConfig, writeConfig, getConfigPath, loadConfig, getConfigDefaultAccount, getAccountId, } = require('@hubspot/local-dev-lib/config');
|
|
11
|
+
const { updateAccountConfig, writeConfig, getConfigPath, loadConfig, getConfigDefaultAccount, getAccountId, configFileExists, } = require('@hubspot/local-dev-lib/config');
|
|
12
12
|
const { commaSeparatedValues, toKebabCase, } = require('@hubspot/local-dev-lib/text');
|
|
13
13
|
const { promptUser } = require('../lib/prompts/promptUtils');
|
|
14
14
|
const { personalAccessKeyPrompt, OAUTH_FLOW, } = require('../lib/prompts/personalAccessKeyPrompt');
|
|
@@ -18,7 +18,7 @@ const { addConfigOptions, setLogLevel, addTestingOptions, addGlobalOptions, } =
|
|
|
18
18
|
const { trackAuthAction, trackCommandUsage } = require('../lib/usageTracking');
|
|
19
19
|
const { authenticateWithOauth } = require('../lib/oauth');
|
|
20
20
|
const { EXIT_CODES } = require('../lib/enums/exitCodes');
|
|
21
|
-
const { uiFeatureHighlight } = require('../lib/ui');
|
|
21
|
+
const { uiFeatureHighlight, uiCommandReference } = require('../lib/ui');
|
|
22
22
|
const { logError } = require('../lib/errorHandlers/index');
|
|
23
23
|
const i18nKey = 'commands.auth';
|
|
24
24
|
const TRACKING_STATUS = {
|
|
@@ -43,9 +43,13 @@ exports.handler = async (options) => {
|
|
|
43
43
|
const env = qa ? ENVIRONMENTS.QA : ENVIRONMENTS.PROD;
|
|
44
44
|
// Needed to load deprecated config
|
|
45
45
|
loadConfig(configFlagValue);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const configPath = getConfigPath(configFlagValue);
|
|
47
|
+
checkAndWarnGitInclusion(configPath);
|
|
48
|
+
if (configFileExists(true)) {
|
|
49
|
+
logger.error(i18n(`${i18nKey}.errors.globalConfigFileExists`, {
|
|
50
|
+
configPath,
|
|
51
|
+
authCommand: uiCommandReference('hs account auth'),
|
|
52
|
+
}));
|
|
49
53
|
process.exit(EXIT_CODES.ERROR);
|
|
50
54
|
}
|
|
51
55
|
trackCommandUsage('auth');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Argv, ArgumentsCamelCase } from 'yargs';
|
|
2
|
+
import { CommonArgs, ConfigArgs } from '../../types/Yargs';
|
|
3
|
+
export declare const describe: string;
|
|
4
|
+
export declare const command = "migrate";
|
|
5
|
+
type ConfigMigrateArgs = CommonArgs & ConfigArgs & {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function handler(args: ArgumentsCamelCase<ConfigMigrateArgs>): Promise<void>;
|
|
9
|
+
export declare function builder(yargs: Argv): Argv<ConfigMigrateArgs>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
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.command = exports.describe = void 0;
|
|
7
|
+
exports.handler = handler;
|
|
8
|
+
exports.builder = builder;
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
11
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
12
|
+
const migrate_1 = require("@hubspot/local-dev-lib/config/migrate");
|
|
13
|
+
const configMigrate_1 = require("../../lib/configMigrate");
|
|
14
|
+
const commonOpts_1 = require("../../lib/commonOpts");
|
|
15
|
+
const lang_1 = require("../../lib/lang");
|
|
16
|
+
const index_1 = require("../../lib/errorHandlers/index");
|
|
17
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
18
|
+
const i18nKey = 'commands.config.subcommands.migrate';
|
|
19
|
+
exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`, {
|
|
20
|
+
deprecatedConfigPath: config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
21
|
+
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
22
|
+
});
|
|
23
|
+
exports.command = 'migrate';
|
|
24
|
+
async function handler(args) {
|
|
25
|
+
const { config: configPath, force } = args;
|
|
26
|
+
if (configPath && !fs_1.default.existsSync(configPath)) {
|
|
27
|
+
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.errors.configNotFound`, {
|
|
28
|
+
configPath,
|
|
29
|
+
}));
|
|
30
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
31
|
+
}
|
|
32
|
+
const deprecatedConfigExists = (0, migrate_1.configFileExists)(false, configPath);
|
|
33
|
+
const globalConfigExists = (0, migrate_1.configFileExists)(true);
|
|
34
|
+
if (!globalConfigExists && deprecatedConfigExists) {
|
|
35
|
+
try {
|
|
36
|
+
await (0, configMigrate_1.handleMigration)(configPath);
|
|
37
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
(0, index_1.logError)(error);
|
|
41
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (globalConfigExists && deprecatedConfigExists) {
|
|
45
|
+
try {
|
|
46
|
+
await (0, configMigrate_1.handleMerge)(configPath, force);
|
|
47
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
(0, index_1.logError)(error);
|
|
51
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (globalConfigExists && !deprecatedConfigExists) {
|
|
55
|
+
logger_1.logger.log((0, lang_1.i18n)(`${i18nKey}.migrationAlreadyCompleted`, {
|
|
56
|
+
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
57
|
+
}));
|
|
58
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function builder(yargs) {
|
|
62
|
+
(0, commonOpts_1.addConfigOptions)(yargs);
|
|
63
|
+
yargs
|
|
64
|
+
.option('force', {
|
|
65
|
+
alias: 'f',
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
default: false,
|
|
68
|
+
description: (0, lang_1.i18n)(`${i18nKey}.options.force`),
|
|
69
|
+
})
|
|
70
|
+
.example([
|
|
71
|
+
[
|
|
72
|
+
'$0 config migrate',
|
|
73
|
+
(0, lang_1.i18n)(`${i18nKey}.examples.default`, {
|
|
74
|
+
deprecatedConfigPath: config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
75
|
+
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
76
|
+
}),
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
'$0 config migrate --config=/path/to/config.yml',
|
|
80
|
+
(0, lang_1.i18n)(`${i18nKey}.examples.configFlag`, {
|
|
81
|
+
globalConfigPath: config_1.GLOBAL_CONFIG_PATH,
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
]);
|
|
85
|
+
return yargs;
|
|
86
|
+
}
|
package/commands/config/set.d.ts
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
import { ArgumentsCamelCase, Argv } from 'yargs';
|
|
2
|
+
import { CommonArgs } from '../../types/Yargs';
|
|
3
|
+
import { CmsPublishMode } from '@hubspot/local-dev-lib/types/Files';
|
|
4
|
+
export declare const command = "set";
|
|
5
|
+
export declare const describe: string;
|
|
6
|
+
type ConfigSetArgs = CommonArgs & {
|
|
7
|
+
defaultCmsPublishMode: CmsPublishMode;
|
|
8
|
+
allowUsageTracking?: boolean;
|
|
9
|
+
httpTimeout?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function handler(args: ArgumentsCamelCase<ConfigSetArgs>): Promise<void>;
|
|
12
|
+
export declare function builder(yargs: Argv): Argv<ConfigSetArgs>;
|
|
1
13
|
export {};
|
package/commands/config/set.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
3
|
+
exports.describe = exports.command = void 0;
|
|
4
|
+
exports.handler = handler;
|
|
5
|
+
exports.builder = builder;
|
|
6
|
+
const lang_1 = require("../../lib/lang");
|
|
7
|
+
const usageTracking_1 = require("../../lib/usageTracking");
|
|
8
|
+
const promptUtils_1 = require("../../lib/prompts/promptUtils");
|
|
9
|
+
const exitCodes_1 = require("../../lib/enums/exitCodes");
|
|
10
|
+
const configOptions_1 = require("../../lib/configOptions");
|
|
9
11
|
const i18nKey = 'commands.config.subcommands.set';
|
|
10
12
|
exports.command = 'set';
|
|
11
|
-
exports.describe = i18n(`${i18nKey}.describe`);
|
|
12
|
-
|
|
13
|
-
const { cmsPublishMode } = await promptUser([
|
|
13
|
+
exports.describe = (0, lang_1.i18n)(`${i18nKey}.describe`);
|
|
14
|
+
async function selectOptions() {
|
|
15
|
+
const { cmsPublishMode } = await (0, promptUtils_1.promptUser)([
|
|
14
16
|
{
|
|
15
17
|
type: 'list',
|
|
16
|
-
look: false,
|
|
17
18
|
name: 'cmsPublishMode',
|
|
18
19
|
pageSize: 20,
|
|
19
|
-
message: i18n(`${i18nKey}.promptMessage`),
|
|
20
|
+
message: (0, lang_1.i18n)(`${i18nKey}.promptMessage`),
|
|
20
21
|
choices: [
|
|
21
22
|
{
|
|
22
23
|
name: 'Default CMS publish mode',
|
|
@@ -28,52 +29,52 @@ const selectOptions = async () => {
|
|
|
28
29
|
},
|
|
29
30
|
]);
|
|
30
31
|
return cmsPublishMode;
|
|
31
|
-
}
|
|
32
|
-
|
|
32
|
+
}
|
|
33
|
+
async function handleConfigUpdate(accountId, options) {
|
|
33
34
|
const { allowUsageTracking, defaultCmsPublishMode, httpTimeout } = options;
|
|
34
35
|
if (typeof defaultCmsPublishMode !== 'undefined') {
|
|
35
|
-
await setDefaultCmsPublishMode({ defaultCmsPublishMode, accountId });
|
|
36
|
+
await (0, configOptions_1.setDefaultCmsPublishMode)({ defaultCmsPublishMode, accountId });
|
|
36
37
|
return true;
|
|
37
38
|
}
|
|
38
39
|
else if (typeof httpTimeout !== 'undefined') {
|
|
39
|
-
await setHttpTimeout({ httpTimeout, accountId });
|
|
40
|
+
await (0, configOptions_1.setHttpTimeout)({ httpTimeout, accountId });
|
|
40
41
|
return true;
|
|
41
42
|
}
|
|
42
43
|
else if (typeof allowUsageTracking !== 'undefined') {
|
|
43
|
-
await setAllowUsageTracking({ allowUsageTracking, accountId });
|
|
44
|
+
await (0, configOptions_1.setAllowUsageTracking)({ allowUsageTracking, accountId });
|
|
44
45
|
return true;
|
|
45
46
|
}
|
|
46
47
|
return false;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const { derivedAccountId } =
|
|
50
|
-
trackCommandUsage('config-set',
|
|
51
|
-
const configUpdated = await handleConfigUpdate(derivedAccountId,
|
|
48
|
+
}
|
|
49
|
+
async function handler(args) {
|
|
50
|
+
const { derivedAccountId } = args;
|
|
51
|
+
(0, usageTracking_1.trackCommandUsage)('config-set', {}, derivedAccountId);
|
|
52
|
+
const configUpdated = await handleConfigUpdate(derivedAccountId, args);
|
|
52
53
|
if (!configUpdated) {
|
|
53
54
|
const selectedOptions = await selectOptions();
|
|
54
55
|
await handleConfigUpdate(derivedAccountId, selectedOptions);
|
|
55
56
|
}
|
|
56
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
57
|
-
}
|
|
58
|
-
|
|
57
|
+
process.exit(exitCodes_1.EXIT_CODES.SUCCESS);
|
|
58
|
+
}
|
|
59
|
+
function builder(yargs) {
|
|
59
60
|
yargs
|
|
60
61
|
.options({
|
|
61
62
|
'default-cms-publish-mode': {
|
|
62
|
-
describe: i18n(`${i18nKey}.options.defaultMode.describe`),
|
|
63
|
+
describe: (0, lang_1.i18n)(`${i18nKey}.options.defaultMode.describe`),
|
|
63
64
|
type: 'string',
|
|
64
65
|
},
|
|
65
66
|
'allow-usage-tracking': {
|
|
66
|
-
describe: i18n(`${i18nKey}.options.allowUsageTracking.describe`),
|
|
67
|
+
describe: (0, lang_1.i18n)(`${i18nKey}.options.allowUsageTracking.describe`),
|
|
67
68
|
type: 'boolean',
|
|
68
69
|
},
|
|
69
70
|
'http-timeout': {
|
|
70
|
-
describe: i18n(`${i18nKey}.options.httpTimeout.describe`),
|
|
71
|
+
describe: (0, lang_1.i18n)(`${i18nKey}.options.httpTimeout.describe`),
|
|
71
72
|
type: 'string',
|
|
72
73
|
},
|
|
73
74
|
})
|
|
74
75
|
.conflicts('defaultCmsPublishMode', 'allowUsageTracking')
|
|
75
76
|
.conflicts('defaultCmsPublishMode', 'httpTimeout')
|
|
76
77
|
.conflicts('allowUsageTracking', 'httpTimeout')
|
|
77
|
-
.example([['$0 config set', i18n(`${i18nKey}.examples.default`)]]);
|
|
78
|
+
.example([['$0 config set', (0, lang_1.i18n)(`${i18nKey}.examples.default`)]]);
|
|
78
79
|
return yargs;
|
|
79
|
-
}
|
|
80
|
+
}
|
package/commands/config.d.ts
CHANGED