@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,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 { i18n } = require('../../lib/lang');
@@ -87,56 +89,59 @@ const determineSrcAndDest = async (options) => {
87
89
  return { absoluteSrc, dest };
88
90
  };
89
91
  exports.handler = async (options) => {
90
- const { notify, skipUpload, noSsl, port, debug } = options;
92
+ const { notify, skipUpload, noSsl, port, debug, resetSession } = options;
91
93
  await loadAndValidateOptions(options);
92
94
  const accountId = getAccountId(options);
93
95
  const { absoluteSrc, dest } = await determineSrcAndDest(options);
94
96
  const filePaths = await getUploadableFileList(absoluteSrc, false);
95
- const initialUploadProgressBar = new cliProgress.SingleBar({
96
- gracefulExit: true,
97
- format: '[{bar}] {percentage}% | {value}/{total} | {label}',
98
- hideCursor: true,
99
- }, cliProgress.Presets.rect);
100
- initialUploadProgressBar.start(filePaths.length, 0, {
101
- label: i18n(`${i18nKey}.initialUploadProgressBar.start`),
102
- });
103
- let uploadsHaveStarted = false;
104
- const uploadOptions = {
105
- onAttemptCallback: () => {
106
- /* Intentionally blank */
107
- },
108
- onSuccessCallback: () => {
109
- initialUploadProgressBar.increment();
110
- if (!uploadsHaveStarted) {
111
- uploadsHaveStarted = true;
112
- initialUploadProgressBar.update(0, {
113
- label: i18n(`${i18nKey}.initialUploadProgressBar.uploading`),
114
- });
115
- }
116
- },
117
- onFirstErrorCallback: () => {
118
- /* Intentionally blank */
119
- },
120
- onRetryCallback: () => {
121
- /* Intentionally blank */
122
- },
123
- onFinalErrorCallback: () => initialUploadProgressBar.increment(),
124
- onFinishCallback: results => {
125
- initialUploadProgressBar.update(filePaths.length, {
126
- label: i18n(`${i18nKey}.initialUploadProgressBar.finish`),
127
- });
128
- initialUploadProgressBar.stop();
129
- results.forEach(result => {
130
- if (result.resultType == FILE_UPLOAD_RESULT_TYPES.FAILURE) {
131
- logger.error('Uploading file "%s" to "%s" failed', result.file, dest);
132
- logError(result.error, new ApiErrorContext({
133
- accountId,
134
- request: dest,
135
- payload: result.file,
136
- }));
97
+ const startProgressBar = numFiles => {
98
+ const initialUploadProgressBar = new cliProgress.SingleBar({
99
+ gracefulExit: true,
100
+ format: '[{bar}] {percentage}% | {value}/{total} | {label}',
101
+ hideCursor: true,
102
+ }, cliProgress.Presets.rect);
103
+ initialUploadProgressBar.start(numFiles, 0, {
104
+ label: i18n(`${i18nKey}.initialUploadProgressBar.start`),
105
+ });
106
+ let uploadsHaveStarted = false;
107
+ const uploadOptions = {
108
+ onAttemptCallback: () => {
109
+ /* Intentionally blank */
110
+ },
111
+ onSuccessCallback: () => {
112
+ initialUploadProgressBar.increment();
113
+ if (!uploadsHaveStarted) {
114
+ uploadsHaveStarted = true;
115
+ initialUploadProgressBar.update(0, {
116
+ label: i18n(`${i18nKey}.initialUploadProgressBar.uploading`),
117
+ });
137
118
  }
138
- });
139
- },
119
+ },
120
+ onFirstErrorCallback: () => {
121
+ /* Intentionally blank */
122
+ },
123
+ onRetryCallback: () => {
124
+ /* Intentionally blank */
125
+ },
126
+ onFinalErrorCallback: () => initialUploadProgressBar.increment(),
127
+ onFinishCallback: results => {
128
+ initialUploadProgressBar.update(numFiles, {
129
+ label: i18n(`${i18nKey}.initialUploadProgressBar.finish`),
130
+ });
131
+ initialUploadProgressBar.stop();
132
+ results.forEach(result => {
133
+ if (result.resultType == FILE_UPLOAD_RESULT_TYPES.FAILURE) {
134
+ logger.error('Uploading file "%s" to "%s" failed', result.file, dest);
135
+ logError(result.error, new ApiErrorContext({
136
+ accountId,
137
+ request: dest,
138
+ payload: result.file,
139
+ }));
140
+ }
141
+ });
142
+ },
143
+ };
144
+ return uploadOptions;
140
145
  };
141
146
  trackCommandUsage('preview', accountId);
142
147
  preview(accountId, absoluteSrc, dest, {
@@ -146,7 +151,8 @@ exports.handler = async (options) => {
146
151
  noSsl,
147
152
  port,
148
153
  debug,
149
- uploadOptions,
154
+ resetSession,
155
+ startProgressBar,
150
156
  handleUserInput,
151
157
  });
152
158
  };
@@ -186,5 +192,9 @@ exports.builder = yargs => {
186
192
  describe: false,
187
193
  type: 'boolean',
188
194
  });
195
+ yargs.option('resetSession', {
196
+ describe: false,
197
+ type: 'boolean',
198
+ });
189
199
  return yargs;
190
200
  };
@@ -1,3 +1 @@
1
- export const command: "theme";
2
- export const describe: any;
3
- export function builder(yargs: any): any;
1
+ export {};
package/commands/theme.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const marketplaceValidate = require('./theme/marketplace-validate');
3
5
  const generateSelectors = require('./theme/generate-selectors');
4
6
  const previewCommand = require('./theme/preview');
@@ -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): any;
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, hasUploadErrors, } = require('@hubspot/local-dev-lib/cms/uploadFolder');
@@ -1,4 +1 @@
1
- export const command: "watch [--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/watch.js CHANGED
@@ -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 { watch } = require('@hubspot/local-dev-lib/cms/watch');
package/lang/en.lyaml CHANGED
@@ -178,6 +178,7 @@ en:
178
178
  describe: "Type of asset"
179
179
  subcommands:
180
180
  apiSample:
181
+ folderOverwritePrompt: "The folder with name \"{{ folderName }}\" already exists. Overwrite?"
181
182
  errors:
182
183
  nameRequired: "The \"name\" argument is required when creating an API Sample."
183
184
  noSamples: "Currently there are no samples available, please, try again later."
@@ -570,6 +571,7 @@ en:
570
571
  withFlags: "Use --name and --type flags to bypass the prompt."
571
572
  deploy:
572
573
  describe: "Deploy a project build"
574
+ deployBuildIdPrompt: "[--build] Deploy which build?"
573
575
  debug:
574
576
  deploying: "Deploying project at path: {{ path }}"
575
577
  errors:
@@ -702,6 +704,11 @@ en:
702
704
  success: "Successfully opened \"{{ projectName }}\""
703
705
  feedback:
704
706
  describe: "Leave feedback on HubSpot projects or file a bug report"
707
+ feedbackType:
708
+ prompt: "What type of feedback would you like to leave?"
709
+ bug: "[--bug] Report a bug"
710
+ general: "[--general] Tell us about your experience with HubSpot's developer tools"
711
+ openPrompt: "Create a Github issue in your browser?"
705
712
  success: "We opened {{ url }} in your browser."
706
713
  options:
707
714
  bug:
@@ -999,6 +1006,7 @@ en:
999
1006
  installCount: "{{#bold}}The app {{ appName }} has {{ installCount }} production {{ installText }}{{/bold}}"
1000
1007
  explanation: "Some changes made during local development may need to be synced to HubSpot, which will impact those existing installs. We strongly recommend creating a copy of this app to use instead."
1001
1008
  confirmation: "You will always be asked to confirm any permanent changes to your app’s configuration before uploading them."
1009
+ confirmationPrompt: "Proceed with local development of this {{#bold}}production{{/bold}} app?"
1002
1010
  devServer:
1003
1011
  cleanupError: "Failed to cleanup local dev server: {{ message }}"
1004
1012
  setupError: "Failed to setup local dev server: {{ message }}"
@@ -1193,8 +1201,6 @@ en:
1193
1201
  invalidOauthClientSecretCopy: "Please copy the actual OAuth2 client secret rather than the asterisks that mask it."
1194
1202
  invalidPersonalAccessKey: "You did not enter a valid access key. Please try again."
1195
1203
  invalidPersonalAccessKeyCopy: "Please copy the actual access key rather than the bullets that mask it."
1196
- folderOverwritePrompt:
1197
- overwriteConfirm: "The folder with name \"{{ folderName }}\" already exists. Overwrite?"
1198
1204
  createTemplatePrompt:
1199
1205
  selectTemplate: "Select the type of template to create"
1200
1206
  createModulePrompt:
@@ -1276,15 +1282,6 @@ en:
1276
1282
  errors:
1277
1283
  invalidName: "You entered an invalid name. Please try again."
1278
1284
  projectDoesNotExist: "Project {{#bold}}{{ projectName }}{{/bold}} could not be found in \"{{ accountIdentifier }}\""
1279
- feedbackPrompt:
1280
- feedbackType:
1281
- message: "What type of feedback would you like to leave?"
1282
- bug: "[--bug] Report a bug"
1283
- general: "[--general] Tell us about your experience with HubSpot's developer tools"
1284
- bugPrompt: "Create an issue on Github in your browser?"
1285
- generalPrompt: "Create an issue on Github in your browser?"
1286
- deployBuildIdPrompt:
1287
- enterBuildId: "[--build] Deploy which build?"
1288
1285
  previewPrompt:
1289
1286
  enterSrc: "[--src] Enter a local theme directory to preview."
1290
1287
  enterDest: "[--dest] Enter the destination path for the src theme in HubSpot Design Tools."
@@ -1300,8 +1297,6 @@ en:
1300
1297
  prompt: "Open hubspot.com to install this app?"
1301
1298
  reinstallPrompt: "Open hubspot.com to reinstall this app?"
1302
1299
  decline: "To continue local development of this app, install it in your target test account and re-run {{#bold}}`hs project dev`{{/bold}}"
1303
- activeInstallConfirmationPrompt:
1304
- message: "Proceed with local development of this {{#bold}}production{{/bold}} app?"
1305
1300
  convertFields:
1306
1301
  positionals:
1307
1302
  src:
@@ -1,35 +1 @@
1
- declare const _exports: DevServerManager;
2
- export = _exports;
3
- declare class DevServerManager {
4
- initialized: boolean;
5
- started: boolean;
6
- componentsByType: {};
7
- server: any;
8
- path: any;
9
- devServers: {
10
- [x: string]: {
11
- componentType: "private-app";
12
- serverInterface: import("@hubspot/ui-extensions-dev-server").DevModeInterfaceNonSingleton;
13
- } | {
14
- componentType: "public-app";
15
- serverInterface: import("@hubspot/ui-extensions-dev-server").DevModeInterfaceNonSingleton;
16
- };
17
- };
18
- iterateDevServers(callback: any): Promise<void>;
19
- arrangeComponentsByType(components: any): any;
20
- setup({ components, onUploadRequired, accountId, setActiveApp }: {
21
- components: any;
22
- onUploadRequired: any;
23
- accountId: any;
24
- setActiveApp: any;
25
- }): Promise<void>;
26
- start({ accountId, projectConfig }: {
27
- accountId: any;
28
- projectConfig: any;
29
- }): Promise<void>;
30
- fileChange({ filePath, event }: {
31
- filePath: any;
32
- event: any;
33
- }): void;
34
- cleanup(): Promise<void>;
35
- }
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 { COMPONENT_TYPES } = require('./projectStructure');
4
6
  const { i18n } = require('./lang');
@@ -1,41 +1 @@
1
- export = LocalDevManager;
2
- declare class LocalDevManager {
3
- constructor(options: any);
4
- targetAccountId: any;
5
- targetProjectAccountId: any;
6
- projectConfig: any;
7
- projectDir: any;
8
- projectId: any;
9
- debug: any;
10
- deployedBuild: any;
11
- isGithubLinked: any;
12
- watcher: chokidar.FSWatcher | null;
13
- uploadWarnings: {};
14
- runnableComponents: any;
15
- activeApp: any;
16
- activePublicAppData: any;
17
- env: any;
18
- publicAppActiveInstalls: number | null;
19
- projectSourceDir: string;
20
- setActiveApp(appUid: any): Promise<void>;
21
- setActivePublicAppData(): Promise<void>;
22
- checkActivePublicAppInstalls(): Promise<void>;
23
- start(): Promise<void>;
24
- stop(showProgress?: boolean): Promise<void>;
25
- getActiveAppInstallationData(): Promise<import("@hubspot/local-dev-lib/types/Apps").PublicAppInstallationData>;
26
- checkPublicAppInstallation(): Promise<void>;
27
- updateKeypressListeners(): void;
28
- getUploadCommand(): string;
29
- logUploadWarning(reason: any): void;
30
- mostRecentUploadWarning: any;
31
- monitorConsoleOutput(): void;
32
- compareLocalProjectToDeployed(): void;
33
- startWatching(): void;
34
- stopWatching(): Promise<void>;
35
- handleWatchEvent(filePath: any, event: any, configPaths: any): void;
36
- devServerSetup(): Promise<boolean>;
37
- devServerStart(): Promise<void>;
38
- devServerFileChange(filePath: any, event: any): void;
39
- devServerCleanup(): Promise<boolean>;
40
- }
41
- import chokidar = require("chokidar");
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 chokidar = require('chokidar');
4
6
  const chalk = require('chalk');
@@ -18,7 +20,7 @@ const { CONFIG_FILES, COMPONENT_TYPES, getAppCardConfigs, } = require('./project
18
20
  const { UI_COLORS, uiCommandReference, uiAccountDescription, uiBetaTag, uiLink, uiLine, } = require('./ui');
19
21
  const { logError } = require('./errorHandlers/index');
20
22
  const { installPublicAppPrompt } = require('./prompts/installPublicAppPrompt');
21
- const { activeInstallConfirmationPrompt, } = require('./prompts/activeInstallConfirmationPrompt');
23
+ const { confirmPrompt } = require('./prompts/promptUtils');
22
24
  const WATCH_EVENTS = {
23
25
  add: 'add',
24
26
  change: 'change',
@@ -96,7 +98,7 @@ class LocalDevManager {
96
98
  }));
97
99
  logger.log(i18n(`${i18nKey}.activeInstallWarning.explanation`));
98
100
  uiLine();
99
- const proceed = await activeInstallConfirmationPrompt();
101
+ const proceed = await confirmPrompt(i18n(`${i18nKey}.activeInstallWarning.confirmationPrompt`), { defaultAnswer: false });
100
102
  if (!proceed) {
101
103
  process.exit(EXIT_CODES.SUCCESS);
102
104
  }
@@ -240,7 +242,7 @@ class LocalDevManager {
240
242
  }
241
243
  compareLocalProjectToDeployed() {
242
244
  const deployedComponentNames = this.deployedBuild.subbuildStatuses.map(subbuildStatus => subbuildStatus.buildName);
243
- let missingComponents = [];
245
+ const missingComponents = [];
244
246
  this.runnableComponents.forEach(({ type, config, path }) => {
245
247
  if (Object.values(COMPONENT_TYPES).includes(type)) {
246
248
  const cardConfigs = getAppCardConfigs(config, path);
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { getProjectConfig, ensureProjectExists } = require('./projects');
3
5
  const { fetchProjectComponentsMetadata, } = require('@hubspot/local-dev-lib/api/projects');
4
6
  const { i18n } = require('./lang');
@@ -1,6 +1,7 @@
1
- export function isStandardAccount(config: any): any;
2
- export function isSandbox(config: any): any;
3
- export function isStandardSandbox(config: any): any;
4
- export function isDevelopmentSandbox(config: any): any;
5
- export function isDeveloperTestAccount(config: any): any;
6
- export function isAppDeveloperAccount(config: any): any;
1
+ import { CLIAccount } from '@hubspot/local-dev-lib/types/Accounts';
2
+ export declare function isStandardAccount(accountConfig: CLIAccount): boolean;
3
+ export declare function isSandbox(accountConfig: CLIAccount): boolean;
4
+ export declare function isStandardSandbox(accountConfig: CLIAccount): boolean;
5
+ export declare function isDevelopmentSandbox(accountConfig: CLIAccount): boolean;
6
+ export declare function isDeveloperTestAccount(accountConfig: CLIAccount): boolean;
7
+ export declare function isAppDeveloperAccount(accountConfig: CLIAccount): boolean;
@@ -1,18 +1,32 @@
1
1
  "use strict";
2
- const { HUBSPOT_ACCOUNT_TYPES, } = require('@hubspot/local-dev-lib/constants/config');
3
- const isAccountType = (config, accountType) => config.accountType && config.accountType === accountType;
4
- const isStandardAccount = config => isAccountType(config, HUBSPOT_ACCOUNT_TYPES.STANDARD);
5
- const isSandbox = config => isAccountType(config, HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX) ||
6
- isAccountType(config, HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
7
- const isStandardSandbox = config => isAccountType(config, HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
8
- const isDevelopmentSandbox = config => isAccountType(config, HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
9
- const isDeveloperTestAccount = config => isAccountType(config, HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST);
10
- const isAppDeveloperAccount = config => isAccountType(config, HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER);
11
- module.exports = {
12
- isStandardAccount,
13
- isSandbox,
14
- isStandardSandbox,
15
- isDevelopmentSandbox,
16
- isDeveloperTestAccount,
17
- isAppDeveloperAccount,
18
- };
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStandardAccount = isStandardAccount;
4
+ exports.isSandbox = isSandbox;
5
+ exports.isStandardSandbox = isStandardSandbox;
6
+ exports.isDevelopmentSandbox = isDevelopmentSandbox;
7
+ exports.isDeveloperTestAccount = isDeveloperTestAccount;
8
+ exports.isAppDeveloperAccount = isAppDeveloperAccount;
9
+ const config_1 = require("@hubspot/local-dev-lib/constants/config");
10
+ function isAccountType(accountConfig, accountType) {
11
+ return (Boolean(accountConfig.accountType) &&
12
+ accountConfig.accountType === accountType);
13
+ }
14
+ function isStandardAccount(accountConfig) {
15
+ return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD);
16
+ }
17
+ function isSandbox(accountConfig) {
18
+ return (isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX) ||
19
+ isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX));
20
+ }
21
+ function isStandardSandbox(accountConfig) {
22
+ return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
23
+ }
24
+ function isDevelopmentSandbox(accountConfig) {
25
+ return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
26
+ }
27
+ function isDeveloperTestAccount(accountConfig) {
28
+ return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST);
29
+ }
30
+ function isAppDeveloperAccount(accountConfig) {
31
+ return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER);
32
+ }
@@ -1,22 +1 @@
1
- export function buildNewAccount({ name, accountType, accountConfig, env, portalLimit, force, }: {
2
- name: any;
3
- accountType: any;
4
- accountConfig: any;
5
- env: any;
6
- portalLimit: any;
7
- force?: boolean | undefined;
8
- }): Promise<{
9
- configAccountName: string | undefined;
10
- result: import("@hubspot/local-dev-lib/types/developerTestAccounts").DeveloperTestAccount | {
11
- sandbox: import("@hubspot/local-dev-lib/types/Sandbox").Sandbox;
12
- personalAccessKey: string;
13
- name: any;
14
- } | undefined;
15
- }>;
16
- export function saveAccountToConfig({ env, personalAccessKey, accountName, accountId, force, }: {
17
- env: any;
18
- personalAccessKey: any;
19
- accountName: any;
20
- accountId: any;
21
- force?: boolean | undefined;
22
- }): Promise<string | undefined>;
1
+ export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
2
4
  const { getAccessToken, updateConfigWithAccessToken, } = require('@hubspot/local-dev-lib/personalAccessKey');
3
5
  const { personalAccessKeyPrompt, } = require('./prompts/personalAccessKeyPrompt');
4
6
  const { accountNameExistsInConfig, updateAccountConfig, writeConfig, getAccountId, } = require('@hubspot/local-dev-lib/config');
@@ -1,20 +1,26 @@
1
- export function addAccountOptions(program: any): any;
2
- export function addConfigOptions(yargs: any): any;
3
- export function addOverwriteOptions(yargs: any): any;
4
- export function addModeOptions(yargs: any, { read, write }: {
5
- read: any;
6
- write: any;
7
- }): any;
8
- export function addTestingOptions(yargs: any): any;
9
- export function addUseEnvironmentOptions(yargs: any): any;
10
- /**
11
- * Get command name from Yargs `argv`
12
- * @param {object} argv
13
- */
14
- export function getCommandName(argv: object): any;
15
- export function getMode(command?: {}): string;
1
+ import { Argv, Arguments } from 'yargs';
2
+ export declare function addAccountOptions(yargs: Argv): Argv;
3
+ export declare function addConfigOptions(yargs: Argv): Argv;
4
+ export declare function addOverwriteOptions(yargs: Argv): Argv;
5
+ export declare function addModeOptions(yargs: Argv, { read, write }: {
6
+ read?: boolean;
7
+ write?: boolean;
8
+ }): Argv;
9
+ export declare function addTestingOptions(yargs: Argv): Argv;
10
+ export declare function addUseEnvironmentOptions(yargs: Argv): Argv;
11
+ export declare function setLogLevel(options: Arguments<{
12
+ debug?: boolean;
13
+ }>): void;
14
+ export declare function getCommandName(argv: Arguments<{
15
+ _?: string[];
16
+ }>): string;
16
17
  /**
17
18
  * Obtains accountId using supplied --account flag or from environment variables
18
19
  */
19
- export function getAccountId(options?: {}): number | null;
20
- export function setLogLevel(options?: {}): void;
20
+ export declare function getAccountId(options: Arguments<{
21
+ portal?: number | string;
22
+ account?: number | string;
23
+ }>): number | null;
24
+ export declare function getMode(options: Arguments<{
25
+ mode?: string;
26
+ }>): string;