@hubspot/cli 7.8.12-experimental.1 → 7.9.0-beta.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/commands/__tests__/cms.test.js +44 -1
- package/commands/__tests__/customObject.test.js +22 -1
- package/commands/__tests__/project.test.js +2 -0
- package/commands/account/auth.js +1 -0
- package/commands/auth.js +1 -0
- package/commands/{__tests__/remove.test.js → cms/__tests__/delete.test.js} +8 -8
- package/commands/{__tests__ → cms/__tests__}/fetch.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/function.test.js +7 -3
- package/commands/{__tests__ → cms/__tests__}/lint.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/list.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/mv.test.js +3 -3
- package/commands/{__tests__ → cms/__tests__}/theme.test.js +9 -2
- package/commands/cms/app/create.d.ts +9 -0
- package/commands/cms/app/create.js +82 -0
- package/commands/cms/app.d.ts +3 -0
- package/commands/cms/app.js +17 -0
- package/commands/cms/delete.d.ts +6 -0
- package/commands/cms/delete.js +43 -0
- package/commands/cms/fetch.d.ts +12 -0
- package/commands/cms/fetch.js +79 -0
- package/commands/{__tests__ → cms/function/__tests__}/logs.test.js +4 -5
- package/commands/cms/function/create.d.ts +12 -0
- package/commands/cms/function/create.js +84 -0
- package/commands/cms/function/deploy.d.ts +6 -0
- package/commands/cms/function/deploy.js +89 -0
- package/commands/cms/function/list.d.ts +6 -0
- package/commands/cms/function/list.js +60 -0
- package/commands/cms/function/logs.d.ts +10 -0
- package/commands/cms/function/logs.js +135 -0
- package/commands/cms/function/server.d.ts +10 -0
- package/commands/cms/function/server.js +69 -0
- package/commands/cms/function.d.ts +3 -0
- package/commands/cms/function.js +27 -0
- package/commands/cms/lint.d.ts +6 -0
- package/commands/cms/lint.js +83 -0
- package/commands/cms/list.d.ts +6 -0
- package/commands/cms/list.js +96 -0
- package/commands/cms/module/create.d.ts +11 -0
- package/commands/cms/module/create.js +84 -0
- package/commands/cms/module/marketplace-validate.d.ts +6 -0
- package/commands/cms/module/marketplace-validate.js +45 -0
- package/commands/cms/module.d.ts +3 -0
- package/commands/cms/module.js +17 -0
- package/commands/cms/mv.d.ts +7 -0
- package/commands/cms/mv.js +60 -0
- package/commands/cms/template/create.d.ts +9 -0
- package/commands/cms/template/create.js +72 -0
- package/commands/cms/template.d.ts +3 -0
- package/commands/cms/template.js +17 -0
- package/commands/{theme → cms/theme}/__tests__/marketplace-validate.test.js +2 -2
- package/commands/{theme → cms/theme}/__tests__/preview.test.js +2 -2
- package/commands/cms/theme/create.d.ts +6 -0
- package/commands/cms/theme/create.js +58 -0
- package/commands/cms/theme/generate-selectors.d.ts +6 -0
- package/commands/cms/theme/generate-selectors.js +171 -0
- package/commands/cms/theme/marketplace-validate.d.ts +6 -0
- package/commands/cms/theme/marketplace-validate.js +46 -0
- package/commands/cms/theme/preview.d.ts +12 -0
- package/commands/cms/theme/preview.js +224 -0
- package/commands/cms/theme.d.ts +3 -0
- package/commands/cms/theme.js +25 -0
- package/commands/cms/upload.d.ts +12 -0
- package/commands/cms/upload.js +212 -0
- package/commands/cms/watch.d.ts +14 -0
- package/commands/cms/watch.js +138 -0
- package/commands/cms/webpack/create.d.ts +6 -0
- package/commands/cms/webpack/create.js +58 -0
- package/commands/cms/webpack.d.ts +3 -0
- package/commands/cms/webpack.js +17 -0
- package/commands/cms.js +26 -0
- package/commands/create.js +4 -2
- package/commands/customObject/{schema/__tests__/create.test.js → __tests__/createSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/delete.test.js → __tests__/deleteSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/fetch-all.test.js → __tests__/fetch-all-schemas.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/fetch.test.js → __tests__/fetchSchema.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/list.test.js → __tests__/listSchemas.test.js} +5 -5
- package/commands/customObject/{schema/__tests__/update.test.js → __tests__/updateSchema.test.js} +5 -5
- package/commands/customObject/createSchema.d.ts +6 -0
- package/commands/customObject/createSchema.js +56 -0
- package/commands/customObject/deleteSchema.d.ts +7 -0
- package/commands/customObject/deleteSchema.js +69 -0
- package/commands/customObject/fetchAllSchemas.d.ts +6 -0
- package/commands/customObject/fetchAllSchemas.js +57 -0
- package/commands/customObject/fetchSchema.d.ts +7 -0
- package/commands/customObject/fetchSchema.js +67 -0
- package/commands/customObject/listSchemas.d.ts +4 -0
- package/commands/customObject/listSchemas.js +35 -0
- package/commands/customObject/schema/create.d.ts +4 -6
- package/commands/customObject/schema/create.js +13 -36
- package/commands/customObject/schema/delete.d.ts +4 -7
- package/commands/customObject/schema/delete.js +15 -50
- package/commands/customObject/schema/fetch-all.d.ts +4 -6
- package/commands/customObject/schema/fetch-all.js +14 -41
- package/commands/customObject/schema/fetch.d.ts +4 -7
- package/commands/customObject/schema/fetch.js +14 -49
- package/commands/customObject/schema/list.d.ts +4 -4
- package/commands/customObject/schema/list.js +10 -19
- package/commands/customObject/schema/update.d.ts +4 -7
- package/commands/customObject/schema/update.js +15 -50
- package/commands/customObject/schema.js +4 -2
- package/commands/customObject/updateSchema.d.ts +7 -0
- package/commands/customObject/updateSchema.js +71 -0
- package/commands/customObject.js +16 -1
- package/commands/feedback.js +1 -1
- package/commands/fetch.d.ts +4 -12
- package/commands/fetch.js +19 -46
- package/commands/function/deploy.d.ts +4 -6
- package/commands/function/deploy.js +14 -71
- package/commands/function/list.d.ts +4 -6
- package/commands/function/list.js +14 -40
- package/commands/function/server.d.ts +4 -10
- package/commands/function/server.js +22 -29
- package/commands/function.d.ts +2 -4
- package/commands/function.js +25 -14
- package/commands/lint.d.ts +4 -6
- package/commands/lint.js +13 -65
- package/commands/list.d.ts +4 -6
- package/commands/list.js +13 -74
- package/commands/logs.d.ts +4 -10
- package/commands/logs.js +24 -87
- package/commands/module/marketplace-validate.d.ts +4 -6
- package/commands/module/marketplace-validate.js +15 -27
- package/commands/module.d.ts +2 -2
- package/commands/module.js +17 -15
- package/commands/mv.d.ts +4 -7
- package/commands/mv.js +13 -39
- package/commands/project/__tests__/add.test.js +12 -12
- package/commands/project/__tests__/devUnifiedFlow.test.js +32 -0
- package/commands/project/__tests__/list.test.js +31 -0
- package/commands/project/__tests__/migrate.test.js +1 -0
- package/commands/project/add.d.ts +2 -2
- package/commands/project/add.js +3 -2
- package/commands/project/create.js +1 -1
- package/commands/project/dev/deprecatedFlow.js +2 -2
- package/commands/project/dev/index.js +5 -5
- package/commands/project/dev/unifiedFlow.js +8 -3
- package/commands/project/download.js +5 -2
- package/commands/project/installDeps.d.ts +2 -2
- package/commands/project/installDeps.js +1 -0
- package/commands/project/list.d.ts +4 -0
- package/commands/project/list.js +62 -0
- package/commands/project/migrate.js +5 -2
- package/commands/project.js +2 -0
- package/commands/remove.d.ts +4 -6
- package/commands/remove.js +12 -24
- package/commands/testAccount/create.js +2 -2
- package/commands/testAccount/delete.js +1 -1
- package/commands/theme/generate-selectors.d.ts +4 -6
- package/commands/theme/generate-selectors.js +14 -152
- package/commands/theme/marketplace-validate.d.ts +4 -6
- package/commands/theme/marketplace-validate.js +14 -25
- package/commands/theme/preview.d.ts +4 -12
- package/commands/theme/preview.js +18 -180
- package/commands/theme.d.ts +2 -2
- package/commands/theme.js +19 -13
- package/commands/upload.d.ts +4 -12
- package/commands/upload.js +19 -169
- package/commands/watch.d.ts +4 -14
- package/commands/watch.js +23 -88
- package/lang/en.d.ts +561 -425
- package/lang/en.js +563 -427
- package/lang/en.lyaml +2 -2
- package/lib/__tests__/buildAccount.test.js +2 -2
- package/lib/__tests__/http.test.js +40 -0
- package/lib/buildAccount.d.ts +2 -2
- package/lib/buildAccount.js +7 -7
- package/lib/configMigrate.js +88 -9
- package/lib/constants.d.ts +9 -0
- package/lib/constants.js +9 -0
- package/lib/generateSelectors.js +1 -1
- package/lib/http.d.ts +1 -0
- package/lib/http.js +26 -0
- package/lib/middleware/autoUpdateMiddleware.d.ts +2 -1
- package/lib/middleware/autoUpdateMiddleware.js +12 -2
- package/lib/middleware/commandTargetingUtils.d.ts +1 -1
- package/lib/middleware/commandTargetingUtils.js +16 -20
- package/lib/projects/__tests__/AppDevModeInterface.test.js +95 -109
- package/lib/projects/__tests__/DevServerManager.test.d.ts +1 -0
- package/lib/projects/__tests__/DevServerManager.test.js +183 -0
- package/lib/projects/__tests__/LocalDevProcess.test.js +6 -5
- package/lib/projects/__tests__/LocalDevWebsocketServer.test.js +6 -6
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.d.ts +1 -0
- package/lib/projects/__tests__/UIExtensionsDevModeInterface.test.js +161 -0
- package/lib/projects/__tests__/deploy.test.js +9 -9
- package/lib/projects/__tests__/upload.test.js +2 -2
- package/lib/projects/add/__tests__/v2AddComponent.test.d.ts +1 -0
- package/lib/projects/add/__tests__/{v3AddComponent.test.js → v2AddComponent.test.js} +35 -35
- package/lib/projects/add/{v3AddComponent.d.ts → v2AddComponent.d.ts} +1 -1
- package/lib/projects/add/{v3AddComponent.js → v2AddComponent.js} +5 -5
- package/lib/projects/create/__tests__/v2.test.d.ts +1 -0
- package/lib/projects/create/__tests__/{v3.test.js → v2.test.js} +2 -2
- package/lib/projects/create/index.js +2 -2
- package/lib/projects/create/{v3.d.ts → v2.d.ts} +3 -3
- package/lib/projects/create/{v3.js → v2.js} +3 -3
- package/lib/projects/deploy.d.ts +1 -1
- package/lib/projects/deploy.js +2 -2
- package/lib/projects/localDev/AppDevModeInterface.d.ts +10 -3
- package/lib/projects/localDev/AppDevModeInterface.js +132 -105
- package/lib/projects/localDev/DevServerManager.d.ts +10 -29
- package/lib/projects/localDev/DevServerManager.js +20 -76
- package/lib/projects/localDev/DevServerManager_DEPRECATED.d.ts +40 -0
- package/lib/projects/localDev/DevServerManager_DEPRECATED.js +120 -0
- package/lib/projects/localDev/{LocalDevManager.js → LocalDevManager_DEPRECATED.js} +6 -6
- package/lib/projects/localDev/LocalDevProcess.js +3 -2
- package/lib/projects/localDev/LocalDevState.d.ts +3 -0
- package/lib/projects/localDev/LocalDevState.js +9 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.d.ts +4 -0
- package/lib/projects/localDev/LocalDevWebsocketServer.js +39 -6
- package/lib/projects/localDev/UIExtensionsDevModeInterface.d.ts +13 -0
- package/lib/projects/localDev/UIExtensionsDevModeInterface.js +37 -0
- package/lib/projects/localDev/helpers/account.d.ts +1 -1
- package/lib/projects/localDev/helpers/account.js +2 -2
- package/lib/projects/localDev/helpers/process.d.ts +1 -0
- package/lib/projects/localDev/helpers/process.js +15 -0
- package/lib/projects/localDev/helpers/project.js +2 -3
- package/lib/projects/localDev/localDevWebsocketServerUtils.d.ts +3 -0
- package/lib/projects/localDev/localDevWebsocketServerUtils.js +9 -0
- package/lib/projects/urls.d.ts +0 -1
- package/lib/projects/urls.js +0 -3
- package/lib/prompts/__tests__/projectAddPrompt.test.js +10 -10
- package/lib/prompts/installAppPrompt.d.ts +1 -6
- package/lib/prompts/installAppPrompt.js +1 -6
- package/lib/prompts/projectAddPrompt.d.ts +2 -2
- package/lib/prompts/projectAddPrompt.js +1 -1
- package/lib/theme/__tests__/migrate.test.js +4 -4
- package/lib/ui/index.d.ts +2 -0
- package/lib/ui/index.js +8 -0
- package/lib/ui/uiMessages.d.ts +5 -0
- package/lib/ui/uiMessages.js +5 -0
- package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +2 -2
- package/mcp-server/tools/project/__tests__/CreateProjectTool.test.js +1 -1
- package/package.json +6 -5
- package/types/Cms.d.ts +6 -6
- package/lib/projects/localDev/DevServerManagerV2.d.ts +0 -22
- package/lib/projects/localDev/DevServerManagerV2.js +0 -81
- /package/commands/{customObject/schema → cms}/__tests__/delete.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/fetch.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/function.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/lint.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/list.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/mv.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/__tests__}/theme.test.d.ts +0 -0
- /package/commands/{__tests__ → cms/function/__tests__}/logs.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/generate-selectors.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/generate-selectors.test.js +0 -0
- /package/commands/{theme → cms/theme}/__tests__/marketplace-validate.test.d.ts +0 -0
- /package/commands/{theme → cms/theme}/__tests__/preview.test.d.ts +0 -0
- /package/commands/{__tests__/remove.test.d.ts → customObject/__tests__/createSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/create.test.d.ts → __tests__/deleteSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/fetch-all.test.d.ts → __tests__/fetch-all-schemas.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/fetch.test.d.ts → __tests__/fetchSchema.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/list.test.d.ts → __tests__/listSchemas.test.d.ts} +0 -0
- /package/commands/customObject/{schema/__tests__/update.test.d.ts → __tests__/updateSchema.test.d.ts} +0 -0
- /package/{lib/projects/add/__tests__/v3AddComponent.test.d.ts → commands/project/__tests__/list.test.d.ts} +0 -0
- /package/lib/{projects/create/__tests__/v3.test.d.ts → __tests__/http.test.d.ts} +0 -0
- /package/{commands/create → lib/cmsAssets}/api-sample.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/api-sample.js +0 -0
- /package/{commands/create → lib/cmsAssets}/app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/function.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/function.js +0 -0
- /package/{commands/create → lib/cmsAssets}/index.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/index.js +0 -0
- /package/{commands/create → lib/cmsAssets}/module.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/module.js +0 -0
- /package/{commands/create → lib/cmsAssets}/react-app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/react-app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/template.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/template.js +0 -0
- /package/{commands/create → lib/cmsAssets}/vue-app.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/vue-app.js +0 -0
- /package/{commands/create → lib/cmsAssets}/webpack-serverless.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/webpack-serverless.js +0 -0
- /package/{commands/create → lib/cmsAssets}/website-theme.d.ts +0 -0
- /package/{commands/create → lib/cmsAssets}/website-theme.js +0 -0
- /package/lib/projects/localDev/{LocalDevManager.d.ts → LocalDevManager_DEPRECATED.d.ts} +0 -0
|
@@ -1,59 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { uiLogger } from '../../lib/ui/logger.js';
|
|
4
|
-
import { logError, ApiErrorContext } from '../../lib/errorHandlers/index.js';
|
|
5
|
-
import { getTableContents, getTableHeader } from '../../lib/ui/table.js';
|
|
6
|
-
import { trackCommandUsage } from '../../lib/usageTracking.js';
|
|
7
|
-
import { commands } from '../../lang/en.js';
|
|
8
|
-
import { EXIT_CODES } from '../../lib/enums/exitCodes.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../../lib/ui/index.js';
|
|
2
|
+
import cmsFunctionListCommand from '../cms/function/list.js';
|
|
9
3
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
4
|
+
import { commands } from '../../lang/en.js';
|
|
10
5
|
const command = ['list', 'ls'];
|
|
11
|
-
const describe =
|
|
6
|
+
const describe = uiDeprecatedTag(cmsFunctionListCommand.describe, false);
|
|
12
7
|
async function handler(args) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
uiLogger.debug(commands.function.subcommands.list.debug.gettingFunctions);
|
|
16
|
-
const { data: routesResp } = await getRoutes(derivedAccountId).catch(async (e) => {
|
|
17
|
-
logError(e, new ApiErrorContext({ accountId: derivedAccountId }));
|
|
18
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
19
|
-
});
|
|
20
|
-
if (!routesResp.objects.length) {
|
|
21
|
-
return uiLogger.info(commands.function.subcommands.list.info.noFunctions);
|
|
22
|
-
}
|
|
23
|
-
if (args.json) {
|
|
24
|
-
return uiLogger.json(routesResp.objects);
|
|
25
|
-
}
|
|
26
|
-
const functionsAsArrays = routesResp.objects.map(func => {
|
|
27
|
-
const { route, method, created, updated, secretNames } = func;
|
|
28
|
-
return [
|
|
29
|
-
route,
|
|
30
|
-
method,
|
|
31
|
-
secretNames.join(', '),
|
|
32
|
-
moment(created).format(),
|
|
33
|
-
moment(updated).format(),
|
|
34
|
-
];
|
|
35
|
-
});
|
|
36
|
-
functionsAsArrays.unshift(getTableHeader(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
|
|
37
|
-
return uiLogger.log(getTableContents(functionsAsArrays));
|
|
8
|
+
uiCommandRelocatedMessage('hs cms function list');
|
|
9
|
+
await cmsFunctionListCommand.handler(args);
|
|
38
10
|
}
|
|
39
|
-
function
|
|
11
|
+
function deprecatedFunctionListBuilder(yargs) {
|
|
40
12
|
yargs.options({
|
|
41
13
|
json: {
|
|
42
|
-
describe: commands.function.subcommands.list.options.json
|
|
14
|
+
describe: commands.cms.subcommands.function.subcommands.list.options.json
|
|
15
|
+
.describe,
|
|
43
16
|
type: 'boolean',
|
|
44
17
|
},
|
|
45
18
|
});
|
|
46
19
|
return yargs;
|
|
47
20
|
}
|
|
48
|
-
const
|
|
21
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionListCommand.describe, 'hs cms function list');
|
|
22
|
+
const builder = makeYargsBuilder(deprecatedFunctionListBuilder, command, verboseDescribe, {
|
|
49
23
|
useConfigOptions: true,
|
|
50
24
|
useAccountOptions: true,
|
|
51
25
|
useEnvironmentOptions: true,
|
|
52
26
|
});
|
|
53
|
-
const
|
|
54
|
-
|
|
27
|
+
const deprecatedFunctionListCommand = {
|
|
28
|
+
...cmsFunctionListCommand,
|
|
55
29
|
describe,
|
|
56
30
|
handler,
|
|
57
31
|
builder,
|
|
58
32
|
};
|
|
59
|
-
export default
|
|
33
|
+
export default deprecatedFunctionListCommand;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
contact?: boolean;
|
|
6
|
-
watch?: boolean;
|
|
7
|
-
'log-output'?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const functionServerCommand: YargsCommandModule<unknown, FunctionServerArgs>;
|
|
10
|
-
export default functionServerCommand;
|
|
1
|
+
import { YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
import { FunctionServerArgs } from '../cms/function/server.js';
|
|
3
|
+
declare const deprecatedFunctionServerCommand: YargsCommandModule<unknown, FunctionServerArgs>;
|
|
4
|
+
export default deprecatedFunctionServerCommand;
|
|
@@ -1,64 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
// This package is not typed, so we need to use require
|
|
4
|
-
import { start as startTestServer } from '@hubspot/serverless-dev-runtime';
|
|
5
|
-
import { commands } from '../../lang/en.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../../lib/ui/index.js';
|
|
2
|
+
import cmsFunctionServerCommand from '../cms/function/server.js';
|
|
6
3
|
import { makeYargsBuilder } from '../../lib/yargsUtils.js';
|
|
4
|
+
import { commands } from '../../lang/en.js';
|
|
7
5
|
const command = 'server <path>';
|
|
8
|
-
const describe =
|
|
6
|
+
const describe = uiDeprecatedTag(cmsFunctionServerCommand.describe, false);
|
|
9
7
|
async function handler(args) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
uiLogger.debug(commands.function.subcommands.server.debug.startingServer(functionPath));
|
|
13
|
-
startTestServer({
|
|
14
|
-
accountId: derivedAccountId,
|
|
15
|
-
...args,
|
|
16
|
-
});
|
|
8
|
+
uiCommandRelocatedMessage('hs cms function server');
|
|
9
|
+
await cmsFunctionServerCommand.handler(args);
|
|
17
10
|
}
|
|
18
|
-
function
|
|
11
|
+
function deprecatedFunctionServerBuilder(yargs) {
|
|
19
12
|
yargs.positional('path', {
|
|
20
|
-
describe: commands.function.subcommands.server.positionals.path
|
|
13
|
+
describe: commands.cms.subcommands.function.subcommands.server.positionals.path
|
|
14
|
+
.describe,
|
|
21
15
|
type: 'string',
|
|
22
16
|
});
|
|
23
17
|
yargs.options({
|
|
24
18
|
port: {
|
|
25
|
-
describe: commands.function.subcommands.server.options.port
|
|
19
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.port
|
|
20
|
+
.describe,
|
|
26
21
|
type: 'string',
|
|
27
22
|
default: 5432,
|
|
28
23
|
},
|
|
29
24
|
contact: {
|
|
30
|
-
describe: commands.function.subcommands.server.options.contact
|
|
25
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.contact
|
|
26
|
+
.describe,
|
|
31
27
|
type: 'boolean',
|
|
32
28
|
default: true,
|
|
33
29
|
},
|
|
34
30
|
watch: {
|
|
35
|
-
describe: commands.function.subcommands.server.options.watch
|
|
31
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.watch
|
|
32
|
+
.describe,
|
|
36
33
|
type: 'boolean',
|
|
37
34
|
default: true,
|
|
38
35
|
},
|
|
39
36
|
'log-output': {
|
|
40
|
-
describe: commands.function.subcommands.server.options.logOutput
|
|
37
|
+
describe: commands.cms.subcommands.function.subcommands.server.options.logOutput
|
|
38
|
+
.describe,
|
|
41
39
|
type: 'boolean',
|
|
42
40
|
default: false,
|
|
43
41
|
},
|
|
44
42
|
});
|
|
45
|
-
yargs.example([
|
|
46
|
-
[
|
|
47
|
-
'$0 functions server ./tmp/myFunctionFolder.functions',
|
|
48
|
-
commands.function.subcommands.server.examples.default,
|
|
49
|
-
],
|
|
50
|
-
]);
|
|
51
43
|
return yargs;
|
|
52
44
|
}
|
|
53
|
-
const
|
|
45
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionServerCommand.describe, 'hs cms function server');
|
|
46
|
+
const builder = makeYargsBuilder(deprecatedFunctionServerBuilder, command, verboseDescribe, {
|
|
54
47
|
useConfigOptions: true,
|
|
55
48
|
useAccountOptions: true,
|
|
56
49
|
useEnvironmentOptions: true,
|
|
57
50
|
});
|
|
58
|
-
const
|
|
59
|
-
|
|
51
|
+
const deprecatedFunctionServerCommand = {
|
|
52
|
+
...cmsFunctionServerCommand,
|
|
60
53
|
describe,
|
|
61
54
|
handler,
|
|
62
55
|
builder,
|
|
63
56
|
};
|
|
64
|
-
export default
|
|
57
|
+
export default deprecatedFunctionServerCommand;
|
package/commands/function.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { YargsCommandModuleBucket } from '../types/Yargs.js';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
declare const functionCommand: YargsCommandModuleBucket;
|
|
5
|
-
export default functionCommand;
|
|
2
|
+
declare const deprecatedFunctionCommand: YargsCommandModuleBucket;
|
|
3
|
+
export default deprecatedFunctionCommand;
|
package/commands/function.js
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import { uiLogger } from '../lib/ui/logger.js';
|
|
3
|
+
import cmsFunctionCommand from './cms/function.js';
|
|
4
|
+
import listCommand from './function/list.js';
|
|
5
|
+
import deployCommand from './function/deploy.js';
|
|
6
|
+
import serverCommand from './function/server.js';
|
|
5
7
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
const command = ['function', 'functions'];
|
|
9
|
+
const describe = uiDeprecatedTag(cmsFunctionCommand.describe, false);
|
|
10
|
+
// We cannot use the builder from cmsFunctionCommand because it includes the create and logs commands
|
|
8
11
|
function functionBuilder(yargs) {
|
|
9
|
-
yargs
|
|
12
|
+
yargs
|
|
13
|
+
.command(listCommand)
|
|
14
|
+
.command(deployCommand)
|
|
15
|
+
.command(serverCommand)
|
|
16
|
+
.demandCommand(1, '');
|
|
10
17
|
return yargs;
|
|
11
18
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsFunctionCommand.describe, 'hs cms function');
|
|
20
|
+
const builder = makeYargsBuilder(functionBuilder, command, verboseDescribe);
|
|
21
|
+
async function handler(args) {
|
|
22
|
+
uiCommandRelocatedMessage('hs cms function');
|
|
23
|
+
uiLogger.log('');
|
|
24
|
+
await cmsFunctionCommand.handler(args);
|
|
25
|
+
}
|
|
26
|
+
const deprecatedFunctionCommand = {
|
|
27
|
+
...cmsFunctionCommand,
|
|
17
28
|
describe,
|
|
18
29
|
builder,
|
|
19
|
-
handler
|
|
30
|
+
handler,
|
|
20
31
|
};
|
|
21
|
-
export default
|
|
32
|
+
export default deprecatedFunctionCommand;
|
package/commands/lint.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const lintCommand: YargsCommandModule<unknown, LintArgs>;
|
|
6
|
-
export default lintCommand;
|
|
1
|
+
import { YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
import { LintArgs } from './cms/lint.js';
|
|
3
|
+
declare const deprecatedCmsLintCommand: YargsCommandModule<unknown, LintArgs>;
|
|
4
|
+
export default deprecatedCmsLintCommand;
|
package/commands/lint.js
CHANGED
|
@@ -1,83 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { trackCommandUsage } from '../lib/usageTracking.js';
|
|
4
|
-
import { commands } from '../lang/en.js';
|
|
5
|
-
import { resolveLocalPath } from '../lib/filesystem.js';
|
|
6
|
-
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import cmsLintCommand from './cms/lint.js';
|
|
7
3
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
8
|
-
import {
|
|
4
|
+
import { commands } from '../lang/en.js';
|
|
9
5
|
const command = 'lint <path>';
|
|
10
|
-
|
|
11
|
-
const describe = undefined; //'Lint a file or folder for HubL syntax';
|
|
12
|
-
function getErrorsFromHublValidationObject(validation) {
|
|
13
|
-
return ((validation && validation.meta && validation.meta.template_errors) || []);
|
|
14
|
-
}
|
|
15
|
-
function printHublValidationError(err) {
|
|
16
|
-
const { severity, message, lineno, startPosition } = err;
|
|
17
|
-
if (severity === 'FATAL') {
|
|
18
|
-
uiLogger.error(`[${lineno}, ${startPosition}]: ${message}`);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
uiLogger.warn(`[${lineno}, ${startPosition}]: ${message}`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function printHublValidationResult({ file, validation }) {
|
|
25
|
-
let count = 0;
|
|
26
|
-
if (!validation) {
|
|
27
|
-
return count;
|
|
28
|
-
}
|
|
29
|
-
const errors = getErrorsFromHublValidationObject(validation);
|
|
30
|
-
if (!errors.length) {
|
|
31
|
-
return count;
|
|
32
|
-
}
|
|
33
|
-
uiLogger.group(file);
|
|
34
|
-
errors.forEach(err => {
|
|
35
|
-
if (err.reason !== 'SYNTAX_ERROR') {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
++count;
|
|
39
|
-
printHublValidationError(err);
|
|
40
|
-
});
|
|
41
|
-
uiLogger.groupEnd();
|
|
42
|
-
return count;
|
|
43
|
-
}
|
|
6
|
+
const describe = uiDeprecatedTag(cmsLintCommand.describe, false);
|
|
44
7
|
async function handler(args) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const groupName = commands.lint.groupName(localPath);
|
|
48
|
-
trackCommandUsage('lint', undefined, derivedAccountId);
|
|
49
|
-
uiLogger.group(groupName);
|
|
50
|
-
let count = 0;
|
|
51
|
-
try {
|
|
52
|
-
await lint(derivedAccountId, localPath, (result) => {
|
|
53
|
-
return (count += printHublValidationResult(result));
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
uiLogger.groupEnd();
|
|
58
|
-
logError(err, { accountId: derivedAccountId });
|
|
59
|
-
process.exit(EXIT_CODES.ERROR);
|
|
60
|
-
}
|
|
61
|
-
uiLogger.groupEnd();
|
|
62
|
-
uiLogger.log(commands.lint.issuesFound(count));
|
|
8
|
+
uiCommandRelocatedMessage('hs cms lint');
|
|
9
|
+
await cmsLintCommand.handler(args);
|
|
63
10
|
}
|
|
64
|
-
function
|
|
11
|
+
function deprecatedCmsLintBuilder(yargs) {
|
|
65
12
|
yargs.positional('path', {
|
|
66
|
-
describe: commands.lint.positionals.path.describe,
|
|
13
|
+
describe: commands.cms.subcommands.lint.positionals.path.describe,
|
|
67
14
|
required: true,
|
|
68
15
|
type: 'string',
|
|
69
16
|
});
|
|
70
17
|
return yargs;
|
|
71
18
|
}
|
|
72
|
-
const
|
|
19
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsLintCommand.describe, 'hs cms lint');
|
|
20
|
+
const builder = makeYargsBuilder(deprecatedCmsLintBuilder, command, verboseDescribe, {
|
|
73
21
|
useGlobalOptions: true,
|
|
74
22
|
useConfigOptions: true,
|
|
75
23
|
useAccountOptions: true,
|
|
76
24
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
25
|
+
const deprecatedCmsLintCommand = {
|
|
26
|
+
...cmsLintCommand,
|
|
79
27
|
describe,
|
|
80
28
|
handler,
|
|
81
29
|
builder,
|
|
82
30
|
};
|
|
83
|
-
export default
|
|
31
|
+
export default deprecatedCmsLintCommand;
|
package/commands/list.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const cmsListCommand: YargsCommandModule<unknown, ListArgs>;
|
|
6
|
-
export default cmsListCommand;
|
|
1
|
+
import { YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
import { ListArgs } from './cms/list.js';
|
|
3
|
+
declare const deprecatedCmsListCommand: YargsCommandModule<unknown, ListArgs>;
|
|
4
|
+
export default deprecatedCmsListCommand;
|
package/commands/list.js
CHANGED
|
@@ -1,92 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { isPathFolder } from '../lib/filesystem.js';
|
|
4
|
-
import { logError } from '../lib/errorHandlers/index.js';
|
|
5
|
-
import { getDirectoryContentsByPath } from '@hubspot/local-dev-lib/api/fileMapper';
|
|
6
|
-
import { HUBSPOT_FOLDER, MARKETPLACE_FOLDER } from '../lib/constants.js';
|
|
7
|
-
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import cmsListCommand from './cms/list.js';
|
|
8
3
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
9
|
-
import { uiLogger } from '../lib/ui/logger.js';
|
|
10
4
|
import { commands } from '../lang/en.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return chalk.reset.cyan(fileOrFolder);
|
|
14
|
-
}
|
|
15
|
-
if (fileOrFolder === HUBSPOT_FOLDER || fileOrFolder === MARKETPLACE_FOLDER) {
|
|
16
|
-
return chalk.reset.bold.blue(fileOrFolder);
|
|
17
|
-
}
|
|
18
|
-
return chalk.reset.blue(fileOrFolder);
|
|
19
|
-
}
|
|
20
|
-
function sortContents(a, b) {
|
|
21
|
-
// Pin @hubspot folder to top
|
|
22
|
-
if (a === HUBSPOT_FOLDER) {
|
|
23
|
-
return -1;
|
|
24
|
-
}
|
|
25
|
-
else if (b === HUBSPOT_FOLDER) {
|
|
26
|
-
return 1;
|
|
27
|
-
}
|
|
28
|
-
// Pin @marketplace folder to top
|
|
29
|
-
if (a === MARKETPLACE_FOLDER) {
|
|
30
|
-
return -1;
|
|
31
|
-
}
|
|
32
|
-
else if (b === MARKETPLACE_FOLDER) {
|
|
33
|
-
return 1;
|
|
34
|
-
}
|
|
35
|
-
return a.localeCompare(b);
|
|
36
|
-
}
|
|
37
|
-
const command = ['list [path]', 'ls [path]'];
|
|
38
|
-
const describe = commands.list.describe;
|
|
5
|
+
const command = 'list [path]';
|
|
6
|
+
const describe = uiDeprecatedTag(cmsListCommand.describe, false);
|
|
39
7
|
async function handler(args) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
let contentsResp;
|
|
43
|
-
trackCommandUsage('list', undefined, derivedAccountId);
|
|
44
|
-
uiLogger.debug(commands.list.gettingPathContents(directoryPath));
|
|
45
|
-
try {
|
|
46
|
-
const { data } = await getDirectoryContentsByPath(derivedAccountId, directoryPath);
|
|
47
|
-
contentsResp = data;
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
logError(e);
|
|
51
|
-
process.exit(EXIT_CODES.ERROR);
|
|
52
|
-
}
|
|
53
|
-
if (!contentsResp.folder) {
|
|
54
|
-
uiLogger.info(commands.list.noFilesFoundAtPath(directoryPath));
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
// getDirectoryContentsByPath omits @hubspot
|
|
58
|
-
const contents = directoryPath === '/'
|
|
59
|
-
? ['@hubspot', ...contentsResp.children]
|
|
60
|
-
: contentsResp.children;
|
|
61
|
-
if (contents.length === 0) {
|
|
62
|
-
uiLogger.info(commands.list.noFilesFoundAtPath(directoryPath));
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const folderContentsOutput = contents
|
|
66
|
-
.map(addColorToContents)
|
|
67
|
-
.sort(sortContents)
|
|
68
|
-
.join('\n');
|
|
69
|
-
uiLogger.log(folderContentsOutput);
|
|
70
|
-
process.exit(EXIT_CODES.SUCCESS);
|
|
8
|
+
uiCommandRelocatedMessage('hs cms list');
|
|
9
|
+
await cmsListCommand.handler(args);
|
|
71
10
|
}
|
|
72
|
-
function
|
|
11
|
+
function deprecatedCmsListBuilder(yargs) {
|
|
73
12
|
yargs.positional('path', {
|
|
74
|
-
describe: commands.list.positionals.path.describe,
|
|
13
|
+
describe: commands.cms.subcommands.list.positionals.path.describe,
|
|
75
14
|
type: 'string',
|
|
76
15
|
});
|
|
77
|
-
yargs.example([['$0 list'], ['$0 list /'], ['$0 list my-modules']]);
|
|
78
16
|
return yargs;
|
|
79
17
|
}
|
|
80
|
-
const
|
|
18
|
+
const verboseDescribe = uiCommandRenamedDescription(cmsListCommand.describe, 'hs cms list');
|
|
19
|
+
const builder = makeYargsBuilder(deprecatedCmsListBuilder, command, verboseDescribe, {
|
|
81
20
|
useGlobalOptions: true,
|
|
82
21
|
useConfigOptions: true,
|
|
83
22
|
useAccountOptions: true,
|
|
84
23
|
useEnvironmentOptions: true,
|
|
85
24
|
});
|
|
86
|
-
const
|
|
87
|
-
|
|
25
|
+
const deprecatedCmsListCommand = {
|
|
26
|
+
...cmsListCommand,
|
|
88
27
|
describe,
|
|
89
28
|
handler,
|
|
90
29
|
builder,
|
|
91
30
|
};
|
|
92
|
-
export default
|
|
31
|
+
export default deprecatedCmsListCommand;
|
package/commands/logs.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
compact?: boolean;
|
|
6
|
-
follow?: boolean;
|
|
7
|
-
limit?: number;
|
|
8
|
-
};
|
|
9
|
-
declare const logsCommand: YargsCommandModule<unknown, LogsArgs>;
|
|
10
|
-
export default logsCommand;
|
|
1
|
+
import { YargsCommandModule } from '../types/Yargs.js';
|
|
2
|
+
import { LogsArgs } from './cms/function/logs.js';
|
|
3
|
+
declare const deprecatedLogsCommand: YargsCommandModule<unknown, LogsArgs>;
|
|
4
|
+
export default deprecatedLogsCommand;
|
package/commands/logs.js
CHANGED
|
@@ -1,121 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { getFunctionLogs, getLatestFunctionLog, } from '@hubspot/local-dev-lib/api/functions';
|
|
4
|
-
import { tailLogs } from '../lib/serverlessLogs.js';
|
|
5
|
-
import { promptUser } from '../lib/prompts/promptUtils.js';
|
|
6
|
-
import { EXIT_CODES } from '../lib/enums/exitCodes.js';
|
|
7
|
-
import { isHubSpotHttpError } from '@hubspot/local-dev-lib/errors/index';
|
|
1
|
+
import { uiCommandRelocatedMessage, uiCommandRenamedDescription, uiDeprecatedTag, } from '../lib/ui/index.js';
|
|
2
|
+
import functionLogsCommand from './cms/function/logs.js';
|
|
8
3
|
import { makeYargsBuilder } from '../lib/yargsUtils.js';
|
|
9
|
-
import { uiLogger } from '../lib/ui/logger.js';
|
|
10
4
|
import { commands } from '../lang/en.js';
|
|
11
|
-
const handleLogsError = (e, accountId, functionPath) => {
|
|
12
|
-
if (isHubSpotHttpError(e) && (e.status === 404 || e.status == 400)) {
|
|
13
|
-
uiLogger.error(commands.logs.errors.noLogsFound(functionPath, accountId));
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const endpointLog = async (accountId, functionPath, options) => {
|
|
17
|
-
const { limit, latest, follow, compact } = options;
|
|
18
|
-
const requestParams = {
|
|
19
|
-
limit,
|
|
20
|
-
latest,
|
|
21
|
-
follow,
|
|
22
|
-
endpoint: functionPath,
|
|
23
|
-
};
|
|
24
|
-
uiLogger.debug(commands.logs.gettingLogs(latest, functionPath));
|
|
25
|
-
let logsResp;
|
|
26
|
-
if (follow) {
|
|
27
|
-
const tailCall = (after) => getFunctionLogs(accountId, functionPath, { after });
|
|
28
|
-
const fetchLatest = () => {
|
|
29
|
-
try {
|
|
30
|
-
return getLatestFunctionLog(accountId, functionPath);
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
handleLogsError(e, accountId, functionPath);
|
|
34
|
-
return Promise.reject(e);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
await tailLogs(accountId, functionPath, fetchLatest, tailCall, compact);
|
|
38
|
-
}
|
|
39
|
-
else if (latest) {
|
|
40
|
-
try {
|
|
41
|
-
const { data } = await getLatestFunctionLog(accountId, functionPath);
|
|
42
|
-
logsResp = data;
|
|
43
|
-
}
|
|
44
|
-
catch (e) {
|
|
45
|
-
handleLogsError(e, accountId, functionPath);
|
|
46
|
-
process.exit(EXIT_CODES.ERROR);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
try {
|
|
51
|
-
const { data } = await getFunctionLogs(accountId, functionPath, requestParams);
|
|
52
|
-
logsResp = data;
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
handleLogsError(e, accountId, functionPath);
|
|
56
|
-
process.exit(EXIT_CODES.ERROR);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (logsResp) {
|
|
60
|
-
return outputLogs(logsResp, { compact });
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
5
|
const command = 'logs [endpoint]';
|
|
64
|
-
const describe =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
message: commands.logs.endpointPrompt,
|
|
71
|
-
when: !endpointArgValue,
|
|
72
|
-
});
|
|
73
|
-
await endpointLog(derivedAccountId, endpointArgValue || endpointPromptValue, options);
|
|
74
|
-
};
|
|
75
|
-
function logsBuilder(yargs) {
|
|
6
|
+
const describe = uiDeprecatedTag(functionLogsCommand.describe, false);
|
|
7
|
+
async function handler(args) {
|
|
8
|
+
uiCommandRelocatedMessage('hs cms function logs');
|
|
9
|
+
await functionLogsCommand.handler(args);
|
|
10
|
+
}
|
|
11
|
+
function deprecatedLogsBuilder(yargs) {
|
|
76
12
|
yargs.positional('endpoint', {
|
|
77
|
-
describe: commands.logs.positionals.endpoint
|
|
13
|
+
describe: commands.cms.subcommands.function.subcommands.logs.positionals.endpoint
|
|
14
|
+
.describe,
|
|
78
15
|
type: 'string',
|
|
79
16
|
});
|
|
80
17
|
yargs
|
|
81
18
|
.options({
|
|
82
19
|
latest: {
|
|
83
20
|
alias: 'l',
|
|
84
|
-
describe: commands.logs.options.latest
|
|
21
|
+
describe: commands.cms.subcommands.function.subcommands.logs.options.latest
|
|
22
|
+
.describe,
|
|
85
23
|
type: 'boolean',
|
|
86
24
|
},
|
|
87
25
|
compact: {
|
|
88
|
-
describe: commands.logs.options.compact
|
|
26
|
+
describe: commands.cms.subcommands.function.subcommands.logs.options.compact
|
|
27
|
+
.describe,
|
|
89
28
|
type: 'boolean',
|
|
90
29
|
},
|
|
91
30
|
follow: {
|
|
92
31
|
alias: ['f'],
|
|
93
|
-
describe: commands.logs.options.follow
|
|
32
|
+
describe: commands.cms.subcommands.function.subcommands.logs.options.follow
|
|
33
|
+
.describe,
|
|
94
34
|
type: 'boolean',
|
|
95
35
|
},
|
|
96
36
|
limit: {
|
|
97
|
-
describe: commands.logs.options.limit
|
|
37
|
+
describe: commands.cms.subcommands.function.subcommands.logs.options.limit
|
|
38
|
+
.describe,
|
|
98
39
|
type: 'number',
|
|
99
40
|
},
|
|
100
41
|
})
|
|
101
42
|
.conflicts('follow', 'limit');
|
|
102
|
-
yargs.example([
|
|
103
|
-
['$0 logs my-endpoint', commands.logs.examples.default],
|
|
104
|
-
['$0 logs my-endpoint --limit=10', commands.logs.examples.limit],
|
|
105
|
-
['$0 logs my-endpoint --follow', commands.logs.examples.follow],
|
|
106
|
-
]);
|
|
107
43
|
return yargs;
|
|
108
44
|
}
|
|
109
|
-
const
|
|
45
|
+
const verboseDescribe = uiCommandRenamedDescription(functionLogsCommand.describe, 'hs cms function logs');
|
|
46
|
+
const builder = makeYargsBuilder(deprecatedLogsBuilder, command, verboseDescribe, {
|
|
110
47
|
useGlobalOptions: true,
|
|
111
48
|
useConfigOptions: true,
|
|
112
49
|
useAccountOptions: true,
|
|
113
50
|
useEnvironmentOptions: true,
|
|
114
51
|
});
|
|
115
|
-
const
|
|
116
|
-
|
|
52
|
+
const deprecatedLogsCommand = {
|
|
53
|
+
...functionLogsCommand,
|
|
117
54
|
describe,
|
|
118
|
-
builder,
|
|
119
55
|
handler,
|
|
56
|
+
builder,
|
|
120
57
|
};
|
|
121
|
-
export default
|
|
58
|
+
export default deprecatedLogsCommand;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const marketplaceValidateCommand: YargsCommandModule<unknown, MarketplaceValidateArgs>;
|
|
6
|
-
export default marketplaceValidateCommand;
|
|
1
|
+
import { YargsCommandModule } from '../../types/Yargs.js';
|
|
2
|
+
import { MarketplaceValidateArgs } from '../cms/module/marketplace-validate.js';
|
|
3
|
+
declare const deprecatedMarketplaceValidateCommand: YargsCommandModule<unknown, MarketplaceValidateArgs>;
|
|
4
|
+
export default deprecatedMarketplaceValidateCommand;
|