@vendure/cloud 0.4.0 → 0.5.0-dev.20261016123507.ge07a06e

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 (522) hide show
  1. package/README.md +43 -10
  2. package/dist/cli/arguments.d.ts.map +1 -1
  3. package/dist/cli/arguments.js +9 -31
  4. package/dist/cli/arguments.js.map +1 -1
  5. package/dist/cli/command.d.ts.map +1 -1
  6. package/dist/cli/command.js +13 -30
  7. package/dist/cli/command.js.map +1 -1
  8. package/dist/cli/commands/access/access.d.ts +5 -0
  9. package/dist/cli/commands/access/access.d.ts.map +1 -0
  10. package/dist/cli/commands/access/access.js +73 -0
  11. package/dist/cli/commands/access/access.js.map +1 -0
  12. package/dist/cli/commands/access/index.d.ts +2 -0
  13. package/dist/cli/commands/access/index.d.ts.map +1 -0
  14. package/dist/cli/commands/access/index.js +46 -0
  15. package/dist/cli/commands/access/index.js.map +1 -0
  16. package/dist/cli/commands/deployment/arguments.d.ts.map +1 -1
  17. package/dist/cli/commands/deployment/arguments.js +1 -8
  18. package/dist/cli/commands/deployment/arguments.js.map +1 -1
  19. package/dist/cli/commands/deployment/build-logs.d.ts.map +1 -1
  20. package/dist/cli/commands/deployment/build-logs.js +12 -16
  21. package/dist/cli/commands/deployment/build-logs.js.map +1 -1
  22. package/dist/cli/commands/deployment/deploy.d.ts.map +1 -1
  23. package/dist/cli/commands/deployment/deploy.js +88 -45
  24. package/dist/cli/commands/deployment/deploy.js.map +1 -1
  25. package/dist/cli/commands/deployment/index.d.ts.map +1 -1
  26. package/dist/cli/commands/deployment/index.js +18 -30
  27. package/dist/cli/commands/deployment/index.js.map +1 -1
  28. package/dist/cli/commands/deployment/list.d.ts.map +1 -1
  29. package/dist/cli/commands/deployment/list.js +5 -5
  30. package/dist/cli/commands/deployment/list.js.map +1 -1
  31. package/dist/cli/commands/deployment/log-export.d.ts.map +1 -1
  32. package/dist/cli/commands/deployment/log-export.js +14 -27
  33. package/dist/cli/commands/deployment/log-export.js.map +1 -1
  34. package/dist/cli/commands/deployment/log-query-output.d.ts.map +1 -1
  35. package/dist/cli/commands/deployment/log-query-output.js +18 -32
  36. package/dist/cli/commands/deployment/log-query-output.js.map +1 -1
  37. package/dist/cli/commands/deployment/logs.d.ts.map +1 -1
  38. package/dist/cli/commands/deployment/logs.js +52 -72
  39. package/dist/cli/commands/deployment/logs.js.map +1 -1
  40. package/dist/cli/commands/deployment/options.d.ts.map +1 -1
  41. package/dist/cli/commands/deployment/options.js +11 -20
  42. package/dist/cli/commands/deployment/options.js.map +1 -1
  43. package/dist/cli/commands/deployment/plan-format.d.ts.map +1 -1
  44. package/dist/cli/commands/deployment/plan-format.js +2 -2
  45. package/dist/cli/commands/deployment/plan-format.js.map +1 -1
  46. package/dist/cli/commands/deployment/plan.d.ts.map +1 -1
  47. package/dist/cli/commands/deployment/plan.js +7 -8
  48. package/dist/cli/commands/deployment/plan.js.map +1 -1
  49. package/dist/cli/commands/deployment/recovery.d.ts.map +1 -1
  50. package/dist/cli/commands/deployment/recovery.js +25 -35
  51. package/dist/cli/commands/deployment/recovery.js.map +1 -1
  52. package/dist/cli/commands/deployment/rollback.d.ts.map +1 -1
  53. package/dist/cli/commands/deployment/rollback.js +58 -12
  54. package/dist/cli/commands/deployment/rollback.js.map +1 -1
  55. package/dist/cli/commands/deployment/shared.d.ts.map +1 -1
  56. package/dist/cli/commands/deployment/shared.js +4 -7
  57. package/dist/cli/commands/deployment/shared.js.map +1 -1
  58. package/dist/cli/commands/deployment/show.d.ts.map +1 -1
  59. package/dist/cli/commands/deployment/show.js +8 -9
  60. package/dist/cli/commands/deployment/show.js.map +1 -1
  61. package/dist/cli/commands/deployment/source.d.ts.map +1 -1
  62. package/dist/cli/commands/deployment/source.js +2 -2
  63. package/dist/cli/commands/deployment/source.js.map +1 -1
  64. package/dist/cli/commands/deployment/status.d.ts.map +1 -1
  65. package/dist/cli/commands/deployment/status.js +10 -11
  66. package/dist/cli/commands/deployment/status.js.map +1 -1
  67. package/dist/cli/commands/deployment/teardown.js +22 -31
  68. package/dist/cli/commands/deployment/teardown.js.map +1 -1
  69. package/dist/cli/commands/identity-context/context.d.ts.map +1 -1
  70. package/dist/cli/commands/identity-context/context.js +3 -4
  71. package/dist/cli/commands/identity-context/context.js.map +1 -1
  72. package/dist/cli/commands/identity-context/index.d.ts.map +1 -1
  73. package/dist/cli/commands/identity-context/index.js +16 -50
  74. package/dist/cli/commands/identity-context/index.js.map +1 -1
  75. package/dist/cli/commands/identity-context/keys.d.ts.map +1 -1
  76. package/dist/cli/commands/identity-context/keys.js +13 -15
  77. package/dist/cli/commands/identity-context/keys.js.map +1 -1
  78. package/dist/cli/commands/identity-context/use.js +1 -1
  79. package/dist/cli/commands/identity-context/use.js.map +1 -1
  80. package/dist/cli/commands/index.d.ts.map +1 -1
  81. package/dist/cli/commands/index.js +13 -20
  82. package/dist/cli/commands/index.js.map +1 -1
  83. package/dist/cli/commands/project-config/config/build-fields.d.ts.map +1 -1
  84. package/dist/cli/commands/project-config/config/build-fields.js +2 -3
  85. package/dist/cli/commands/project-config/config/build-fields.js.map +1 -1
  86. package/dist/cli/commands/project-config/config/build.d.ts.map +1 -1
  87. package/dist/cli/commands/project-config/config/build.js +8 -9
  88. package/dist/cli/commands/project-config/config/build.js.map +1 -1
  89. package/dist/cli/commands/project-config/config/desired-state.d.ts.map +1 -1
  90. package/dist/cli/commands/project-config/config/desired-state.js +10 -12
  91. package/dist/cli/commands/project-config/config/desired-state.js.map +1 -1
  92. package/dist/cli/commands/project-config/config/email/domain.d.ts.map +1 -1
  93. package/dist/cli/commands/project-config/config/email/domain.js +12 -9
  94. package/dist/cli/commands/project-config/config/email/domain.js.map +1 -1
  95. package/dist/cli/commands/project-config/config/email/events.d.ts.map +1 -1
  96. package/dist/cli/commands/project-config/config/email/events.js +9 -9
  97. package/dist/cli/commands/project-config/config/email/events.js.map +1 -1
  98. package/dist/cli/commands/project-config/config/email/index.d.ts.map +1 -1
  99. package/dist/cli/commands/project-config/config/email/index.js +5 -6
  100. package/dist/cli/commands/project-config/config/email/index.js.map +1 -1
  101. package/dist/cli/commands/project-config/config/email/test-sending.d.ts.map +1 -1
  102. package/dist/cli/commands/project-config/config/email/test-sending.js +6 -5
  103. package/dist/cli/commands/project-config/config/email/test-sending.js.map +1 -1
  104. package/dist/cli/commands/project-config/config/index.d.ts.map +1 -1
  105. package/dist/cli/commands/project-config/config/index.js +8 -10
  106. package/dist/cli/commands/project-config/config/index.js.map +1 -1
  107. package/dist/cli/commands/project-config/config/runtime.d.ts.map +1 -1
  108. package/dist/cli/commands/project-config/config/runtime.js +10 -21
  109. package/dist/cli/commands/project-config/config/runtime.js.map +1 -1
  110. package/dist/cli/commands/project-config/config/set.js +3 -3
  111. package/dist/cli/commands/project-config/config/set.js.map +1 -1
  112. package/dist/cli/commands/project-config/config/show.d.ts.map +1 -1
  113. package/dist/cli/commands/project-config/config/show.js +7 -7
  114. package/dist/cli/commands/project-config/config/show.js.map +1 -1
  115. package/dist/cli/commands/project-config/env/add.d.ts.map +1 -1
  116. package/dist/cli/commands/project-config/env/add.js +4 -3
  117. package/dist/cli/commands/project-config/env/add.js.map +1 -1
  118. package/dist/cli/commands/project-config/env/get.d.ts.map +1 -1
  119. package/dist/cli/commands/project-config/env/get.js +7 -2
  120. package/dist/cli/commands/project-config/env/get.js.map +1 -1
  121. package/dist/cli/commands/project-config/env/import.d.ts.map +1 -1
  122. package/dist/cli/commands/project-config/env/import.js +15 -8
  123. package/dist/cli/commands/project-config/env/import.js.map +1 -1
  124. package/dist/cli/commands/project-config/env/index.js +7 -8
  125. package/dist/cli/commands/project-config/env/index.js.map +1 -1
  126. package/dist/cli/commands/project-config/env/list.d.ts.map +1 -1
  127. package/dist/cli/commands/project-config/env/list.js +29 -8
  128. package/dist/cli/commands/project-config/env/list.js.map +1 -1
  129. package/dist/cli/commands/project-config/env/metadata-options.d.ts.map +1 -1
  130. package/dist/cli/commands/project-config/env/metadata-options.js +0 -1
  131. package/dist/cli/commands/project-config/env/metadata-options.js.map +1 -1
  132. package/dist/cli/commands/project-config/env/pull.d.ts.map +1 -1
  133. package/dist/cli/commands/project-config/env/pull.js +22 -8
  134. package/dist/cli/commands/project-config/env/pull.js.map +1 -1
  135. package/dist/cli/commands/project-config/env/read-value.d.ts.map +1 -1
  136. package/dist/cli/commands/project-config/env/read-value.js +8 -4
  137. package/dist/cli/commands/project-config/env/read-value.js.map +1 -1
  138. package/dist/cli/commands/project-config/env/rm.d.ts.map +1 -1
  139. package/dist/cli/commands/project-config/env/rm.js +4 -3
  140. package/dist/cli/commands/project-config/env/rm.js.map +1 -1
  141. package/dist/cli/commands/project-config/env/run.d.ts.map +1 -1
  142. package/dist/cli/commands/project-config/env/run.js +9 -8
  143. package/dist/cli/commands/project-config/env/run.js.map +1 -1
  144. package/dist/cli/commands/project-config/env/update.d.ts.map +1 -1
  145. package/dist/cli/commands/project-config/env/update.js +4 -3
  146. package/dist/cli/commands/project-config/env/update.js.map +1 -1
  147. package/dist/cli/commands/project-config/environment/create.d.ts.map +1 -1
  148. package/dist/cli/commands/project-config/environment/create.js +5 -6
  149. package/dist/cli/commands/project-config/environment/create.js.map +1 -1
  150. package/dist/cli/commands/project-config/environment/delete.d.ts.map +1 -1
  151. package/dist/cli/commands/project-config/environment/delete.js +6 -6
  152. package/dist/cli/commands/project-config/environment/delete.js.map +1 -1
  153. package/dist/cli/commands/project-config/environment/find.js +3 -3
  154. package/dist/cli/commands/project-config/environment/find.js.map +1 -1
  155. package/dist/cli/commands/project-config/environment/index.d.ts.map +1 -1
  156. package/dist/cli/commands/project-config/environment/index.js +8 -10
  157. package/dist/cli/commands/project-config/environment/index.js.map +1 -1
  158. package/dist/cli/commands/project-config/environment/initial-superadmin.d.ts.map +1 -1
  159. package/dist/cli/commands/project-config/environment/initial-superadmin.js +4 -5
  160. package/dist/cli/commands/project-config/environment/initial-superadmin.js.map +1 -1
  161. package/dist/cli/commands/project-config/environment/list.d.ts.map +1 -1
  162. package/dist/cli/commands/project-config/environment/list.js +5 -5
  163. package/dist/cli/commands/project-config/environment/list.js.map +1 -1
  164. package/dist/cli/commands/project-config/environment/regions.d.ts.map +1 -1
  165. package/dist/cli/commands/project-config/environment/regions.js +3 -3
  166. package/dist/cli/commands/project-config/environment/regions.js.map +1 -1
  167. package/dist/cli/commands/project-config/environment/show.d.ts.map +1 -1
  168. package/dist/cli/commands/project-config/environment/show.js +3 -4
  169. package/dist/cli/commands/project-config/environment/show.js.map +1 -1
  170. package/dist/cli/commands/project-config/environment/update.d.ts.map +1 -1
  171. package/dist/cli/commands/project-config/environment/update.js +3 -4
  172. package/dist/cli/commands/project-config/environment/update.js.map +1 -1
  173. package/dist/cli/commands/project-config/index.js +5 -5
  174. package/dist/cli/commands/project-config/index.js.map +1 -1
  175. package/dist/cli/commands/project-config/init/build-detection.d.ts.map +1 -1
  176. package/dist/cli/commands/project-config/init/build-detection.js +4 -4
  177. package/dist/cli/commands/project-config/init/build-detection.js.map +1 -1
  178. package/dist/cli/commands/project-config/init/index.d.ts.map +1 -1
  179. package/dist/cli/commands/project-config/init/index.js +4 -5
  180. package/dist/cli/commands/project-config/init/index.js.map +1 -1
  181. package/dist/cli/commands/project-config/init/init.d.ts.map +1 -1
  182. package/dist/cli/commands/project-config/init/init.js +18 -22
  183. package/dist/cli/commands/project-config/init/init.js.map +1 -1
  184. package/dist/cli/commands/project-config/options.d.ts.map +1 -1
  185. package/dist/cli/commands/project-config/options.js +9 -14
  186. package/dist/cli/commands/project-config/options.js.map +1 -1
  187. package/dist/cli/commands/project-config/project/create.d.ts.map +1 -1
  188. package/dist/cli/commands/project-config/project/create.js +3 -3
  189. package/dist/cli/commands/project-config/project/create.js.map +1 -1
  190. package/dist/cli/commands/project-config/project/delete.d.ts.map +1 -1
  191. package/dist/cli/commands/project-config/project/delete.js +4 -5
  192. package/dist/cli/commands/project-config/project/delete.js.map +1 -1
  193. package/dist/cli/commands/project-config/project/index.d.ts.map +1 -1
  194. package/dist/cli/commands/project-config/project/index.js +4 -5
  195. package/dist/cli/commands/project-config/project/index.js.map +1 -1
  196. package/dist/cli/commands/project-config/project/link.d.ts.map +1 -1
  197. package/dist/cli/commands/project-config/project/link.js +4 -4
  198. package/dist/cli/commands/project-config/project/link.js.map +1 -1
  199. package/dist/cli/commands/project-config/project/list.d.ts.map +1 -1
  200. package/dist/cli/commands/project-config/project/list.js +5 -5
  201. package/dist/cli/commands/project-config/project/list.js.map +1 -1
  202. package/dist/cli/commands/project-config/project/show.d.ts.map +1 -1
  203. package/dist/cli/commands/project-config/project/show.js +11 -14
  204. package/dist/cli/commands/project-config/project/show.js.map +1 -1
  205. package/dist/cli/commands/project-config/project/subscription-state.d.ts.map +1 -1
  206. package/dist/cli/commands/project-config/project/subscription-state.js +17 -20
  207. package/dist/cli/commands/project-config/project/subscription-state.js.map +1 -1
  208. package/dist/cli/commands/project-config/project/unlink.d.ts.map +1 -1
  209. package/dist/cli/commands/project-config/project/unlink.js +2 -3
  210. package/dist/cli/commands/project-config/project/unlink.js.map +1 -1
  211. package/dist/cli/commands/project-config/project/update.d.ts.map +1 -1
  212. package/dist/cli/commands/project-config/project/update.js +3 -4
  213. package/dist/cli/commands/project-config/project/update.js.map +1 -1
  214. package/dist/cli/commands/project-config/source/connect.d.ts.map +1 -1
  215. package/dist/cli/commands/project-config/source/connect.js +24 -26
  216. package/dist/cli/commands/project-config/source/connect.js.map +1 -1
  217. package/dist/cli/commands/project-config/source/disconnect.d.ts.map +1 -1
  218. package/dist/cli/commands/project-config/source/disconnect.js +4 -4
  219. package/dist/cli/commands/project-config/source/disconnect.js.map +1 -1
  220. package/dist/cli/commands/project-config/source/index.js +7 -7
  221. package/dist/cli/commands/project-config/source/index.js.map +1 -1
  222. package/dist/cli/commands/project-config/source/map.d.ts.map +1 -1
  223. package/dist/cli/commands/project-config/source/map.js +12 -16
  224. package/dist/cli/commands/project-config/source/map.js.map +1 -1
  225. package/dist/cli/commands/project-config/source/repos.d.ts.map +1 -1
  226. package/dist/cli/commands/project-config/source/repos.js +5 -5
  227. package/dist/cli/commands/project-config/source/repos.js.map +1 -1
  228. package/dist/cli/commands/project-config/source/status.d.ts.map +1 -1
  229. package/dist/cli/commands/project-config/source/status.js +16 -25
  230. package/dist/cli/commands/project-config/source/status.js.map +1 -1
  231. package/dist/cli/commands/runtime-data/backup.d.ts.map +1 -1
  232. package/dist/cli/commands/runtime-data/backup.js +34 -36
  233. package/dist/cli/commands/runtime-data/backup.js.map +1 -1
  234. package/dist/cli/commands/runtime-data/index.d.ts.map +1 -1
  235. package/dist/cli/commands/runtime-data/index.js +38 -39
  236. package/dist/cli/commands/runtime-data/index.js.map +1 -1
  237. package/dist/cli/commands/runtime-data/resource.d.ts +1 -0
  238. package/dist/cli/commands/runtime-data/resource.d.ts.map +1 -1
  239. package/dist/cli/commands/runtime-data/resource.js +92 -33
  240. package/dist/cli/commands/runtime-data/resource.js.map +1 -1
  241. package/dist/cli/commands/runtime-data/restore.d.ts.map +1 -1
  242. package/dist/cli/commands/runtime-data/restore.js +32 -45
  243. package/dist/cli/commands/runtime-data/restore.js.map +1 -1
  244. package/dist/cli/commands/runtime-data/seeds.d.ts.map +1 -1
  245. package/dist/cli/commands/runtime-data/seeds.js +24 -26
  246. package/dist/cli/commands/runtime-data/seeds.js.map +1 -1
  247. package/dist/cli/commands/runtime-data/tunnel.d.ts.map +1 -1
  248. package/dist/cli/commands/runtime-data/tunnel.js +33 -43
  249. package/dist/cli/commands/runtime-data/tunnel.js.map +1 -1
  250. package/dist/cli/host-arguments.d.ts.map +1 -1
  251. package/dist/cli/host-arguments.js +10 -18
  252. package/dist/cli/host-arguments.js.map +1 -1
  253. package/dist/cli/host-nodes.js +1 -1
  254. package/dist/cli/host-nodes.js.map +1 -1
  255. package/dist/cli/index.d.ts +10 -13
  256. package/dist/cli/index.d.ts.map +1 -1
  257. package/dist/cli/index.js +22 -33
  258. package/dist/cli/index.js.map +1 -1
  259. package/dist/cli/lib/api-client.d.ts +10 -5
  260. package/dist/cli/lib/api-client.d.ts.map +1 -1
  261. package/dist/cli/lib/api-client.js +23 -42
  262. package/dist/cli/lib/api-client.js.map +1 -1
  263. package/dist/cli/lib/auth.d.ts +4 -145
  264. package/dist/cli/lib/auth.d.ts.map +1 -1
  265. package/dist/cli/lib/auth.js +8 -515
  266. package/dist/cli/lib/auth.js.map +1 -1
  267. package/dist/cli/lib/cli-login.d.ts +12 -0
  268. package/dist/cli/lib/cli-login.d.ts.map +1 -0
  269. package/dist/cli/lib/cli-login.js +155 -0
  270. package/dist/cli/lib/cli-login.js.map +1 -0
  271. package/dist/cli/lib/cloud-api-url.d.ts +2 -0
  272. package/dist/cli/lib/cloud-api-url.d.ts.map +1 -0
  273. package/dist/cli/lib/cloud-api-url.js +3 -0
  274. package/dist/cli/lib/cloud-api-url.js.map +1 -0
  275. package/dist/cli/lib/commit.d.ts.map +1 -1
  276. package/dist/cli/lib/commit.js +2 -3
  277. package/dist/cli/lib/commit.js.map +1 -1
  278. package/dist/cli/lib/config-revisions.d.ts +9 -0
  279. package/dist/cli/lib/config-revisions.d.ts.map +1 -0
  280. package/dist/cli/lib/config-revisions.js +52 -0
  281. package/dist/cli/lib/config-revisions.js.map +1 -0
  282. package/dist/cli/lib/config.d.ts +0 -4
  283. package/dist/cli/lib/config.d.ts.map +1 -1
  284. package/dist/cli/lib/config.js +3 -5
  285. package/dist/cli/lib/config.js.map +1 -1
  286. package/dist/cli/lib/console-pairing.d.ts +1 -14
  287. package/dist/cli/lib/console-pairing.d.ts.map +1 -1
  288. package/dist/cli/lib/console-pairing.js +48 -60
  289. package/dist/cli/lib/console-pairing.js.map +1 -1
  290. package/dist/cli/lib/contract/backup-schedule-reasons.d.ts.map +1 -1
  291. package/dist/cli/lib/contract/backup-schedule-reasons.js +3 -7
  292. package/dist/cli/lib/contract/backup-schedule-reasons.js.map +1 -1
  293. package/dist/cli/lib/contract/build-settings.d.ts +1 -1
  294. package/dist/cli/lib/contract/build-settings.d.ts.map +1 -1
  295. package/dist/cli/lib/contract/build-settings.js +12 -18
  296. package/dist/cli/lib/contract/build-settings.js.map +1 -1
  297. package/dist/cli/lib/contract/database.d.ts.map +1 -1
  298. package/dist/cli/lib/contract/database.js +7 -13
  299. package/dist/cli/lib/contract/database.js.map +1 -1
  300. package/dist/cli/lib/contract/deployment-resource-labels.d.ts.map +1 -1
  301. package/dist/cli/lib/contract/deployment-resource-labels.js +2 -6
  302. package/dist/cli/lib/contract/deployment-resource-labels.js.map +1 -1
  303. package/dist/cli/lib/contract/deployments.d.ts +1 -0
  304. package/dist/cli/lib/contract/deployments.d.ts.map +1 -1
  305. package/dist/cli/lib/contract/deployments.js +32 -40
  306. package/dist/cli/lib/contract/deployments.js.map +1 -1
  307. package/dist/cli/lib/contract/desired-state.d.ts +3 -1
  308. package/dist/cli/lib/contract/desired-state.d.ts.map +1 -1
  309. package/dist/cli/lib/contract/desired-state.js +33 -50
  310. package/dist/cli/lib/contract/desired-state.js.map +1 -1
  311. package/dist/cli/lib/contract/env-vars.d.ts +37 -0
  312. package/dist/cli/lib/contract/env-vars.d.ts.map +1 -0
  313. package/dist/cli/lib/contract/env-vars.js +6 -0
  314. package/dist/cli/lib/contract/env-vars.js.map +1 -0
  315. package/dist/cli/lib/contract/foreign-credentials.d.ts +14 -27
  316. package/dist/cli/lib/contract/foreign-credentials.d.ts.map +1 -1
  317. package/dist/cli/lib/contract/foreign-credentials.js +19 -32
  318. package/dist/cli/lib/contract/foreign-credentials.js.map +1 -1
  319. package/dist/cli/lib/contract/logs.d.ts.map +1 -1
  320. package/dist/cli/lib/contract/logs.js +26 -34
  321. package/dist/cli/lib/contract/logs.js.map +1 -1
  322. package/dist/cli/lib/contract/managed-email.d.ts.map +1 -1
  323. package/dist/cli/lib/contract/managed-email.js +2 -3
  324. package/dist/cli/lib/contract/managed-email.js.map +1 -1
  325. package/dist/cli/lib/contract/permission-denied.d.ts +16 -0
  326. package/dist/cli/lib/contract/permission-denied.d.ts.map +1 -0
  327. package/dist/cli/lib/contract/permission-denied.js +20 -0
  328. package/dist/cli/lib/contract/permission-denied.js.map +1 -0
  329. package/dist/cli/lib/contract/project-grants.d.ts +16 -0
  330. package/dist/cli/lib/contract/project-grants.d.ts.map +1 -0
  331. package/dist/cli/lib/contract/project-grants.js +58 -0
  332. package/dist/cli/lib/contract/project-grants.js.map +1 -0
  333. package/dist/cli/lib/contract/projects.d.ts.map +1 -1
  334. package/dist/cli/lib/contract/projects.js +2 -3
  335. package/dist/cli/lib/contract/projects.js.map +1 -1
  336. package/dist/cli/lib/contract/public-error-details.d.ts.map +1 -1
  337. package/dist/cli/lib/contract/public-error-details.js +28 -43
  338. package/dist/cli/lib/contract/public-error-details.js.map +1 -1
  339. package/dist/cli/lib/contract/regions.js +2 -2
  340. package/dist/cli/lib/contract/regions.js.map +1 -1
  341. package/dist/cli/lib/contract/runtime-operations.d.ts +16 -0
  342. package/dist/cli/lib/contract/runtime-operations.d.ts.map +1 -1
  343. package/dist/cli/lib/contract/runtime-operations.js +16 -21
  344. package/dist/cli/lib/contract/runtime-operations.js.map +1 -1
  345. package/dist/cli/lib/contract/seeds.d.ts.map +1 -1
  346. package/dist/cli/lib/contract/seeds.js +12 -21
  347. package/dist/cli/lib/contract/seeds.js.map +1 -1
  348. package/dist/cli/lib/contract/source-disconnect-reasons.d.ts.map +1 -1
  349. package/dist/cli/lib/contract/source-disconnect-reasons.js +9 -17
  350. package/dist/cli/lib/contract/source-disconnect-reasons.js.map +1 -1
  351. package/dist/cli/lib/contract/source-repository.d.ts.map +1 -1
  352. package/dist/cli/lib/contract/source-repository.js +5 -9
  353. package/dist/cli/lib/contract/source-repository.js.map +1 -1
  354. package/dist/cli/lib/contract/wire-types.d.ts.map +1 -1
  355. package/dist/cli/lib/contract/wire-types.js +3 -8
  356. package/dist/cli/lib/contract/wire-types.js.map +1 -1
  357. package/dist/cli/lib/contract/wire-values.d.ts.map +1 -1
  358. package/dist/cli/lib/contract/wire-values.js +2 -3
  359. package/dist/cli/lib/contract/wire-values.js.map +1 -1
  360. package/dist/cli/lib/dotenv.d.ts +6 -0
  361. package/dist/cli/lib/dotenv.d.ts.map +1 -1
  362. package/dist/cli/lib/dotenv.js +62 -20
  363. package/dist/cli/lib/dotenv.js.map +1 -1
  364. package/dist/cli/lib/env-file.d.ts.map +1 -1
  365. package/dist/cli/lib/env-file.js +5 -11
  366. package/dist/cli/lib/env-file.js.map +1 -1
  367. package/dist/cli/lib/env-preflight.d.ts +6 -1
  368. package/dist/cli/lib/env-preflight.d.ts.map +1 -1
  369. package/dist/cli/lib/env-preflight.js +91 -63
  370. package/dist/cli/lib/env-preflight.js.map +1 -1
  371. package/dist/cli/lib/errors.d.ts +17 -49
  372. package/dist/cli/lib/errors.d.ts.map +1 -1
  373. package/dist/cli/lib/errors.js +47 -106
  374. package/dist/cli/lib/errors.js.map +1 -1
  375. package/dist/cli/lib/format.d.ts.map +1 -1
  376. package/dist/cli/lib/format.js +3 -5
  377. package/dist/cli/lib/format.js.map +1 -1
  378. package/dist/cli/lib/invocation.d.ts +4 -5
  379. package/dist/cli/lib/invocation.d.ts.map +1 -1
  380. package/dist/cli/lib/invocation.js +5 -33
  381. package/dist/cli/lib/invocation.js.map +1 -1
  382. package/dist/cli/lib/log-stream.d.ts.map +1 -1
  383. package/dist/cli/lib/log-stream.js +15 -23
  384. package/dist/cli/lib/log-stream.js.map +1 -1
  385. package/dist/cli/lib/logger.d.ts.map +1 -1
  386. package/dist/cli/lib/logger.js +7 -12
  387. package/dist/cli/lib/logger.js.map +1 -1
  388. package/dist/cli/lib/organization.d.ts.map +1 -1
  389. package/dist/cli/lib/organization.js +5 -13
  390. package/dist/cli/lib/organization.js.map +1 -1
  391. package/dist/cli/lib/project-link.d.ts.map +1 -1
  392. package/dist/cli/lib/project-link.js +2 -4
  393. package/dist/cli/lib/project-link.js.map +1 -1
  394. package/dist/cli/lib/resolve.d.ts +1 -6
  395. package/dist/cli/lib/resolve.d.ts.map +1 -1
  396. package/dist/cli/lib/resolve.js +26 -48
  397. package/dist/cli/lib/resolve.js.map +1 -1
  398. package/dist/cli/lib/source-repository-link.d.ts.map +1 -1
  399. package/dist/cli/lib/source-repository-link.js +6 -9
  400. package/dist/cli/lib/source-repository-link.js.map +1 -1
  401. package/dist/cli/lib/terminal-output.d.ts +4 -0
  402. package/dist/cli/lib/terminal-output.d.ts.map +1 -1
  403. package/dist/cli/lib/terminal-output.js +35 -18
  404. package/dist/cli/lib/terminal-output.js.map +1 -1
  405. package/dist/cli/lib/types.d.ts +3 -7
  406. package/dist/cli/lib/types.d.ts.map +1 -1
  407. package/dist/cli/lib/types.js.map +1 -1
  408. package/dist/cli/lib/utf8.d.ts +2 -0
  409. package/dist/cli/lib/utf8.d.ts.map +1 -0
  410. package/dist/cli/lib/utf8.js +12 -0
  411. package/dist/cli/lib/utf8.js.map +1 -0
  412. package/dist/cli/root-options.d.ts.map +1 -1
  413. package/dist/cli/root-options.js +11 -14
  414. package/dist/cli/root-options.js.map +1 -1
  415. package/dist/cli-plugin.d.ts.map +1 -1
  416. package/dist/cli-plugin.js +2 -6
  417. package/dist/cli-plugin.js.map +1 -1
  418. package/dist/cloud-config-module.js +2 -2
  419. package/dist/cloud-config-module.js.map +1 -1
  420. package/dist/dev/cli-host.d.ts.map +1 -1
  421. package/dist/dev/cli-host.js +16 -19
  422. package/dist/dev/cli-host.js.map +1 -1
  423. package/dist/dev/dashboard-vite-config.d.ts.map +1 -1
  424. package/dist/dev/dashboard-vite-config.js +17 -20
  425. package/dist/dev/dashboard-vite-config.js.map +1 -1
  426. package/dist/dev/dev-command.d.ts.map +1 -1
  427. package/dist/dev/dev-command.js +72 -55
  428. package/dist/dev/dev-command.js.map +1 -1
  429. package/dist/dev/dev-config.d.ts +3 -0
  430. package/dist/dev/dev-config.d.ts.map +1 -1
  431. package/dist/dev/dev-config.js +43 -13
  432. package/dist/dev/dev-config.js.map +1 -1
  433. package/dist/dev/dev-migrate.js +7 -11
  434. package/dist/dev/dev-migrate.js.map +1 -1
  435. package/dist/dev/dev-process.d.ts.map +1 -1
  436. package/dist/dev/dev-process.js +6 -10
  437. package/dist/dev/dev-process.js.map +1 -1
  438. package/dist/dev/dev-server.js +7 -9
  439. package/dist/dev/dev-server.js.map +1 -1
  440. package/dist/dev/dev-worker.js +5 -3
  441. package/dist/dev/dev-worker.js.map +1 -1
  442. package/dist/dev/local-services.d.ts.map +1 -1
  443. package/dist/dev/local-services.js +163 -106
  444. package/dist/dev/local-services.js.map +1 -1
  445. package/dist/dev/project-layout.d.ts.map +1 -1
  446. package/dist/dev/project-layout.js +12 -17
  447. package/dist/dev/project-layout.js.map +1 -1
  448. package/dist/dev/project-plugin-scope.d.ts +2 -0
  449. package/dist/dev/project-plugin-scope.d.ts.map +1 -0
  450. package/dist/dev/project-plugin-scope.js +38 -0
  451. package/dist/dev/project-plugin-scope.js.map +1 -0
  452. package/dist/entrypoint.js +2 -0
  453. package/dist/entrypoint.js.map +1 -1
  454. package/dist/index.d.ts.map +1 -1
  455. package/dist/index.js +3 -6
  456. package/dist/index.js.map +1 -1
  457. package/dist/local-asset-server.d.ts.map +1 -1
  458. package/dist/local-asset-server.js +7 -13
  459. package/dist/local-asset-server.js.map +1 -1
  460. package/dist/local-cache-plugin.d.ts.map +1 -1
  461. package/dist/local-cache-plugin.js +20 -28
  462. package/dist/local-cache-plugin.js.map +1 -1
  463. package/dist/local-cache.d.ts.map +1 -1
  464. package/dist/local-cache.js +40 -55
  465. package/dist/local-cache.js.map +1 -1
  466. package/dist/local-core.d.ts.map +1 -1
  467. package/dist/local-core.js +3 -5
  468. package/dist/local-core.js.map +1 -1
  469. package/dist/local-dashboard-plugin.d.ts.map +1 -1
  470. package/dist/local-dashboard-plugin.js +6 -11
  471. package/dist/local-dashboard-plugin.js.map +1 -1
  472. package/dist/local-database.d.ts.map +1 -1
  473. package/dist/local-database.js +20 -23
  474. package/dist/local-database.js.map +1 -1
  475. package/dist/local-durable-execution-plugin.d.ts +12 -0
  476. package/dist/local-durable-execution-plugin.d.ts.map +1 -1
  477. package/dist/local-durable-execution-plugin.js +296 -24
  478. package/dist/local-durable-execution-plugin.js.map +1 -1
  479. package/dist/local-runtime-guard.d.ts +2 -0
  480. package/dist/local-runtime-guard.d.ts.map +1 -1
  481. package/dist/local-runtime-guard.js +40 -3
  482. package/dist/local-runtime-guard.js.map +1 -1
  483. package/dist/local-runtime.d.ts.map +1 -1
  484. package/dist/local-runtime.js +51 -48
  485. package/dist/local-runtime.js.map +1 -1
  486. package/package.json +16 -9
  487. package/dist/cli/commands/identity-context/login.d.ts +0 -2
  488. package/dist/cli/commands/identity-context/login.d.ts.map +0 -1
  489. package/dist/cli/commands/identity-context/login.js +0 -158
  490. package/dist/cli/commands/identity-context/login.js.map +0 -1
  491. package/dist/cli/commands/identity-context/logout.d.ts +0 -2
  492. package/dist/cli/commands/identity-context/logout.d.ts.map +0 -1
  493. package/dist/cli/commands/identity-context/logout.js +0 -11
  494. package/dist/cli/commands/identity-context/logout.js.map +0 -1
  495. package/dist/cli/commands/identity-context/org-switch.d.ts +0 -3
  496. package/dist/cli/commands/identity-context/org-switch.d.ts.map +0 -1
  497. package/dist/cli/commands/identity-context/org-switch.js +0 -83
  498. package/dist/cli/commands/identity-context/org-switch.js.map +0 -1
  499. package/dist/cli/commands/identity-context/whoami.d.ts +0 -3
  500. package/dist/cli/commands/identity-context/whoami.d.ts.map +0 -1
  501. package/dist/cli/commands/identity-context/whoami.js +0 -101
  502. package/dist/cli/commands/identity-context/whoami.js.map +0 -1
  503. package/dist/cli/lib/console-credential.d.ts +0 -55
  504. package/dist/cli/lib/console-credential.d.ts.map +0 -1
  505. package/dist/cli/lib/console-credential.js +0 -164
  506. package/dist/cli/lib/console-credential.js.map +0 -1
  507. package/dist/cli/lib/console-origins.d.ts +0 -30
  508. package/dist/cli/lib/console-origins.d.ts.map +0 -1
  509. package/dist/cli/lib/console-origins.js +0 -87
  510. package/dist/cli/lib/console-origins.js.map +0 -1
  511. package/dist/cli/lib/console-session-lock.d.ts +0 -39
  512. package/dist/cli/lib/console-session-lock.d.ts.map +0 -1
  513. package/dist/cli/lib/console-session-lock.js +0 -235
  514. package/dist/cli/lib/console-session-lock.js.map +0 -1
  515. package/dist/cli/lib/console-session.d.ts +0 -47
  516. package/dist/cli/lib/console-session.d.ts.map +0 -1
  517. package/dist/cli/lib/console-session.js +0 -235
  518. package/dist/cli/lib/console-session.js.map +0 -1
  519. package/dist/cli/lib/file-lock.d.ts +0 -23
  520. package/dist/cli/lib/file-lock.d.ts.map +0 -1
  521. package/dist/cli/lib/file-lock.js +0 -121
  522. package/dist/cli/lib/file-lock.js.map +0 -1
@@ -1,20 +1,20 @@
1
1
  import * as prompts from "@clack/prompts";
2
- import { cloudInvocation, createAuthenticatedClient, formatBytes, formatDateTime, formatTable, requiredArgument, resolveEnvironment, sleep, } from "../../index.js";
2
+ import { CLOUD_INVOCATION, createAuthenticatedClient, formatBytes, formatDateTime, formatTable, output, requiredArgument, resolveEnvironment, sleep, } from "../../index.js";
3
3
  import { describeBackupScheduleExclusion } from "../../lib/contract/backup-schedule-reasons.js";
4
4
  import { DB_OPERATION_FAILED_STATUSES, DB_OPERATION_SUCCESS_STATUS, } from "../../lib/contract/database.js";
5
5
  const POLL_INTERVAL_MS = 3_000;
6
- // Matches the worker's measured-size ceiling. Large logical dumps are hours-long work; the former
7
- // 15-minute provider placeholder made the CLI give up while a healthy dump was still running.
6
+ // Matches the worker's measured-size ceiling. Large logical dumps take hours; a 15-minute ceiling
7
+ // made the CLI give up while a healthy dump was still running.
8
8
  const TIMEOUT_MS = 12 * 60 * 60 * 1000;
9
9
  export async function createBackup({ options, globals, }) {
10
10
  // `--no-wait` is a negated boolean, so the host's Commander gives `wait` and defaults it to true.
11
11
  const wait = options.wait !== false;
12
12
  const { project, environment } = await resolveEnvironment(globals);
13
- const client = createAuthenticatedClient(globals);
13
+ const client = await createAuthenticatedClient(globals);
14
14
  const backup = await client.post(`/environments/${environment.id}/database/backups`);
15
15
  if (!wait) {
16
- prompts.log.success(`Backup ${backup.id} started.`);
17
- prompts.log.info(`Check progress with \`${cloudInvocation()} backup db status ${backup.id}\`.`);
16
+ output.success(`Backup ${backup.id} started.`);
17
+ output.info(`Check progress with \`${CLOUD_INVOCATION} backup db status ${backup.id}\`.`);
18
18
  return undefined;
19
19
  }
20
20
  const spinner = prompts.spinner();
@@ -25,7 +25,7 @@ export async function createBackup({ options, globals, }) {
25
25
  !DB_OPERATION_FAILED_STATUSES.has(current.status)) {
26
26
  if (Date.now() - startTime > TIMEOUT_MS) {
27
27
  spinner.stop("Backup is taking longer than expected");
28
- prompts.log.warn(`Backup ${backup.id} did not complete within 12 hours. Check progress with \`${cloudInvocation()} backup db status ${backup.id}\`.`);
28
+ output.warn(`Backup ${backup.id} did not complete within 12 hours. Check progress with \`${CLOUD_INVOCATION} backup db status ${backup.id}\`.`);
29
29
  return 1;
30
30
  }
31
31
  await sleep(POLL_INTERVAL_MS);
@@ -33,24 +33,24 @@ export async function createBackup({ options, globals, }) {
33
33
  }
34
34
  if (current.status === DB_OPERATION_SUCCESS_STATUS) {
35
35
  spinner.stop("Backup complete.");
36
- prompts.log.success(`Backup ${current.id} completed.`);
36
+ output.success(`Backup ${current.id} completed.`);
37
37
  return undefined;
38
38
  }
39
39
  spinner.stop("Backup failed");
40
- prompts.log.error(`Backup ${current.id} ended with status "${current.status}".`);
40
+ output.error(`Backup ${current.id} ended with status "${current.status}".`);
41
41
  if (current.errorDetails)
42
- prompts.log.error(current.errorDetails);
42
+ output.error(current.errorDetails);
43
43
  return 1;
44
44
  }
45
45
  export async function listBackups({ globals }) {
46
46
  const { environment } = await resolveEnvironment(globals);
47
- const client = createAuthenticatedClient(globals);
47
+ const client = await createAuthenticatedClient(globals);
48
48
  const spinner = prompts.spinner();
49
49
  spinner.start("Fetching backups...");
50
50
  const backups = await client.get(`/environments/${environment.id}/database/backups`);
51
51
  spinner.stop("Done.");
52
52
  if (backups.length === 0) {
53
- prompts.log.info(`No backups yet. Create one with \`${cloudInvocation()} backup db\`.`);
53
+ output.info(`No backups yet. Create one with \`${CLOUD_INVOCATION} backup db\`.`);
54
54
  return;
55
55
  }
56
56
  // No ANSI anywhere in here: clack's note box measures string width to draw its border, and colour
@@ -67,9 +67,8 @@ export async function listBackups({ globals }) {
67
67
  // would put trailing space on every other row.
68
68
  restored: backup.lastRestoredAt ? `(restored ${formatDateTime(backup.lastRestoredAt)})` : "",
69
69
  }));
70
- // `formatTable` pads every column to its widest value, the last one included, so appending the
71
- // suffix to a finished line puts it in the same place on every row. Ids vary in length and cannot
72
- // be truncated — the full id is what `restore db` takes.
70
+ // `formatTable` pads every column to its widest value, so appending the suffix to a finished line
71
+ // aligns it on every row. Ids cannot be truncated: `restore db` takes the full id.
73
72
  const lines = formatTable(["ID", "KIND", "STATUS", "CREATED", "SIZE"], rows.map((row) => row.columns))
74
73
  .split("\n")
75
74
  .map((line, index) => {
@@ -77,18 +76,17 @@ export async function listBackups({ globals }) {
77
76
  const restored = index === 0 ? "" : rows[index - 1].restored;
78
77
  return restored ? `${line} ${restored}` : line;
79
78
  });
80
- prompts.note(lines.join("\n"), `Backups: ${environment.slug}`);
81
- // The reason a backup failed is a sentence rather than a column, so it is shown by `status`
82
- // rather than wrapped into this table.
79
+ output.note(lines.join("\n"), `Backups: ${environment.slug}`);
80
+ // The reason a backup failed is a sentence, shown by `status`, not a column here.
83
81
  if (backups.some((b) => b.errorDetails)) {
84
- prompts.log.info(`See why a backup failed with \`${cloudInvocation()} backup db status <backup-id>\`.`);
82
+ output.info(`See why a backup failed with \`${CLOUD_INVOCATION} backup db status <backup-id>\`.`);
85
83
  }
86
- prompts.log.info(`Restore with \`${cloudInvocation()} restore db <backup-id>\`.`);
84
+ output.info(`Restore with \`${CLOUD_INVOCATION} restore db <backup-id>\`.`);
87
85
  }
88
86
  export async function showBackupStatus({ args, globals }) {
89
87
  const backupId = requiredArgument(args, 0, "backup-id");
90
88
  const { environment } = await resolveEnvironment(globals);
91
- const client = createAuthenticatedClient(globals);
89
+ const client = await createAuthenticatedClient(globals);
92
90
  const backup = await client.get(`/environments/${environment.id}/database/backups/${encodeURIComponent(backupId)}`);
93
91
  const lines = [
94
92
  ` status: ${backup.status}`,
@@ -101,31 +99,31 @@ export async function showBackupStatus({ args, globals }) {
101
99
  ...(backup.errorDetails ? [` reason: ${backup.errorDetails}`] : []),
102
100
  ...(backup.lastRestoredAt ? [` restored: ${formatDateTime(backup.lastRestoredAt)}`] : []),
103
101
  ];
104
- prompts.note(lines.join("\n"), `Backup ${backup.id}`);
102
+ output.note(lines.join("\n"), `Backup ${backup.id}`);
105
103
  }
106
104
  export async function showBackupSchedule({ globals }) {
107
105
  const { environment } = await resolveEnvironment(globals);
108
- const client = createAuthenticatedClient(globals);
106
+ const client = await createAuthenticatedClient(globals);
109
107
  const schedule = await client.get(`/environments/${environment.id}/database/backup-schedule`);
110
108
  if (!schedule.scheduled) {
111
- prompts.log.info(describeBackupScheduleExclusion(schedule.reason));
112
- // The next step differs by case, which is why the wire carries a code. An environment with no
113
- // provisioned database cannot be backed up by hand either — the platform refuses that and records
114
- // a failed backup — so it is told to deploy instead.
115
- prompts.log.info(schedule.reason === "not-deployed"
116
- ? `Deploy it with \`${cloudInvocation()} deploy\`.`
117
- : `Take a backup now with \`${cloudInvocation()} backup db\`.`);
109
+ output.info(describeBackupScheduleExclusion(schedule.reason));
110
+ // The next step differs by case, hence the wire code. An environment with no provisioned
111
+ // database cannot be backed up by hand either (the platform refuses and records a failed
112
+ // backup), so it is told to deploy.
113
+ output.info(schedule.reason === "not-deployed"
114
+ ? `Deploy it with \`${CLOUD_INVOCATION} deploy\`.`
115
+ : `Take a backup now with \`${CLOUD_INVOCATION} backup db\`.`);
118
116
  return;
119
117
  }
120
- prompts.note(formatTable(["SCHEDULE", "RUNS", "KEPT FOR"], schedule.entries.map(scheduleRow)), `Backup schedule: ${environment.slug}`);
118
+ output.note(formatTable(["SCHEDULE", "RUNS", "KEPT FOR"], schedule.entries.map(scheduleRow)), `Backup schedule: ${environment.slug}`);
121
119
  // A run the platform skipped leaves a gap in the list, and a customer who was told only when
122
120
  // backups are taken reads that gap as a missed backup.
123
- prompts.log.info("A scheduled run is skipped when the database has had no writes since its previous run, and the skipped run is recorded with its reason.");
124
- prompts.log.info("These times are when backups are taken and how long each one is kept. They are not a guarantee of how much data a restore recovers or how long a restore takes.");
125
- prompts.log.info(`List the backups themselves with \`${cloudInvocation()} backup db list\`.`);
121
+ output.info("A scheduled run is skipped when the database has had no writes since its previous run, and the skipped run is recorded with its reason.");
122
+ output.info("These times are when backups are taken and how long each one is kept. They are not a guarantee of how much data a restore recovers or how long a restore takes.");
123
+ output.info(`List the backups themselves with \`${CLOUD_INVOCATION} backup db list\`.`);
126
124
  }
127
- // The tier leads the row, because it is what `backup db status` prints as a backup's `schedule` and
128
- // a customer holding one has to be able to find it here.
125
+ // The tier leads the row because `backup db status` prints it as a backup's `schedule`, and a
126
+ // customer holding one has to find it here.
129
127
  function scheduleRow(entry) {
130
128
  const when = entry.day === null ? "Every day" : `Every ${entry.day}`;
131
129
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"backup.js","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/backup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAEL,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,EAGL,4BAA4B,EAC5B,2BAA2B,GAE5B,MAAM,gCAAgC,CAAC;AAExC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,kGAAkG;AAClG,8FAA8F;AAC9F,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,YAAY,CAA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AAG,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;AAC3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/index.ts"],"names":[],"mappings":"AAuKA,eAAO,MAAM,YAAY,qDA2CvB,CAAC;AAEH,eAAO,MAAM,mBAAmB,uDAK/B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/index.ts"],"names":[],"mappings":"AAwKA,eAAO,MAAM,YAAY,qDA2CvB,CAAC;AAEH,eAAO,MAAM,mBAAmB,uDAK/B,CAAC"}
@@ -3,22 +3,20 @@ import { defineCloudCommand, defineCloudCommandGroup, } from "../../command.js";
3
3
  // the VC Runtime Operations behind `resource`, and the database backup, restore and tunnel
4
4
  // commands. `seedCommands` is declared here too and left unregistered; its declaration says why.
5
5
  //
6
- // This module declares the tree and nothing else. Every `run` reaches its implementation through
7
- // `await import(...)`, so the Vendure CLI host — which `require`s the plugin on every `vendure`
8
- // invocation, including the ones with nothing to do with Cloud — pays for this file and
9
- // `../../command.js`, not for the authentication stack, `zod` or `@clack/prompts` behind them.
10
- // `../../lib/contract/seeds.js` imports `zod`, which is the specific reason the seed commands
6
+ // This module declares the tree only. Every `run` reaches its implementation through `await
7
+ // import(...)`, so the Vendure CLI host, which `require`s the plugin on every `vendure` invocation,
8
+ // pays for this file and `../../command.js`, not for the authentication stack, `zod` or
9
+ // `@clack/prompts` behind them. `../../lib/contract/seeds.js` imports `zod`, so the seed commands
11
10
  // cannot be reached from here at module scope.
12
11
  //
13
12
  // `test/cli-published-surface.test.ts` holds that line by walking the static graph from
14
13
  // `cli-plugin.ts`, which reaches this file through the assembled inventory.
15
14
  //
16
- // The commands are in the order `vcloud` registered them, so `vendure --help` lists them the way
17
- // `vcloud --help` did. The host has no equivalent of Commander's help groups, so the order is all
18
- // that survives of that grouping.
15
+ // The host has no equivalent of Commander's help groups, so command order keeps related entries
16
+ // together.
19
17
  //
20
- // `deploy`, `status`, `logs` and `rollback` are not part of this family. They read a VC Deployment
21
- // rather than operate a resource, and CLO-688 owns them.
18
+ // `deploy`, `status`, `logs` and `rollback` read a VC Deployment instead of operating a resource;
19
+ // CLO-688 owns them.
22
20
  const resourceCommands = defineCloudCommandGroup({
23
21
  name: "resource",
24
22
  description: "Inspect and control environment resources",
@@ -37,18 +35,22 @@ const resourceCommands = defineCloudCommandGroup({
37
35
  arguments: [{ name: "resource", description: "Managed resource key", required: true }],
38
36
  run: async (input) => (await import("./resource.js")).showResource(input),
39
37
  }),
38
+ defineCloudCommand({
39
+ name: "operation",
40
+ description: "Show the status of a stop, start or restart operation",
41
+ arguments: [{ name: "operation-id", description: "Operation id", required: true }],
42
+ run: async (input) => (await import("./resource.js")).showResourceOperation(input),
43
+ }),
40
44
  ],
41
45
  });
42
- // `backup db` both runs a backup and carries `list` and `status` beneath it, which is the shape
43
- // `vcloud backup db` has always had. The host registers it as a runnable parent: `backup db` backs
44
- // up, `backup db list` and `backup db status` run these, and a word that is neither is refused as
45
- // an unknown command rather than falling through into a backup.
46
+ // `backup db` runs a backup and carries `list` and `status` beneath it. The host registers it as a
47
+ // runnable parent: `backup db` backs up, `backup db list` and `backup db status` run these, and any
48
+ // other word is refused as an unknown command.
46
49
  //
47
- // That refusal depends on `backup db` declaring no positional argument, and it must not gain one.
48
- // A runnable parent hands a token that falls inside one of its own declared slots to the action as
49
- // a value, so a parent with a slot to fill could take `lst` for data rather than for a misspelled
50
- // `list`. This one has no slot, so every operand it is given is spare. The host also refuses a node
51
- // declaring both positional arguments and subcommands outright, at plugin load.
50
+ // That refusal depends on `backup db` declaring no positional argument. A runnable parent hands a
51
+ // token inside one of its declared slots to the action as a value, so a parent with a slot could
52
+ // take `lst` as data for a misspelled `list`. The host also refuses a node declaring both
53
+ // positional arguments and subcommands at plugin load.
52
54
  const backupSubcommands = [
53
55
  defineCloudCommand({
54
56
  name: "list",
@@ -71,8 +73,8 @@ const backupCommands = defineCloudCommandGroup({
71
73
  name: "backup",
72
74
  description: "Back up an environment resource",
73
75
  subcommands: [
74
- // Composed rather than declared through one helper: `defineCloudCommand` builds the runnable
75
- // half, and the subcommands are attached to it. The host's own node type carries both.
76
+ // `defineCloudCommand` builds the runnable half and the subcommands are attached to it; the
77
+ // host's node type carries both.
76
78
  {
77
79
  ...defineCloudCommand({
78
80
  name: "db",
@@ -105,9 +107,9 @@ const restoreCommands = defineCloudCommandGroup({
105
107
  ],
106
108
  options: [
107
109
  {
108
- // `required` is about the value, as it is on `tunnel db --port`: it keeps the host
109
- // emitting `--from <environment>`, so `--from` with nothing after it stays an error
110
- // rather than resolving to the environment being overwritten.
110
+ // `required` is about the value, as on `tunnel db --port`: it keeps the host emitting
111
+ // `--from <environment>`, so `--from` with nothing after it stays an error and does not
112
+ // resolve to the environment being overwritten.
111
113
  long: "--from <environment>",
112
114
  description: "Restore a backup taken from another environment in the same project. Defaults to the environment being restored into.",
113
115
  required: true,
@@ -130,8 +132,8 @@ const tunnelCommands = defineCloudCommandGroup({
130
132
  description: "Open a local tunnel to the environment database",
131
133
  options: [
132
134
  {
133
- // `required` is about the value: it keeps the host emitting `--port <port>` rather than
134
- // `--port [port]`, so `--port` with nothing after it stays the error it is under `vcloud`.
135
+ // `required` is about the value: it keeps the host emitting `--port <port>` and not
136
+ // `--port [port]`, so `--port` with nothing after it remains a missing-value error.
135
137
  long: "--port <port>",
136
138
  description: "Local port to listen on (defaults to 5432, falls back to a free port)",
137
139
  required: true,
@@ -142,15 +144,14 @@ const tunnelCommands = defineCloudCommandGroup({
142
144
  ],
143
145
  });
144
146
  // `runtimeDataCommands` below omits this group, so no entry point assembles a `seed` command and
145
- // both parsers refuse the word. Nothing takes its place: a stub answering "not available yet"
146
- // would tell a customer the capability exists, which Closed Beta does not.
147
+ // both parsers refuse the word. A stub answering "not available yet" would tell a customer the
148
+ // capability exists, which Closed Beta does not.
147
149
  //
148
- // The declarations stay because CLO-661 hydrates a pull-request preview environment from a named
149
- // seed, and CLO-774 delivers that capability. The `await import(...)` calls below are what keep
150
- // `./seeds.js` in the bundler's graph; the export is what lets
150
+ // CLO-774 revives the group: CLO-661 hydrates a pull-request preview environment from a named seed.
151
+ // The `await import(...)` calls keep `./seeds.js` in the bundler's graph. The export lets
151
152
  // `test/cli-runtime-data-support.ts` reach the group, so `test/cli-runtime-data-seeds.test.ts`
152
- // keeps exercising the four implementations. Registering it again means more than adding it back
153
- // to the array, and that support module throws to name what else has to move.
153
+ // keeps exercising the four implementations. That support module throws to name what else has to
154
+ // move to register the group again.
154
155
  export const seedCommands = defineCloudCommandGroup({
155
156
  name: "seed",
156
157
  description: "Manage named seed datasets",
@@ -201,13 +202,11 @@ export const runtimeDataCommands = [
201
202
  tunnelCommands,
202
203
  ];
203
204
  // The three VC Runtime Operations differ only in the action they start and the words around it, so
204
- // they are declared once. The `[resources...]` argument is optional and variadic: it arrives as the
205
- // whole collected vector, and as `[]` when the customer named no resource, which is what
206
- // `resource.ts` reads as "all managed resources".
205
+ // they are declared once. The `[resources...]` argument is optional and variadic: it arrives as
206
+ // `[]` when the customer named no resource, which `resource.ts` reads as "all managed resources".
207
207
  //
208
- // The return type is read off `defineCloudCommand` rather than named, because naming it means
209
- // importing it from `@vendure/cli`, and resolving the host is one of the costs this module exists
210
- // to avoid.
208
+ // The return type is inferred from `defineCloudCommand`; naming it needs an import from
209
+ // `@vendure/cli`, and resolving the host is one of the costs this module avoids.
211
210
  function runtimeOperation(name, description) {
212
211
  return defineCloudCommand({
213
212
  name,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,kGAAkG;AAClG,2FAA2F;AAC3F,iGAAiG;AACjG,EAAE;AACF,iGAAiG;AACjG,gGAAgG;AAChG,wFAAwF;AACxF,+FA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CAA4C;YACzD,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACjF,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;YACzE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;SACrE,CAAC;KACH;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,cAAc;CACf,CAAC;AAEF,mGAAmG;AACnG,oGAAoG;AACpG,yFAAyF;AACzF,kDAAkD;AAClD,EAAE;AACF,8FAA8F;AAC9F,kGAAkG;AAClG,YAAY;AACZ,SAAS,gBAAgB,CACvB,IAAkC,EAClC,WAAmB;IAEnB,OAAO,kBAAkB,CAAC;QACxB,IAAI;QACJ,WAAW;QACX,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE,0DAA0D;aACxE;SACF;QACD,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,yCAAyC,EAAE;YACzE,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,IAAI,qBAAqB,EAAE;SAC3E;QACD,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC;KACxF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,kBAAkB,CAA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E;SAC3E;QACD,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC;KACxF,CAAC,CAAC;AACL,CAAC"}
@@ -5,6 +5,7 @@ declare const OPERATION_ACTIONS: {
5
5
  readonly restart: "RESTART";
6
6
  };
7
7
  export declare function runResourceOperation({ args, options, globals }: CloudCommandInput, name: keyof typeof OPERATION_ACTIONS): Promise<number | undefined>;
8
+ export declare function showResourceOperation({ args, globals, }: CloudCommandInput): Promise<number | undefined>;
8
9
  export declare function listResources({ globals }: CloudCommandInput): Promise<void>;
9
10
  export declare function showResource({ args, globals }: CloudCommandInput): Promise<void>;
10
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/resource.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAQvB,MAAM,gBAAgB,CAAC;AAoBxB,QAAA,MAAM,iBAAiB;;;;CAIb,CAAC;AAEX,wBAAsB,oBAAoB,CACxC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,iBAAiB,EAC7C,IAAI,EAAE,MAAM,OAAO,iBAAiB,GACnC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA0D7B;AAED,wBAAsB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAajF;AAED,wBAAsB,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBtF"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/runtime-data/resource.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,iBAAiB,EAQvB,MAAM,gBAAgB,CAAC;AAuCxB,QAAA,MAAM,iBAAiB;;;;CAIb,CAAC;AAEX,wBAAsB,oBAAoB,CACxC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,iBAAiB,EAC7C,IAAI,EAAE,MAAM,OAAO,iBAAiB,GACnC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgE7B;AAuCD,wBAAsB,qBAAqB,CAAC,EAC1C,IAAI,EACJ,OAAO,GACR,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAQjD;AAED,wBAAsB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjF;AAED,wBAAsB,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBtF"}
@@ -1,14 +1,24 @@
1
1
  import * as prompts from "@clack/prompts";
2
- import { cloudInvocation, createAuthenticatedClient, requiredArgument, resolveEnvironment, sleep, variadicArgument, writeJson, } from "../../index.js";
3
- import { RUNTIME_OPERATION_TIMEOUT_MS, RuntimeOperationAction, RuntimeOperationStatus, isTerminalRuntimeOperationStatus, } from "../../lib/contract/runtime-operations.js";
2
+ import { z } from "zod";
3
+ import { CLOUD_INVOCATION, createAuthenticatedClient, output, requiredArgument, resolveEnvironment, sleep, variadicArgument, writeJson, } from "../../index.js";
4
+ import { RUNTIME_OPERATION_TIMEOUT_MS, RUNTIME_SERVICE_KEYS, RuntimeOperationAction, RuntimeOperationStatus, RuntimeOperationWarningCode, isTerminalRuntimeOperationStatus, } from "../../lib/contract/runtime-operations.js";
4
5
  const POLL_INTERVAL_MS = 3_000;
5
- // `vcloud` kept its own terminal-status set and its own fifteen-minute ceiling, both identical to
6
- // the shared ones. `isTerminalRuntimeOperationStatus` is the contract's own guard over
7
- // `TERMINAL_RUNTIME_OPERATION_STATUSES`, so following an operation and giving up on one are both
8
- // read from the contract rather than from a copy that would keep polling forever if a status were
9
- // added. The ceiling is quoted in the sentence a customer reads, which is where a copy would show.
10
- // Which action each command name starts. Declared here rather than in the command tree so the
11
- // declaration module does not reach the contract, which is where `zod` starts.
6
+ const STOP_BILLING_NOTICE = "Stopping keeps this environment's database, assets and configuration. Its subscription and the resources it keeps remain billable while it is stopped. Stopping does not cancel the subscription.";
7
+ const INTERRUPTION_FALLBACK_WARNING = "Vendure Cloud could not list what this operation interrupts. A restart can interrupt requests in progress and background jobs, and a stop takes the selected services offline until they are started.";
8
+ const preflightSchema = z.object({
9
+ action: z.enum(RuntimeOperationAction),
10
+ resources: z.array(z.enum(RUNTIME_SERVICE_KEYS)),
11
+ warnings: z.array(z.object({
12
+ code: z.enum(RuntimeOperationWarningCode),
13
+ resource: z.enum(RUNTIME_SERVICE_KEYS),
14
+ message: z.string().min(1),
15
+ })),
16
+ });
17
+ // `isTerminalRuntimeOperationStatus` is the contract's guard over
18
+ // `TERMINAL_RUNTIME_OPERATION_STATUSES`; a local copy would keep polling forever if a status were
19
+ // added. The ceiling is quoted in the sentence a customer reads.
20
+ // Which action each command name starts. Declared here so the declaration module does not reach the
21
+ // contract, where `zod` starts.
12
22
  const OPERATION_ACTIONS = {
13
23
  stop: RuntimeOperationAction.STOP,
14
24
  start: RuntimeOperationAction.START,
@@ -18,7 +28,7 @@ export async function runResourceOperation({ args, options, globals }, name) {
18
28
  const action = OPERATION_ACTIONS[name];
19
29
  const resources = variadicArgument(args, 0, "resources");
20
30
  // `--no-wait` is a negated boolean, so the host's Commander gives `wait` and defaults it to true.
21
- // Anything other than the flag having been given reads as waiting, which is what `vcloud` did.
31
+ // Anything other than the flag having been given reads as waiting.
22
32
  const wait = options.wait !== false;
23
33
  const skipConfirmation = options.yes === true;
24
34
  const { project, environment } = await resolveEnvironment(globals);
@@ -28,6 +38,15 @@ export async function runResourceOperation({ args, options, globals }, name) {
28
38
  if (json && requiresConfirmation && !skipConfirmation) {
29
39
  throw new Error("--json requires --yes for production stop and restart commands.");
30
40
  }
41
+ const client = await createAuthenticatedClient(globals);
42
+ // Before the confirmation, so the customer reads them while deciding. Start interrupts nothing.
43
+ if (!json && action !== RuntimeOperationAction.START) {
44
+ const warnings = await interruptionWarnings(client, environment.id, action, resources);
45
+ if (action === RuntimeOperationAction.STOP)
46
+ output.warn(STOP_BILLING_NOTICE);
47
+ for (const warning of warnings)
48
+ output.warn(warning);
49
+ }
31
50
  if (requiresConfirmation && !skipConfirmation) {
32
51
  const verb = action.toLowerCase();
33
52
  const confirmed = await prompts.confirm({
@@ -39,10 +58,9 @@ export async function runResourceOperation({ args, options, globals }, name) {
39
58
  return undefined;
40
59
  }
41
60
  }
42
- const client = createAuthenticatedClient(globals);
43
61
  let operation = await client.post(`/environments/${environment.id}/resource-operations`, { action, ...(resources.length > 0 ? { resources } : {}) });
44
62
  if (!wait || isTerminalRuntimeOperationStatus(operation.status)) {
45
- return outputOperation(operation, json, project.slug, environment.slug);
63
+ return outputOperation(operation, json, project.slug, environment.slug, true);
46
64
  }
47
65
  const spinner = json ? null : prompts.spinner();
48
66
  spinner?.start(`${titleCase(action.toLowerCase())} in progress...`);
@@ -50,10 +68,10 @@ export async function runResourceOperation({ args, options, globals }, name) {
50
68
  while (!isTerminalRuntimeOperationStatus(operation.status)) {
51
69
  if (Date.now() - startedAt > RUNTIME_OPERATION_TIMEOUT_MS) {
52
70
  spinner?.stop("Resource operation is still running.");
53
- const message = `Resource operation ${operation.id} is still running in the background after ${RUNTIME_OPERATION_TIMEOUT_MS / 60_000} minutes. Use ${cloudInvocation()} resource list to check current state.`;
71
+ const message = `Resource operation ${operation.id} is still running in the background after ${RUNTIME_OPERATION_TIMEOUT_MS / 60_000} minutes. Use ${statusCommand(operation.id, project.slug, environment.slug)} to check its status.`;
54
72
  if (json)
55
73
  throw new Error(message);
56
- prompts.log.warn(message);
74
+ output.warn(message);
57
75
  return 1;
58
76
  }
59
77
  await sleep(POLL_INTERVAL_MS);
@@ -61,57 +79,93 @@ export async function runResourceOperation({ args, options, globals }, name) {
61
79
  spinner?.message(operation.status.toLowerCase());
62
80
  }
63
81
  spinner?.stop(runtimeCompletionMessage(operation));
64
- return outputOperation(operation, json, project.slug, environment.slug);
82
+ return outputOperation(operation, json, project.slug, environment.slug, false);
83
+ }
84
+ // Advisory: a failed read, or an answer that is malformed or about a different operation, prints
85
+ // the conservative warning and leaves the operation request to decide.
86
+ async function interruptionWarnings(client, environmentId, action, resources) {
87
+ const query = new URLSearchParams({ action });
88
+ if (resources.length > 0)
89
+ query.set("resources", resources.join(","));
90
+ const answer = preflightSchema.safeParse(await client
91
+ .get(`/environments/${environmentId}/resource-operations/preflight?${query}`)
92
+ .catch(() => null));
93
+ const selected = resources.length > 0 ? resources : RUNTIME_SERVICE_KEYS;
94
+ return answer.success && describesOperation(answer.data, action, selected)
95
+ ? answer.data.warnings.map((warning) => warning.message)
96
+ : [INTERRUPTION_FALLBACK_WARNING];
97
+ }
98
+ // The answer names this action and exactly the selected services, and warns only about them.
99
+ function describesOperation(answer, action, selected) {
100
+ const answered = new Set(answer.resources);
101
+ return (answer.action === action &&
102
+ answered.size === answer.resources.length &&
103
+ answered.size === new Set(selected).size &&
104
+ answer.resources.every((resource) => selected.includes(resource)) &&
105
+ answer.warnings.every((warning) => answered.has(warning.resource)));
106
+ }
107
+ export async function showResourceOperation({ args, globals, }) {
108
+ const operationId = requiredArgument(args, 0, "operation-id");
109
+ const { project, environment } = await resolveEnvironment(globals);
110
+ const client = await createAuthenticatedClient(globals);
111
+ const operation = await client.get(`/environments/${environment.id}/resource-operations/${encodeURIComponent(operationId)}`);
112
+ return outputOperation(operation, globals.json === true, project.slug, environment.slug, false);
65
113
  }
66
114
  export async function listResources({ globals }) {
67
115
  const { environment } = await resolveEnvironment(globals);
68
- const resources = await createAuthenticatedClient(globals).get(`/environments/${environment.id}/resources`);
116
+ const client = await createAuthenticatedClient(globals);
117
+ const resources = await client.get(`/environments/${environment.id}/resources`);
69
118
  if (globals.json === true) {
70
119
  writeJson(resources);
71
120
  return;
72
121
  }
73
122
  for (const resource of resources) {
74
123
  const health = resource.health ? ` / ${resource.health}` : "";
75
- prompts.log.info(`${resource.name} — ${resource.category} — ${resource.runtimeState}${health}`);
124
+ output.info(`${resource.name} — ${resource.category} — ${resource.runtimeState}${health}`);
76
125
  }
77
126
  }
78
127
  export async function showResource({ args, globals }) {
79
128
  const resourceKey = requiredArgument(args, 0, "resource");
80
129
  const { environment } = await resolveEnvironment(globals);
81
- const resource = await createAuthenticatedClient(globals).get(`/environments/${environment.id}/resources/${encodeURIComponent(resourceKey)}`);
130
+ const client = await createAuthenticatedClient(globals);
131
+ const resource = await client.get(`/environments/${environment.id}/resources/${encodeURIComponent(resourceKey)}`);
82
132
  if (globals.json === true) {
83
133
  writeJson(resource);
84
134
  return;
85
135
  }
86
- prompts.log.info(`Resource: ${resource.name}`);
87
- prompts.log.info(`Category: ${resource.category}`);
88
- prompts.log.info(`Type: ${resource.type}`);
89
- prompts.log.info(`State: ${resource.runtimeState}`);
90
- prompts.log.info(`Health: ${resource.health ?? "N/A"}`);
136
+ output.info(`Resource: ${resource.name}`);
137
+ output.info(`Category: ${resource.category}`);
138
+ output.info(`Type: ${resource.type}`);
139
+ output.info(`State: ${resource.runtimeState}`);
140
+ output.info(`Health: ${resource.health ?? "N/A"}`);
91
141
  if (resource.stateReason)
92
- prompts.log.info(`Reason: ${resource.stateReason}`);
142
+ output.info(`Reason: ${resource.stateReason}`);
93
143
  if (resource.observedAt)
94
- prompts.log.info(`Observed: ${resource.observedAt}`);
95
- prompts.log.info(`Actions: ${resource.supportedActions.join(", ") || "None"}`);
144
+ output.info(`Observed: ${resource.observedAt}`);
145
+ output.info(`Actions: ${resource.supportedActions.join(", ") || "None"}`);
96
146
  for (const [key, value] of Object.entries(resource.configuration)) {
97
147
  if (value !== undefined)
98
- prompts.log.info(`${formatConfigurationKey(key)}: ${value}`);
148
+ output.info(`${formatConfigurationKey(key)}: ${value}`);
99
149
  }
100
150
  }
101
- // Answers the exit code the operation earned: a partial or failed operation is a failure, and
102
- // everything else is not.
103
- function outputOperation(operation, json, projectSlug, environmentSlug) {
151
+ // The exit code the operation earned: a partial or failed operation is a failure.
152
+ function outputOperation(operation, json, projectSlug, environmentSlug,
153
+ // Only the command that started the operation points at the re-read; the re-read itself does not.
154
+ hintReRead) {
104
155
  if (json) {
105
156
  writeJson(operation);
106
157
  }
107
158
  else {
108
159
  for (const result of operation.results ?? []) {
109
- prompts.log.info(`${result.resource}: ${result.state} (${result.outcome})`);
160
+ output.info(`${result.resource}: ${result.state} (${result.outcome})`);
110
161
  if (result.errorDetails)
111
- prompts.log.error(result.errorDetails);
162
+ output.error(result.errorDetails);
112
163
  }
113
164
  if (operation.errorDetails)
114
- prompts.log.error(operation.errorDetails);
165
+ output.error(operation.errorDetails);
166
+ if (hintReRead && !isTerminalRuntimeOperationStatus(operation.status)) {
167
+ output.info(`Use ${statusCommand(operation.id, projectSlug, environmentSlug)} to check its status.`);
168
+ }
115
169
  prompts.outro(`${projectSlug} / ${environmentSlug}: ${operationSummary(operation)}`);
116
170
  }
117
171
  if (operation.status === RuntimeOperationStatus.PARTIAL ||
@@ -138,6 +192,11 @@ function runtimeCompletionMessage(operation) {
138
192
  }
139
193
  return "Resource operation failed.";
140
194
  }
195
+ // Names the project and environment the operation was started in, so the re-read does not fall
196
+ // back to a different saved default.
197
+ function statusCommand(operationId, projectSlug, environmentSlug) {
198
+ return `${CLOUD_INVOCATION} resource operation ${operationId} --project ${projectSlug} --environment ${environmentSlug}`;
199
+ }
141
200
  function titleCase(value) {
142
201
  return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
143
202
  }