balena-cli 19.1.1 → 19.1.2

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 (354) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/build/app.js +1 -1
  3. package/build/app.js.map +1 -1
  4. package/build/commands/api-key/generate.d.ts +1 -1
  5. package/build/commands/api-key/generate.js +1 -2
  6. package/build/commands/api-key/generate.js.map +1 -1
  7. package/build/commands/api-key/revoke.d.ts +1 -1
  8. package/build/commands/api-key/revoke.js +1 -2
  9. package/build/commands/api-key/revoke.js.map +1 -1
  10. package/build/commands/api-keys/index.d.ts +1 -1
  11. package/build/commands/api-keys/index.js +1 -2
  12. package/build/commands/api-keys/index.js.map +1 -1
  13. package/build/commands/app/create.d.ts +1 -1
  14. package/build/commands/app/create.js +1 -2
  15. package/build/commands/app/create.js.map +1 -1
  16. package/build/commands/block/create.d.ts +1 -1
  17. package/build/commands/block/create.js +1 -2
  18. package/build/commands/block/create.js.map +1 -1
  19. package/build/commands/build/index.d.ts +1 -1
  20. package/build/commands/build/index.js +5 -4
  21. package/build/commands/build/index.js.map +1 -1
  22. package/build/commands/config/generate.d.ts +1 -1
  23. package/build/commands/config/generate.js +1 -2
  24. package/build/commands/config/generate.js.map +1 -1
  25. package/build/commands/config/inject.d.ts +1 -1
  26. package/build/commands/config/inject.js +1 -2
  27. package/build/commands/config/inject.js.map +1 -1
  28. package/build/commands/config/read.d.ts +1 -1
  29. package/build/commands/config/read.js +2 -2
  30. package/build/commands/config/read.js.map +1 -1
  31. package/build/commands/config/reconfigure.d.ts +1 -1
  32. package/build/commands/config/reconfigure.js +1 -2
  33. package/build/commands/config/reconfigure.js.map +1 -1
  34. package/build/commands/config/write.d.ts +1 -1
  35. package/build/commands/config/write.js +1 -2
  36. package/build/commands/config/write.js.map +1 -1
  37. package/build/commands/deploy/index.d.ts +1 -1
  38. package/build/commands/deploy/index.js +3 -3
  39. package/build/commands/deploy/index.js.map +1 -1
  40. package/build/commands/device/deactivate.d.ts +1 -1
  41. package/build/commands/device/deactivate.js +1 -2
  42. package/build/commands/device/deactivate.js.map +1 -1
  43. package/build/commands/device/identify.d.ts +1 -1
  44. package/build/commands/device/identify.js +1 -2
  45. package/build/commands/device/identify.js.map +1 -1
  46. package/build/commands/device/index.d.ts +1 -1
  47. package/build/commands/device/index.js +1 -2
  48. package/build/commands/device/index.js.map +1 -1
  49. package/build/commands/device/init.d.ts +1 -1
  50. package/build/commands/device/init.js +3 -3
  51. package/build/commands/device/init.js.map +1 -1
  52. package/build/commands/device/list.d.ts +1 -1
  53. package/build/commands/device/list.js +2 -2
  54. package/build/commands/device/list.js.map +1 -1
  55. package/build/commands/device/local-mode.d.ts +1 -1
  56. package/build/commands/device/local-mode.js +1 -2
  57. package/build/commands/device/local-mode.js.map +1 -1
  58. package/build/commands/device/move.d.ts +1 -1
  59. package/build/commands/device/move.js +1 -2
  60. package/build/commands/device/move.js.map +1 -1
  61. package/build/commands/device/os-update.d.ts +1 -1
  62. package/build/commands/device/os-update.js +1 -2
  63. package/build/commands/device/os-update.js.map +1 -1
  64. package/build/commands/device/pin.d.ts +1 -1
  65. package/build/commands/device/pin.js +1 -2
  66. package/build/commands/device/pin.js.map +1 -1
  67. package/build/commands/device/public-url.d.ts +1 -1
  68. package/build/commands/device/public-url.js +1 -2
  69. package/build/commands/device/public-url.js.map +1 -1
  70. package/build/commands/device/purge.d.ts +1 -1
  71. package/build/commands/device/purge.js +1 -2
  72. package/build/commands/device/purge.js.map +1 -1
  73. package/build/commands/device/reboot.d.ts +1 -1
  74. package/build/commands/device/reboot.js +1 -2
  75. package/build/commands/device/reboot.js.map +1 -1
  76. package/build/commands/device/register.d.ts +1 -1
  77. package/build/commands/device/register.js +1 -2
  78. package/build/commands/device/register.js.map +1 -1
  79. package/build/commands/device/rename.d.ts +1 -1
  80. package/build/commands/device/rename.js +1 -2
  81. package/build/commands/device/rename.js.map +1 -1
  82. package/build/commands/device/restart.d.ts +1 -1
  83. package/build/commands/device/restart.js +1 -2
  84. package/build/commands/device/restart.js.map +1 -1
  85. package/build/commands/device/rm.d.ts +1 -1
  86. package/build/commands/device/rm.js +1 -2
  87. package/build/commands/device/rm.js.map +1 -1
  88. package/build/commands/device/shutdown.d.ts +1 -1
  89. package/build/commands/device/shutdown.js +1 -2
  90. package/build/commands/device/shutdown.js.map +1 -1
  91. package/build/commands/device/start-service.d.ts +1 -1
  92. package/build/commands/device/start-service.js +1 -2
  93. package/build/commands/device/start-service.js.map +1 -1
  94. package/build/commands/device/stop-service.d.ts +1 -1
  95. package/build/commands/device/stop-service.js +1 -2
  96. package/build/commands/device/stop-service.js.map +1 -1
  97. package/build/commands/device/track-fleet.d.ts +1 -1
  98. package/build/commands/device/track-fleet.js +1 -2
  99. package/build/commands/device/track-fleet.js.map +1 -1
  100. package/build/commands/devices/supported.d.ts +1 -1
  101. package/build/commands/devices/supported.js +1 -2
  102. package/build/commands/devices/supported.js.map +1 -1
  103. package/build/commands/env/add.d.ts +1 -1
  104. package/build/commands/env/add.js +3 -3
  105. package/build/commands/env/add.js.map +1 -1
  106. package/build/commands/env/rename.d.ts +1 -1
  107. package/build/commands/env/rename.js +3 -3
  108. package/build/commands/env/rename.js.map +1 -1
  109. package/build/commands/env/rm.d.ts +1 -1
  110. package/build/commands/env/rm.js +3 -3
  111. package/build/commands/env/rm.js.map +1 -1
  112. package/build/commands/envs/index.d.ts +1 -1
  113. package/build/commands/envs/index.js +3 -3
  114. package/build/commands/envs/index.js.map +1 -1
  115. package/build/commands/fleet/create.d.ts +1 -1
  116. package/build/commands/fleet/create.js +1 -2
  117. package/build/commands/fleet/create.js.map +1 -1
  118. package/build/commands/fleet/index.d.ts +1 -1
  119. package/build/commands/fleet/index.js +1 -2
  120. package/build/commands/fleet/index.js.map +1 -1
  121. package/build/commands/fleet/pin.d.ts +1 -1
  122. package/build/commands/fleet/pin.js +1 -2
  123. package/build/commands/fleet/pin.js.map +1 -1
  124. package/build/commands/fleet/purge.d.ts +1 -1
  125. package/build/commands/fleet/purge.js +2 -2
  126. package/build/commands/fleet/purge.js.map +1 -1
  127. package/build/commands/fleet/rename.d.ts +1 -1
  128. package/build/commands/fleet/rename.js +1 -2
  129. package/build/commands/fleet/rename.js.map +1 -1
  130. package/build/commands/fleet/restart.d.ts +1 -1
  131. package/build/commands/fleet/restart.js +2 -2
  132. package/build/commands/fleet/restart.js.map +1 -1
  133. package/build/commands/fleet/rm.d.ts +1 -1
  134. package/build/commands/fleet/rm.js +2 -2
  135. package/build/commands/fleet/rm.js.map +1 -1
  136. package/build/commands/fleet/track-latest.d.ts +1 -1
  137. package/build/commands/fleet/track-latest.js +1 -2
  138. package/build/commands/fleet/track-latest.js.map +1 -1
  139. package/build/commands/fleets/index.d.ts +1 -1
  140. package/build/commands/fleets/index.js +2 -2
  141. package/build/commands/fleets/index.js.map +1 -1
  142. package/build/commands/internal/osinit.d.ts +1 -1
  143. package/build/commands/internal/osinit.js +1 -2
  144. package/build/commands/internal/osinit.js.map +1 -1
  145. package/build/commands/join/index.d.ts +1 -1
  146. package/build/commands/join/index.js +3 -3
  147. package/build/commands/join/index.js.map +1 -1
  148. package/build/commands/key/add.d.ts +1 -2
  149. package/build/commands/key/add.js +1 -6
  150. package/build/commands/key/add.js.map +1 -1
  151. package/build/commands/key/index.d.ts +1 -1
  152. package/build/commands/key/index.js +1 -2
  153. package/build/commands/key/index.js.map +1 -1
  154. package/build/commands/key/rm.d.ts +1 -1
  155. package/build/commands/key/rm.js +1 -2
  156. package/build/commands/key/rm.js.map +1 -1
  157. package/build/commands/keys/index.d.ts +1 -1
  158. package/build/commands/keys/index.js +2 -2
  159. package/build/commands/keys/index.js.map +1 -1
  160. package/build/commands/leave/index.d.ts +1 -1
  161. package/build/commands/leave/index.js +3 -3
  162. package/build/commands/leave/index.js.map +1 -1
  163. package/build/commands/local/configure.d.ts +1 -1
  164. package/build/commands/local/configure.js +1 -2
  165. package/build/commands/local/configure.js.map +1 -1
  166. package/build/commands/local/flash.d.ts +1 -1
  167. package/build/commands/local/flash.js +1 -2
  168. package/build/commands/local/flash.js.map +1 -1
  169. package/build/commands/login/index.d.ts +1 -1
  170. package/build/commands/login/index.js +1 -2
  171. package/build/commands/login/index.js.map +1 -1
  172. package/build/commands/logout/index.d.ts +1 -1
  173. package/build/commands/logout/index.js +2 -2
  174. package/build/commands/logout/index.js.map +1 -1
  175. package/build/commands/logs/index.d.ts +1 -1
  176. package/build/commands/logs/index.js +3 -3
  177. package/build/commands/logs/index.js.map +1 -1
  178. package/build/commands/notes/index.d.ts +1 -2
  179. package/build/commands/notes/index.js +4 -6
  180. package/build/commands/notes/index.js.map +1 -1
  181. package/build/commands/orgs/index.d.ts +1 -1
  182. package/build/commands/orgs/index.js +2 -2
  183. package/build/commands/orgs/index.js.map +1 -1
  184. package/build/commands/os/build-config.d.ts +1 -1
  185. package/build/commands/os/build-config.js +1 -2
  186. package/build/commands/os/build-config.js.map +1 -1
  187. package/build/commands/os/configure.d.ts +1 -1
  188. package/build/commands/os/configure.js +3 -3
  189. package/build/commands/os/configure.js.map +1 -1
  190. package/build/commands/os/download.d.ts +1 -1
  191. package/build/commands/os/download.js +3 -3
  192. package/build/commands/os/download.js.map +1 -1
  193. package/build/commands/os/initialize.d.ts +1 -1
  194. package/build/commands/os/initialize.js +1 -2
  195. package/build/commands/os/initialize.js.map +1 -1
  196. package/build/commands/os/versions.d.ts +1 -1
  197. package/build/commands/os/versions.js +1 -2
  198. package/build/commands/os/versions.js.map +1 -1
  199. package/build/commands/preload/index.d.ts +1 -1
  200. package/build/commands/preload/index.js +1 -2
  201. package/build/commands/preload/index.js.map +1 -1
  202. package/build/commands/push/index.d.ts +1 -1
  203. package/build/commands/push/index.js +5 -4
  204. package/build/commands/push/index.js.map +1 -1
  205. package/build/commands/release/finalize.d.ts +1 -1
  206. package/build/commands/release/finalize.js +2 -2
  207. package/build/commands/release/finalize.js.map +1 -1
  208. package/build/commands/release/index.d.ts +1 -2
  209. package/build/commands/release/index.js +1 -2
  210. package/build/commands/release/index.js.map +1 -1
  211. package/build/commands/release/invalidate.d.ts +1 -1
  212. package/build/commands/release/invalidate.js +2 -2
  213. package/build/commands/release/invalidate.js.map +1 -1
  214. package/build/commands/release/validate.d.ts +1 -1
  215. package/build/commands/release/validate.js +2 -2
  216. package/build/commands/release/validate.js.map +1 -1
  217. package/build/commands/releases/index.d.ts +1 -1
  218. package/build/commands/releases/index.js +1 -2
  219. package/build/commands/releases/index.js.map +1 -1
  220. package/build/commands/scan/index.d.ts +1 -1
  221. package/build/commands/scan/index.js +1 -2
  222. package/build/commands/scan/index.js.map +1 -1
  223. package/build/commands/settings/index.d.ts +1 -1
  224. package/build/commands/settings/index.js +2 -2
  225. package/build/commands/settings/index.js.map +1 -1
  226. package/build/commands/ssh/index.d.ts +1 -1
  227. package/build/commands/ssh/index.js +4 -5
  228. package/build/commands/ssh/index.js.map +1 -1
  229. package/build/commands/support/index.d.ts +1 -1
  230. package/build/commands/support/index.js +1 -2
  231. package/build/commands/support/index.js.map +1 -1
  232. package/build/commands/tag/rm.d.ts +1 -1
  233. package/build/commands/tag/rm.js +1 -2
  234. package/build/commands/tag/rm.js.map +1 -1
  235. package/build/commands/tag/set.d.ts +1 -1
  236. package/build/commands/tag/set.js +1 -2
  237. package/build/commands/tag/set.js.map +1 -1
  238. package/build/commands/tags/index.d.ts +1 -1
  239. package/build/commands/tags/index.js +2 -2
  240. package/build/commands/tags/index.js.map +1 -1
  241. package/build/commands/tunnel/index.d.ts +1 -1
  242. package/build/commands/tunnel/index.js +3 -3
  243. package/build/commands/tunnel/index.js.map +1 -1
  244. package/build/commands/util/available-drives.d.ts +1 -1
  245. package/build/commands/util/available-drives.js +2 -2
  246. package/build/commands/util/available-drives.js.map +1 -1
  247. package/build/commands/version/index.d.ts +1 -1
  248. package/build/commands/version/index.js +1 -2
  249. package/build/commands/version/index.js.map +1 -1
  250. package/build/commands/whoami/index.d.ts +1 -1
  251. package/build/commands/whoami/index.js +2 -2
  252. package/build/commands/whoami/index.js.map +1 -1
  253. package/build/hooks/{prerun/track.d.ts → prerun.d.ts} +1 -1
  254. package/build/hooks/prerun.js +42 -0
  255. package/build/hooks/prerun.js.map +1 -0
  256. package/build/utils/patterns.d.ts +2 -0
  257. package/build/utils/patterns.js +16 -0
  258. package/build/utils/patterns.js.map +1 -1
  259. package/npm-shrinkwrap.json +2 -14
  260. package/oclif.manifest.json +9 -332
  261. package/package.json +3 -4
  262. package/src/app.ts +1 -1
  263. package/src/commands/api-key/generate.ts +1 -2
  264. package/src/commands/api-key/revoke.ts +1 -2
  265. package/src/commands/api-keys/index.ts +1 -2
  266. package/src/commands/app/create.ts +1 -3
  267. package/src/commands/block/create.ts +1 -3
  268. package/src/commands/build/index.ts +6 -4
  269. package/src/commands/config/generate.ts +1 -2
  270. package/src/commands/config/inject.ts +1 -2
  271. package/src/commands/config/read.ts +1 -1
  272. package/src/commands/config/reconfigure.ts +1 -2
  273. package/src/commands/config/write.ts +1 -2
  274. package/src/commands/deploy/index.ts +4 -4
  275. package/src/commands/device/deactivate.ts +1 -2
  276. package/src/commands/device/identify.ts +1 -2
  277. package/src/commands/device/index.ts +1 -2
  278. package/src/commands/device/init.ts +3 -3
  279. package/src/commands/device/list.ts +1 -1
  280. package/src/commands/device/local-mode.ts +1 -2
  281. package/src/commands/device/move.ts +1 -2
  282. package/src/commands/device/os-update.ts +1 -2
  283. package/src/commands/device/pin.ts +1 -2
  284. package/src/commands/device/public-url.ts +1 -2
  285. package/src/commands/device/purge.ts +1 -2
  286. package/src/commands/device/reboot.ts +1 -2
  287. package/src/commands/device/register.ts +1 -2
  288. package/src/commands/device/rename.ts +1 -2
  289. package/src/commands/device/restart.ts +1 -2
  290. package/src/commands/device/rm.ts +1 -2
  291. package/src/commands/device/shutdown.ts +1 -2
  292. package/src/commands/device/start-service.ts +1 -2
  293. package/src/commands/device/stop-service.ts +1 -2
  294. package/src/commands/device/track-fleet.ts +1 -2
  295. package/src/commands/devices/supported.ts +1 -3
  296. package/src/commands/env/add.ts +4 -3
  297. package/src/commands/env/rename.ts +4 -4
  298. package/src/commands/env/rm.ts +4 -4
  299. package/src/commands/envs/index.ts +4 -3
  300. package/src/commands/fleet/create.ts +1 -3
  301. package/src/commands/fleet/index.ts +1 -3
  302. package/src/commands/fleet/pin.ts +1 -2
  303. package/src/commands/fleet/purge.ts +1 -1
  304. package/src/commands/fleet/rename.ts +1 -3
  305. package/src/commands/fleet/restart.ts +1 -1
  306. package/src/commands/fleet/rm.ts +1 -1
  307. package/src/commands/fleet/track-latest.ts +1 -2
  308. package/src/commands/fleets/index.ts +1 -2
  309. package/src/commands/internal/osinit.ts +1 -2
  310. package/src/commands/join/index.ts +3 -3
  311. package/src/commands/key/add.ts +1 -6
  312. package/src/commands/key/index.ts +1 -2
  313. package/src/commands/key/rm.ts +1 -2
  314. package/src/commands/keys/index.ts +1 -1
  315. package/src/commands/leave/index.ts +3 -3
  316. package/src/commands/local/configure.ts +1 -2
  317. package/src/commands/local/flash.ts +1 -2
  318. package/src/commands/login/index.ts +1 -2
  319. package/src/commands/logout/index.ts +1 -1
  320. package/src/commands/logs/index.ts +3 -3
  321. package/src/commands/notes/index.ts +3 -8
  322. package/src/commands/orgs/index.ts +1 -1
  323. package/src/commands/os/build-config.ts +1 -2
  324. package/src/commands/os/configure.ts +4 -3
  325. package/src/commands/os/download.ts +3 -3
  326. package/src/commands/os/initialize.ts +1 -2
  327. package/src/commands/os/versions.ts +1 -2
  328. package/src/commands/preload/index.ts +1 -3
  329. package/src/commands/push/index.ts +7 -4
  330. package/src/commands/release/finalize.ts +1 -1
  331. package/src/commands/release/index.ts +1 -2
  332. package/src/commands/release/invalidate.ts +1 -1
  333. package/src/commands/release/validate.ts +1 -1
  334. package/src/commands/releases/index.ts +1 -2
  335. package/src/commands/scan/index.ts +1 -2
  336. package/src/commands/settings/index.ts +1 -1
  337. package/src/commands/ssh/index.ts +8 -5
  338. package/src/commands/support/index.ts +1 -2
  339. package/src/commands/tag/rm.ts +1 -2
  340. package/src/commands/tag/set.ts +1 -2
  341. package/src/commands/tags/index.ts +1 -1
  342. package/src/commands/tunnel/index.ts +4 -3
  343. package/src/commands/util/available-drives.ts +1 -1
  344. package/src/commands/version/index.ts +1 -2
  345. package/src/commands/whoami/index.ts +1 -1
  346. package/src/hooks/prerun.ts +119 -0
  347. package/src/utils/patterns.ts +41 -1
  348. package/build/command.d.ts +0 -16
  349. package/build/command.js +0 -57
  350. package/build/command.js.map +0 -1
  351. package/build/hooks/prerun/track.js +0 -14
  352. package/build/hooks/prerun/track.js.map +0 -1
  353. package/src/command.ts +0 -170
  354. package/src/hooks/prerun/track.ts +0 -44
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
 
@@ -16,10 +16,9 @@
16
16
  */
17
17
 
18
18
  import type * as BalenaSdk from 'balena-sdk';
19
-
20
- import Command from '../../command';
21
19
  import * as cf from '../../utils/common-flags';
22
20
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
21
+ import { Command } from '@oclif/core';
23
22
 
24
23
  interface ExtendedApplication extends ApplicationWithDeviceTypeSlug {
25
24
  device_count: number;
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import { stripIndent } from '../../utils/lazy';
21
20
 
22
21
  // 'Internal' commands are called during the execution of other commands.
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args, Flags } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Flags, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
  import { applicationIdInfo } from '../../utils/messages';
@@ -77,7 +76,8 @@ export default class JoinCmd extends Command {
77
76
 
78
77
  const promote = await import('../../utils/promote');
79
78
  const sdk = getBalenaSdk();
80
- const logger = await Command.getLogger();
79
+ const Logger = await import('../../utils/logger');
80
+ const logger = Logger.getLogger();
81
81
  return promote.join(
82
82
  logger,
83
83
  sdk,
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import { ExpectedError } from '../../errors';
21
20
  import * as cf from '../../utils/common-flags';
22
21
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
@@ -67,8 +66,6 @@ export default class KeyAddCmd extends Command {
67
66
 
68
67
  public static authenticated = true;
69
68
 
70
- public static readStdin = true;
71
-
72
69
  public async run() {
73
70
  const { args: params } = await this.parse(KeyAddCmd);
74
71
 
@@ -76,8 +73,6 @@ export default class KeyAddCmd extends Command {
76
73
  if (params.path != null) {
77
74
  const { readFile } = (await import('fs')).promises;
78
75
  key = await readFile(params.path, 'utf8');
79
- } else if (this.stdin.length > 0) {
80
- key = this.stdin;
81
76
  } else {
82
77
  throw new ExpectedError('No public key file or path provided.');
83
78
  }
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
22
21
  import { parseAsInteger } from '../../utils/validation';
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
  import { parseAsInteger } from '../../utils/validation';
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import * as cf from '../../utils/common-flags';
20
20
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
21
21
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { stripIndent } from '../../utils/lazy';
22
21
  import { parseAsLocalHostnameOrIp } from '../../utils/validation';
@@ -61,7 +60,8 @@ export default class LeaveCmd extends Command {
61
60
  const { args: params } = await this.parse(LeaveCmd);
62
61
 
63
62
  const promote = await import('../../utils/promote');
64
- const logger = await Command.getLogger();
63
+ const Logger = await import('../../utils/logger');
64
+ const logger = Logger.getLogger();
65
65
  return promote.leave(logger, params.deviceIpOrHostname);
66
66
  }
67
67
  }
@@ -15,9 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
18
+ import { Args, Command } from '@oclif/core';
19
19
  import { promisify } from 'util';
20
- import Command from '../../command';
21
20
  import * as cf from '../../utils/common-flags';
22
21
  import { stripIndent } from '../../utils/lazy';
23
22
 
@@ -15,9 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
18
+ import { Args, Command } from '@oclif/core';
19
19
  import type { BlockDevice } from 'etcher-sdk/build/source-destination';
20
- import Command from '../../command';
21
20
  import { ExpectedError } from '../../errors';
22
21
  import * as cf from '../../utils/common-flags';
23
22
  import { getChalk, getVisuals, stripIndent } from '../../utils/lazy';
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy';
22
21
  import { ExpectedError } from '../../errors';
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
20
20
 
21
21
  export default class LogoutCmd extends Command {
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
  import type { LogMessage } from 'balena-sdk';
@@ -151,8 +150,9 @@ export default class LogsCmd extends Command {
151
150
  maxAttempts: 1 + (options['max-retry'] ?? MAX_RETRY),
152
151
  });
153
152
  } else {
153
+ const { checkLoggedIn } = await import('../../utils/patterns');
154
154
  // Logs from cloud
155
- await Command.checkLoggedIn();
155
+ await checkLoggedIn();
156
156
  if (options.tail) {
157
157
  const logStream = await balena.logs.subscribe(params.device, {
158
158
  count: 100,
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import { ExpectedError } from '../../errors';
21
20
  import * as cf from '../../utils/common-flags';
22
21
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
@@ -53,14 +52,10 @@ export default class NoteCmd extends Command {
53
52
 
54
53
  public static authenticated = true;
55
54
 
56
- public static readStdin = true;
57
-
58
55
  public async run() {
59
56
  const { args: params, flags: options } = await this.parse(NoteCmd);
60
57
 
61
- params.note = params.note || this.stdin;
62
-
63
- if (params.note.length === 0) {
58
+ if (params.note?.length === 0) {
64
59
  throw new ExpectedError('Missing note content');
65
60
  }
66
61
 
@@ -73,6 +68,6 @@ export default class NoteCmd extends Command {
73
68
 
74
69
  const balena = getBalenaSdk();
75
70
 
76
- return balena.models.device.setNote(options.device, params.note);
71
+ return balena.models.device.setNote(options.device, params.note ?? '');
77
72
  }
78
73
  }
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import * as cf from '../../utils/common-flags';
20
20
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
21
21
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getCliForm, stripIndent } from '../../utils/lazy';
22
21
  import * as _ from 'lodash';
@@ -15,12 +15,11 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
18
+ import { Flags, Args, Command } from '@oclif/core';
19
19
  import type { Interfaces } from '@oclif/core';
20
20
  import type * as BalenaSdk from 'balena-sdk';
21
21
  import { promisify } from 'util';
22
22
  import * as _ from 'lodash';
23
- import Command from '../../command';
24
23
  import { ExpectedError } from '../../errors';
25
24
  import * as cf from '../../utils/common-flags';
26
25
  import { getBalenaSdk, stripIndent, getCliForm } from '../../utils/lazy';
@@ -319,7 +318,9 @@ async function validateOptions(options: FlagsDef) {
319
318
  );
320
319
  }
321
320
 
322
- await Command.checkLoggedIn();
321
+ const { checkLoggedIn } = await import('../../utils/patterns');
322
+
323
+ await checkLoggedIn();
323
324
  }
324
325
 
325
326
  /**
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { stripIndent } from '../../utils/lazy';
22
21
 
@@ -90,7 +89,8 @@ export default class OsDownloadCmd extends Command {
90
89
  const { isESR } = await import('../../utils/image-manager');
91
90
  if (options.version === 'menu-esr' || isESR(options.version)) {
92
91
  try {
93
- await OsDownloadCmd.checkLoggedIn();
92
+ const { checkLoggedIn } = await import('../../utils/patterns');
93
+ await checkLoggedIn();
94
94
  } catch (e) {
95
95
  const { ExpectedError, NotLoggedInError } = await import(
96
96
  '../../errors'
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getCliForm, stripIndent } from '../../utils/lazy';
22
21
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { stripIndent } from '../../utils/lazy';
22
21
 
@@ -15,7 +15,6 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
19
18
  import { ExpectedError } from '../../errors';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import {
@@ -27,8 +26,7 @@ import {
27
26
  import { applicationIdInfo } from '../../utils/messages';
28
27
  import { dockerConnectionCliFlags } from '../../utils/docker';
29
28
  import { parseAsInteger } from '../../utils/validation';
30
-
31
- import { Flags, Args } from '@oclif/core';
29
+ import { Flags, Args, Command } from '@oclif/core';
32
30
  import * as _ from 'lodash';
33
31
  import type {
34
32
  Application,
@@ -15,9 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
18
+ import { Flags, Args, Command } from '@oclif/core';
19
19
  import type { Interfaces } from '@oclif/core';
20
- import Command from '../../command';
21
20
  import * as cf from '../../utils/common-flags';
22
21
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
23
22
  import { dockerignoreHelp, registrySecretsHelp } from '../../utils/messages';
@@ -227,7 +226,9 @@ export default class PushCmd extends Command {
227
226
  public async run() {
228
227
  const { args: params, flags: options } = await this.parse(PushCmd);
229
228
 
230
- const logger = await Command.getLogger();
229
+ const Logger = await import('../../utils/logger');
230
+
231
+ const logger = Logger.getLogger();
231
232
  logger.logDebug(`Using build source directory: ${options.source} `);
232
233
 
233
234
  const sdk = getBalenaSdk();
@@ -294,7 +295,9 @@ export default class PushCmd extends Command {
294
295
  options['release-tag'] ?? [],
295
296
  );
296
297
 
297
- await Command.checkLoggedIn();
298
+ const { checkLoggedIn } = await import('../../utils/patterns');
299
+
300
+ await checkLoggedIn();
298
301
  const [token, baseUrl] = await Promise.all([
299
302
  sdk.auth.getToken(),
300
303
  sdk.settings.get('balenaUrl'),
@@ -15,8 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
+ import { Command } from '@oclif/core';
18
19
  import { commitOrIdArg } from '.';
19
- import Command from '../../command';
20
20
  import * as cf from '../../utils/common-flags';
21
21
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
22
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args, type Interfaces } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, type Interfaces, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
22
21
  import type * as BalenaSdk from 'balena-sdk';
@@ -15,8 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
+ import { Command } from '@oclif/core';
18
19
  import { commitOrIdArg } from '.';
19
- import Command from '../../command';
20
20
  import * as cf from '../../utils/common-flags';
21
21
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
22
 
@@ -15,8 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
+ import { Command } from '@oclif/core';
18
19
  import { commitOrIdArg } from '.';
19
- import Command from '../../command';
20
20
  import * as cf from '../../utils/common-flags';
21
21
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
22
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
22
21
  import { applicationNameNote } from '../../utils/messages';
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getCliUx, stripIndent } from '../../utils/lazy';
22
21
 
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import * as cf from '../../utils/common-flags';
20
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
21
21
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
  import {
@@ -121,15 +120,19 @@ export default class SshCmd extends Command {
121
120
 
122
121
  // Remote connection
123
122
  const { getProxyConfig } = await import('../../utils/helpers');
124
- const { getOnlineTargetDeviceUuid } = await import('../../utils/patterns');
123
+ const {
124
+ getOnlineTargetDeviceUuid,
125
+ checkLoggedIn,
126
+ checkNotUsingOfflineMode,
127
+ } = await import('../../utils/patterns');
125
128
  const sdk = getBalenaSdk();
126
129
 
127
130
  const proxyConfig = getProxyConfig();
128
131
  const useProxy = !!proxyConfig && !options.noproxy;
129
132
 
130
133
  // this will be a tunnelled SSH connection...
131
- await Command.checkNotUsingOfflineMode();
132
- await Command.checkLoggedIn();
134
+ await checkNotUsingOfflineMode();
135
+ await checkLoggedIn();
133
136
  const deviceUuid = await getOnlineTargetDeviceUuid(
134
137
  sdk,
135
138
  params.fleetOrDevice,
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import { ExpectedError } from '../../errors';
21
20
  import * as cf from '../../utils/common-flags';
22
21
  import { getBalenaSdk, getCliUx, stripIndent } from '../../utils/lazy';
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
  import { applicationIdInfo } from '../../utils/messages';
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Args, Command } from '@oclif/core';
20
19
  import * as cf from '../../utils/common-flags';
21
20
  import { getBalenaSdk, stripIndent } from '../../utils/lazy';
22
21
  import { applicationIdInfo } from '../../utils/messages';
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import { ExpectedError } from '../../errors';
20
20
  import * as cf from '../../utils/common-flags';
21
21
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags, Args } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Args, Command } from '@oclif/core';
20
19
  import {
21
20
  NoPortsDefinedError,
22
21
  InvalidPortMappingError,
@@ -94,7 +93,9 @@ export default class TunnelCmd extends Command {
94
93
  public async run() {
95
94
  const { args: params, flags: options } = await this.parse(TunnelCmd);
96
95
 
97
- const logger = await Command.getLogger();
96
+ const Logger = await import('../../utils/logger');
97
+
98
+ const logger = Logger.getLogger();
98
99
  const sdk = getBalenaSdk();
99
100
 
100
101
  const logConnection = (
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import * as cf from '../../utils/common-flags';
20
20
  import { stripIndent, getChalk, getVisuals } from '../../utils/lazy';
21
21
 
@@ -15,8 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { Flags } from '@oclif/core';
19
- import Command from '../../command';
18
+ import { Flags, Command } from '@oclif/core';
20
19
  import { stripIndent } from '../../utils/lazy';
21
20
 
22
21
  export interface JsonVersions {
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import Command from '../../command';
18
+ import { Command } from '@oclif/core';
19
19
  import { getBalenaSdk, getVisuals, stripIndent } from '../../utils/lazy';
20
20
 
21
21
  export default class WhoamiCmd extends Command {