@hubspot/cli 6.2.2-experimental.0 → 6.3.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.
Files changed (335) hide show
  1. package/LICENSE +12 -0
  2. package/README.md +71 -0
  3. package/commands/accounts/clean.d.ts +1 -4
  4. package/commands/accounts/clean.js +2 -0
  5. package/commands/accounts/info.d.ts +1 -4
  6. package/commands/accounts/info.js +3 -1
  7. package/commands/accounts/list.d.ts +1 -4
  8. package/commands/accounts/list.js +2 -0
  9. package/commands/accounts/remove.d.ts +1 -4
  10. package/commands/accounts/remove.js +2 -0
  11. package/commands/accounts/rename.d.ts +1 -4
  12. package/commands/accounts/rename.js +2 -0
  13. package/commands/accounts/use.d.ts +1 -4
  14. package/commands/accounts/use.js +2 -0
  15. package/commands/accounts.d.ts +1 -3
  16. package/commands/accounts.js +2 -0
  17. package/commands/auth.d.ts +1 -4
  18. package/commands/auth.js +2 -2
  19. package/commands/cms/convertFields.d.ts +1 -4
  20. package/commands/cms/convertFields.js +2 -0
  21. package/commands/cms/lighthouseScore.d.ts +1 -4
  22. package/commands/cms/lighthouseScore.js +2 -0
  23. package/commands/cms/reactModules.d.ts +1 -4
  24. package/commands/cms/reactModules.js +2 -0
  25. package/commands/cms.d.ts +1 -3
  26. package/commands/cms.js +2 -0
  27. package/commands/config/set.d.ts +1 -4
  28. package/commands/config/set.js +3 -3
  29. package/commands/config.d.ts +1 -3
  30. package/commands/config.js +2 -0
  31. package/commands/create/api-sample.d.ts +1 -13
  32. package/commands/create/api-sample.js +4 -2
  33. package/commands/create/app.d.ts +1 -10
  34. package/commands/create/app.js +2 -0
  35. package/commands/create/function.d.ts +1 -6
  36. package/commands/create/function.js +2 -0
  37. package/commands/create/index.d.ts +1 -109
  38. package/commands/create/index.js +2 -0
  39. package/commands/create/module.d.ts +1 -11
  40. package/commands/create/module.js +2 -0
  41. package/commands/create/react-app.d.ts +1 -9
  42. package/commands/create/react-app.js +2 -0
  43. package/commands/create/template.d.ts +1 -12
  44. package/commands/create/template.js +2 -0
  45. package/commands/create/vue-app.d.ts +1 -9
  46. package/commands/create/vue-app.js +2 -0
  47. package/commands/create/webpack-serverless.d.ts +1 -9
  48. package/commands/create/webpack-serverless.js +2 -0
  49. package/commands/create/website-theme.d.ts +1 -9
  50. package/commands/create/website-theme.js +2 -0
  51. package/commands/create.d.ts +24 -4
  52. package/commands/create.js +4 -3
  53. package/commands/customObject/create.d.ts +1 -4
  54. package/commands/customObject/create.js +2 -0
  55. package/commands/customObject/schema/create.d.ts +1 -4
  56. package/commands/customObject/schema/create.js +2 -0
  57. package/commands/customObject/schema/delete.d.ts +1 -4
  58. package/commands/customObject/schema/delete.js +3 -1
  59. package/commands/customObject/schema/fetch-all.d.ts +1 -4
  60. package/commands/customObject/schema/fetch-all.js +2 -0
  61. package/commands/customObject/schema/fetch.d.ts +1 -4
  62. package/commands/customObject/schema/fetch.js +3 -1
  63. package/commands/customObject/schema/list.d.ts +1 -3
  64. package/commands/customObject/schema/list.js +2 -0
  65. package/commands/customObject/schema/update.d.ts +1 -4
  66. package/commands/customObject/schema/update.js +2 -0
  67. package/commands/customObject/schema.d.ts +1 -3
  68. package/commands/customObject/schema.js +2 -0
  69. package/commands/customObject.d.ts +1 -3
  70. package/commands/customObject.js +2 -0
  71. package/commands/feedback.d.ts +1 -4
  72. package/commands/feedback.js +21 -4
  73. package/commands/fetch.d.ts +1 -4
  74. package/commands/fetch.js +2 -0
  75. package/commands/filemanager/fetch.d.ts +1 -4
  76. package/commands/filemanager/fetch.js +4 -2
  77. package/commands/filemanager/upload.d.ts +1 -4
  78. package/commands/filemanager/upload.js +2 -0
  79. package/commands/filemanager.d.ts +1 -3
  80. package/commands/filemanager.js +2 -0
  81. package/commands/functions/deploy.d.ts +1 -4
  82. package/commands/functions/deploy.js +2 -0
  83. package/commands/functions/list.d.ts +1 -4
  84. package/commands/functions/list.js +13 -2
  85. package/commands/functions/server.d.ts +1 -4
  86. package/commands/functions/server.js +2 -0
  87. package/commands/functions.d.ts +1 -3
  88. package/commands/functions.js +2 -0
  89. package/commands/hubdb/clear.d.ts +1 -4
  90. package/commands/hubdb/clear.js +2 -0
  91. package/commands/hubdb/create.d.ts +1 -4
  92. package/commands/hubdb/create.js +2 -0
  93. package/commands/hubdb/delete.d.ts +1 -4
  94. package/commands/hubdb/delete.js +2 -0
  95. package/commands/hubdb/fetch.d.ts +1 -4
  96. package/commands/hubdb/fetch.js +2 -0
  97. package/commands/hubdb.d.ts +1 -3
  98. package/commands/hubdb.js +2 -0
  99. package/commands/init.d.ts +1 -4
  100. package/commands/init.js +2 -2
  101. package/commands/lint.d.ts +1 -4
  102. package/commands/lint.js +30 -1
  103. package/commands/list.d.ts +1 -4
  104. package/commands/list.js +2 -0
  105. package/commands/logs.d.ts +1 -4
  106. package/commands/logs.js +2 -0
  107. package/commands/module/marketplace-validate.d.ts +1 -4
  108. package/commands/module/marketplace-validate.js +3 -1
  109. package/commands/module.d.ts +1 -3
  110. package/commands/module.js +2 -0
  111. package/commands/mv.d.ts +1 -4
  112. package/commands/mv.js +2 -0
  113. package/commands/open.d.ts +1 -4
  114. package/commands/open.js +2 -0
  115. package/commands/project/add.d.ts +1 -4
  116. package/commands/project/add.js +2 -0
  117. package/commands/project/cloneApp.d.ts +1 -4
  118. package/commands/project/cloneApp.js +2 -0
  119. package/commands/project/create.d.ts +1 -4
  120. package/commands/project/create.js +2 -0
  121. package/commands/project/deploy.d.ts +1 -4
  122. package/commands/project/deploy.js +12 -3
  123. package/commands/project/dev.d.ts +1 -4
  124. package/commands/project/dev.js +3 -0
  125. package/commands/project/download.d.ts +1 -4
  126. package/commands/project/download.js +4 -2
  127. package/commands/project/installDeps.d.ts +1 -6
  128. package/commands/project/installDeps.js +2 -0
  129. package/commands/project/listBuilds.d.ts +1 -4
  130. package/commands/project/listBuilds.js +2 -0
  131. package/commands/project/logs.d.ts +1 -4
  132. package/commands/project/logs.js +3 -1
  133. package/commands/project/migrateApp.d.ts +1 -4
  134. package/commands/project/migrateApp.js +2 -0
  135. package/commands/project/open.d.ts +1 -4
  136. package/commands/project/open.js +2 -0
  137. package/commands/project/upload.d.ts +1 -4
  138. package/commands/project/upload.js +2 -0
  139. package/commands/project/watch.d.ts +1 -4
  140. package/commands/project/watch.js +2 -0
  141. package/commands/project.d.ts +1 -3
  142. package/commands/project.js +2 -0
  143. package/commands/remove.d.ts +1 -4
  144. package/commands/remove.js +2 -0
  145. package/commands/sandbox/create.d.ts +1 -4
  146. package/commands/sandbox/create.js +2 -0
  147. package/commands/sandbox/delete.d.ts +1 -4
  148. package/commands/sandbox/delete.js +7 -3
  149. package/commands/sandbox.d.ts +1 -3
  150. package/commands/sandbox.js +2 -0
  151. package/commands/secrets/addSecret.d.ts +1 -4
  152. package/commands/secrets/addSecret.js +2 -0
  153. package/commands/secrets/deleteSecret.d.ts +1 -4
  154. package/commands/secrets/deleteSecret.js +2 -0
  155. package/commands/secrets/listSecrets.d.ts +1 -4
  156. package/commands/secrets/listSecrets.js +2 -0
  157. package/commands/secrets/updateSecret.d.ts +1 -4
  158. package/commands/secrets/updateSecret.js +2 -0
  159. package/commands/secrets.d.ts +1 -3
  160. package/commands/secrets.js +2 -0
  161. package/commands/theme/generate-selectors.d.ts +1 -4
  162. package/commands/theme/generate-selectors.js +3 -1
  163. package/commands/theme/marketplace-validate.d.ts +1 -4
  164. package/commands/theme/marketplace-validate.js +3 -1
  165. package/commands/theme/preview.d.ts +1 -4
  166. package/commands/theme/preview.js +56 -46
  167. package/commands/theme.d.ts +1 -3
  168. package/commands/theme.js +2 -0
  169. package/commands/upload.d.ts +1 -4
  170. package/commands/upload.js +2 -0
  171. package/commands/watch.d.ts +1 -4
  172. package/commands/watch.js +2 -0
  173. package/lang/en.lyaml +8 -13
  174. package/lib/DevServerManager.d.ts +1 -35
  175. package/lib/DevServerManager.js +2 -0
  176. package/lib/LocalDevManager.d.ts +1 -41
  177. package/lib/LocalDevManager.js +5 -3
  178. package/lib/ProjectLogsManager.d.ts +1 -0
  179. package/lib/{projectLogsManager.js → ProjectLogsManager.js} +2 -0
  180. package/lib/accountTypes.d.ts +7 -6
  181. package/lib/accountTypes.js +31 -17
  182. package/lib/buildAccount.d.ts +1 -22
  183. package/lib/buildAccount.js +2 -0
  184. package/lib/commonOpts.d.ts +23 -17
  185. package/lib/commonOpts.js +73 -54
  186. package/lib/configOptions.d.ts +1 -0
  187. package/lib/configOptions.js +110 -0
  188. package/lib/constants.d.ts +76 -83
  189. package/lib/constants.js +21 -46
  190. package/lib/dependencyManagement.d.ts +1 -7
  191. package/lib/dependencyManagement.js +2 -0
  192. package/lib/developerTestAccounts.d.ts +1 -7
  193. package/lib/developerTestAccounts.js +2 -0
  194. package/lib/enums/exitCodes.d.ts +5 -5
  195. package/lib/enums/exitCodes.js +3 -2
  196. package/lib/errorHandlers/index.d.ts +1 -19
  197. package/lib/errorHandlers/index.js +2 -0
  198. package/lib/errorHandlers/suppressError.d.ts +1 -1
  199. package/lib/errorHandlers/suppressError.js +2 -0
  200. package/lib/filesystem.d.ts +2 -2
  201. package/lib/filesystem.js +12 -10
  202. package/lib/generateSelectors.d.ts +1 -0
  203. package/lib/{generate-selectors.js → generateSelectors.js} +3 -1
  204. package/lib/hasFeature.d.ts +1 -1
  205. package/lib/hasFeature.js +7 -8
  206. package/lib/hasFlag.d.ts +1 -2
  207. package/lib/hasFlag.js +7 -3
  208. package/lib/interpolation.d.ts +5 -10
  209. package/lib/interpolation.js +39 -45
  210. package/lib/lang.d.ts +9 -3
  211. package/lib/lang.js +38 -31
  212. package/lib/links.d.ts +1 -127
  213. package/lib/links.js +2 -0
  214. package/lib/localDev.d.ts +1 -11
  215. package/lib/localDev.js +2 -0
  216. package/lib/marketplaceValidate.d.ts +1 -0
  217. package/lib/{marketplace-validate.js → marketplaceValidate.js} +2 -0
  218. package/lib/oauth.d.ts +1 -1
  219. package/lib/oauth.js +3 -1
  220. package/lib/polling.d.ts +1 -1
  221. package/lib/polling.js +2 -0
  222. package/lib/process.d.ts +12 -2
  223. package/lib/process.js +17 -15
  224. package/lib/projectStructure.d.ts +1 -13
  225. package/lib/projectStructure.js +4 -2
  226. package/lib/projects.d.ts +1 -40
  227. package/lib/projects.js +10 -5
  228. package/lib/projectsWatch.d.ts +1 -1
  229. package/lib/projectsWatch.js +8 -3
  230. package/lib/prompts/accountNamePrompt.d.ts +1 -11
  231. package/lib/prompts/accountNamePrompt.js +3 -2
  232. package/lib/prompts/accountsPrompt.d.ts +1 -3
  233. package/lib/prompts/accountsPrompt.js +2 -17
  234. package/lib/prompts/cleanUploadPrompt.d.ts +1 -1
  235. package/lib/prompts/cleanUploadPrompt.js +2 -0
  236. package/lib/prompts/cmsFieldPrompt.d.ts +1 -1
  237. package/lib/prompts/cmsFieldPrompt.js +2 -0
  238. package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
  239. package/lib/prompts/createApiSamplePrompt.js +2 -0
  240. package/lib/prompts/createFunctionPrompt.d.ts +1 -1
  241. package/lib/prompts/createFunctionPrompt.js +5 -4
  242. package/lib/prompts/createModulePrompt.d.ts +1 -1
  243. package/lib/prompts/createModulePrompt.js +2 -0
  244. package/lib/prompts/createProjectPrompt.d.ts +1 -1
  245. package/lib/prompts/createProjectPrompt.js +10 -5
  246. package/lib/prompts/createTemplatePrompt.d.ts +1 -1
  247. package/lib/prompts/createTemplatePrompt.js +2 -0
  248. package/lib/prompts/downloadProjectPrompt.d.ts +1 -1
  249. package/lib/prompts/downloadProjectPrompt.js +3 -1
  250. package/lib/prompts/installPublicAppPrompt.d.ts +1 -1
  251. package/lib/prompts/installPublicAppPrompt.js +2 -0
  252. package/lib/prompts/personalAccessKeyPrompt.d.ts +1 -69
  253. package/lib/prompts/personalAccessKeyPrompt.js +2 -0
  254. package/lib/prompts/previewPrompt.d.ts +1 -2
  255. package/lib/prompts/previewPrompt.js +2 -0
  256. package/lib/prompts/projectAddPrompt.d.ts +1 -1
  257. package/lib/prompts/projectAddPrompt.js +2 -0
  258. package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -4
  259. package/lib/prompts/projectDevTargetAccountPrompt.js +2 -0
  260. package/lib/prompts/projectNamePrompt.d.ts +1 -1
  261. package/lib/prompts/projectNamePrompt.js +2 -0
  262. package/lib/prompts/projectsLogsPrompt.d.ts +1 -5
  263. package/lib/prompts/projectsLogsPrompt.js +2 -0
  264. package/lib/prompts/promptUtils.d.ts +12 -2
  265. package/lib/prompts/promptUtils.js +25 -12
  266. package/lib/prompts/sandboxesPrompt.d.ts +1 -2
  267. package/lib/prompts/sandboxesPrompt.js +2 -0
  268. package/lib/prompts/secretPrompt.d.ts +1 -1
  269. package/lib/prompts/secretPrompt.js +2 -0
  270. package/lib/prompts/selectPublicAppPrompt.d.ts +1 -5
  271. package/lib/prompts/selectPublicAppPrompt.js +3 -1
  272. package/lib/prompts/setAsDefaultAccountPrompt.d.ts +1 -1
  273. package/lib/prompts/setAsDefaultAccountPrompt.js +2 -0
  274. package/lib/prompts/uploadPrompt.d.ts +1 -1
  275. package/lib/prompts/uploadPrompt.js +2 -0
  276. package/lib/sandboxSync.d.ts +1 -8
  277. package/lib/sandboxSync.js +3 -1
  278. package/lib/sandboxes.d.ts +1 -40
  279. package/lib/sandboxes.js +2 -0
  280. package/lib/schema.d.ts +3 -2
  281. package/lib/schema.js +20 -18
  282. package/lib/serverlessLogs.d.ts +1 -8
  283. package/lib/serverlessLogs.js +3 -1
  284. package/lib/ui/SpinniesManager.d.ts +1 -61
  285. package/lib/ui/SpinniesManager.js +2 -0
  286. package/lib/ui/git.d.ts +1 -1
  287. package/lib/ui/git.js +2 -0
  288. package/lib/ui/index.d.ts +1 -36
  289. package/lib/ui/index.js +2 -0
  290. package/lib/ui/serverlessFunctionLogs.d.ts +1 -1
  291. package/lib/ui/serverlessFunctionLogs.js +2 -0
  292. package/lib/ui/spinniesUtils.d.ts +1 -60
  293. package/lib/ui/spinniesUtils.js +2 -0
  294. package/lib/ui/supportHyperlinks.d.ts +1 -3
  295. package/lib/ui/supportHyperlinks.js +3 -1
  296. package/lib/ui/supportsColor.d.ts +1 -13
  297. package/lib/ui/supportsColor.js +3 -1
  298. package/lib/ui/table.d.ts +1 -2
  299. package/lib/ui/table.js +2 -0
  300. package/lib/upload.d.ts +1 -1
  301. package/lib/upload.js +4 -2
  302. package/lib/usageTracking.d.ts +1 -6
  303. package/lib/usageTracking.js +12 -1
  304. package/lib/validation.d.ts +1 -16
  305. package/lib/validation.js +2 -2
  306. package/package.json +17 -9
  307. package/commands/config/set/allowUsageTracking.d.ts +0 -4
  308. package/commands/config/set/allowUsageTracking.js +0 -45
  309. package/commands/config/set/defaultMode.d.ts +0 -4
  310. package/commands/config/set/defaultMode.js +0 -48
  311. package/commands/config/set/httpTimeout.d.ts +0 -4
  312. package/commands/config/set/httpTimeout.js +0 -33
  313. package/lib/debugInfo.d.ts +0 -3
  314. package/lib/debugInfo.js +0 -18
  315. package/lib/environment.d.ts +0 -1
  316. package/lib/environment.js +0 -14
  317. package/lib/generate-selectors.d.ts +0 -6
  318. package/lib/getFunctionArrays.d.ts +0 -1
  319. package/lib/getFunctionArrays.js +0 -17
  320. package/lib/hublValidate.d.ts +0 -4
  321. package/lib/hublValidate.js +0 -28
  322. package/lib/interpolationHelpers.d.ts +0 -6
  323. package/lib/interpolationHelpers.js +0 -26
  324. package/lib/marketplace-validate.d.ts +0 -5
  325. package/lib/projectLogsManager.d.ts +0 -19
  326. package/lib/prompts/activeInstallConfirmationPrompt.d.ts +0 -1
  327. package/lib/prompts/activeInstallConfirmationPrompt.js +0 -18
  328. package/lib/prompts/deployBuildIdPrompt.d.ts +0 -1
  329. package/lib/prompts/deployBuildIdPrompt.js +0 -20
  330. package/lib/prompts/feedbackPrompt.d.ts +0 -2
  331. package/lib/prompts/feedbackPrompt.js +0 -37
  332. package/lib/prompts/folderOverwritePrompt.d.ts +0 -1
  333. package/lib/prompts/folderOverwritePrompt.js +0 -15
  334. package/lib/regex.d.ts +0 -1
  335. package/lib/regex.js +0 -5
@@ -1,4 +1,24 @@
1
- export const command: "create <type> [name] [dest] [--internal]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ /**
2
+ * To add a new asset type: See vue-app.js for a simple example
3
+ * 1. Create a new file under the `create` directory with the command name being the name of the file
4
+ * 2. The file _must_ export a `dest` function and an `execute` function. See below for details
5
+ * Note: No changes should be needed to this file when adding new types, unless you need new functionality
6
+ *
7
+ * @export {(Data) => String} dest - A function returning the destination of the asset we are creating
8
+ * @export {(Data) => Object=} execute - The code called once all other checks pass. This should contain the logic
9
+ * for handling your command. Optionally return an object containing KV pairs
10
+ * of any context or data you want passed along to usage tracking
11
+ * @export {Boolean=} hidden - If true, the command will not show up in --help
12
+ * @export {(Data) => Boolean=} validate - If provided, return true if it passes validation, false otherwise.
13
+ * If not provided, validation will automatically succeed
14
+ *
15
+ * The Data object contains
16
+ * {
17
+ * assetType: String - Type of the asset (e.g. api-sample, react-app, template)
18
+ * name: String - Filename of the asset
19
+ * dest: String - The path specified by the user on where to create the asset
20
+ * internal: Boolean - A flag for retrieving the internal spec for the asset type
21
+ * options: Object - The options object passed to the command by Yargs
22
+ * }
23
+ */
24
+ export {};
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // @ts-nocheck
2
3
  /**
3
4
  * To add a new asset type: See vue-app.js for a simple example
4
5
  * 1. Create a new file under the `create` directory with the command name being the name of the file
@@ -22,11 +23,11 @@
22
23
  * options: Object - The options object passed to the command by Yargs
23
24
  * }
24
25
  */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
25
27
  const fs = require('fs-extra');
26
28
  const { logError } = require('../lib/errorHandlers/index');
27
29
  const { logger } = require('@hubspot/local-dev-lib/logger');
28
30
  const { setLogLevel, getAccountId } = require('../lib/commonOpts');
29
- const { logDebugInfo } = require('../lib/debugInfo');
30
31
  const { resolveLocalPath } = require('../lib/filesystem');
31
32
  const { trackCommandUsage } = require('../lib/usageTracking');
32
33
  const assets = require('./create/index');
@@ -40,9 +41,9 @@ exports.describe = i18n(`${i18nKey}.describe`, {
40
41
  supportedAssetTypes: SUPPORTED_ASSET_TYPES,
41
42
  });
42
43
  exports.handler = async (options) => {
43
- let { type: assetType, name, dest, internal: getInternalVersion } = options;
44
+ let { type: assetType, dest } = options;
45
+ const { name, internal: getInternalVersion } = options;
44
46
  setLogLevel(options);
45
- logDebugInfo(options);
46
47
  assetType = typeof assetType === 'string' && assetType.toLowerCase();
47
48
  if (assetType === 'global-partial') {
48
49
  logger.error(i18n(`${i18nKey}.errors.deprecatedAssetType`, {
@@ -1,4 +1 @@
1
- export const command: "create <name> <definition>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../lib/errorHandlers/index');
4
6
  const { getAbsoluteFilePath } = require('@hubspot/local-dev-lib/path');
@@ -1,4 +1 @@
1
- export const command: "create <definition>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../../lib/errorHandlers/index');
4
6
  const { getAbsoluteFilePath } = require('@hubspot/local-dev-lib/path');
@@ -1,4 +1 @@
1
- export const command: "delete <name>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { loadAndValidateOptions } = require('../../../lib/validation');
4
6
  const { trackCommandUsage } = require('../../../lib/usageTracking');
@@ -10,7 +12,7 @@ const i18nKey = 'commands.customObject.subcommands.schema.subcommands.delete';
10
12
  exports.command = 'delete <name>';
11
13
  exports.describe = i18n(`${i18nKey}.describe`);
12
14
  exports.handler = async (options) => {
13
- let { name } = options;
15
+ const { name } = options;
14
16
  await loadAndValidateOptions(options);
15
17
  const accountId = getAccountId(options);
16
18
  trackCommandUsage('custom-object-schema-delete', null, accountId);
@@ -1,4 +1 @@
1
- export const command: "fetch-all [dest]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { loadAndValidateOptions } = require('../../../lib/validation');
4
6
  const { trackCommandUsage } = require('../../../lib/usageTracking');
@@ -1,4 +1 @@
1
- export const command: "fetch <name> [dest]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const path = require('path');
3
5
  const { isConfigFlagEnabled } = require('@hubspot/local-dev-lib/config');
4
6
  const { logger } = require('@hubspot/local-dev-lib/logger');
@@ -15,7 +17,7 @@ const i18nKey = 'commands.customObject.subcommands.schema.subcommands.fetch';
15
17
  exports.command = 'fetch <name> [dest]';
16
18
  exports.describe = i18n(`${i18nKey}.describe`);
17
19
  exports.handler = async (options) => {
18
- let { name, dest } = options;
20
+ const { name, dest } = options;
19
21
  await loadAndValidateOptions(options);
20
22
  const accountId = getAccountId(options);
21
23
  trackCommandUsage('custom-object-schema-fetch', null, accountId);
@@ -1,3 +1 @@
1
- export const command: "list";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../../lib/errorHandlers/index');
4
6
  const { loadAndValidateOptions } = require('../../../lib/validation');
@@ -1,4 +1 @@
1
- export const command: "update <name> <definition>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../../lib/errorHandlers/index');
4
6
  const { getAbsoluteFilePath } = require('@hubspot/local-dev-lib/path');
@@ -1,3 +1 @@
1
- export const command: "schema";
2
- export const describe: any;
3
- export function builder(yargs: any): any;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const createCommand = require('./schema/create');
3
5
  const fetchCommand = require('./schema/fetch');
4
6
  const fetchAllCommand = require('./schema/fetch-all');
@@ -1,3 +1 @@
1
- export const command: string[];
2
- export const describe: string | undefined;
3
- export function builder(yargs: any): any;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
3
5
  const schemaCommand = require('./customObject/schema');
4
6
  const createCommand = require('./customObject/create');
@@ -1,4 +1 @@
1
- export const command: "feedback";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,17 +1,34 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const open = require('open');
3
5
  const { i18n } = require('../lib/lang');
4
- const { FEEDBACK_URLS } = require('../lib/constants');
5
6
  const { logger } = require('@hubspot/local-dev-lib/logger');
6
- const { feedbackTypePrompt, shouldOpenBrowserPrompt, } = require('../lib/prompts/feedbackPrompt');
7
+ const { confirmPrompt, listPrompt } = require('../lib/prompts/promptUtils');
7
8
  const i18nKey = 'commands.project.subcommands.feedback';
9
+ const FEEDBACK_OPTIONS = {
10
+ BUG: 'bug',
11
+ GENERAL: 'general',
12
+ };
13
+ const FEEDBACK_URLS = {
14
+ BUG: 'https://github.com/HubSpot/hubspot-cli/issues/new',
15
+ GENERAL: 'https://docs.google.com/forms/d/e/1FAIpQLSejZZewYzuH3oKBU01tseX-cSWOUsTHLTr-YsiMGpzwcvgIMg/viewform?usp=sf_link',
16
+ };
8
17
  exports.command = 'feedback';
9
18
  exports.describe = i18n(`${i18nKey}.describe`);
10
19
  exports.handler = async (options) => {
11
20
  const { bug: bugFlag, general: generalFlag } = options;
12
21
  const usedTypeFlag = bugFlag !== generalFlag;
13
- const { type } = await feedbackTypePrompt(usedTypeFlag);
14
- const { shouldOpen } = await shouldOpenBrowserPrompt(type, usedTypeFlag);
22
+ await listPrompt(i18n(`${i18nKey}.feedbackType.prompt`), {
23
+ choices: Object.values(FEEDBACK_OPTIONS).map(option => ({
24
+ name: i18n(`${i18nKey}.feedbackType.${option}`),
25
+ value: option,
26
+ })),
27
+ when: !usedTypeFlag,
28
+ });
29
+ const shouldOpen = await confirmPrompt(i18n(`${i18nKey}.openPrompt`), {
30
+ when: !usedTypeFlag,
31
+ });
15
32
  if (shouldOpen || usedTypeFlag) {
16
33
  // NOTE: for now, all feedback should go to the hubspot-cli repository
17
34
  const url = FEEDBACK_URLS.BUG;
@@ -1,4 +1 @@
1
- export const command: "fetch <src> [dest]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ export {};
package/commands/fetch.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { downloadFileOrFolder } = require('@hubspot/local-dev-lib/fileMapper');
3
5
  const { logger } = require('@hubspot/local-dev-lib/logger');
4
6
  const { addConfigOptions, addAccountOptions, addOverwriteOptions, addModeOptions, addUseEnvironmentOptions, getAccountId, getMode, } = require('../lib/commonOpts');
@@ -1,4 +1 @@
1
- export const command: "fetch <src> [dest]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { downloadFileOrFolder } = require('@hubspot/local-dev-lib/fileManager');
3
5
  const { logger } = require('@hubspot/local-dev-lib/logger');
4
6
  const { resolveLocalPath } = require('../../lib/filesystem');
@@ -12,13 +14,13 @@ const { logError } = require('../../lib/errorHandlers/index');
12
14
  exports.command = 'fetch <src> [dest]';
13
15
  exports.describe = i18n(`${i18nKey}.describe`);
14
16
  exports.handler = async (options) => {
15
- let { src, dest, includeArchived } = options;
17
+ const { src, includeArchived } = options;
16
18
  await loadAndValidateOptions(options);
17
19
  if (typeof src !== 'string') {
18
20
  logger.error(i18n(`${i18nKey}.errors.sourceRequired`));
19
21
  process.exit(EXIT_CODES.ERROR);
20
22
  }
21
- dest = resolveLocalPath(dest);
23
+ const dest = resolveLocalPath(options.dest);
22
24
  const accountId = getAccountId(options);
23
25
  trackCommandUsage('filemanager-fetch', null, accountId);
24
26
  try {
@@ -1,4 +1 @@
1
- export const command: "upload <src> <dest>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const fs = require('fs');
3
5
  const path = require('path');
4
6
  const { uploadFolder } = require('@hubspot/local-dev-lib/fileManager');
@@ -1,3 +1 @@
1
- export const command: "filemanager";
2
- export const describe: any;
3
- export function builder(yargs: any): any;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { addConfigOptions, addAccountOptions, addOverwriteOptions, } = require('../lib/commonOpts');
3
5
  const upload = require('./filemanager/upload');
4
6
  const fetch = require('./filemanager/fetch');
@@ -1,4 +1 @@
1
- export const command: "deploy <path>";
2
- export const describe: false;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const SpinniesManager = require('../../lib/ui/SpinniesManager');
3
5
  const { addAccountOptions, addConfigOptions, getAccountId, addUseEnvironmentOptions, } = require('../../lib/commonOpts');
4
6
  const { trackCommandUsage } = require('../../lib/usageTracking');
@@ -1,4 +1 @@
1
- export const command: "list";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
4
+ const moment = require('moment');
2
5
  const { getRoutes } = require('@hubspot/local-dev-lib/api/functions');
3
6
  const { logger } = require('@hubspot/local-dev-lib/logger');
4
7
  const { logError, ApiErrorContext } = require('../../lib/errorHandlers/index');
5
- const { getFunctionArrays } = require('../../lib/getFunctionArrays');
6
8
  const { getTableContents, getTableHeader } = require('../../lib/ui/table');
7
9
  const { addConfigOptions, addAccountOptions, addUseEnvironmentOptions, getAccountId, } = require('../../lib/commonOpts');
8
10
  const { trackCommandUsage } = require('../../lib/usageTracking');
@@ -27,7 +29,16 @@ exports.handler = async (options) => {
27
29
  if (options.json) {
28
30
  return logger.log(routesResp.objects);
29
31
  }
30
- const functionsAsArrays = getFunctionArrays(routesResp);
32
+ const functionsAsArrays = routesResp.objects.map(func => {
33
+ const { route, method, created, updated, secretNames } = func;
34
+ return [
35
+ route,
36
+ method,
37
+ secretNames.join(', '),
38
+ moment(created).format(),
39
+ moment(updated).format(),
40
+ ];
41
+ });
31
42
  functionsAsArrays.unshift(getTableHeader(['Route', 'Method', 'Secrets', 'Created', 'Updated']));
32
43
  return logger.log(getTableContents(functionsAsArrays));
33
44
  };
@@ -1,4 +1 @@
1
- export const command: "server <path>";
2
- export const describe: false;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { addAccountOptions, addConfigOptions, getAccountId, addUseEnvironmentOptions, } = require('../../lib/commonOpts');
3
5
  const { trackCommandUsage } = require('../../lib/usageTracking');
4
6
  const { logger } = require('@hubspot/local-dev-lib/logger');
@@ -1,3 +1 @@
1
- export const command: "functions";
2
- export const describe: any;
3
- export function builder(yargs: any): any;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
3
5
  const list = require('./functions/list');
4
6
  const deploy = require('./functions/deploy');
@@ -1,4 +1 @@
1
- export const command: "clear <tableId>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../lib/errorHandlers/index');
4
6
  const { clearHubDbTableRows } = require('@hubspot/local-dev-lib/hubdb');
@@ -1,4 +1 @@
1
- export const command: "create <src>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const path = require('path');
3
5
  const { logger } = require('@hubspot/local-dev-lib/logger');
4
6
  const { logError } = require('../../lib/errorHandlers/index');
@@ -1,4 +1 @@
1
- export const command: "delete <tableId>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../lib/errorHandlers/index');
4
6
  const { deleteTable } = require('@hubspot/local-dev-lib/api/hubdb');
@@ -1,4 +1 @@
1
- export const command: "fetch <tableId> [dest]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): void;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { logger } = require('@hubspot/local-dev-lib/logger');
3
5
  const { logError } = require('../../lib/errorHandlers/index');
4
6
  const { downloadHubDbTable } = require('@hubspot/local-dev-lib/hubdb');
@@ -1,3 +1 @@
1
- export const command: "hubdb";
2
- export const describe: any;
3
- export function builder(yargs: any): any;
1
+ export {};
package/commands/hubdb.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { addConfigOptions, addAccountOptions } = require('../lib/commonOpts');
3
5
  const createCommand = require('./hubdb/create');
4
6
  const fetchCommand = require('./hubdb/fetch');
@@ -1,4 +1 @@
1
- export const command: "init [--account]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<never>;
4
- export function builder(yargs: any): any;
1
+ export {};
package/commands/init.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const path = require('path');
3
5
  const fs = require('fs-extra');
4
6
  const { getConfigPath, createEmptyConfigFile, deleteEmptyConfigFile, updateDefaultAccount, } = require('@hubspot/local-dev-lib/config');
@@ -19,7 +21,6 @@ const { setLogLevel, addTestingOptions } = require('../lib/commonOpts');
19
21
  const { promptUser } = require('../lib/prompts/promptUtils');
20
22
  const { OAUTH_FLOW, personalAccessKeyPrompt, } = require('../lib/prompts/personalAccessKeyPrompt');
21
23
  const { cliAccountNamePrompt } = require('../lib/prompts/accountNamePrompt');
22
- const { logDebugInfo } = require('../lib/debugInfo');
23
24
  const { authenticateWithOauth } = require('../lib/oauth');
24
25
  const { EXIT_CODES } = require('../lib/enums/exitCodes');
25
26
  const { uiFeatureHighlight } = require('../lib/ui');
@@ -69,7 +70,6 @@ exports.handler = async (options) => {
69
70
  const { auth: authType = PERSONAL_ACCESS_KEY_AUTH_METHOD.value, c, account: optionalAccount, } = options;
70
71
  const configPath = (c && path.join(getCwd(), c)) || getConfigPath();
71
72
  setLogLevel(options);
72
- logDebugInfo(options);
73
73
  trackCommandUsage('init', {
74
74
  authType,
75
75
  });
@@ -1,4 +1 @@
1
- export const command: "lint <path>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ export {};
package/commands/lint.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { lint } = require('@hubspot/local-dev-lib/cms/validate');
3
- const { printHublValidationResult } = require('../lib/hublValidate');
4
5
  const { logger } = require('@hubspot/local-dev-lib/logger');
5
6
  const { logError } = require('../lib/errorHandlers/index');
6
7
  const { addConfigOptions, addAccountOptions, getAccountId, } = require('../lib/commonOpts');
@@ -13,6 +14,34 @@ const { EXIT_CODES } = require('../lib/enums/exitCodes');
13
14
  exports.command = 'lint <path>';
14
15
  // Hiding since this command is still experimental
15
16
  exports.describe = null; //'Lint a file or folder for HubL syntax';
17
+ function getErrorsFromHublValidationObject(validation) {
18
+ return ((validation && validation.meta && validation.meta.template_errors) || []);
19
+ }
20
+ function printHublValidationError(err) {
21
+ const { severity, message, lineno, startPosition } = err;
22
+ const method = severity === 'FATAL' ? 'error' : 'warn';
23
+ logger[method]('[%d, %d]: %s', lineno, startPosition, message);
24
+ }
25
+ function printHublValidationResult({ file, validation }) {
26
+ let count = 0;
27
+ if (!validation) {
28
+ return count;
29
+ }
30
+ const errors = getErrorsFromHublValidationObject(validation);
31
+ if (!errors.length) {
32
+ return count;
33
+ }
34
+ logger.group(file);
35
+ errors.forEach(err => {
36
+ if (err.reason !== 'SYNTAX_ERROR') {
37
+ return;
38
+ }
39
+ ++count;
40
+ printHublValidationError(err);
41
+ });
42
+ logger.groupEnd();
43
+ return count;
44
+ }
16
45
  exports.handler = async (options) => {
17
46
  const { path: lintPath } = options;
18
47
  await loadAndValidateOptions(options);
@@ -1,4 +1 @@
1
- export const command: "list [path]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ export {};
package/commands/list.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const chalk = require('chalk');
3
5
  const { addAccountOptions, addConfigOptions, getAccountId, addUseEnvironmentOptions, } = require('../lib/commonOpts');
4
6
  const { trackCommandUsage } = require('../lib/usageTracking');
@@ -1,4 +1 @@
1
- export const command: "logs [endpoint]";
2
- export const describe: any;
3
- export function handler(options: any): Promise<void>;
4
- export function builder(yargs: any): any;
1
+ export {};
package/commands/logs.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { addAccountOptions, addConfigOptions, getAccountId, addUseEnvironmentOptions, } = require('../lib/commonOpts');
3
5
  const { trackCommandUsage } = require('../lib/usageTracking');
4
6
  const { logger } = require('@hubspot/local-dev-lib/logger');
@@ -1,4 +1 @@
1
- export const command: "marketplace-validate <src>";
2
- export const describe: any;
3
- export function handler(options: any): Promise<never>;
4
- export function builder(yargs: any): any;
1
+ export {};